1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[57,9],{496:function(e,t,r){"use strict";r.r(t);r(300),r(87),r(63),r(12),r(47),r(39),r(88);var n=6e4,o=36e5,c=24*o;function l(e){return(0+e.toString()).slice(-2)}var m={components:{},props:{isSlot:{type:Boolean,default:!1},time:{type:Number,default:0},format:{type:String,default:"hh:mm:ss"},autoStart:{type:Boolean,default:!0}},watch:{time:{immediate:!0,handler:function(e){e&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(e){return setTimeout(e,100)},isSameSecond:function(e,t){return Math.floor(e)===Math.floor(t)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var e=this;this.tid=this.createTimer((function(){var t=e.getRemain();e.isSameSecond(t,e.remain)&&0!==t||e.setRemain(t),0!==e.remain&&e.setTimer()}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},pause:function(){this.counting=!1,clearTimeout(this.tid)},reset:function(){this.pause(),this.remain=this.time,this.setRemain(this.remain),this.autoStart&&this.start()},setRemain:function(e){var t=this.format;this.remain=e;var time,r=(time=e,{days:Math.floor(time/c),hours:l(Math.floor(time%c/o)),minutes:l(Math.floor(time%o/n)),seconds:l(Math.floor(time%n/1e3))});this.formateTime=function(e,t){var r=t.days,n=t.hours,o=t.minutes,c=t.seconds;return-1!==e.indexOf("dd")&&(e=e.replace("dd",r)),-1!==e.indexOf("hh")&&(e=e.replace("hh",l(n))),-1!==e.indexOf("mm")&&(e=e.replace("mm",l(o))),-1!==e.indexOf("ss")&&(e=e.replace("ss",l(c))),e}(t,r),this.$emit("change",r),0===e&&(this.pause(),this.$emit("finish"))}}},d=r(9),component=Object(d.a)(m,(function(){var e=this,t=e._self._c;return e.time>=0?t("div",[t("client-only",[e.isSlot?e._t("default"):t("span",[e._v(e._s(e.formateTime))])],2)],1):e._e()}),[],!1,null,null,null);t.default=component.exports},501:function(e,t,r){"use strict";r.d(t,"d",(function(){return n})),r.d(t,"e",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return m}));var n=5,o={SMS:0,ACCOUNT:1},c={REGISTER:"ZCYZ",FINDPWD:"ZHMM",LOGIN:"YZMDL",SJSQYZ:"SJSQYZ",CHANGE_MOBILE:"BGSJHM",BIND:"BDSJHM"},l={NONE:"",SEX:"sex",NICKNAME:"nickname",AVATAR:"avatar",MOBILE:"mobile"},m={NORMAL:"normal",HANDLING:"apply",FINISH:"finish"}},596:function(e,t,r){var content=r(683);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(18).default)("2737f848",content,!0,{sourceMap:!1})},682:function(e,t,r){"use strict";r(596)},683:function(e,t,r){var n=r(17)((function(i){return i[1]}));n.push([e.i,'.user-profile{padding:10px;width:980px}.user-profile .user-header{border-bottom:1px solid #e5e5e5;padding:10px 5px}.user-profile .user-container{margin-top:35px}.user-profile .user-container .user-form-item{margin-top:24px;padding-left:13px}.user-profile .user-container .user-form-item .user-form-label{margin-right:24px;text-align:left;width:60px}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader:hover .avatar .mask{display:flex}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader:hover .avatar:after{opacity:1}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar{position:relative}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar .mask{display:none;position:absolute}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar:after{align-items:center;background-color:rgba(0,0,0,.3);border-radius:60px;color:#fff;content:"更换头像";display:flex;flex-direction:row;font-size:12px;height:64px;justify-content:center;left:0;opacity:0;position:absolute;top:0;transition:opacity .3s ease;width:100%}.user-profile .user-container .user-form-item .user-input{width:240px}.user-profile .user-container .user-form-item .el-radio__input.is-checked+.el-radio__label{color:#007aff}.user-profile .user-container .user-form-item .el-input__inner:focus{border-color:#007aff}.user-profile .user-container .user-form-item .el-radio__input.is-checked .el-radio__inner{background:#007aff;border-color:#007aff}.user-profile .user-container .user-form-item .el-radio__inner:hover{border-color:#007aff}.user-profile .user-container .primary-btn{border:none;border-radius:4px;cursor:pointer;height:32px;margin-top:32px;width:100px}.user-profile .user-container .primary-btn:focus{border:none;outline:none}',""]),n.locals={},e.exports=n},733:function(e,t,r){"use strict";r.r(t);r(30),r(24),r(20),r(23),r(12),r(31),r(21),r(32);var n=r(8),o=r(10),c=(r(56),r(501)),l=r(82),m=r.n(l),d=r(14),f=r(195);function v(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?v(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):v(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var _={head:function(){return{title:this.$store.getters.headTitle,link:[{rel:"icon",type:"image/x-icon",href:this.$store.getters.favicon}]}},layout:"user",mounted:function(){this.getUserInfoFun()},data:function(){return{avatar:"",mobile:"",sex:0,createTime:"",sn:"",action:f.a.baseUrl+"/api/file/formimage",nickName:"",radio:1,showChangeNumber:!1,showPwdPop:!1,telephone:"",verifyCode:"",pwd:"",againPwd:"",smsType:c.c.CHANGE_MOBILE,canSendNumber:!0,canSendPwd:!0,fileList:[],team_info:{}}},methods:h(h({beforeAvatarUpload:function(e){var t=e.name.substring(e.name.lastIndexOf(".")+1);console.log("fdsadsf");var r="jpg"===t,n="png"===t;return r||n?r||n||"jpeg"===t:(this.$message({message:"上传文件只能是 jpg, jpeg, png格式!",type:"warning"}),!1)}},Object(d.b)(["getPublicData"])),{},{getUserInfoFun:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$get("user/info");case 2:return 1==(r=t.sent).code&&(e.avatar=r.data.avatar,e.nickName=r.data.nickname,e.mobile=r.data.mobile,e.sex=r.data.sex,e.radio=e.sex,e.createTime=r.data.create_time,e.sn=r.data.sn),t.next=6,e.$get("user/center");case 6:1==(n=t.sent).code&&(e.team_info=n.data.team_info);case 8:case"end":return t.stop()}}),t)})))()},saveUserInfo:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$post("pc/changeUserInfo",{sex:"男"==e.radio?1:2,nickname:e.nickName});case 2:1==(r=t.sent).code&&(e.$message({message:r.msg,type:"success"}),e.getPublicData());case 4:case"end":return t.stop()}}),t)})))()},closeChangeNumber:function(){this.telephone="",this.verifyCode="",this.showChangeNumber=!1},closePwdPop:function(){this.telephone="",this.verifyCode="",this.showPwdPop=!1},openChangeNumber:function(){this.showChangeNumber=!0,this.smsType=this.mobile?c.c.CHANGE_MOBILE:c.c.BIND},openChangePwdPop:function(){if(""==this.mobile)return this.$message.error("请先绑定手机号");this.showPwdPop=!0,this.smsType=c.c.FINDPWD},sndSmsToPhone:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.smsType!=c.c.CHANGE_MOBILE&&e.smsType!=c.c.BIND||e.canSendNumber){t.next=4;break}return t.abrupt("return");case 4:if(e.smsType!=c.c.FINDPWD||e.canSendPwd){t.next=6;break}return t.abrupt("return");case 6:if(e.smsType!=c.c.CHANGE_MOBILE||e.telephone){t.next=8;break}return t.abrupt("return",e.$message.error("请输入手机号"));case 8:return t.next=10,e.$post("sms/send",{mobile:e.smsType==c.c.FINDPWD?e.mobile:e.telephone,key:e.smsType});case 10:1==t.sent.code&&(e.smsType==c.c.FINDPWD?e.canSendPwd=!1:e.canSendNumber=!1,e.$message.success("发送成功"));case 12:case"end":return t.stop()}}),t)})))()},changeUserMobile:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.telephone){t.next=2;break}return t.abrupt("return",e.$message.error("请输入新的手机号码"));case 2:if(e.verifyCode){t.next=4;break}return t.abrupt("return",e.$message.error("请输入验证码"));case 4:return t.next=6,e.$post("user/changeMobile",{mobile:e.mobile,new_mobile:e.telephone,code:e.verifyCode,action:e.mobile?"change":"",client:c.d});case 6:1==(r=t.sent).code&&(e.showChangeNumber=!1,e.$message.success(r.msg),e.getPublicData(),e.getUserInfoFun());case 8:case"end":return t.stop()}}),t)})))()},setPassWord:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.verifyCode){t.next=2;break}return t.abrupt("return",e.$message.error("请输入验证码"));case 2:if(e.pwd){t.next=4;break}return t.abrupt("return",e.$message.error("请输入密码"));case 4:if(e.againPwd){t.next=6;break}return t.abrupt("return",e.$message.error("请输入确认密码"));case 6:if(e.pwd==e.againPwd){t.next=8;break}return t.abrupt("return",e.$message.error("两次密码输入不一致"));case 8:return t.next=10,e.$post("login_password/forget",{mobile:e.mobile,code:e.verifyCode,password:e.pwd,repassword:e.againPwd,client:c.d});case 10:1==(r=t.sent).code&&(e.$message({message:r.msg,type:"success"}),e.showPwdPop=!1,n=r.data.token,m.a.set("token",n,{expires:60}));case 12:case"end":return t.stop()}}),t)})))()},uploadFileSuccess:function(e,t){var r=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.$post("user/setInfo",{field:c.b.AVATAR,value:e.data.uri});case 2:if(1!=(n=t.sent).code){t.next=9;break}return r.$message({message:n.msg,type:"success"}),t.next=7,r.$get("user/info");case 7:1==(o=t.sent).code&&(r.avatar=o.data.avatar,r.nickName=o.data.nickname,r.mobile=o.data.mobile,r.sex=o.data.sex,r.radio=r.sex,r.createTime=o.data.create_time);case 9:case"end":return t.stop()}}),t)})))()}})},x=(r(682),r(9)),component=Object(x.a)(_,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"user-profile"},[t("div",{staticClass:"user-header lg"},[e._v("\n 个人资料\n ")]),e._v(" "),t("div",{staticClass:"user-container"},[t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("头像")]),e._v(" "),t("div",{staticClass:"user-avatar-upload"},[t("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.action,"show-file-list":!1,"file-list":e.fileList,"on-success":e.uploadFileSuccess,headers:{token:e.$store.state.token},accept:"image/jpg,image/jpeg,image/png","before-upload":e.beforeAvatarUpload}},[t("div",{staticClass:"avatar"},[t("el-image",{staticStyle:{width:"64px",height:"64px","border-radius":"60px"},attrs:{src:e.avatar}}),e._v(" "),t("div",{staticClass:"mask white"})],1)])],1)]),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("用户ID")]),e._v(" "),t("div",{staticClass:"normal nr"},[e._v(e._s(e.sn))])]),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("昵称")]),e._v(" "),t("el-input",{staticClass:"user-input",attrs:{"suffix-icon":"el-icon-edit"},model:{value:e.nickName,callback:function(t){e.nickName=t},expression:"nickName"}})],1),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("性别")]),e._v(" "),t("el-radio-group",{model:{value:e.radio,callback:function(t){e.radio=t},expression:"radio"}},[t("el-radio",{attrs:{label:"男"}},[e._v("男")]),e._v(" "),t("el-radio",{attrs:{label:"女"}},[e._v("女")])],1)],1),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("手机号")]),e._v(" "),t("div",{staticClass:"normal nr"},[e._v(e._s(e.mobile))]),e._v(" "),t("div",{staticStyle:{color:"#6699CC","margin-left":"13px",cursor:"pointer"},on:{click:e.openChangeNumber}},[e._v("\n "+e._s(e.mobile?"修改号码":"绑定手机号"))])]),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("注册时间")]),e._v(" "),t("div",{staticClass:"normal nr"},[e._v(e._s(e.createTime))])]),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("登录密码")]),e._v(" "),t("div",{staticClass:"nr",staticStyle:{color:"#6699CC",cursor:"pointer"},on:{click:e.openChangePwdPop}},[e._v("修改密码")])]),e._v(" "),t("div",{staticClass:"user-form-item flex"},[t("label",{staticClass:"user-form-label nr"},[e._v("我的团队")]),e._v(" "),t("div",{staticClass:"normal nr flex"},[t("div",{staticClass:"name"},[e._v("团队名称:"),t("span",{staticClass:"primary"},[e._v(e._s(e.team_info.name))])]),e._v(" "),t("div",{staticClass:"phone m-l-30"},[e._v("联系电话:"),t("span",{staticClass:"primary"},[e._v(e._s(e.team_info.phone))])])])]),e._v(" "),t("button",{staticClass:"primary-btn bg-primary flex-center white",on:{click:e.saveUserInfo}},[e._v("\n 保存\n ")])]),e._v(" "),t("el-dialog",{attrs:{center:!0,title:e.mobile?"更换手机号":"绑定手机",visible:e.showChangeNumber,width:"40%"},on:{"update:visible":function(t){e.showChangeNumber=t}}},[t("div",[t("el-form",{staticStyle:{width:"50%",margin:"0 auto"}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入新的手机号码"},model:{value:e.telephone,callback:function(t){e.telephone=t},expression:"telephone"}})],1),e._v(" "),t("el-form-item",[t("div",{staticClass:"flex"},[t("el-input",{attrs:{placeholder:"短信验证码"},model:{value:e.verifyCode,callback:function(t){e.verifyCode=t},expression:"verifyCode"}}),e._v(" "),t("el-button",{staticStyle:{"margin-left":"14px"},on:{click:e.sndSmsToPhone}},[e.canSendNumber?t("div",[e._v("获取验证码")]):t("count-down",{attrs:{time:60,format:"ss秒",autoStart:""},on:{finish:function(t){e.canSendNumber=!0}}})],1)],1)])],1)],1),e._v(" "),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{staticStyle:{width:"134px"},attrs:{type:"primary"},on:{click:e.changeUserMobile}},[e._v("确认")]),e._v(" "),t("el-button",{staticStyle:{width:"134px"},on:{click:e.closeChangeNumber}},[e._v("取消")])],1)]),e._v(" "),t("el-dialog",{attrs:{title:"设置登录密码",center:!0,visible:e.showPwdPop,width:"40%"},on:{"update:visible":function(t){e.showPwdPop=t}}},[t("div",[t("el-form",{staticStyle:{width:"50%",margin:"0 auto"}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入手机号码"},model:{value:e.mobile,callback:function(t){e.mobile=t},expression:"mobile"}})],1),e._v(" "),t("el-form-item",[t("div",{staticClass:"flex"},[t("el-input",{attrs:{placeholder:"短信验证码"},model:{value:e.verifyCode,callback:function(t){e.verifyCode=t},expression:"verifyCode"}}),e._v(" "),t("el-button",{staticStyle:{"margin-left":"14px"},on:{click:e.sndSmsToPhone}},[e.canSendPwd?t("div",[e._v("获取验证码")]):t("count-down",{attrs:{time:60,format:"ss秒",autoStart:""},on:{finish:function(t){e.canSendPwd=!0}}})],1)],1)]),e._v(" "),t("el-form-item",[t("el-input",{attrs:{type:"password",placeholder:"请输入密码 (数字与字母自由组合)"},model:{value:e.pwd,callback:function(t){e.pwd=t},expression:"pwd"}})],1),e._v(" "),t("el-form-item",[t("el-input",{attrs:{type:"password",placeholder:"再次输入密码"},model:{value:e.againPwd,callback:function(t){e.againPwd=t},expression:"againPwd"}})],1)],1)],1),e._v(" "),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{staticStyle:{width:"134px"},attrs:{type:"primary"},on:{click:e.setPassWord}},[e._v("确认")]),e._v(" "),t("el-button",{staticStyle:{width:"134px"},on:{click:e.closePwdPop}},[e._v("取消")])],1)])],1)}),[],!1,null,null,null);t.default=component.exports;installComponents(component,{CountDown:r(496).default})}}]); |