1 |
- webpackJsonp([8],{"8Jf1":function(t,e){},HH94:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Dd8w"),o=a.n(n),s=a("NYxO"),i=a("Zp+1"),r=a("mtWM"),l=a.n(r),d={components:{Tab:i.a},data:function(){return{editBtn:{loding:!1,text:"保存"},TabData:[{name:"个人信息",val:"info"}],TabDefault:"info",formLabelWidth:"120px",AgentFormData:{user_nicename:"",signature:"",avatar:""}}},created:function(){this.getInfo()},computed:o()({},Object(s.c)(["agenInfo"])),methods:o()({},Object(s.b)(["getAgentInfo"]),{getInfo:function(){var t=this;l.a.post("/agent/info").then(function(e){if(200===e.data.code){var a=e.data.data;t.AgentFormData.user_nicename=a.user_nicename,t.AgentFormData.signature=a.signature,t.AgentFormData.avatar=a.avatar}})},upLoadHead:function(t){var e=t.target.files,a=this;if(e.length<=0)return!1;var n=e[0];console.log(n);var o=new FormData;o.append("filetype","image"),o.append("app","agent"),o.append("file",n),o.append("id","UPLOAD_FILE_LOGO"),o.append("name",n.name),o.append("type",n.type),o.append("lastModifiedDate",n.lastModifiedDate),o.append("size",n.size);var s=new XMLHttpRequest;s.open("post","/agent/asset/upload?_ajax=1"),s.upload.onprogress=function(t){var e=t.loaded/t.total*100+"%";console.log(e)},s.send(o),s.onreadystatechange=function(){if(4===s.readyState&&200===s.status){var t=JSON.parse(s.response);200===t.code?a.AgentFormData.avatar=t.data.url:a.showNotify("失败",t.msg,"error")}}},EditAgentInfo:function(){var t=this;this.editBtn.loding=!0,this.editBtn.text="保存中",l.a.post("/agent/edit",this.AgentFormData).then(function(e){t.editBtn.loding=!1,t.editBtn.text="保存",200===e.data.code?(t.getAgentInfo(),t.showNotify("成功",e.data.msg)):t.showNotify("失败",e.data.msg,"error")})}})},f={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"panel"},[a("Tab",{attrs:{defalut:t.TabDefault,data:t.TabData}}),t._v(" "),a("div",{staticClass:"panel_body"},[a("div",{staticClass:"userInfoBody"},[t.agenInfo?a("div",{staticClass:"userInfoBody_head"},[a("label",{attrs:{for:"uploadUserHead"}},[a("div",{staticClass:"imgTpl"},[a("img",{attrs:{src:t.AgentFormData.avatar||t.$store.state.root_path+"tg_touxiang.png",alt:""}}),t._v(" "),a("span",{staticClass:"text"},[t._v("更换头像")])]),t._v(" "),a("h2",{staticClass:"nickname"},[t._v(t._s(t.agenInfo.user_nicename))]),t._v(" "),a("input",{attrs:{type:"file",id:"uploadUserHead"},on:{change:t.upLoadHead}})])]):t._e(),t._v(" "),a("div",{staticClass:"userInfoBody_form"},[a("el-form",[a("el-form-item",{attrs:{label:"用户昵称:","label-width":t.formLabelWidth}},[a("el-input",{attrs:{"auto-complete":"off",placeholder:"输入昵称",size:"small"},model:{value:t.AgentFormData.user_nicename,callback:function(e){t.$set(t.AgentFormData,"user_nicename",e)},expression:"AgentFormData.user_nicename"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"用户账号:","label-width":t.formLabelWidth}},[a("el-input",{attrs:{"auto-complete":"off",disabled:"",value:t.agenInfo.user_login,size:"small"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"绑定手机:","label-width":t.formLabelWidth}},[t.agenInfo.mobile?a("div",[a("span",[t._v(t._s(t.agenInfo.mobile))]),t._v(" "),a("router-link",{staticClass:"toPhonePage",attrs:{to:{path:"/account/phone"}}},[t._v("换绑")])],1):a("div",{staticClass:"toreset",staticStyle:{"justify-content":"flex-start"}},[a("router-link",{attrs:{to:{path:"/account/phone"}}},[t._v("您还没有绑定手机,点击前往绑定")])],1)]),t._v(" "),a("el-form-item",{attrs:{label:"个性签名:","label-width":t.formLabelWidth}},[a("el-input",{attrs:{"auto-complete":"off",type:"textarea",placeholder:"此用户很懒,什么都没有说..."},model:{value:t.AgentFormData.signature,callback:function(e){t.$set(t.AgentFormData,"signature",e)},expression:"AgentFormData.signature"}})],1)],1)],1),t._v(" "),a("div",{staticClass:"userInfoBody_footer"},[a("el-button",{attrs:{type:"primary",loading:t.editBtn.loding},on:{click:t.EditAgentInfo}},[t._v(t._s(t.editBtn.text))]),t._v(" "),a("el-button",[t._v("取 消")])],1)])])],1)},staticRenderFns:[]};var u=a("VU/8")(d,f,!1,function(t){a("8Jf1")},null,null);e.default=u.exports}});
|