(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/user/user"],{29:function(n,e,t){"use strict";(function(n){t(5);o(t(4));var e=o(t(30));function o(n){return n&&n.__esModule?n:{default:n}}wx.__webpack_require_UNI_MP_PLUGIN__=t,n(e.default)}).call(this,t(1)["createPage"])},30:function(n,e,t){"use strict";t.r(e);var o=t(31),r=t(33);for(var c in r)"default"!==c&&function(n){t.d(e,n,(function(){return r[n]}))}(c);t(35);var i,u=t(11),s=Object(u["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"80842834",null,!1,o["components"],i);s.options.__file="pages/user/user.vue",e["default"]=s.exports},31:function(n,e,t){"use strict";t.r(e);var o=t(32);t.d(e,"render",(function(){return o["render"]})),t.d(e,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(e,"components",(function(){return o["components"]}))},32:function(n,e,t){"use strict";var o;t.r(e),t.d(e,"render",(function(){return r})),t.d(e,"staticRenderFns",(function(){return i})),t.d(e,"recyclableRender",(function(){return c})),t.d(e,"components",(function(){return o}));var r=function(){var n=this,e=n.$createElement;n._self._c},c=!1,i=[];r._withStripped=!0},33:function(n,e,t){"use strict";t.r(e);var o=t(34),r=t.n(o);for(var c in o)"default"!==c&&function(n){t.d(e,n,(function(){return o[n]}))}(c);e["default"]=r.a},34:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(24),r={data:function(){return{login:!1,userInfo:{},setList:[{name:"购买记录",icon:"jilu.png"},{name:"退出登录",icon:"logout.png"}]}},onShow:function(){n.getStorageSync("token")&&n.getStorageSync("userInfo")&&(this.login=!0,this.userInfo=n.getStorageSync("userInfo"))},methods:{getLogin:function(){var e=this;n.getStorageSync("token")&&n.getStorageSync("userInfo")||(n.showLoading({title:"加载中",mask:!0}),n.login({success:function(t){(0,o.wxLogin)({code:t.code}).then((function(t){n.hideLoading(),200==t.code?e.checkLogin(t.data):n.showModal({title:"提示",content:t.msg,showCancel:!1})}))}}))},checkLogin:function(e){e.token?(n.showLoading({title:"加载中",mask:!0}),n.setStorageSync("token",e.token),n.setStorageSync("userInfo",e.user),this.login=!0,this.userInfo=n.getStorageSync("userInfo"),n.hideLoading()):!e.token&&e.openid?n.showModal({title:"提示",content:e.msg,showCancel:!1,success:function(t){n.reLaunch({url:"../login/login?type=index&openid="+e.openid})}}):e.token||e.openid||n.showModal({title:"错误提示",content:e.msg,showCancel:!1})},getUrl:function(e){0==e?n.navigateTo({url:"../Buy_soap_tape/purchase_history"}):n.showModal({content:"确定要退出登录么？",success:function(e){e.confirm&&(n.showLoading({title:"加载中",mask:!0}),(0,o.logout)().then((function(e){n.hideLoading(),n.removeStorageSync("token"),n.removeStorageSync("userInfo"),n.reLaunch({url:"../login/login"})})))}})}}};e.default=r}).call(this,t(1)["default"])},35:function(n,e,t){"use strict";t.r(e);var o=t(36),r=t.n(o);for(var c in o)"default"!==c&&function(n){t.d(e,n,(function(){return o[n]}))}(c);e["default"]=r.a},36:function(n,e,t){}},[[29,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/user/user.js.map