| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bundle-pages-user_profile-user_profile"],{"31cf":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}));var i={uIcon:n("8e61").default,uPopup:n("637c").default,uField:n("baad").default,uVerificationCode:n("bac9").default,uFormItem:n("9899").default,uPicker:n("2d62").default},o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"user-profile p-t-10"},[n("v-uni-view",{staticClass:"content"},[n("v-uni-view",{staticClass:"bg-white"},[n("v-uni-view",{staticClass:"user-avatar-box flex-col col-center"},[n("v-uni-button",{staticClass:"column column-center",attrs:{"hover-class":"none","open-type":"chooseAvatar"},on:{chooseavatar:function(t){arguments[0]=t=e.$handleEvent(t),e.onChooseAvatar.apply(void 0,arguments)},click:function(t){arguments[0]=t=e.$handleEvent(t),e.onChooseAvatar.apply(void 0,arguments)}}},[n("v-uni-image",{staticClass:"user-avatar",attrs:{src:""!=e.userInfo.avatar1?e.userInfo.avatar:"/static/images/portrait_empty.png"}}),n("v-uni-view",{staticClass:"muted xs"},[e._v("点击修改头像")])],1)],1),n("v-uni-view",{staticClass:"row-info flex bdb-line"},[n("v-uni-view",{staticClass:"label md"},[e._v("ID")]),n("v-uni-view",{staticClass:"md flex-1"},[e._v(e._s(e.userInfo.sn))])],1),n("v-uni-view",{staticClass:"row-info flex bdb-line",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.changeName.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"label md"},[e._v("昵称")]),n("v-uni-view",{staticClass:"md flex-1"},[e._v(e._s(e.userInfo.nickname))]),n("u-icon",{attrs:{name:"arrow-right"}})],1),n("v-uni-view",{staticClass:"row-info flex bdb-line",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.changeSex.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"label md"},[e._v("性别")]),n("v-uni-view",{staticClass:"md flex-1",class:0==e.userInfo.sex?"muted":""},[e._v(e._s(e.userInfo.sex))]),n("u-icon",{attrs:{name:"arrow-right"}})],1),n("v-uni-view",{staticClass:"row-info flex bdb-line"},[n("v-uni-view",{staticClass:"label md"},[e._v("手机号")]),n("v-uni-view",{staticClass:"md flex-1",class:{muted:!e.userInfo.mobile}},[e._v(e._s(e.userInfo.mobile?e.userInfo.mobile:"未绑定"))]),n("v-uni-view",{staticClass:"bd-btn br60 flex row-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.showModifyMobile.apply(void 0,arguments)}}},[e._v(e._s(e.userInfo.mobile?"更换手机号":"绑定手机号"))])],1),n("v-uni-view",{staticClass:"row-info flex bdb-line"},[n("v-uni-view",{staticClass:"label md"},[e._v("注册时间")]),n("v-uni-view",{staticClass:"md flex-1"},[e._v(e._s(e.userInfo.create_time))])],1)],1)],1),n("v-uni-view",{staticClass:"br60 save-btn flex row-center lg",staticStyle:{"background-color":"white"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.goToCancel.apply(void 0,arguments)}}},[e._v("注销账号")]),e.appConfig.copyright_info?n("v-uni-view",{staticClass:"license xs text-center"},[n("v-uni-view",[e._v(e._s(e.appConfig.copyright_info))]),n("v-uni-view",[e._v(e._s(e.appConfig.icp_number))])],1):e._e(),n("u-popup",{attrs:{type:"center",closeable:!0,mode:"center","border-radius":"14"},model:{value:e.showMobile,callback:function(t){e.showMobile=t},expression:"showMobile"}},[n("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:e.showMobile,expression:"showMobile"}],staticClass:"modify-container bg-white"},[n("v-uni-view",{staticClass:"title xl text-center"},[e._v(e._s(e.userInfo.mobile?"更换手机号":"绑定手机号"))]),e.userInfo.mobile?n("u-field",{attrs:{label:"+86","label-width":"100",disabled:!0},model:{value:e.userInfo.mobile,callback:function(t){e.$set(e.userInfo,"mobile",t)},expression:"userInfo.mobile"}}):n("u-field",{attrs:{label:"+86","label-width":"140",placeholder:"请输入手机号"},model:{value:e.new_mobile,callback:function(t){e.new_mobile=t},expression:"new_mobile"}}),n("u-field",{attrs:{label:"验证码","label-width":"140",placeholder:"请输入验证码"},model:{value:e.mobileCode,callback:function(t){e.mobileCode=t},expression:"mobileCode"}},[n("v-uni-view",{staticClass:"primary send-code-btn br60 flex row-center",attrs:{slot:"right"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.sendSmsFun.apply(void 0,arguments)}},slot:"right"},[n("u-verification-code",{ref:"uCode",attrs:{"keep-running":!0,"unique-key":"mobile"},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.codeChange.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"sm"},[e._v(e._s(e.codeTips))])],1)],1),e.userInfo.mobile?n("u-field",{attrs:{label:"新手机号","label-width":"140",placeholder:"请输入新的手机号码"},model:{value:e.new_mobile,callback:function(t){e.new_mobile=t},expression:"new_mobile"}}):e._e(),n("v-uni-view",{staticClass:"primary m-t-10 xs"},[e._v(e._s(e.userInfo.mobile?"更改":"绑定")+"手机号码成功后,您的账号将会变更为该设置号码")]),n("v-uni-view",{staticClass:"btn bg-primary white flex row-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.changeUserMobileFun.apply(void 0,arguments)}}},[e._v("确定")])],1)],1),n("u-popup",{attrs:{closeable:!0,maskCloseAble:!1,mode:"center","border-radius":"14"},model:{value:e.showNickName,callback:function(t){e.showNickName=t},expression:"showNickName"}},[n("v-uni-view",{staticClass:"modify-container bg-white",staticStyle:{width:"70vw",padding:"24rpx"}},[n("v-uni-view",{staticClass:"title xl text-center"},[e._v("修改用户名")]),n("v-uni-form",{on:{submit:function(t){arguments[0]=t=e.$handleEvent(t),e.changeNameConfirm.apply(void 0,arguments)}}},[n("u-form-item",{attrs:{label:"新昵称",labelWidth:120}},[n("v-uni-input",{staticClass:"nr",staticStyle:{height:"60rpx"},attrs:{value:e.userInfo.nickname,name:"nickname",type:"nickname",placeholder:"请输入新的昵称"}})],1),n("v-uni-button",{staticClass:"btn bg-primary white flex row-center",attrs:{"form-type":"submit"}},[e._v("确定")])],1)],1)],1),n("u-popup",{attrs:{closeable:!0,mode:"center","border-radius":"14"},model:{value:e.showPwd,callback:function(t){e.showPwd=t},expression:"showPwd"}},[n("v-uni-view",{staticClass:"modify-container bg-white"},[n("v-uni-view",{staticClass:"title xl text-center"},[e._v("设置密码")]),n("u-field",{attrs:{label:"+86",disabled:!0,"label-width":"100"},model:{value:e.userInfo.mobile,callback:function(t){e.$set(e.userInfo,"mobile",t)},expression:"userInfo.mobile"}}),n("u-field",{attrs:{label:"验证码","label-width":"140",placeholder:"请输入验证码"},model:{value:e.pwdCode,callback:function(t){e.pwdCode=t},expression:"pwdCode"}},[n("v-uni-view",{staticClass:"primary send-code-btn br60 flex row-center",attrs:{slot:"right"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.sendSmsFun.apply(void 0,arguments)}},slot:"right"},[n("u-verification-code",{ref:"uCode",attrs:{"unique-key":"password","keep-running":!0},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.codeChange.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"sm"},[e._v(e._s(e.codeTips))])],1)],1),n("u-field",{attrs:{label:"设置密码","label-width":"140",type:"password",placeholder:"请输入新密码"},model:{value:e.pwd,callback:function(t){e.pwd=t},expression:"pwd"}}),n("u-field",{attrs:{label:"确认密码","label-width":"140",type:"password",placeholder:"再次输入新密码确认"},model:{value:e.comfirmPwd,callback:function(t){e.comfirmPwd=t},expression:"comfirmPwd"}}),n("v-uni-view",{staticClass:"btn bg-primary white flex row-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.forgetPwdFun.apply(void 0,arguments)}}},[e._v("确定")])],1)],1),n("u-picker",{attrs:{mode:"selector","default-selector":[0],range:e.sexList},on:{confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.onConfirm.apply(void 0,arguments)}},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}})],1)},a=[]},"79b2":function(e,t,n){var i=n("c86c");t=i(!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/* 行为相关颜色 */.user-profile[data-v-79c668f4]{min-height:calc(100vh - env(safe-area-inset-bottom));display:flex;flex-direction:column}.user-profile .content[data-v-79c668f4]{border-top-left-radius:%?28?%;border-top-right-radius:%?28?%}.user-profile .content .user-avatar-box[data-v-79c668f4]{padding:%?30?%}.user-profile .content .user-avatar-box .user-avatar[data-v-79c668f4]{width:%?120?%;height:%?120?%;border-radius:50%}.user-profile .content .row-info[data-v-79c668f4]{padding:%?30?% %?20?%}.user-profile .content .row-info .label[data-v-79c668f4]{width:%?180?%}.user-profile .content .row-info .bd-btn[data-v-79c668f4]{padding:%?8?% %?24?%;border:1px solid #ff2c3c;color:#ff2c3c}.user-profile .content .bdb-line[data-v-79c668f4]{border-bottom:%?1?% solid #e5e5e5}.user-profile .license[data-v-79c668f4]{margin-top:%?20?%;color:#a7a7a7}.user-profile .save-btn[data-v-79c668f4]{margin:%?40?% %?30?% 0;height:%?88?%}.user-profile .modify-container[data-v-79c668f4]{padding:%?30?%;width:%?620?%;border-radius:%?30?%}.user-profile .modify-container .title[data-v-79c668f4]{padding:%?26?% %?0?%}.user-profile .modify-container .btn[data-v-79c668f4]{height:%?80?%;border-radius:%?20?%;margin:%?60?% %?50?% 0}',""]),e.exports=t},8760:function(e,t,n){var i=n("79b2");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var o=n("967d").default;o("085eb991",i,!0,{sourceMap:!1,shadowMode:!1})},"991e":function(e,t,n){"use strict";n.r(t);var i=n("31cf"),o=n("a69f");for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);n("cf12");var s=n("828b"),r=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"79c668f4",null,!1,i["a"],void 0);t["default"]=r.exports},a69f:function(e,t,n){"use strict";n.r(t);var i=n("c05ae"),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);t["default"]=o.a},c05ae:function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("5c47"),n("a1c1"),n("aa9c");var o=i(n("9b1b")),a=i(n("5de6")),s=i(n("2634")),r=i(n("2fdc")),l=n("94b9"),c=n("7c82"),u=n("1226"),d=n("f2b4"),f=n("8f59"),v=n("c069"),p=n("6d9a"),h=i(n("ebba")),m={NONE:"",SEX:"sex",NICKNAME:"nickname",AVATAR:"avatar",MOBILE:"mobile"},b={name:"userProfile",data:function(){return{action:c.baseURL+"/api/file/formimage",fileList:[],userInfo:{},new_mobile:"",pwdCode:"",mobileCode:"",newNickname:"",sexList:["男","女"],fieldType:m.NONE,showPicker:!1,showMobile:!1,showPwd:!1,showNickName:!1,codeTips:"",canSendSms:!0,pwd:"",comfirmPwd:"",smsType:"",code:"",version:c.version}},methods:{codeChange:function(e){this.codeTips=e},onSuccess:function(e){console.log(e)},uploadImage:function(e){var t=this;uni.showLoading({title:"正在上传中...",mask:!0}),(0,v.uploadFile)(e).then((function(e){uni.hideLoading(),t.setUserInfoFun(e.uri)})).catch((function(){uni.hideLoading(),t.$toast({title:"上传失败"})}))},bindWeixin:function(){this.oaAuth()},oaAuth:function(){h.default.getWxUrl()},onChooseAvatar:function(e){this.fieldType=m.AVATAR,uni.$u.route({url:"/components/uview-ui/components/u-avatar-cropper/u-avatar-cropper",params:{destWidth:300,rectWidth:200,fileType:"jpg"}})},changeNameConfirm:function(e){var t=this;return(0,r.default)((0,s.default)().mark((function n(){return(0,s.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.fieldType=m.NICKNAME,t.newNickname=e.detail.value.nickname,t.newNickname){n.next=4;break}return n.abrupt("return",t.$toast({title:"请输入新的昵称"}));case 4:return n.next=6,t.setUserInfoFun(t.newNickname);case 6:t.showNickName=!1;case 7:case"end":return n.stop()}}),n)})))()},getUserProfileFun:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){var n,i,o,a,r,c,u,d;return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,p.getUserProfile)();case 2:return n=t.sent,i=n.userInfo,o=i.avatarUrl,a=i.nickName,r=i.gender,t.next=7,(0,l.setWechatInfo)({nickname:a,avatar:o,sex:r});case 7:c=t.sent,u=c.msg,d=c.code,1==d&&(e.$toast({title:u}),e.getUserInfoFun());case 11:case"end":return t.stop()}}),t)})))()},logout:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){var n,i,o;return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,uni.showModal({title:"提示",content:"是否退出登录?"});case 2:if(n=t.sent,i=(0,a.default)(n,2),i[0],o=i[1],o.confirm){t.next=8;break}return t.abrupt("return");case 8:(0,l.userLogout)().then((function(t){1==t.code&&(e.$store.commit("logout"),e.$toast({title:"退出成功"}),setTimeout((function(){e.$Router.replace("/pages/login/login")}),500))}));case 9:case"end":return t.stop()}}),t)})))()},goToExplain:function(e){this.$Router.push({path:"/bundle/pages/server_explan/server_explan",query:{type:e}})},goLicense:function(){this.$Router.push({path:"/bundle/pages/license/license",query:{id:""}})},goToCancel:function(){this.$Router.push({path:"/bundle/pages/cancel/cancel",query:{id:""}})},sendSmsFun:function(e){var t=this;this.$refs.uCode.canGetCode&&(0,u.sendSms)({mobile:this.userInfo.mobile||this.new_mobile,key:this.smsType}).then((function(e){1==e.code&&(t.$toast({title:e.msg}),t.$refs.uCode.start())}))},getUserInfoFun:function(){var e=this;(0,l.getUserInfo)().then((function(t){1==t.code&&(e.userInfo=t.data)}))},showModifyMobile:function(){this.new_mobile="",this.showMobile=!0,this.smsType=this.userInfo.mobile?d.SMSType.CHANGE_MOBILE:d.SMSType.BIND},changeUserMobileFun:function(){var e=this;this.mobileCode?this.new_mobile?(0,l.changeUserMobile)({mobile:this.userInfo.mobile,new_mobile:this.new_mobile,code:this.mobileCode,action:this.userInfo.mobile?"change":"binding"}).then((function(t){1==t.code&&(e.showMobile=!1,e.$toast({title:t.msg}),e.getUserInfoFun())})):this.$toast({title:"请输入新的手机号码"}):this.$toast({title:"请输入验证码"})},setUserInfoFun:function(e){var t=this;return(0,r.default)((0,s.default)().mark((function n(){var i;return(0,s.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,l.setUserInfo)({field:t.fieldType,value:e});case 2:i=n.sent,1==i.code&&(t.$toast({title:i.msg}),t.getUserInfoFun());case 4:case"end":return n.stop()}}),n)})))()},onConfirm:function(e){this.setUserInfoFun(e[0]+1),this.showPicker=!1},changeSex:function(e){this.showPicker=!0,this.fieldType=m.SEX},showPwdPop:function(){this.userInfo.mobile?(this.smsType=d.SMSType.FINDPWD,this.showPwd=!0):this.$toast({title:"请绑定手机后再设置密码"})},forgetPwdFun:function(){var e=this,t=this.pwdCode,n=this.pwd,i=this.comfirmPwd;if(t)if(n)if(i)if(n==i){var o={mobile:this.userInfo.mobile,code:t,password:n,repassword:i};(0,u.forgetPwd)(o).then((function(t){1==t.code&&(e.showPwd=!1,e.$toast({title:"设置密码成功"}),e.getUserInfoFun())}))}else this.$toast({title:"两次密码输入不一致"});else this.$toast({title:"再次输入新密码确认"});else this.$toast({title:"请输入新密码"});else this.$toast({title:"请输入短信验证码"})},changeName:function(){this.fieldType=m.NICKNAME,this.newNickname="",this.showNickName=!0}},onLoad:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){var n,i;return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.getUserInfoFun(),n=e.$Route.query,i=n.code,n.form,!i){t.next=6;break}return Array.isArray(i)&&(i=i.pop()),t.next=6,(0,l.apibindOa)({code:i});case 6:uni.$on("uAvatarCropper",(function(t){console.log(t),e.uploadImage(t)})),e.getUserProfileFun=(0,v.trottle)(e.getUserProfileFun,500,e);case 8:case"end":return t.stop()}}),t)})))()},onUnload:function(){uni.$off("uAvatarCropper")},computed:(0,o.default)({},(0,f.mapGetters)(["token","appConfig"]))};t.default=b},cf12:function(e,t,n){"use strict";var i=n("8760"),o=n.n(i);o.a}}]);
|