1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-acbed89a"],{"05ca":function(e,t,n){},4584:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!==e.value?n("div",{staticClass:"edit-box"},[n("back-bar",{attrs:{title:e.$t("h5.edit")+" "+e.$t("h5."+e.type)}}),n("el-input",{attrs:{placeholder:e.$t("h5.input")+" "+e.$t("h5."+e.type),clearable:"",autofocus:""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("div",{staticClass:"submit-wrap"},[n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.submit}},[e._v("完成")])],1)],1):e._e()},s=[],r=(n("b5aa"),n("4457")),u=(n("4694"),n("bd31")),i=(n("dc12"),n("e3ff"),n("ad09"),n("f775")),o=n.n(i),c=n("8973"),p=n("5975"),h=n("1848"),m=n("52c1");c["default"].component(o.a.name,o.a);var f={name:"editNickname",components:{backBar:h["a"]},computed:Object(u["a"])({},Object(m["e"])({group:function(e){return e.group},userInfo:function(e){return e.userInfo},groupName:function(e){return e.group.groupName},groupNotice:function(e){return e.group.groupNotice},nickname:function(e){return e.userInfo.nick_name},username:function(e){return e.userInfo.user_name}}),{type:function(){return this.$route.params.type}}),data:function(){return{value:null}},methods:Object(u["a"])({},Object(m["d"])(["updateGroup","setUserNickName","updateMemberInfo","setUserUserName","initGroup","changeSessionId"]),Object(m["b"])(["updateSessionItem","getUserInfo","getGroupInfo"]),{submit:function(){if(this.value.length){var e=this.value;switch(this.type){case"nickname":if(e.length>16)return void this.$showTips(this.$t("userinfo.nickTooLong"));this.changeNickname(e);break;case"username":/^[a-zA-Z_0-9-]{5,20}$/i.test(e)?this.changeUsername(e):this.$showTips(this.$t("userinfo.wrongPattern"));break;case"groupName":if(e.length>16)return void this.$showTips(this.$t("userinfo.groupNameTooLong"));this.changeGroupName(e);break;case"groupNotice":this.changeGroupNotice(e);break}}else this.$showTips(this.$t("userinfo.inputIsEmpty"))},changeNickname:function(e){var t=this;p["a"].user.changeNickName({nick_name:e}).then(function(n){n.data;t.setUserNickName(e),t.updateMemberInfo({userId:t.$store.state.userId,nickName:e}),t.successBack("/editMe")})},changeUsername:function(e){var t=this;p["a"].user.changeUserName({user_name:e}).then(function(n){n.data;t.setUserUserName(e),t.updateMemberInfo({userId:t.$store.state.userId,userName:e}),t.successBack("/editMe")})},changeGroupName:function(e){var t=this,n=this.group.groupId;p["a"].group.changeTitle({group_id:n,title:e}).then(function(a){a.data;t.updateSessionItem({sessionId:n,data:{name:e}}),t.$store.commit("updateGroup",{key:"groupName",data:e}),t.successBack("/groupSet/".concat(n))})},changeGroupNotice:function(e){var t=this,n=this.group.groupId;p["a"].group.changeNotice({group_id:n,notice:e}).then(function(){t.$showTips(t.$t("public.updateSucc")),t.$store.commit("updateGroup",{key:"groupNotice",data:e}),t.successBack("/groupSet/".concat(n))})},successBack:function(e){var t=this;this.$showTips(this.$t("public.updateSucc")),setTimeout(function(){t.$router.replace(e)},2e3)}}),mounted:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if("nickname"!==this.type&&"username"!==this.type){e.next=7;break}if(e.t0=!this.userInfo,!e.t0){e.next=5;break}return e.next=5,this.getUserInfo();case 5:e.next=13;break;case 7:if(this.group.groupId){e.next=13;break}return t=this.$route.params.id,this.initGroup({groupId:t,useCache:!1}),this.changeSessionId(t),e.next=13,this.getGroupInfo();case 13:this.value=this[this.type];case 14:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},d=f,g=(n("b1e2"),n("fc05")),l=Object(g["a"])(d,a,s,!1,null,null,null);t["default"]=l.exports},b1e2:function(e,t,n){"use strict";var a=n("05ca"),s=n.n(a);s.a},e3ff:function(e,t,n){}}]);
|