(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ef72ea28"],{"10cb":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("6584"),n("2877")),c=Object(u["a"])(i,a,r,!1,null,"2be6cb1e",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("96cf"),n("1da1")),i=(n("a481"),n("be94")),u=(n("7f7f"),n("10cb"),n("450d"),n("f3ad")),c=n.n(u),o=n("2b0e"),p=n("5975"),h=n("1848"),m=n("2f62");o["default"].component(c.a.name,c.a);var l={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)}));return function(){return e.apply(this,arguments)}}()},f=l,d=(n("b1e2"),n("2877")),g=Object(d["a"])(f,a,r,!1,null,null,null);t["default"]=g.exports},6584:function(e,t,n){"use strict";var a=n("8c53"),r=n.n(a);r.a},"8b2a":function(e,t,n){},"8c53":function(e,t,n){},b1e2:function(e,t,n){"use strict";var a=n("8b2a"),r=n.n(a);r.a}}]);