(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"0363":function(e,n,t){"use strict";(function(e,n){var o=t("4ea4");t("3e39");o(t("66fd"));var c=o(t("2233"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(c.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},2233:function(e,n,t){"use strict";t.r(n);var o=t("ae3a"),c=t("7592");for(var i in c)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return c[e]}))}(i);t("5315");var a=t("f0c5"),r=Object(a["a"])(c["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=r.exports},5315:function(e,n,t){"use strict";var o=t("f99c"),c=t.n(o);c.a},7592:function(e,n,t){"use strict";t.r(n);var o=t("b4b7"),c=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=c.a},ae3a:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return o}));var o={uniPopup:function(){return t.e("components/uni-popup/uni-popup").then(t.bind(null,"9fd5"))}},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()})},i=[]},b4b7:function(e,n,t){"use strict";(function(e,o){var c=t("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=c(t("9523")),a=t("ec28"),r=t("03a1"),u=t("679b"),s=t("26cb");function d(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 l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,i.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var f={data:function(){return{userInfo:{},code:"",isclick:!1,iv1:"",encryptedData1:"",hasphone:!1}},onLoad:function(){this.loadData()},computed:{},methods:l(l({},(0,s.mapMutations)("user",["login","setUserInfo"])),{},{close:function(){this.$refs.popupsq.close()},getPhoneNumber:function(n){if(console.log(n,"e+++++++++++++++"),"getPhoneNumber:ok"!=n.detail.errMsg)return this.isclick=!1,void e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3});console.log("chenggong++++++++++++++"),this.hasphone=!0,this.iv1=n.detail.iv,this.encryptedData1=n.detail.encryptedData,this.$refs.popupsq.open()},loadData:function(){var e=this;(0,r.loginWinxinMp)().then((function(n){console.log(n,"ddddddddddddddddddddddd"),o.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,o.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,u.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,a.getUserInfo)({}).then((function(n){console.log("userInfo+++++++++++",n),t.login(),e.hideLoading(),t.setUserInfo(n.data),"微信用户"==n.data.nickname?e.showModal({title:"提示",content:"您暂未设置用户名，头像。是否前往设置",success:function(n){n.confirm?e.navigateTo({url:"/pages/set/userinfo"}):n.cancel&&(logout({}).then((function(e){t.logout()})).catch((function(e){console.log(e)})),t.go())}}):t.go()}))},go:function(){var n=e.getStorageSync("present")||"/pages/index/index";"pages/shop/product"==n&&(n="/pages/index/index"),e.switchTab({url:n,fail:function(t){e.navigateTo({url:n,fail:function(n){e.navigateTo({url:"/pages/index/index"})}})}})}})};n.default=f}).call(this,t("543d")["default"],t("bc2e")["default"])},f99c:function(e,n,t){}},[["0363","common/runtime","common/vendor"]]]);