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
5.9 KiB
1 lines
5.9 KiB
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/binding_phone/index"],{"0645":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.inAnimation=!1})},a=[]},"4bf6":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("7561");n(i("3240"));var a=n(i("8c2d"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"4d6f":function(t,e,i){"use strict";i.r(e);var n=i("51c1"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"51c1":function(t,e,i){"use strict";(function(t,n){var a=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(i("7eb4")),s=a(i("ee10")),c=i("bad7"),r=a(i("6ec3")),u=a(i("cef6")),h=i("a230"),f=i("77d7"),l=i("6975"),d=a(i("8b80")),p=a(i("a4e8")),g=getApp(),v=t.getSystemInfoSync().statusBarHeight+"px",m={mixins:[r.default,u.default],components:{Verify:function(){i.e("pages/users/components/verify/verify").then(function(){return resolve(i("a4ec"))}.bind(null,i)).catch(i.oe)},editUserModal:function(){Promise.all([i.e("common/vendor"),i.e("components/eidtUserModal/index")]).then(function(){return resolve(i("83bc"))}.bind(null,i)).catch(i.oe)},privacyAgreementPopup:function(){i.e("components/privacyAgreementPopup/index").then(function(){return resolve(i("59b7"))}.bind(null,i)).catch(i.oe)}},data:function(){return{imgHost:c.HTTP_REQUEST_URL,statusBarHeight:v,pageType:1,phone:"",captcha:"",text:"获取验证码",isShow:!1,protocol:!1,inAnimation:!1,authKey:"",backUrl:"",pageTitle:"绑定手机号",configData:p.default.get("BASIC_CONFIG"),canGetPrivacySetting:!1}},onLoad:function(t){n.getPrivacySetting&&(this.canGetPrivacySetting=!0),t.authKey&&(this.authKey=t.authKey),this.backUrl=t.backUrl||"",t.pageType&&(this.pageType=t.pageType||1,this.pageTitle=1==t.pageType?"绑定手机号":"手机号登录");var e=getCurrentPages(),i=e[e.length-2];i&&"pages/order_addcart/order_addcart"==i.route?this.isHome=!0:this.isHome=!1},methods:{onAgree:function(){this.protocol=!0},submitData:function(){if(0!=this.pageType){if(this.rules())if(this.authKey)this.phoneAuth(this.authKey);else{var t=this.$Cache.get("snsapiKey");this.phoneAuth(t)}}else this.isLogin()},rules:function(){return this.protocol||0!=this.pageType?this.phone?/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.phone)?!!this.captcha||(this.$util.Tips({title:"请填写验证码"}),!1):(this.$util.Tips({title:"请输入正确的手机号码"}),!1):(this.$util.Tips({title:"请填写手机号码"}),!1):(this.$util.Tips({title:"请先阅读并同意协议"}),!1)},isLogin:function(){var e=this;this.rules()&&(t.showLoading({title:"正在登录中"}),d.default.getCode().then((function(i){(0,l.phoneLogin)({code:i,spread_spid:g.globalData.spid,spread_code:g.globalData.code,phone:e.phone,captcha:e.captcha}).then((function(i){t.hideLoading();var n=i.data.expires_time-e.$Cache.time();e.$store.commit("LOGIN",{token:i.data.token,time:n}),e.getUserInfo(i.data.store_user_avatar)})).catch((function(e){t.hideLoading(),t.showToast({title:e,icon:"none",duration:2e3})}))})).catch((function(t){})))},phoneAuth:function(e){var i,n=this;t.showLoading({title:"正在登录中"}),i=l.phoneLogin,i({phone:this.phone,captcha:this.captcha,key:e}).then((function(t){var e=t.data.expires_time-n.$Cache.time();n.$store.commit("LOGIN",{token:t.data.token,time:e}),n.getUserInfo(t.data.store_user_avatar)})).catch((function(e){t.hideLoading(),n.$util.Tips({title:e})}))},getUserInfo:function(e){var i=this,n=this;(0,f.getUserInfo)().then((function(a){t.hideLoading(),n.userInfo=a.data,n.$store.commit("SETUID",a.data.uid),n.$store.commit("UPDATE_USERINFO",a.data),e?i.isShow=!0:n.$util.Tips({title:"登录成功",icon:"success"},{tab:3,url:i.configData.wechat_auth_switch?2:1})}))},wechatPhone:function(){if(this.$Cache.clear("snsapiKey"),this.backUrl){var e=t.getStorageSync("snRouter");e||(e="/pages/index/index"),this.$util.Tips({title:"登录成功",icon:"success"},{tab:4,url:this.url||"/pages/user/index"})}else t.reLaunch({url:"/pages/user/index"})},success:function(t){this.$refs.verify.hide();var e=this;(0,h.verifyCode)().then((function(i){var n={phone:e.phone,type:"reset",key:i.data.key,captchaType:"blockPuzzle",captchaVerification:t.captchaVerification};(0,h.registerVerify)(n).then((function(t){e.$util.Tips({title:t.msg}),e.sendCode()})).catch((function(t){return e.$util.Tips({title:t})}))}))},code:function(){var t=this;return(0,s.default)(o.default.mark((function e(){var i;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t,i.phone){e.next=3;break}return e.abrupt("return",i.$util.Tips({title:"请填写手机号码"}));case 3:if(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(i.phone)){e.next=5;break}return e.abrupt("return",i.$util.Tips({title:"请输入正确的手机号码"}));case 5:return t.$refs.verify.show(),e.abrupt("return");case 7:case"end":return e.stop()}}),e)})))()},ChangeIsDefault:function(){this.$set(this,"protocol",!this.protocol)},closeEdit:function(){this.isShow=!1,this.$util.Tips({title:"登录成功",icon:"success"},{tab:3,url:2})},editSuccess:function(){this.isShow=!1},back:function(){t.navigateBack({delta:this.configData.wechat_auth_switch?2:1})},privacy:function(e){t.navigateTo({url:"/pages/users/privacy/index?type="+e})}}};e.default=m}).call(this,i("df3c")["default"],i("3223")["default"])},8246:function(t,e,i){},"8c2d":function(t,e,i){"use strict";i.r(e);var n=i("0645"),a=i("4d6f");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("e2fc");var s=i("828b"),c=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"032464ae",null,!1,n["a"],void 0);e["default"]=c.exports},e2fc:function(t,e,i){"use strict";var n=i("8246"),a=i.n(n);a.a}},[["4bf6","common/runtime","common/vendor","pages/users/common/vendor"]]]); |