(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"0bce":function(e,n,t){"use strict";var o;t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return c})),t.d(n,"a",(function(){return o}));var i=function(){var e=this,n=e.$createElement;e._self._c},c=[]},1275:function(e,n,t){},"8a7c":function(e,n,t){"use strict";t.r(n);var o=t("0bce"),i=t("a757");for(var c in i)"default"!==c&&function(e){t.d(n,e,(function(){return i[e]}))}(c);t("8a98");var r,a=t("f0c5"),u=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],r);n["default"]=u.exports},"8a98":function(e,n,t){"use strict";var o=t("1275"),i=t.n(o);i.a},a757:function(e,n,t){"use strict";t.r(n);var o=t("ea0a"),i=t.n(o);for(var c in o)"default"!==c&&function(e){t.d(n,e,(function(){return o[e]}))}(c);n["default"]=i.a},cb02:function(e,n,t){"use strict";(function(e){t("b755");o(t("66fd"));var n=o(t("8a7c"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},ea0a:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("d45f"),i=t("aee8"),c=t("9836"),r=t("26cb");function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){d(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function d(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s={data:function(){return{userInfo:{},code:"",isclick:!1,iv1:"",encryptedData1:"",hasphone:!1,loding:!1}},onLoad:function(){this.loadData()},computed:u({},(0,r.mapState)(["baseURL","urlFile"])),methods:u(u({},(0,r.mapMutations)("user",["login","setUserInfo"])),{},{close:function(){this.$refs.popupsq.close()},getPhoneNumber:function(n){var t=this;if(console.log(n,"e+++++++++++++++"),!t.loding){if(t.loding=!0,"getPhoneNumber:ok"!=n.detail.errMsg)return t.loding=!1,void e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3});console.log("chenggong++++++++++++++"),t.iv1=n.detail.iv,t.encryptedData1=n.detail.encryptedData,e.showLoading({title:"授权中",mask:!0}),t.loadMp()}},loadData:function(){var e=this;(0,i.loginWinxinMp)().then((function(n){console.log(n,"ddddddddddddddddddddddd"),wx.login({success:function(n){console.log(n,"loginWinxinMp"),e.code=n.code,console.log(e.code,"wxlogin.code++++++")},fill:function(e){console.log(e)}})}))},userInfoData:function(){var n=this;n.isclick||(n.isclick=!0,wx.getUserProfile({desc:"用于完善会员资料",success:function(t){console.log(t,"that.userInfo+++++++++++++++++++"),n.userInfo=t,e.showLoading({title:"授权中",mask:!0}),n.loadMp()},fail:function(t){n.isclick=!1,e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3})}}))},loadMp:function(){var n=this,t=n.userInfo;console.log(t);var o=e.getStorageSync("spread")||"",i=e.getStorageSync("spread_code")||"";(0,c.wechatMpAuth)({code:n.code,iv:n.iv1,encryptedData:n.encryptedData1,spread_spid:o,spread_code:i}).then((function(t){var o=t.data;e.hideLoading(),n.loding=!1,n.wchatAuth(o),console.log(o,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(t){n.loding=!1,e.hideLoading()}))},wchatAuth:function(n){var t=this;e.setStorageSync("token",n.token),console.log(n.token,"token++++++++++++++"),(0,o.getUserInfo)({}).then((function(n){console.log("userInfo+++++++++++",n),t.login(),e.hideLoading(),t.setUserInfo(n.data);var o=e.getStorageSync("present")||"/pages/index/index";"pages/shop/product"==o&&(o="/pages/index/index"),e.switchTab({url:o,fail:function(n){e.navigateTo({url:o,fail:function(n){e.navigateTo({url:"/pages/index/index"})}})}})}))}})};n.default=s}).call(this,t("543d")["default"])}},[["cb02","common/runtime","common/vendor"]]]);