|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-setting-setUserInfo"],{"056a":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return a}));var a={uUpload:n("ab87").default,uPicker:n("68ab").default},r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",[a("v-uni-view",{staticClass:"userInfo"},[a("u-upload",{staticClass:"userInfo--upload",on:{afterRead:function(t){arguments[0]=t=e.$handleEvent(t),e.updateAvatar.apply(void 0,arguments)}}},[a("v-uni-image",{staticClass:"userInfo--head",attrs:{src:e.userInfo.avatar||n("7084")}})],1),a("v-uni-view",[e._v(e._s(e.userInfo.nickname))])],1),a("UiCell",{staticClass:"cell",attrs:{title:"昵称",value:e.userInfo.nickname},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$Router.push("/setNickname")}}}),a("UiCell",{staticClass:"cell cell--last",attrs:{title:"性别",value:e.sexName},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.sexShow=!0}}}),a("u-picker",{attrs:{show:e.sexShow,columns:e.sexData,defaultIndex:e.sexDefault,keyName:"label"},on:{cancel:function(t){arguments[0]=t=e.$handleEvent(t),e.sexShow=!1},confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.sexChange.apply(void 0,arguments)}}})],1)},u=[]},"07a0":function(e,t,n){"use strict";var a=n("9547"),r=n.n(a);r.a},"17f5":function(e,t,n){var a=n("24fb");t=a(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 透明度 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */uni-page-body[data-v-38546e2e]{background:#f8f8f8}.userInfo[data-v-38546e2e]{padding:%?77?% 0 %?60?%;text-align:center;font-size:%?28?%;color:#333}.userInfo--head[data-v-38546e2e], .userInfo--upload[data-v-38546e2e]{width:%?120?%;height:%?120?%;border-radius:50%;margin:0 auto %?13?%}.cell[data-v-38546e2e]{padding:0 %?40?%}.cell--last[data-v-38546e2e]{border:0}[data-v-38546e2e] .userInfo .uiCell--title{font-size:%?32?%}[data-v-38546e2e] .uiCell--value{color:#999}body.?%PAGE?%[data-v-38546e2e]{background:#f8f8f8}',""]),e.exports=t},2129:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiPutUser=t.ApiGetCurrentUser=void 0;var a=n("5767"),r="/uc",u=function(){return(0,a.ToAsyncAwait)(a.MsbRequestTk.get("".concat(r,"/user/current")))};t.ApiGetCurrentUser=u;var s=function(e){return(0,a.ToAsyncAwait)(a.MsbRequestTk.put("".concat(r,"/user/"),e))};t.ApiPutUser=s},"49d1":function(e,t,n){"use strict";n.r(t);var a=n("76ae"),r=n.n(a);for(var u in a)"default"!==u&&function(e){n.d(t,e,(function(){return a[e]}))}(u);t["default"]=r.a},"6da9":function(e,t,n){"use strict";n.r(t);var a=n("056a"),r=n("49d1");for(var u in r)"default"!==u&&function(e){n.d(t,e,(function(){return r[e]}))}(u);n("07a0");var s,i=n("f0c5"),o=Object(i["a"])(r["default"],a["b"],a["c"],!1,null,"38546e2e",null,!1,a["a"],s);t["default"]=o.exports},7084:function(e,t,n){e.exports=n.p+"static/img/tx.71ed472a.png"},"76ae":function(e,t,n){"use strict";var a=n("4ea4");n("99af"),n("7db0"),n("c740"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n("5530"));n("96cf");var u=a(n("1da1")),s=a(n("359f")),i=a(n("f196")),o=(n("5767"),n("2129")),c=n("ed1e"),f={components:{UiCell:i.default,UiButton:s.default},data:function(){return{sexShow:!1,sexData:[[{label:"女",val:2},{label:"男",val:1}]]}},computed:{userInfo:function(){return this.$store.state.userInfo},sexName:function(){var e=this,t=this.sexData[0].find((function(t){return t.val===e.userInfo.gender}));return t?t.label:"未知"},sexDefault:function(){var e=this;return[this.sexData[0].findIndex((function(t){return t.val===e.userInfo.gender}))]}},methods:{sexChange:function(e){var t=this;return(0,u.default)(regeneratorRuntime.mark((function n(){var a,u,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=e.value[0].val,n.next=3,(0,o.ApiPutUser)({gender:a});case 3:if(u=n.sent,s=u.error,u.result,!s){n.next=9;break}return ui.$u.totas(s.message),n.abrupt("return",!1);case 9:t.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},t.userInfo),{},{gender:a})),t.sexShow=!1;case 11:case"end":return n.stop()}}),n)})))()},getOssCon:function(){return(0,u.default)(regeneratorRuntime.mark((function e(){var t,n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,c.ApiPostGetOssConfig)({configId:"account-avatar/",serviceName:"uc"});case 2:if(t=e.sent,n=t.error,a=t.result,!n){e.next=8;break}return uni.$u.toast(n.message),e.abrupt("return",!1);case 8:return e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})))()},updateAvatar:function(e){var t=this;return(0,u.default)(regeneratorRuntime.mark((function n(){var a,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=e.file,n.next=3,t.getOssCon();case 3:s=n.sent,uni.uploadFile({name:"file",filePath:a.url,url:s.host,formData:{name:a.name,key:"".concat(s.dir,"${filename}"),policy:s.policy,OSSAccessKeyId:s.accessId,success_action_status:200,signature:s.signature},success:function(){var e=(0,u.default)(regeneratorRuntime.mark((function e(n){var u,i,c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return u="".concat(s.host,"/").concat(s.dir).concat(a.name),e.next=3,(0,o.ApiPutUser)({avatar:u});case 3:if(i=e.sent,c=i.error,i.result,!c){e.next=9;break}return ui.$u.totas(c.message),e.abrupt("return",!1);case 9:t.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},t.userInfo),{},{avatar:u}));case 10:case"end":return e.stop()}}),e)})));function n(t){return e.apply(this,arguments)}return n}()});case 5:case"end":return n.stop()}}),n)})))()}}};t.default=f},9547:function(e,t,n){var a=n("17f5");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=n("4f06").default;r("16f32732",a,!0,{sourceMap:!1,shadowMode:!1})}}]); |