1 |
- webpackJsonp([20],{LRPZ:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=o("Dd8w"),s=o.n(a),i=o("ZohY"),n=o("NYxO"),l=o("mtWM"),r=o.n(l),m=o("mw3O"),d=o.n(m),c={components:{topBar:i.a},data:function(){return{formData:{mobile:"",code:""},removeMobileData:{mobile:"",code:""},codeText:"获取验证码",timer:null,disabled:!1}},computed:s()({},Object(n.c)(["AgentInfo"])),methods:s()({},Object(n.b)(["getAgentInfo"]),{init:function(){this.getAgentInfo(),this.codeText="获取验证码",this.disabled=!1,clearInterval(this.timer),this.removeMobileData.code="",this.formData.mobile="",this.formData.code=""},removeMobile:function(){var t=this;this.removeMobileData.mobile=this.AgentInfo.mobile,r.a.post("/v8/user/remove_mobile",d.a.stringify(this.removeMobileData)).then(function(e){0===e.data.error?(t.$toast.bottom(e.data.msg),t.init()):t.$toast.bottom(e.data.msg)})},bindPhone:function(){var t=this;r.a.post("/v8/user/bind_mobile",d.a.stringify(this.formData)).then(function(e){0===e.data.error?(t.$toast.bottom(e.data.msg),t.init()):t.$toast.bottom(e.data.msg)})},sendCode:function(t){var e=this;if(""!==t)if(/^((0\d{2,3}-\d{7,8})|(1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}))$/.test(t)){var o={mobile:t,smstype:"4"};r.a.post("/v8/system/send_sms",d.a.stringify(o)).then(function(t){0===t.data.error?(e.$toast.bottom(t.data.msg),e.codeText=120,e.disabled=!0,e.timer=setInterval(function(){e.codeText--,e.codeText<=0&&(e.codeText="获取验证码",e.disabled=!1,clearInterval(e.timer))},1e3)):e.$toast.bottom(t.data.msg)})}else this.$toast.bottom("请输入格式正确的手机号");else this.$toast.bottom("手机号不能为空!")}})},v={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"layout"},[o("div",{staticClass:"layout_top"},[o("div",{staticClass:"TopMain"},[t.AgentInfo?o("topBar",{attrs:{title:t.AgentInfo.mobile?"解绑手机":"绑定手机"}}):t._e(),t._v(" "),o("div",{staticClass:"textTop"},[t._v("\n 或手机号码丢失,请联系客服!\n ")])],1)]),t._v(" "),t.AgentInfo?o("div",{staticClass:"layout_container"},[t.AgentInfo.mobile?o("div",{staticClass:"form"},[o("div",{staticClass:"form_group"},[o("em",{staticClass:"label"},[t._v("手机号码:")]),t._v(" "),o("span",{staticClass:"text"},[t._v(t._s(t.AgentInfo.mobile))])]),t._v(" "),o("div",{staticClass:"form_group"},[o("em",{staticClass:"label"},[t._v("验证码:")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.removeMobileData.code,expression:"removeMobileData.code"}],staticClass:"input input-code",attrs:{type:"text"},domProps:{value:t.removeMobileData.code},on:{input:function(e){e.target.composing||t.$set(t.removeMobileData,"code",e.target.value)}}}),t._v(" "),o("button",{staticClass:"btn-code",attrs:{disabled:t.disabled},on:{click:function(e){t.sendCode(t.AgentInfo.mobile)}}},[t._v(t._s(t.codeText))])]),t._v(" "),o("div",{staticClass:"submit"},[o("button",{on:{click:t.removeMobile}},[t._v("解绑")])])]):o("div",{staticClass:"form"},[o("div",{staticClass:"form_group"},[o("em",{staticClass:"label"},[t._v("手机号码:")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.mobile,expression:"formData.mobile"}],staticClass:"input",attrs:{type:"text"},domProps:{value:t.formData.mobile},on:{input:function(e){e.target.composing||t.$set(t.formData,"mobile",e.target.value)}}})]),t._v(" "),o("div",{staticClass:"form_group"},[o("em",{staticClass:"label"},[t._v("验证码:")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.code,expression:"formData.code"}],staticClass:"input input-code",attrs:{type:"text"},domProps:{value:t.formData.code},on:{input:function(e){e.target.composing||t.$set(t.formData,"code",e.target.value)}}}),t._v(" "),o("button",{staticClass:"btn-code",attrs:{disabled:t.disabled},on:{click:function(e){t.sendCode(t.formData.mobile)}}},[t._v(t._s(t.codeText))])]),t._v(" "),o("div",{staticClass:"submit"},[o("button",{on:{click:t.bindPhone}},[t._v("绑定")])])])]):t._e()])},staticRenderFns:[]};var b=o("VU/8")(c,v,!1,function(t){o("fkqY")},null,null);e.default=b.exports},fkqY:function(t,e){}});
|