(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/mine/settings/user"],{"3ba7":function(t,e,n){"use strict";n.r(e);var a=n("d44d"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=o.a},4243:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var a=function(){var t=this.$createElement;this._self._c},o=[]},"70e3":function(t,e,n){"use strict";n.r(e);var a=n("4243"),o=n("3ba7");for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);n("aac4");var r=n("828b"),c=Object(r["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=c.exports},"80f9":function(t,e,n){},aac4:function(t,e,n){"use strict";var a=n("80f9"),o=n.n(a);o.a},d44d:function(t,e,n){"use strict";(function(t){var a=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("7ca3")),i=n("8f59");function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}var c={data:function(){return{loadEnd:!1,userInfo:{},avatar:"",nickname:"",timeout:null}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,i.mapState)({themeColor:function(t){return t.app.themeColor}})),onLoad:function(){var e=this;this.userInfo=t.getStorageSync("userInfo"),this.nickname=this.userInfo.nickname,this.$nextTick((function(){e.loadEnd=!0}))},onUnload:function(){clearTimeout(this.timeout)},methods:{chooseAvatar:function(t){this.avatar=t.detail.avatarUrl},onConfirm:function(e){var n=this;this.nickname=e.detail.value.nickname,this.nickname?this.avatar||this.nickname!==this.userInfo.nickname?(t.showLoading({title:"加载中",mask:!0}),this.uploadAvatar((function(e){var a={avatar:e,nickname:n.nickname||n.userInfo.nickname};n.$util.request("mine.updateUser",a).then((function(e){if(t.hideLoading(),1==e.code){var a=t.getStorageSync("userInfo");a.avatar=e.data.avatar,a.nickname=e.data.nickname,t.setStorageSync("userInfo",a),n.$store.commit("user/setUserInfo",a),t.showToast({icon:"success",title:"设置成功",mask:!0,duration:1500}),n.timeout=setTimeout((function(){t.navigateBack()}),1500)}else t.showToast({title:e.msg,icon:"none"})})).catch((function(e){t.hideLoading(),console.error("更新用户信息 "+e)}))}))):(t.showToast({icon:"success",title:"设置成功",mask:!0,duration:1500}),this.timeout=setTimeout((function(){t.navigateBack()}),1500)):t.showToast({icon:"none",title:"昵称不能为空"})},uploadAvatar:function(e){this.avatar?this.$util.uploadFile(this.avatar).then((function(n){1==n.code?e(n.data.url):t.showToast({title:(null===n||void 0===n?void 0:n.msg)||"上传失败",icon:"none"})})).catch((function(t){console.error("上传图片 ",t)})):e(this.userInfo.avatar)}}};e.default=c}).call(this,n("df3c")["default"])},e6d2:function(t,e,n){"use strict";(function(t,e){var a=n("47a9");n("aa6c");a(n("3240"));var o=a(n("70e3"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])}},[["e6d2","common/runtime","common/vendor"]]]);