You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
3.9 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/user/BindingPhone/index"],{1031:function(e,n,t){"use strict";(function(e){t("0371");a(t("66fd"));var n=a(t("facd"));function a(e){return e&&e.__esModule?e:{default:e}}e(n.default)}).call(this,t("543d")["createPage"])},"445e":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=s(t("a34a")),r=t("2f62"),o=s(t("4a6f")),c=t("fff8"),u=t("89cc"),i=t("6e63");function s(e){return e&&e.__esModule?e:{default:e}}function d(e,n,t,a,r,o,c){try{var u=e[o](c),i=u.value}catch(s){return void t(s)}u.done?n(i):Promise.resolve(i).then(a,r)}function h(e){return function(){var n=this,t=arguments;return new Promise((function(a,r){var o=e.apply(n,t);function c(e){d(o,a,r,c,u,"next",e)}function u(e){d(o,a,r,c,u,"throw",e)}c(void 0)}))}}var l={name:"BindingPhone",components:{},props:{},data:function(){return{captcha:"",phone:""}},mixins:[o.default],computed:(0,r.mapGetters)(["userInfo"]),mounted:function(){},methods:{confirm:function(){var n=this;return h(a.default.mark((function t(){var r,o,s;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=n,o=r.phone,s=r.captcha,t.prev=2,t.next=5,r.$validator({phone:[(0,c.chs_phone)(c.chs_phone.message("手机号码")),(0,c.alpha_num)(c.alpha_num.message())],captcha:[(0,c.required)(c.required.message("验证码")),(0,c.alpha_num)(c.alpha_num.message("验证码"))]}).validate({phone:o,captcha:s});case 5:t.next=10;break;case 7:return t.prev=7,t.t0=t["catch"](2),t.abrupt("return",(0,u.validatorDefaultCatch)(t.t0));case 10:(0,i.wxappBindingPhone)({phone:n.phone,captcha:n.captcha}).then((function(n){void 0!==n.data&&n.data.is_bind?e.showModal({title:"提示",content:"确认绑定?",success:function(n){n.confirm?(0,i.wxappBindingPhone)({phone:this.phone,captcha:this.captcha,step:1}).then((function(n){e.showToast({title:n.msg,icon:"none",duration:2e3}),r.$yrouter.replace({path:"/pages/user/PersonalData/index"})})).catch((function(n){e.showToast({title:n.msg,icon:"none",duration:2e3}),r.$yrouter.replace({path:"/pages/user/PersonalData/index"})})):n.cancel&&(e.showToast({title:"已取消绑定",icon:"none",duration:2e3}),r.$yrouter.replace({path:"/pages/user/PersonalData/index"}))}}):(e.showToast({title:n.msg,icon:"none",duration:2e3}),r.$yrouter.replace({path:"/pages/user/PersonalData/index"}))})).catch((function(n){e.showToast({title:n.msg,icon:"none",duration:2e3})}));case 11:case"end":return t.stop()}}),t,null,[[2,7]])})))()},code:function(){var n=this;return h(a.default.mark((function t(){var r,o;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=n,o=r.phone,t.prev=2,t.next=5,r.$validator({phone:[(0,c.required)(c.required.message("手机号码")),(0,c.chs_phone)(c.chs_phone.message())]}).validate({phone:o});case 5:t.next=10;break;case 7:return t.prev=7,t.t0=t["catch"](2),t.abrupt("return",(0,u.validatorDefaultCatch)(t.t0));case 10:(0,i.registerVerify)({phone:o}).then((function(n){e.showToast({title:n.msg,icon:"none",duration:2e3}),r.sendCode()})).catch((function(n){e.showToast({title:n.msg,icon:"none",duration:2e3})}));case 11:case"end":return t.stop()}}),t,null,[[2,7]])})))()}}};n.default=l}).call(this,t("543d")["default"])},"5c39":function(e,n,t){"use strict";var a;t.d(n,"b",(function(){return r})),t.d(n,"c",(function(){return o})),t.d(n,"a",(function(){return a}));var r=function(){var e=this,n=e.$createElement;e._self._c},o=[]},"9c39":function(e,n,t){"use strict";t.r(n);var a=t("445e"),r=t.n(a);for(var o in a)"default"!==o&&function(e){t.d(n,e,(function(){return a[e]}))}(o);n["default"]=r.a},facd:function(e,n,t){"use strict";t.r(n);var a=t("5c39"),r=t("9c39");for(var o in r)"default"!==o&&function(e){t.d(n,e,(function(){return r[e]}))}(o);var c,u=t("f0c5"),i=Object(u["a"])(r["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],c);n["default"]=i.exports}},[["1031","common/runtime","common/vendor"]]]);