1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a6c5be1"],{"05ca":function(e,t,n){},1848:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"back-bar border-bottom"},[n("div",{staticClass:"arrow-icon",on:{click:e.onBack}},[n("i",{staticClass:"el-icon-arrow-left"})]),e._v("\n "+e._s(e.title)+"\n "),e.url?n("a",{staticClass:"icon-link",attrs:{href:e.url,target:"_blank"}}):e._e(),e._t("default")],2)},r=[],s={name:"backBar",props:{title:String,url:String},methods:{onBack:function(){this.$router?this.$router.go(-1):this.$emit("onBack")}}},i=s,u=(n("a7de"),n("fc05")),c=Object(u["a"])(i,a,r,!1,null,"bdea7596",null);t["a"]=c.exports},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()},r=[],s=(n("b5aa"),n("4457")),i=(n("4694"),n("bd31")),u=(n("dc12"),n("e3ff"),n("ad09"),n("f775")),c=n.n(u),o=n("8973"),p=n("5975"),h=n("1848"),m=n("52c1");o["default"].component(c.a.name,c.a);var f={name:"editNickname",components:{backBar:h["a"]},computed:Object(i["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(i["a"])({},Object(m["d"])(["updateGroup","setUserNickName","updateMemberNickName","setUserUserName","updateMemberNickName","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.updateMemberNickName({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.updateMemberNickName({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(s["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}()},l=f,d=(n("b1e2"),n("fc05")),g=Object(d["a"])(l,a,r,!1,null,null,null);t["default"]=g.exports},a7de:function(e,t,n){"use strict";var a=n("b1c0"),r=n.n(a);r.a},b1c0:function(e,t,n){},b1e2:function(e,t,n){"use strict";var a=n("05ca"),r=n.n(a);r.a},e3ff:function(e,t,n){}}]);
|