(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/demo/demo6"],{4634:function(e,t,n){"use strict";(function(e){n("4518");r(n("66fd"));var t=r(n("77a0"));function r(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},4641:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r}));var r={uAvatar:function(){return n.e("uview-ui/components/u-avatar/u-avatar").then(n.bind(null,"59b7"))}},i=function(){var e=this,t=e.$createElement;e._self._c},o=[]},"4eb8":function(e,t,n){},"58d8":function(e,t,n){"use strict";n.r(t);var r=n("a97a"),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=i.a},"77a0":function(e,t,n){"use strict";n.r(t);var r=n("4641"),i=n("58d8");for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("96c2");var a,s=n("f0c5"),u=Object(s["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);t["default"]=u.exports},"96c2":function(e,t,n){"use strict";var r=n("4eb8"),i=n.n(r);i.a},a97a:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n("a34a"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}var s={data:function(){return{respWx:{},respLogin:{},timer:null,inviteCode:null}},beforeDestroy:function(){this.timer&&(clearTimeout(this.timer),this.timer=null,console.log("clearTimeout"))},onReady:function(){this.show()},methods:{hide:function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},show:function(){var e=this;this.inviteCode=this.$auth.getInviteCode(),this.$mpi.wxLogin().then((function(t){e.respWx=t,console.log("res",t)})),this.setTimer()},setTimer:function(){var e=this;return a(r.default.mark((function t(){return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$mpi.wxLogin();case 2:e.respWx=t.sent,e.timer=setTimeout((function(){e.setTimer()}),24e4);case 4:case"end":return t.stop()}}),t)})))()},tapGetPhoneNumber:function(e){var t=this;return a(r.default.mark((function n(){return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if("getPhoneNumber:ok"==e.detail.errMsg){n.next=2;break}return n.abrupt("return");case 2:t.login(e.detail);case 3:case"end":return n.stop()}}),n)})))()},login:function(e){var t=this;return a(r.default.mark((function n(){var i,o;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(console.log("2:login",e),n.prev=1,t.$dialog.showLoading(),t.respLogin.sessionKey){n.next=7;break}return n.next=6,t.$api.loginByCode({_isReject:!0,code:t.respWx.code});case 6:t.respLogin=n.sent;case 7:return console.log(t.respLogin),n.next=10,t.$api.loginByWxapp({_isReject:!0,openId:t.respLogin.openId,sessionKey:t.respLogin.sessionKey,encryptedData:e.encryptedData,iv:e.iv,inviteCode:t.inviteCode});case 10:i=n.sent,console.log(56,i),i.openId=t.respLogin.openId,i.sessionKey=t.respLogin.sessionKey,o=t.$global.userType.member,t.$auth.login(o,i.sessionId,i.userId,i),t.hide(),t.$util.refreshPage(["/pagesM/pages/category","/pagesM/pages/shop_car"]),t.$auth.removeInviteCode(),t.$auth.getInviteCode(),t.inviteCode?t.$emit("getDistributorCoupon"):t.$emit("signIn",i),n.next=26;break;case 23:n.prev=23,n.t0=n["catch"](1),t.$dialog.alert({content:n.t0.errmsg||"服务繁忙~"});case 26:return n.prev=26,t.$dialog.hideLoading(),t.timer&&(clearTimeout(t.timer),t.setTimer()),n.finish(26);case 30:case"end":return n.stop()}}),n,null,[[1,23,26,30]])})))()}}};t.default=s}},[["4634","common/runtime","common/vendor"]]]);