(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/set/userinfo"],{"39df":function(t,n,e){"use strict";(function(t){var o=e("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var c=o(e("9523")),i=e("26cb"),r=e("aa37"),u=e("82ba"),a=e("5adf");function s(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,o)}return e}function f(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?s(Object(e),!0).forEach((function(n){(0,c.default)(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var l={components:{uniList:function(){e.e("components/uni-list/uni-list").then(function(){return resolve(e("28b9"))}.bind(null,e)).catch(e.oe)},uniListItem:function(){e.e("components/uni-list-item/uni-list-item").then(function(){return resolve(e("ce54"))}.bind(null,e)).catch(e.oe)}},data:function(){return{userInfo:{},pics:[]}},onLoad:function(){this.userInfo=t.getStorageSync("userInfo")||"",console.log(this.userInfo)},onUnload:function(){var t=this;"微信用户"==this.userInfo.nickname&&(0,r.logout)({}).then((function(n){t.logout()})).catch((function(t){console.log(t)})),console.log("222")},methods:f(f({},(0,i.mapMutations)("user",["logout","setUserInfo"])),{},{toLogout:function(){var n=this;t.showModal({content:"确定要退出登录么",success:function(e){e.confirm&&(0,r.logout)({}).then((function(e){n.logout(),t.switchTab({url:"/pages/index/index"})})).catch((function(t){console.log(t)}))}})},imgsub:function(){var t=this;console.log("上传头像"),(0,a.upload)({filename:""}).then((function(n){console.log(n[0].url),t.userInfo.avatar=n[0].url}))},test:function(t){console.log(t.detail,"123456")},onChooseAvatar:function(t){this.userInfo.avatar=t.detail.avatarUrl},edit:function(){var n=this,e=this;t.showLoading({title:"提交中...",mask:!0}),(0,u.edit)({avatar:this.userInfo.avatar,nickname:this.userInfo.nickname}).then((function(o){t.hideLoading(),e.$api.msg("修改成功"),n.setUser(),setTimeout((function(){t.switchTab({url:"/pages/user/user"})}),3e3)})).catch((function(t){console.log(t),e.$api.msg("修改失败")}))},setUser:function(){var t=this;(0,u.getUserInfo)({}).then((function(n){var e=n.data;t.setUserInfo(e)})).catch((function(t){console.log(t)}))}})};n.default=l}).call(this,e("543d")["default"])},a79a:function(t,n,e){"use strict";var o=e("c049"),c=e.n(o);c.a},ace7:function(t,n,e){"use strict";(function(t,n){var o=e("4ea4");e("d1cd");o(e("66fd"));var c=o(e("d16d"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(c.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},b140:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},c=[]},c049:function(t,n,e){},cdef:function(t,n,e){"use strict";e.r(n);var o=e("39df"),c=e.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(i);n["default"]=c.a},d16d:function(t,n,e){"use strict";e.r(n);var o=e("b140"),c=e("cdef");for(var i in c)["default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return c[t]}))}(i);e("a79a");var r=e("f0c5"),u=Object(r["a"])(c["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=u.exports}},[["ace7","common/runtime","common/vendor"]]]);