(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f33da3c"],{"5d45":function(e,t,a){"use strict";var s=a("7526"),i=a.n(s);i.a},6494:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"form-list-wrapper"},[a("Hints",[a("template",{slot:"hintName"},[e._v("个人中心")])],2),a("el-card",{attrs:{shadow:"always"}},[a("el-form",{ref:"ruleForm",staticClass:"form-list",attrs:{model:e.ruleForm,"label-width":"230px"}},[a("el-form-item",{attrs:{label:"用户名：",prop:"name"}},[a("el-input",{attrs:{value:e.ruleForm.name,placeholder:"用户名",disabled:""}})],1),a("el-form-item",{attrs:{label:"用户密码：",prop:"password"}},[a("el-input",{attrs:{placeholder:"请输入密码","show-password":""},model:{value:e.ruleForm.password,callback:function(t){e.$set(e.ruleForm,"password",t)},expression:"ruleForm.password"}})],1),a("el-form-item",{attrs:{label:"邮箱：",prop:"email"}},[a("el-input",{attrs:{placeholder:"请输入邮箱"},model:{value:e.ruleForm.email,callback:function(t){e.$set(e.ruleForm,"email",t)},expression:"ruleForm.email"}})],1),a("el-form-item",{staticClass:"submit-box"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v("提交")])],1)],1)],1),e.wechatLeadEnabled?a("el-card",{staticClass:"wechat-lead-card",attrs:{shadow:"always"}},[a("div",{staticClass:"wechat-lead-header"},[a("div",[a("h3",[e._v("公众号线索提醒")]),a("p",[e._v("建议在电脑端打开本页面，用手机微信按顺序完成两次扫码。")])]),e.wechatLeadStatus.bound&&e.wechatLeadStatus.subscribed?a("el-tag",{attrs:{type:"success"}},[e._v(" 已完成绑定 ")]):e.wechatLeadStatus.bound?a("el-tag",{attrs:{type:"warning"}},[e._v("已绑定，请先关注公众号")]):a("el-tag",{attrs:{type:"info"}},[e._v("尚未完成")])],1),a("div",{staticClass:"wechat-lead-switch"},[a("span",[e._v("开启线索提醒")]),a("el-switch",{attrs:{loading:e.wxRemindSaving},on:{change:e.onWxRemindChange},model:{value:e.wxRemindEnabled,callback:function(t){e.wxRemindEnabled=t},expression:"wxRemindEnabled"}}),a("span",{staticClass:"wechat-lead-switch-tip"},[e._v(" 开启后只推送当前账号收到的线索；未完成上方绑定则收不到提醒。 ")])],1),a("div",{staticClass:"wechat-lead-flow"},[a("section",{staticClass:"wechat-lead-step"},[a("div",{staticClass:"wechat-lead-step-title"},[a("span",[e._v("1")]),a("strong",[e._v("先关注公众号")])]),a("p",[e._v("打开微信，扫描下方二维码，在公众号页面点击“关注”。")]),a("div",{staticClass:"wechat-lead-qrcode",class:{material:e.wechatLeadQrCodeIsMaterial}},[e.wechatLeadQrCodeUrl&&!e.wechatLeadQrCodeIsMaterial?a("div",{ref:"wechatLeadFollowQrCode"}):e.wechatLeadQrCodeUrl?a("img",{attrs:{src:e.wechatLeadQrCodeUrl,alt:"公众号关注物料"}}):a("span",[e._v("关注二维码暂未配置")])]),a("small",[e._v("请确认页面显示“已关注”后，再进行下一步。")])]),a("div",{staticClass:"wechat-lead-arrow"},[e._v("→")]),a("section",{staticClass:"wechat-lead-step wechat-lead-bind-step"},[a("div",{staticClass:"wechat-lead-step-title"},[a("span",[e._v("2")]),a("strong",[e._v("再授权绑定账号")])]),a("p",[e._v("点击按钮生成授权二维码，再用刚刚关注公众号的微信扫一扫。")]),a("el-button",{attrs:{type:"primary",loading:e.wechatLeadBinding},on:{click:e.bindWechatLead}},[e._v(" 生成授权二维码 ")]),a("div",{staticClass:"wechat-lead-note"},[e._v("扫码后请在微信页面确认授权。")])],1)]),a("div",{staticClass:"wechat-lead-result"},[a("div",{staticClass:"wechat-lead-step-title"},[a("span",[e._v("3")]),a("strong",[e._v("回来确认结果")])]),e.wechatLeadStatus.bound&&e.wechatLeadStatus.subscribed?a("p",[e._v(" 已绑定 "+e._s(e.wechatLeadStatus.boundCount)+" 个微信，其中 "+e._s(e.wechatLeadStatus.subscribedCount)+" 个已关注，后续会逐个发送提醒。 ")]):e.wechatLeadStatus.bound?a("p",[e._v("已完成授权，但当前关注状态未确认，请重新关注后点击刷新。")]):a("p",[e._v("授权完成后回到这里，点击右侧按钮查看最新状态。")]),a("el-button",{attrs:{size:"small"},on:{click:e.loadWechatLead}},[e._v("刷新绑定状态")])],1),e.wechatLeadStatus.subscribers.length?a("div",{staticClass:"wechat-lead-bound-list"},[a("div",{staticClass:"wechat-lead-bound-title"},[e._v("已绑定微信")]),a("div",{staticClass:"wechat-lead-bound-items"},e._l(e.wechatLeadStatus.subscribers,(function(t){return a("div",{key:t.id,staticClass:"wechat-lead-bound-item"},[t.headimgurl?a("img",{attrs:{src:t.headimgurl,alt:"微信头像"}}):a("div",{staticClass:"wechat-lead-avatar-placeholder"},[e._v("微")]),a("div",{staticClass:"wechat-lead-bound-info"},[a("strong",[e._v(e._s(t.nickname||"微信用户"))]),a("el-tag",{attrs:{size:"mini",type:t.subscribed?"success":"warning"}},[e._v(" "+e._s(t.subscribed?"已关注":"未关注")+" ")])],1)])})),0)]):e._e()]):e._e(),e.wechatLeadEnabled?a("el-dialog",{attrs:{title:"第 2 步：微信扫码授权绑定",visible:e.wechatLeadBindDialogVisible,width:"360px"},on:{"update:visible":function(t){e.wechatLeadBindDialogVisible=t},closed:e.clearBindQrCode}},[a("div",{ref:"wechatLeadBindQrCode",staticClass:"wechat-lead-bind-qrcode"}),a("p",{staticClass:"wechat-lead-bind-tip"},[e._v("请用已关注公众号的微信扫一扫此二维码，扫码后点击“确认授权”。")]),a("p",{staticClass:"wechat-lead-bind-tip"},[e._v("完成后关闭此窗口，回到页面点击“刷新绑定状态”。")])]):e._e()],1)},i=[],d=(a("b0c0"),a("a9e3"),a("5530")),n=a("b522"),l=a("d044"),r=a.n(l),c={name:"Form",components:{Hints:n["a"]},data:function(){return{ruleForm:{name:"",password:"",email:"",id:0},wechatLeadQrCodeUrl:"",wechatLeadQrCodeIsMaterial:!1,wechatLeadBindDialogVisible:!1,wechatLeadStatus:{bound:!1,subscribed:!1,boundCount:0,subscribedCount:0,subscribers:[]},wechatLeadBinding:!1,wxRemindEnabled:!1,wxRemindSaving:!1}},computed:{wechatLeadEnabled:function(){var e=this.$store.state.all.userInfo||{},t=e.ad_wx_remind;return!0===t||1===Number(t)}},watch:{$route:function(){setTimeout(this.setDataInit,200)},wechatLeadEnabled:function(e){this.wxRemindEnabled=e,e&&!this.wechatLeadQrCodeUrl&&this.loadWechatLead()}},mounted:function(){this.$nextTick((function(){setTimeout(this.setDataInit,2e3)})),this.wechatLeadEnabled&&this.loadWechatLead()},methods:{setDataInit:function(){this.ruleForm.password=this.$store.state.all.userInfo.password,this.ruleForm.email=this.$store.state.all.userInfo.email,this.ruleForm.name=this.$store.state.all.userInfo.name,this.ruleForm.id=this.$store.state.all.userInfo.id,this.wxRemindEnabled=this.wechatLeadEnabled},onWxRemindChange:function(e){var t=this,a=!e;this.wxRemindSaving=!0,this.api.userUpdateSelfWxRemind({ad_wx_remind:e}).then((function(){t.wxRemindSaving=!1,t.$store.commit("setUserInfo",Object(d["a"])(Object(d["a"])({},t.$store.state.all.userInfo),{},{ad_wx_remind:e}))})).catch((function(){t.wxRemindSaving=!1,t.wxRemindEnabled=a}))},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("提交失败!"),!1;console.log({name:t.name,password:t.password,email:t.email}),t.api.userUpdateSelf(t.ruleForm).then((function(){t.$alert("更新成功","提示",{})})).catch((function(){}))}))},resetForm:function(e){this.$refs[e].resetFields()},loadWechatLead:function(){var e=this;this.api.wechatLeadFollowQrCode().then((function(t){e.wechatLeadQrCodeUrl=t.url,e.wechatLeadQrCodeIsMaterial=t.isMaterial,t.isMaterial||e.$nextTick(e.renderFollowQrCode)})).catch((function(){e.wechatLeadQrCodeUrl="",e.wechatLeadQrCodeIsMaterial=!1})),this.api.wechatLeadStatus().then((function(t){e.wechatLeadStatus=Object(d["a"])({bound:!1,subscribed:!1,boundCount:0,subscribedCount:0,subscribers:[]},t)})).catch((function(){}))},renderFollowQrCode:function(){var e=this.$refs.wechatLeadFollowQrCode;e&&this.wechatLeadQrCodeUrl&&(e.innerHTML="",new r.a(e,{text:this.wechatLeadQrCodeUrl,width:180,height:180,correctLevel:r.a.CorrectLevel.M}))},bindWechatLead:function(){var e=this;this.wechatLeadBinding=!0,this.api.wechatLeadBindUrl().then((function(t){e.wechatLeadBinding=!1,e.wechatLeadBindDialogVisible=!0,e.$nextTick((function(){var a=e.$refs.wechatLeadBindQrCode;a&&(a.innerHTML="",new r.a(a,{text:t.url,width:220,height:220,correctLevel:r.a.CorrectLevel.M}))}))})).catch((function(){e.wechatLeadBinding=!1}))},clearBindQrCode:function(){var e=this.$refs.wechatLeadBindQrCode;e&&(e.innerHTML="")}}},o=c,h=(a("5d45"),a("2877")),u=Object(h["a"])(o,s,i,!1,null,null,null);t["default"]=u.exports},7526:function(e,t,a){}}]);