text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["channel/weChatInfo"],{b6a2:function(e,t,a){},cf0c:function(e,t,a){"use strict";a("b6a2")},ecc1:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.load?a("div",{staticClass:"le-matter"},[e.bind||e.isBind?e._e():a("div",{staticClass:"le-bind"},[a("div",{staticClass:"le-bind__content flex flex-direction align-center"},[a("div",{staticClass:"le-bind-logo"}),a("div",{staticClass:"le-bind-name"},[e._v("微信公众号")]),e._m(0),a("el-button",{staticClass:"le-bind-btn",attrs:{type:"primary"},on:{click:function(t){e.bind=!0}}},[e._v("立即绑定")])],1)]),e.bind&&!e.isBind||e.toBind?[a("div",{staticClass:"le-card"},[a("div",{staticClass:"flex flex-direction"},[a("el-form",{ref:"form",staticClass:"le-form",attrs:{"label-width":"100px",model:e.form,rules:e.rules}},[a("div",{staticClass:"le-form__header flex align-center"},[a("span",{staticClass:"le-tip"}),a("span",{staticClass:"le-text"},[e._v("填写公众号信息")])]),a("el-form-item",{attrs:{label:"公众号名称"}},[a("el-input",{attrs:{placeholder:"请输入公众号名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"公众号类型",prop:"type"}},[e._v(" 认证服务号/认证政府订阅号/认证媒体订阅号 ")]),a("el-form-item",{attrs:{label:"AppID",prop:"AppID"}},[a("el-input",{attrs:{placeholder:"请输入AppID"},model:{value:e.form.AppID,callback:function(t){e.$set(e.form,"AppID",t)},expression:"form.AppID"}})],1),a("el-form-item",{attrs:{label:"AppSecret",prop:"AppSecret"}},[a("el-input",{attrs:{placeholder:"请输入AppSecret"},model:{value:e.form.AppSecret,callback:function(t){e.$set(e.form,"AppSecret",t)},expression:"form.AppSecret"}})],1),a("el-form-item",{attrs:{label:"验证文件",prop:"file_name"}},[a("el-input",{model:{value:e.form.file_name,callback:function(t){e.$set(e.form,"file_name",t)},expression:"form.file_name"}},[a("template",{slot:"append"},[a("el-upload",{ref:"upload",attrs:{action:"","on-change":e.handleChange,"http-request":e.upload,limit:1,"auto-upload":!1,"on-exceed":e.handleExceed,"show-file-list":!1}},[e._v("选择文件")])],1)],2),a("el-button",{directives:[{name:"popup",rawName:"v-popup.uploadGuide",modifiers:{uploadGuide:!0}}],staticClass:"le-view-guidelines",attrs:{module:"channel",title:"验证文件下载指引",type:"text",width:"720",hide_close:!0,height:"676",sure_btn:"我知道了"}},[e._v("查看指引")])],1)],1)],1)]),a("div",{staticClass:"le-cardpin"},[a("el-button",{on:{click:function(t){e.bind=!1,e.toBind=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.save("form")}}},[e._v("保存")])],1)]:e._e(),e.isBind&&!e.toBind?[a("div",{staticClass:"le-bind-over"},[e.isPay?e._e():a("div",{staticClass:"le-bind-header"},[a("span",{staticClass:"le-text"},[e._v("你的微信公众号尚未设置支付方式，请先设置支付方式。")]),a("he-link",{attrs:{href:"channel/weChat-pay"}},[a("el-button",{staticClass:"le-btn",attrs:{type:"primary"}},[e._v("立即配置")])],1)],1),a("div",{staticClass:"le-info le-card"},[e._m(1),a("div",{staticClass:"le-item flex"},[a("div",{staticClass:"le-item__label"},[e._v("公众号名称")]),a("div",{staticClass:"le-item__value"},[e._v(e._s(e.form.name))])]),a("div",{staticClass:"le-item flex"},[a("div",{staticClass:"le-item__label"},[e._v("公众号商城二维码")]),a("div",{staticClass:"le-item__value"},[a("div",{directives:[{name:"popup",rawName:"v-popup.uploadQrcode",value:e.qrcode,expression:"qrcode",modifiers:{uploadQrcode:!0}}],staticClass:"le-item--download",attrs:{width:"340",title:"公众号商城二维码",hide_cancel:!0,sure_btn:"下载二维码",module:"channel"}},[e._v(" 下载二维码 ")]),a("div",{staticClass:"le-item-tip"},[e._v(" 下载公众号商城二维码，用于推广与分享公众号 ")])])])]),a("div",{staticClass:"le-info le-card"},[e._m(2),a("div",{staticClass:"le-item flex"},[a("div",{staticClass:"le-item__label"},[e._v("AppID")]),a("div",{staticClass:"le-item__value"},[e._v(e._s(e.form.AppID))])]),a("div",{staticClass:"le-item flex"},[a("div",{staticClass:"le-item__label"},[e._v("AppSecret")]),a("div",{staticClass:"le-item__value"},[e._v(e._s(e.form.AppSecret))])]),a("el-button",{staticClass:"le-editor",attrs:{type:"primary"},on:{click:function(t){e.toBind=!0}}},[e._v("修改账号信息")])],1)])]:e._e()],2):e._e()},s=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"le-bind-des"},[e._v(" 绑定公众号并授权，在这里管理您"),a("br"),e._v(" 的公众号，快速发布公众号商城 ")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"le-info__header flex align-center"},[a("span",{staticClass:"le-tip"}),a("span",{staticClass:"le-text"},[e._v("基本信息")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"le-info__header flex align-center"},[a("span",{staticClass:"le-tip"}),a("span",{staticClass:"le-text"},[e._v("账号信息")])])}],l=(a("f5bd"),{name:"manualBinding",data:function(){return{form:{name:"",AppID:"",AppSecret:"",file_name:"",token:"",encodingAesKey:"",url:""},rules:{AppID:[{required:!0,message:"请输入AppID",trigger:"blur"}],AppSecret:[{required:!0,message:"请输入AppSecret",trigger:"blur"}],file_name:[{required:!1,message:"请上传验证文件",trigger:"change"}]},load:!1,bind:!1,isBind:!1,toBind:!1,isPay:!1,qrcode:""}},computed:{},mounted:function(){this.getConfig(),this.getCode()},methods:{getConfig:function(){var e=this;this.$heshop.appconfig("get").then((function(t){t.apply.wechat.file_name="",e.form=t.apply.wechat,e.isBind=!!t.apply.wechat.AppID,e.isPay=!!t.appPay.wechat.appid,e.load=!0})).catch((function(t){e.$message.error(t.data.message)}))},save:function(e){var t=this;this.$refs[e].validate((function(e){if(e){var a={name:t.form.name,AppID:t.form.AppID,AppSecret:t.form.AppSecret,token:t.form.token,encodingAesKey:t.form.encodingAesKey};t.$heshop.appconfig("post",{behavior:"save",key:"apply_wechat"},a).then((function(){t.$notify({title:"保存成功",message:"公众号手动绑定成功。",type:"success"}),t.toBind=!1,t.$refs.upload.submit()})).catch((function(e){console.error(e),t.$message.error(e.data.message)}))}}))},handleExceed:function(e){this.$set(this.form,"file_name",e[0].name)},handleChange:function(e){this.$set(this.form,"file_name",e.name)},upload:function(e){var t=new FormData;t.append("file",e.file),this.$heshop.file(t,{behavior:"upload"}).then((function(){})).catch((function(e){console.error("数据出出力",e)}))},copy:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"innerText",a=null;if(t){if(a=document.createElement("div"),a.id="tempTarget",a.style.opacity="0",e){var i=document.querySelector("#"+e);a.innerText=i[t]}else a.innerText=t;document.body.appendChild(a)}else a=document.querySelector("#"+e);try{var s=document.createRange();s.selectNode(a),window.getSelection().removeAllRanges(),window.getSelection().addRange(s),document.execCommand("copy"),window.getSelection().removeAllRanges()}catch(l){console.error("复制失败")}t&&a.parentElement.removeChild(a)},router:function(e){this.$router.push({path:e})},getCode:function(){var e=this;this.$heshop.qrcode("post").then((function(t){e.qrcode=t.wechat.image})).catch((function(e){console.error(e)}))}}}),n=l,o=(a("cf0c"),a("4ac2")),r=Object(o["a"])(n,i,s,!1,null,"26f36702",null);t["default"]=r.exports}}]);