(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"19bd":function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return o}));var r=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){!e.isclick&&e.userInfoData()})},c=[]},"1ebb":function(e,t,n){"use strict";(function(e){n("5935");o(n("66fd"));var t=o(n("d092"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])},"7b3d":function(e,t,n){},"868b":function(e,t,n){"use strict";var o=n("7b3d"),r=n.n(o);r.a},"946d":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("7f2d"),r=n("03d0"),c=n("43f1"),i=n("26cb");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f={data:function(){return{userInfo:{},code:"",isclick:!1}},onLoad:function(e){this.loadData()},computed:{},methods:u(u({},(0,i.mapMutations)("user",["login","setUserInfo"])),{},{loadData:function(){var e=this;(0,r.loginWinxinMp)().then((function(){wx.login({success:function(t){console.log(t,"loginWinxinMp"),e.code=t.code},fill:function(e){console.log(e)}})}))},userInfoData:function(){var t=this;t.isclick||(t.isclick=!0,wx.getUserProfile({desc:"用于完善会员资料",success:function(n){console.log(n,"that.userInfo+++++++++++++++++++"),t.userInfo=n,e.showLoading({title:"授权中",mask:!0}),t.loadMp()},fail:function(n){t.isclick=!1,e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3})}}))},loadMp:function(){var t=this,n=t.userInfo;console.log(n);var o=e.getStorageSync("spread")||"",r=e.getStorageSync("spread_code")||"";(0,c.wechatMpAuth)({code:t.code,iv:n.iv,encryptedData:n.encryptedData,spread_spid:o,spread_code:r}).then((function(e){var n=e.data;t.wchatAuth(n),console.log(n,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(e){}))},wchatAuth:function(t){var n=this;e.setStorageSync("token",t.token),console.log(t.token,"token++++++++++++++"),(0,o.getUserInfo)({}).then((function(t){console.log("userInfo+++++++++++",t),n.login(),e.hideLoading(),n.setUserInfo(t.data);var o=e.getStorageSync("present")||"/pages/index/index";"pages/shop/product"==o&&(o="/pages/index/index"),e.switchTab({url:o,fail:function(t){e.navigateTo({url:o,fail:function(t){e.navigateTo({url:"/pages/index/index"})}})}})}))}})};t.default=f}).call(this,n("543d")["default"])},d092:function(e,t,n){"use strict";n.r(t);var o=n("19bd"),r=n("e551");for(var c in r)"default"!==c&&function(e){n.d(t,e,(function(){return r[e]}))}(c);n("868b");var i,a=n("f0c5"),u=Object(a["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);t["default"]=u.exports},e551:function(e,t,n){"use strict";n.r(t);var o=n("946d"),r=n.n(o);for(var c in o)"default"!==c&&function(e){n.d(t,e,(function(){return o[e]}))}(c);t["default"]=r.a}},[["1ebb","common/runtime","common/vendor"]]]);