uni-Identify-quality/unpackage/dist/dev/mp-weixin/pages/login/login.js

2 lines
6.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/login/login"],{201:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var r=o(t(202));e.__webpack_require_UNI_MP_PLUGIN__=t,n(r.default)}).call(this,t(1)["default"],t(2)["createPage"])},202:function(e,n,t){"use strict";t.r(n);var o=t(203),r=t(205);for(var a in r)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(a);t(207);var u,i=t(33),c=Object(i["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"b237504c",null,!1,o["components"],u);c.options.__file="pages/login/login.vue",n["default"]=c.exports},203:function(e,n,t){"use strict";t.r(n);var o=t(204);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},204:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return r})),t.d(n,"staticRenderFns",(function(){return u})),t.d(n,"recyclableRender",(function(){return a})),t.d(n,"components",(function(){return o}));try{o={uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-icon/u-icon")]).then(t.bind(null,347))},"u-Input":function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u--input/u--input")]).then(t.bind(null,356))},uCheckboxGroup:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-checkbox-group/u-checkbox-group")]).then(t.bind(null,362))},uCheckbox:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-checkbox/u-checkbox")]).then(t.bind(null,370))},uButton:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-button/u-button")]).then(t.bind(null,378))},uCodeInput:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-code-input/u-code-input")]).then(t.bind(null,388))}}}catch(i){if(-1===i.message.indexOf("Cannot find module")||-1===i.message.indexOf(".vue"))throw i;console.error(i.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,n=e.$createElement;e._self._c},a=!1,u=[];r._withStripped=!0},205:function(e,n,t){"use strict";t.r(n);var o=t(206),r=t.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);n["default"]=r.a},206:function(e,n,t){"use strict";(function(e){var o=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t(63)),a=o(t(65)),u={data:function(){return{code:"",openId:"",isShow:!1,isNew:!1,isShowCaptcha:!1,phone:"",checked:[],disabled:!0,captcha:"",time:60,timer:null,isPhoneLogin:!1}},methods:{goRouter:function(){e.switchTab({url:"/pages/home/index"})},getPhoneNumber:function(n){var t=this;return(0,a.default)(r.default.mark((function o(){var a;return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if("getPhoneNumber:ok"!=n.detail.errMsg){o.next=7;break}return o.next=3,t.$api.login.getTel({code:n.detail.code});case 3:a=o.sent,0==a.status?(e.setStorageSync("telNum",a.data.telNum),t.isPhoneLogin=!1,e.setStorageSync("phoneLogin",t.isPhoneLogin),t.isNew?e.reLaunch({url:"/pages/realName/realName"}):e.reLaunch({url:"/pages/home/index"})):t.$common.msgToast(a.msg),o.next=8;break;case 7:t.$common.msgToast("请不要拒绝哟~重新点击登录");case 8:case"end":return o.stop()}}),o)})))()},getOpenId:function(){var n=this;return(0,a.default)(r.default.mark((function t(){return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.login({provider:"weixin",success:function(){var t=(0,a.default)(r.default.mark((function t(o){var a;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return console.log("res.code",o.code),n.code=o.code,t.next=4,n.$api.login.login({code:o.code});case 4:a=t.sent,0==a.status?(a.data.accountInfo.isNew||!e.getStorageSync("telNum")?(n.isShow=!0,n.isNew=a.data.accountInfo.isNew):e.reLaunch({url:"/pages/home/index"}),e.setStorageSync("token",a.data.token)):n.$common.msgToast(a.msg);case 6:case"end":return t.stop()}}),t)})));function o(e){return t.apply(this,arguments)}return o}()});case 1:case"end":return t.stop()}}),t)})))()},handleChange:function(){var e=this;this.$nextTick((function(){11===e.phone.length&&e.checked.length>0?e.disabled=!1:e.disabled=!0}))},agreementHandle:function(n){e.navigateTo({url:"/pages/realName/agreement?type="+n})},getCaptcha:function(){var e=this;return(0,a.default)(r.default.mark((function n(){var t;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.disabled){n.next=5;break}return n.next=3,e.$api.login.getTelCaptcha({Telnum:e.phone});case 3:t=n.sent,0===t.status?(e.$common.msgToast("验证码已发送"),e.isShowCaptcha=!0,e.timer=setInterval((function(){e.time>0?e.time--:(clearInterval(e.timer),e.time=60,e.timer=null)}),1e3)):e.$common.msgToast("验证码发送失败,请稍后再试");case 5:case"end":return n.stop()}}),n)})))()},resendCaptcha:function(){null===this.timer&&this.getCaptcha()},handleFinish:function(n){var t=this;return(0,a.default)(r.default.mark((function o(){var a;return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,t.$api.login.checkTelCaptcha({telnum:t.phone,code:n});case 2:a=o.sent,0===a.status?(t.$common.msgToast("请稍等"),e.setStorageSync("token",a.data.token),e.setStorageSync("telNum",t.phone),a.data.isRealName?e.reLaunch({url:"/pages/home/index"}):(t.isPhoneLogin=!0,e.setStorageSync("phoneLogin",t.isPhoneLogin),e.reLaunch({url:"/pages/realName/realName?isPhoneLogin"}))):t.$common.msgToast(a.msg);case 4:case"end":return o.stop()}}),o)})))()},back:function(){this.isShowCaptcha=!1,this.timer&&(clearInterval(this.timer),this.time=60,this.timer=null)}},onLoad:function(){this.getOpenId()}};n.default=u}).call(this,t(2)["default"])},207:function(e,n,t){"use strict";t.r(n);var o=t(208),r=t.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);n["default"]=r.a},208:function(e,n,t){}},[[201,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map