|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-setting-setUserInfo"],{"0824":function(e,n,t){"use strict";var a=t("713c"),r=t.n(a);r.a},2129:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ApiPutUser=n.ApiGetCurrentUser=void 0;var a=t("5767"),r="/uc",u=function(){return(0,a.ToAsyncAwait)(a.MsbRequestTk.get("".concat(r,"/user/current")))};n.ApiGetCurrentUser=u;var s=function(e){return(0,a.ToAsyncAwait)(a.MsbRequestTk.put("".concat(r,"/user/"),e))};n.ApiPutUser=s},"49d1":function(e,n,t){"use strict";t.r(n);var a=t("76ae"),r=t.n(a);for(var u in a)"default"!==u&&function(e){t.d(n,e,(function(){return a[e]}))}(u);n["default"]=r.a},"60f2":function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"c",(function(){return u})),t.d(n,"a",(function(){return a}));var a={uUpload:t("ab87").default,uPicker:t("68ab").default},r=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("v-uni-view",[a("v-uni-view",{staticClass:"userInfo"},[a("u-upload",{staticClass:"userInfo--upload",on:{afterRead:function(n){arguments[0]=n=e.$handleEvent(n),e.updateAvatar.apply(void 0,arguments)}}},[a("v-uni-image",{staticClass:"userInfo--head",attrs:{src:e.userInfo.avatar||t("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(n){arguments[0]=n=e.$handleEvent(n),e.$Router.push("/setNickname")}}}),a("UiCell",{staticClass:"cell cell--last",attrs:{title:"性别",value:e.sexName},on:{click:function(n){arguments[0]=n=e.$handleEvent(n),e.sexShow=!0}}}),a("u-picker",{attrs:{show:e.sexShow,columns:e.sexData,defaultIndex:e.sexDefault,keyName:"label"},on:{cancel:function(n){arguments[0]=n=e.$handleEvent(n),e.sexShow=!1},confirm:function(n){arguments[0]=n=e.$handleEvent(n),e.sexChange.apply(void 0,arguments)}}})],1)},u=[]},"6da9":function(e,n,t){"use strict";t.r(n);var a=t("60f2"),r=t("49d1");for(var u in r)"default"!==u&&function(e){t.d(n,e,(function(){return r[e]}))}(u);t("0824"),t("f6e8");var s,o=t("f0c5"),i=Object(o["a"])(r["default"],a["b"],a["c"],!1,null,"35595dd4",null,!1,a["a"],s);n["default"]=i.exports},7084:function(e,n,t){e.exports=t.p+"static/img/tx.71ed472a.png"},"713c":function(e,n,t){var a=t("d1e9");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=t("4f06").default;r("2e3199b1",a,!0,{sourceMap:!1,shadowMode:!1})},"76ae":function(e,n,t){"use strict";var a=t("4ea4");t("99af"),t("7db0"),t("c740"),t("ac1f"),t("1276"),Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(t("5530"));t("96cf");var u=a(t("1da1")),s=a(t("359f")),o=a(t("f196")),i=(t("5767"),t("2129")),c=t("ed1e"),d={components:{UiCell:o.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,n=this.sexData[0].find((function(n){return n.val===e.userInfo.gender}));return n?n.label:"未知"},sexDefault:function(){var e=this;return[this.sexData[0].findIndex((function(n){return n.val===e.userInfo.gender}))]}},onShow:function(){console.log("-----++")},methods:{sexChange:function(e){var n=this;return(0,u.default)(regeneratorRuntime.mark((function t(){var a,u,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.value[0].val,t.next=3,(0,i.ApiPutUser)({gender:a});case 3:if(u=t.sent,s=u.error,u.result,!s){t.next=9;break}return ui.$u.totas(s.message),t.abrupt("return",!1);case 9:n.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},n.userInfo),{},{gender:a})),n.sexShow=!1;case 11:case"end":return t.stop()}}),t)})))()},getOssCon:function(){return(0,u.default)(regeneratorRuntime.mark((function e(){var n,t,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(n=e.sent,t=n.error,a=n.result,!t){e.next=8;break}return uni.$u.toast(t.message),e.abrupt("return",!1);case 8:return e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})))()},updateAvatar:function(e){var n=this;return(0,u.default)(regeneratorRuntime.mark((function t(){var a,s,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.file,s=a.url.split("/"),o=a.name||s[s.length-1],t.next=5,n.getOssCon();case 5:c=t.sent,uni.uploadFile({name:"file",filePath:a.url,url:c.host,formData:{name:o,key:"".concat(c.dir,"${filename}"),policy:c.policy,OSSAccessKeyId:c.accessId,success_action_status:200,signature:c.signature},success:function(){var e=(0,u.default)(regeneratorRuntime.mark((function e(t){var a,u,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return console.log(t),a="".concat(c.host,"/").concat(c.dir).concat(o),e.next=4,(0,i.ApiPutUser)({avatar:a});case 4:if(u=e.sent,s=u.error,u.result,!s){e.next=10;break}return ui.$u.totas(s.message),e.abrupt("return",!1);case 10:n.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},n.userInfo),{},{avatar:a}));case 11:case"end":return e.stop()}}),e)})));function t(n){return e.apply(this,arguments)}return t}()});case 7:case"end":return t.stop()}}),t)})))()}}};n.default=d},a659:function(e,n,t){var a=t("fcea");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=t("4f06").default;r("39b17f32",a,!0,{sourceMap:!1,shadowMode:!1})},d1e9:function(e,n,t){var a=t("24fb");n=a(!1),n.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-35595dd4]{background:#f8f8f8}body.?%PAGE?%[data-v-35595dd4]{background:#f8f8f8}',""]),e.exports=n},f6e8:function(e,n,t){"use strict";var a=t("a659"),r=t.n(a);r.a},fcea:function(e,n,t){var a=t("24fb");n=a(!1),n.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/* 垂直间距 */.userInfo[data-v-35595dd4]{padding:%?77?% 0 %?60?%;text-align:center;font-size:%?28?%;color:#333}.userInfo--head[data-v-35595dd4], .userInfo--upload[data-v-35595dd4]{width:%?120?%;height:%?120?%;border-radius:50%;margin:0 auto %?13?%}.cell[data-v-35595dd4]{padding:0 %?40?%}.cell--last[data-v-35595dd4]{border:0}[data-v-35595dd4] .userInfo .uiCell--title{font-size:%?32?%}[data-v-35595dd4] .uiCell--value{color:#999}',""]),e.exports=n}}]); |