(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"13dd":function(e,n,t){"use strict";var o=t("7c4a"),c=t.n(o);c.a},"254c":function(e,n,t){"use strict";(function(e){t("7154");o(t("66fd"));var n=o(t("f3bb"));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"])},7683:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("ca0f"),c=t("15b5"),r=t("8a08"),i=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){s(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 s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var d={data:function(){return{userInfo:{},code:"",isclick:!1,iv1:"",encryptedData1:"",hasphone:!1}},onLoad:function(){this.loadData()},computed:{},methods:u(u({},(0,i.mapMutations)("user",["login","setUserInfo"])),{},{close:function(){this.$refs.popupsq.close()},getPhoneNumber:function(n){var t=this;if(console.log(n,"e+++++++++++++++"),"getPhoneNumber:ok"!=n.detail.errMsg)return t.isclick=!1,void e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3});console.log("chenggong++++++++++++++"),t.hasphone=!0,t.iv1=n.detail.iv,t.encryptedData1=n.detail.encryptedData,t.$refs.popupsq.open()},loadData:function(){var e=this;(0,c.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")||"",c=e.getStorageSync("spread_code")||"";(0,r.wechatMpAuth)({code:n.code,iv:t.iv,iv1:n.iv1,encryptedData1:n.encryptedData1,encryptedData:t.encryptedData,spread_spid:o,spread_code:c}).then((function(e){var t=e.data;n.wchatAuth(t),console.log(t,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(e){}))},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=d}).call(this,t("543d")["default"])},"7c4a":function(e,n,t){},c6ae:function(e,n,t){"use strict";t.r(n);var o=t("7683"),c=t.n(o);for(var r in o)"default"!==r&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=c.a},e748:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return o}));var o={uniPopup:function(){return t.e("components/uni-popup/uni-popup").then(t.bind(null,"86bb"))}},c=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){!e.isclick&&e.userInfoData()},e.e1=function(n){!e.isclick&&e.userInfoData()})},r=[]},f3bb:function(e,n,t){"use strict";t.r(n);var o=t("e748"),c=t("c6ae");for(var r in c)"default"!==r&&function(e){t.d(n,e,(function(){return c[e]}))}(r);t("13dd");var i,a=t("f0c5"),u=Object(a["a"])(c["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);n["default"]=u.exports}},[["254c","common/runtime","common/vendor"]]]);