1 line
7.0 KiB
JavaScript
Executable File
1 line
7.0 KiB
JavaScript
Executable File
if(set.code.headcode!=null){set.code.headcode=BASE64.decode(set.code.headcode)}if(set.code.footcode!=null){set.code.footcode=BASE64.decode(set.code.footcode)}if(set.code.css!=null){set.code.css=BASE64.decode(set.code.css)}if(set.post.copyright!=null){set.post.copyright=BASE64.decode(set.post.copyright)}if(set.ad.index_1!=null){set.ad.index_1=BASE64.decode(set.ad.index_1)}if(set.ad.index_2!=null){set.ad.index_2=BASE64.decode(set.ad.index_2)}if(set.ad.index_3!=null){set.ad.index_3=BASE64.decode(set.ad.index_3)}if(set.ad.index_1_phone!=null){set.ad.index_1_phone=BASE64.decode(set.ad.index_1_phone)}if(set.ad.index_2_phone!=null){set.ad.index_2_phone=BASE64.decode(set.ad.index_2_phone)}if(set.ad.index_3_phone!=null){set.ad.index_3_phone=BASE64.decode(set.ad.index_3_phone)}if(set.ad.post_1!=null){set.ad.post_1=BASE64.decode(set.ad.post_1)}if(set.ad.post_2!=null){set.ad.post_2=BASE64.decode(set.ad.post_2)}if(set.ad.post_3!=null){set.ad.post_3=BASE64.decode(set.ad.post_3)}if(set.ad.post_4!=null){set.ad.post_4=BASE64.decode(set.ad.post_4)}if(set.ad.post_5!=null){set.ad.post_5=BASE64.decode(set.ad.post_5)}if(set.ad.post_1_phone!=null){set.ad.post_1_phone=BASE64.decode(set.ad.post_1_phone)}if(set.ad.post_2_phone!=null){set.ad.post_2_phone=BASE64.decode(set.ad.post_2_phone)}if(set.ad.post_3_phone!=null){set.ad.post_3_phone=BASE64.decode(set.ad.post_3_phone)}if(set.ad.post_4_phone!=null){set.ad.post_4_phone=BASE64.decode(set.ad.post_4_phone)}if(set.ad.post_5_phone!=null){set.ad.post_5_phone=BASE64.decode(set.ad.post_5_phone)}var vue=new Vue({el:"#app",data:{menu_active:2,adminurl:adminurl,set:set,dialog:{colorPick:false},myArray:[{name:"John",id:0},{name:"Jean",id:2},{name:"Joao",id:1}],loading:{save:false}},methods:{onCmInput(e){this.set.code.headcode=e},mailtest(s){$(s.target).text("发送中");$.post(vue.adminurl,{action:"corepress_mailtest",user:vue.set.module.smtpuser,pwd:vue.set.module.smtppwd,name:vue.set.module.smtpname,port:vue.set.module.smtpport,host:vue.set.module.smtphost,type:vue.set.module.smtpencrypttype,testmail:vue.set.module.testmail},function(e){$(s.target).text("发信测试");var t=JSON.parse(e);if(t){if(t.code==200){vue.$message({message:t.msg,type:"success",offset:50})}else{vue.$message({message:t.msg,type:"warning",offset:50})}}else{vue.$message({message:"未知错误",type:"error",offset:50})}})},selectMenu(e,t){vue.menu_active=e},reThemeColor(e){if(e==0){vue.set.theme.themeColor="#409EFF"}else if(e==1){vue.set.theme.fontSelectedColor="#3390ff"}else if(e==2){vue.set.theme.themeHoverColor="#409EFF"}},selectImg(e,t){var s;s=wp.media({title:"选择图片",button:{text:"插入"},multiple:false});s.on("select",function(){attachment=s.state().get("selection").first().toJSON();if(e==="set.routine.logo"){vue.set.routine.logo=attachment.url}else if(e==="set.routine.defaultthumbnail"){vue.set.routine.defaultthumbnail=attachment.url}else if(e==="set.routine.favicon"){vue.set.routine.favicon=attachment.url}else if(e==="swiperlist"){vue.set.index.swiperlist[t].imgurl=attachment.url}else if(e==="set.user.lgoinpageimg"){vue.set.user.lgoinpageimg=attachment.url}else if(e==="set.user.regpageimg"){vue.set.user.regpageimg=attachment.url}else if(e==="reward1"){vue.set.post.reward1=attachment.url}else if(e==="reward2"){vue.set.post.reward2=attachment.url}else if(e==="set.theme.bagimg"){vue.set.theme.bagimg=attachment.url}else if(e==="postcard"){vue.set.index.postcard[t].imgurl=attachment.url}else if(e==="set.user.repasswordimg"){vue.set.user.repasswordimg=attachment.url}});s.open()},delSwiper(e){vue.$confirm("此操作将删除当前幻灯片项目,是否确定?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{vue.set.index.swiperlist.splice(e,1)}).catch(()=>{})},addSwiper(){var e={title:"",url:"",imgurl:""};vue.set.index.swiperlist.push(e)},moveSwiper(e,t){console.log(e,t);var s=vue.set.index.swiperlist;s[e]=s.splice(e+t,1,s[e])[0]},addPostCard(){var e={title:"",url:"",imgurl:""};vue.set.index.postcard.push(e)},delPostCard(e){vue.$confirm("此操作将删除当前卡片项目,是否确定?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{vue.set.index.postcard.splice(e,1)}).catch(()=>{})},movePostCard(e,t){var s=vue.set.index.postcard;s[e]=s.splice(e+t,1,s[e])[0]},save(){var d=false;var o=false;vue.set.index.swiperlist.forEach(function(e,t,s){if(e.imgurl==""){d=true}});vue.set.index.postcard.forEach(function(e,t,s){if(e.imgurl==""){o=true}});if(o==true){vue.$message({message:"卡片图像地址为空,请填写!",type:"warning",offset:50});return}if(d==true){vue.$message({message:"幻灯片图像地址为空,请填写!",type:"warning",offset:50});return}if(vue.set.user.loginpage!=0){if(vue.set.user.lgoinpageurl===""||vue.set.user.lgoinpageurl===null){vue.$message({message:"已开启自定义登录页面,请设置地址",type:"warning",offset:50});return}}var e=JSON.parse(JSON.stringify(vue.set));if(e.code.headcode!=null){e.code.headcode=BASE64.encode(e.code.headcode)}if(e.code.footcode!=null){e.code.footcode=BASE64.encode(e.code.footcode)}if(e.code.css!=null){e.code.css=BASE64.encode(e.code.css)}if(e.post.copyright!=null){e.post.copyright=BASE64.encode(e.post.copyright)}if(e.ad.index_1!=null){e.ad.index_1=BASE64.encode(e.ad.index_1)}if(e.ad.index_2!=null){e.ad.index_2=BASE64.encode(e.ad.index_2)}if(e.ad.index_3!=null){e.ad.index_3=BASE64.encode(e.ad.index_3)}if(e.ad.index_1_phone!=null){e.ad.index_1_phone=BASE64.encode(e.ad.index_1_phone)}if(e.ad.index_2_phone!=null){e.ad.index_2_phone=BASE64.encode(e.ad.index_2_phone)}if(e.ad.index_3_phone!=null){e.ad.index_3_phone=BASE64.encode(e.ad.index_3_phone)}if(e.ad.post_1!=null){e.ad.post_1=BASE64.encode(e.ad.post_1)}if(e.ad.post_2!=null){e.ad.post_2=BASE64.encode(e.ad.post_2)}if(e.ad.post_3!=null){e.ad.post_3=BASE64.encode(e.ad.post_3)}if(e.ad.post_4!=null){e.ad.post_4=BASE64.encode(e.ad.post_4)}if(e.ad.post_5!=null){e.ad.post_5=BASE64.encode(e.ad.post_5)}if(e.ad.post_1_phone!=null){e.ad.post_1_phone=BASE64.encode(e.ad.post_1_phone)}if(e.ad.post_2_phone!=null){e.ad.post_2_phone=BASE64.encode(e.ad.post_2_phone)}if(e.ad.post_3_phone!=null){e.ad.post_3_phone=BASE64.encode(e.ad.post_3_phone)}if(e.ad.post_4_phone!=null){e.ad.post_4_phone=BASE64.encode(e.ad.post_4_phone)}if(e.ad.post_5_phone!=null){e.ad.post_5_phone=BASE64.encode(e.ad.post_5_phone)}this.loading.save=true;$.post(vue.adminurl+"?action=save",{save:BASE64.encode(JSON.stringify(e))},e=>{var t=JSON.parse(e);this.loading.save=false;if(t.code==1){vue.$message({message:"保存成功!",type:"success",offset:50})}else{vue.$message({message:"你什么都还没修改呢!",type:"success",offset:50})}})},add_index_tab_id(e){if(vue.set.index.tab_ids==null||vue.set.index.tab_ids==""){vue.set.index.tab_ids=e}else{vue.set.index.tab_ids=vue.set.index.tab_ids+","+e}},add_index_links_id(e){if(vue.set.index.links_ids==null||vue.set.index.links_ids==""){vue.set.index.links_ids=e}else{vue.set.index.links_ids=vue.set.index.links_ids+","+e}},set_cur(e,t){vue.set.theme.curname=e;$(".set-cur").removeClass("set-cur-clicked");$(t.target).parent().addClass("set-cur-clicked")}},created:function(){}}); |