1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a6830cb4"],{"144c":function(t,e,i){"use strict";var n=i("a606"),r=i.n(n);r.a},"417d":function(t,e,i){"use strict";var n=i("6c85"),r=i.n(n);function s(t){if(r()(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}var o=i("ab6b"),a=i.n(o),u=i("ad81"),c=i.n(u);function h(t){if(c()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return a()(t)}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function d(t){return s(t)||h(t)||p()}i.d(e,"a",function(){return d})},"50cd":function(t,e,i){"use strict";var n=i("4cf4"),r=i("0763");t.exports=function(t,e,i){e in t?n.f(t,e,r(0,i)):t[e]=i}},8869:function(t,e,i){"use strict";i.d(e,"f",function(){return d}),i.d(e,"e",function(){return f}),i.d(e,"c",function(){return m}),i.d(e,"d",function(){return g}),i.d(e,"a",function(){return l}),i.d(e,"b",function(){return v});var n=i("396f"),r=(i("5f33"),i("3f47")),s=(i("f10e"),i("417d")),o=(i("612f"),i("4453"),i("ee95")),a=(i("3a23"),i("5975")),u=i("33f8"),c=i("52c1"),h=i("c1f9"),p=i.n(h),d={data:function(){return{isSearch:!1,searchList:null}},methods:{searchUser:function(t,e){var i=t.target.value.toLocaleLowerCase();i?(this.searchList=e.filter(function(t){var e,n,r=(t.name||t.user_name||"").toLocaleLowerCase(),s=(t.nick_name||"").toLocaleLowerCase();return e=!!r&&r.indexOf(i)>-1,n=!!s&&s.indexOf(i)>-1,e||n}),this.isSearch=!0):this.isSearch=!1}}},f={data:function(){return{isSearchGroup:!1,searchUserTimer:null}},methods:{searchUser:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(e,i){var n=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:clearTimeout(this.searchUserTimer),this.searchUserTimer=setTimeout(Object(o["a"])(regeneratorRuntime.mark(function t(){var r,o;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(r=e.target.value.toLocaleLowerCase(),o=n.inviteType,n.isSearchGroup=!0,r.trim()){t.next=7;break}return i.forEach(function(t){n.$set(t,"isShow",!0)}),n.$nextTick(function(){n.isSearchGroup=!1,n.showNum=i.length}),t.abrupt("return");case 7:if(i.forEach(function(t){var e,i,s=(t.user_name||"").toLocaleLowerCase(),o=(t.nick_name||"").toLocaleLowerCase();e=!!s&&s.indexOf(r)>-1,i=!!o&&o.indexOf(r)>-1,n.$set(t,"isShow",e||i)}),i.length+1>=n.membersNum||1==o||2==o){t.next=11;break}return t.next=11,a["a"].group.searchMember({group_id:n.group.groupId,keyword:r}).then(function(t){var e=t.data,n=e.data;n.forEach(function(t){t.isChecked=!1,t.isChoosed=!1,t.isShow=!0}),i=p.a.unionBy([].concat(Object(s["a"])(i),Object(s["a"])(n)),"user_id")});case 11:n.$nextTick(function(){n.isSearchGroup=!1,n.showNum=i.filter(function(t){return t.isShow}).length});case 12:case"end":return t.stop()}},t)})),200);case 2:case"end":return t.stop()}},t,this)}));function e(e,i){return t.apply(this,arguments)}return e}()}},m={data:function(){return{atInd:0}},methods:{atPerson:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var e=this.$refs.chatInput,i=e.selectionStart,n=i-this.keyAfterAt.length;this.inputMsg=this.inputMsg.slice(0,n)+"".concat(t," ")+this.inputMsg.slice(i),this.atInd=0,e.focus(),this.$nextTick(function(){e.setSelectionRange(n+t.length+1,n+t.length+1)}),this.$store.commit("updateIsNewAt",{isNewAt:this.group.isNewAt,isNewAtFound:!0}),this.$store.commit("updateGroupSearchList",[])},handleUp:function(t){return this.atInd>0&&this.atInd--,this.atShow&&t.preventDefault(),!0},handleDown:function(t){var e=this.filterMembers.length;return this.atInd<e-1?this.atInd++:this.atInd=0,this.atShow&&t.preventDefault(),!0}}},g={data:function(){return{selectionAfterAt:!1,keyAfterAt:"",keyAfterAtTimer:"",lastKeyAfterAt:"",isIOS:!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),isShowContextmenu:!1,menuTop:0,menuLeft:0}},mounted:function(){},computed:Object(r["a"])({},Object(c["e"])(["copyText"]),{filterMembers:function(){if(!this.group.groupId)return[];var t=this.group.membersArray,e=[];if(""!==this.keyAfterAt)e=this.group.searchList;else for(var i=0;i<t.length;i++)t[i].user_id!=this.userId&&e.push(t[i]);return e.slice(0,100)},atShow:function(){return this.atInd=0,this.selectionAfterAt&&this.filterMembers.length}}),watch:{keyAfterAt:function(t){var e=this;clearTimeout(this.keyAfterAtTimer),this.keyAfterAtTimer=setTimeout(function(){e.handleKeyAfterAt(t)},200)},inputMsg:function(t,e){this.handleSelectionChange()}},methods:{handleKeyAfterAt:function(t){var e=this;if(this.group.groupId&&""!=t.trim()&&!this.group.isNewAtFound)if(this.group.membersArray.length<this.group.membersNum)a["a"].group.searchMember({group_id:this.group.groupId,keyword:t}).then(function(t){var i=t.data;e.$store.commit("updateGroupSearchList",i.data)});else{var i=this.group.membersArray.filter(function(e){var i,n;return i=!!e.user_name&&e.user_name.indexOf(t)>-1,n=!!e.nick_name&&e.nick_name.indexOf(t)>-1,i||n});this.$store.commit("updateGroupSearchList",i)}},getStrBeforeSelection:function(){var t=this.$refs.chatInput;if(!t)return"";var e=t.selectionStart,i=this.inputMsg.slice(0,e);return i},getStrAfterSelection:function(){var t=this.$refs.chatInput;if(!t)return"";var e=t.selectionStart,i=this.inputMsg.slice(e);return i},handleClick:function(){this.isShowContextmenu=!1},handleLeft:function(t){var e=this.$refs.chatInput,i=e.selectionStart;if(0===i)return!0;var n=this.getStrBeforeSelection(),r=this.group.members;for(var s in r){var o=r[s].user_name,a=new RegExp("@".concat(o," $"));if(a.test(n))return t.preventDefault(),e.setSelectionRange(i-o.length-2,i-o.length-2),!0}},handleRight:function(t){var e=this.$refs.chatInput,i=e.selectionStart,n=this.getStrAfterSelection(),r=this.group.members;for(var s in r){var o=r[s].user_name,a=new RegExp("^@".concat(o," "));if(a.test(n))return t.preventDefault(),e.setSelectionRange(i+o.length+2,i+o.length+2),!0}return!0},handleDel:function(t){var e=this,i=this.$refs.chatInput,r=i.selectionStart;if(0!==r){var s=this.getStrBeforeSelection(),o=this.group.members,a=function(n){var a=o[n].user_name,u=new RegExp("@".concat(a," $"));if(u.test(s))return t.preventDefault(),e.inputMsg=e.inputMsg.slice(0,r-a.length-2)+e.inputMsg.slice(r),e.$nextTick(function(){i.setSelectionRange(r-a.length-2,r-a.length-2)}),{v:void 0}};for(var u in o){var c=a(u);if("object"===Object(n["a"])(c))return c.v}}},handleKeyDown:function(t){var e=this;if(!this.atShow){if(t.altKey||t.ctrlKey){var i=this.getStrBeforeSelection(),n=this.getStrAfterSelection();this.inputMsg=i+"\n"+n,this.$nextTick(function(){e.$refs.chatInput.setSelectionRange(i.length+1,i.length+1)})}else this.handleSend(t),t.preventDefault();return!0}t.preventDefault();var r=this.filterMembers[this.atInd];this.atPerson(r.user_name,r.nick_name)},handleFocus:function(){var t=this;this.$emit("handleFocus"),this.updateChatInputFocus(!0),document.addEventListener("selectionchange",this.handleSelectionChange),this.isIOS&&setTimeout(function(){t.$root.$el.addEventListener("click",t.fixIOS)},0)},handleBlur:function(){var t=this;if(document.removeEventListener("selectionchange",this.handleSelectionChange),this.updateChatInputFocus(!1),(this.selectionAfterAt||this.isShowContextmenu)&&setTimeout(function(){t.selectionAfterAt=!1,t.isShowContextmenu=!1},200),this.isIOS){var e=document.body.scrollTop;document.body.scrollTop=e,this.$root.$el.removeEventListener("click",this.fixIOS)}Object(u["w"])()},handleEsc:function(){this.selectionAfterAt=!1},handleSelectionChange:function(){var t=this.$refs.chatInput;if(t){var e=t.selectionStart,i=this.$refs.chatInput.selectionEnd;if(e===i){var n=this.getStrBeforeSelection();if(this.selectionAfterAt=/@/.test(n),this.selectionAfterAt){this.keyAfterAt=n.slice(n.lastIndexOf("@")+1);var r=this.keyAfterAt.indexOf(this.lastKeyAfterAt)<0;this.$store.commit("updateIsNewAt",{isNewAt:r,isNewAtFound:!r&&this.group.isNewAtFound}),r&&this.$store.commit("updateGroupSearchList",[]),this.lastKeyAfterAt=this.keyAfterAt}}}},handleContextmenu:function(t){this.copyText&&(this.isShowContextmenu=!this.isShowContextmenu,this.isShowContextmenu&&(this.menuTop=t.offsetY,this.menuLeft=t.offsetX>100?t.offsetX-30:t.offsetX))},handlePaste:function(){this.isShowContextmenu=!1,this.inputMsg+=this.copyText},closeEmojiList:function(){this.emojiShow=!1},fixIOS:function(t){var e=this;setTimeout(function(){e.$refs.chatInput===document.activeElement&&document.activeElement.blur()},0)}}},l={methods:{addPanelSession:function(t,e){var i=this,n=this.sessionList.some(function(t){return t.session_id==e});n||a["a"].user.getOtherInfo({target_id:t}).then(function(t){var n=t.data,r=n.data,s={cover_photo:r.cover_photo,is_group:"0",name:r.nick_name,session_id:e,unread:0};i.$store.commit("addSessionItem",s)})}}},v={data:function(){return{curLang:Object(u["s"])("lang")||Object(u["n"])()}},methods:{changeLang:function(){var t="en"==this.curLang?"zh":"en";this.$i18n.locale=t,this.curLang=t,Object(u["A"])("lang",t)}}}},"8af1":function(t,e,i){"use strict";var n=i("8232"),r=i("471d"),s=i("7182"),o=i("44a7"),a=i("33ef"),u=i("3202"),c=i("50cd"),h=i("0811");r(r.S+r.F*!i("1969")(function(t){Array.from(t)}),"Array",{from:function(t){var e,i,r,p,d=s(t),f="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,l=void 0!==g,v=0,b=h(d);if(l&&(g=n(g,m>2?arguments[2]:void 0,2)),void 0==b||f==Array&&a(b))for(e=u(d.length),i=new f(e);e>v;v++)c(i,v,l?g(d[v],v):d[v]);else for(p=b.call(d),i=new f;!(r=p.next()).done;v++)c(i,v,l?o(p,g,[r.value,v],!0):r.value);return i.length=v,i}})},"92dd":function(t,e,i){i("4d6c"),i("8af1"),t.exports=i("836e").Array.from},a36a:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"add-person"},[i("back-bar",{attrs:{title:t.$t("h5.selectContact")}},[3==t.inviteType?i("button",{staticClass:"opt-btn opt-del",on:{click:t.optSubmit}},[t._v(t._s(t.$t("group.delete")))]):i("button",{staticClass:"opt-btn",on:{click:t.optSubmit}},[t._v(t._s(1==t.inviteType?t.$t("h5.createGroup"):t.$t("public.complete")))])]),1==t.inviteType?i("div",{staticClass:"input-wrap"},[i("input",{directives:[{name:"focus",rawName:"v-focus"},{name:"model",rawName:"v-model",value:t.groupName,expression:"groupName"}],attrs:{type:"text",placeholder:t.$t("invite.writeGroupName")},domProps:{value:t.groupName},on:{input:function(e){e.target.composing||(t.groupName=e.target.value)}}})]):i("div",{staticClass:"input-wrap"},[i("i",{staticClass:"el-icon-search"}),i("input",{attrs:{type:"text",placeholder:t.$t("invite.searchContact")},on:{input:function(e){return t.searchUser(e,t.checkList)}}})]),i("div",[t.showNum>0&&!t.isSearchGroup?t._l(t.checkList,function(e,n){return i("div",{key:n},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"item.isShow"}],staticClass:"user-item",class:{checked:e.isChecked},on:{click:function(i){return t.changeStateForH5(e.user_id)}}},[e.isChecked?i("i",{staticClass:"el-icon-circle-check is-choosed"}):i("i",{staticClass:"el-icon-circle-uncheck"}),e.cover_photo?i("img",{staticClass:"user-avatar",attrs:{src:e.cover_photo,alt:""}}):i("div",{staticClass:"user-avatar",class:"avatar_bg"+e.user_id%9,attrs:{"data-name":e.nick_name.slice(0,2).toUpperCase()}}),i("span",{staticClass:"name"},[t._v(t._s(e.nick_name))])])])}):i("div",{staticClass:"no-data"},[t._v(t._s(t.$t("invite.noContact")))])],2)],1)},r=[],s=(i("4453"),i("ee95")),o=i("1848"),a=i("bced"),u=i("33f8"),c={name:"chatInvite",mixins:[a["b"]],data:function(){return{inviteType:1*this.$route.params.inviteType,ext:{tgGroupId:Object(u["r"])("tgGroupId")||""}}},components:{backBar:o["a"]},computed:{},methods:{},created:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.$route.params.id,this.group.groupId||!e){t.next=6;break}return this.initGroup({groupId:e,useCache:!1}),this.changeSessionId(e),t.next=6,this.getGroupInfo();case 6:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},h=c,p=(i("144c"),i("17cc")),d=Object(p["a"])(h,n,r,!1,null,"2e951128",null);e["default"]=d.exports},a606:function(t,e,i){},ab6b:function(t,e,i){t.exports=i("92dd")},ad81:function(t,e,i){t.exports=i("a945")},bced:function(t,e,i){"use strict";i.d(e,"c",function(){return g}),i.d(e,"b",function(){return l}),i.d(e,"a",function(){return v});i("7e48"),i("3050");var n=i("a619"),r=i.n(n),s=(i("f91a"),i("0da4"),i("03a8")),o=i.n(s),a=(i("612f"),i("f10e"),i("4453"),i("ee95")),u=i("3f47"),c=i("5975"),h=i("52c1"),p=i("33f8"),d=i("8869"),f=i("c1f9"),m=i.n(f),g={computed:Object(u["a"])({},Object(h["e"])({myId:function(t){return t.userId},group:function(t){return t.group},curGroupId:function(t){return t.curSession},members:function(t){return t.group.members},sessionInfo:function(t){return t.group.sessionInfo},shareName:function(t){return t.group.shareName},adminList:function(t){return t.group.adminList},membersArray:function(t){return t.group.membersArray}}),{isAdmin:function(){return this.members&&this.members[this.myId]&&1==this.members[this.myId].is_admin},isCreator:function(){return this.group.creator==this.myId},isPrivate:function(){return this.$store.getters.isPrivate}}),mounted:function(){var t=this,e=this.$route.params.id;this.changeSessionId(e),this.isPrivate||this.group.groupId||(this.initGroup({userId:this.myId,groupId:e,useCache:!1}),this.getGroupInfo()),document.addEventListener("click",function(){if(t.$refs.chatSet){var e=t.$refs.chatSet.getAttribute("class");e.indexOf("move-left")>-1&&t.$emit("showCharSet",0)}})},data:function(){return{msgPush:!1,msgTop:!1,limitHeight:!0,isEdit:!1,newGroupName:"",newLink:"",newNotice:"",isEditLink:!1,editNotice:!1,editShareName:"",sharePath:"".concat(location.origin,"/s/"),isSearch:!1,searchList:[],searchTxt:"",meechatType:Object(p["o"])()}},methods:Object(u["a"])({},Object(h["d"])(["initGroup","changeSessionId","changeHotGroupStatus","removeSessionListById"]),Object(h["b"])(["updateSessionItem","getGroupInfo"]),{handleTitleBlur:function(){var t=this;this.isEdit=!1,this.newGroupName.length&&c["a"].group.changeTitle({group_id:this.curGroupId,title:this.newGroupName}).then(function(e){e.data;t.updateSessionItem({sessionId:t.curGroupId,data:{name:t.newGroupName}}),t.$store.commit("updateGroup",{key:"groupName",data:t.newGroupName})})},handleTitleFocus:function(){this.isEdit=!0,this.newGroupName=this.group.groupName},handleShowAll:function(){this.limitHeight||(this.$refs.scrollWrap.scrollTop=0),this.limitHeight=!this.limitHeight},handleLinkBlur:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.isEditLink=!1,!this.editShareName.match(/^\d{1,}$/)){t.next=4;break}return this.$showTips("分享链接不能是纯数字"),t.abrupt("return");case 4:if(this.editShareName.match(/^(\w|.){1,}$/)){t.next=7;break}return this.$showTips("分享链接只能是英文字母,数字和 . 的组合"),t.abrupt("return");case 7:return t.next=9,Object(p["f"])("分享链接只能被修改一次,确认修改为:".concat(this.sharePath+this.editShareName),"提示").catch(function(t){});case 9:c["a"].group.changeName({group_id:this.curGroupId,name:this.editShareName}).then(function(){e.$store.commit("updateGroup",{key:"shareName",data:e.editShareName})});case 10:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),handleLinkFocus:function(){this.isEditLink=!0,this.editShareName=this.shareName},handleNotice:function(){var t=this;c["a"].group.changeNotice({group_id:this.curGroupId,notice:this.newNotice}).then(function(){t.$showTips("修改成功"),t.editNotice=!1,t.$store.commit("updateGroup",{key:"groupNotice",data:t.newNotice})})},handleGroudMgr:function(){this.$emit("handleShowGroudMgr",1)},handleOpenNotice:function(){this.editNotice=!0,this.newNotice=this.group.groupNotice},copyLink:function(t){var e=this,i=document.location.protocol+t;this.$copyText(i).then(function(t){e.$showTips("复制成功")})},changePin:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(e){var i,n,r,s;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return i=1==e?"setPin":"cancelPin",n=1==e?"updateSessionListByPin":"cancelSessionListByPin",t.next=4,c["a"].session[i]({session_id:this.curGroupId});case 4:r=t.sent,s=r.data.data,this.$store.commit("updatePin",e),this.$store.commit(n,{session_id:this.curGroupId,is_pin:s.is_pin,pin_time_int:s.pin_time_int});case 8:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),changeMute:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(e){var i,n;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return i=1==e?"setMute":"cancelMute",n=1==e?"updateSessionListByMute":"cancelSessionListByMute",t.next=4,c["a"].session[i]({session_id:this.curGroupId});case 4:this.$store.commit("updateMute",e),this.$store.commit(n,this.curGroupId);case 6:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),leaveGroup:function(){var t=this;Object(p["f"])(this.$t("group.leaveComfirm")).then(function(){t.$emit("showLoadingRoom",!0),c["a"].group.leaveGroup({group_id:t.curGroupId}).then(function(){t.changeHotGroupStatus({groupId:t.curGroupId,isJoin:0}),t.removeSessionListById(t.curGroupId),t.$showTips(t.$t("group.leaveTip")),t.$emit("showLoadingRoom",!1),t.$store.commit("updateJoin",!1),"h5"==t.meechatType&&t.$router.go(-2)}).catch(function(){t.$emit("showLoadingRoom",!1)})})},searchUser:function(){var t=this;if(this.searchTxt.trim())if(this.membersArray.length<this.group.membersNum)c["a"].group.searchMember({group_id:this.group.groupId,keyword:this.searchTxt}).then(function(e){var i=e.data;t.searchList=i.data});else{var e=this.searchTxt;this.searchList=this.membersArray.filter(function(t){var i,n;return i=!!t.user_name&&t.user_name.indexOf(e)>-1,n=!!t.nick_name&&t.nick_name.indexOf(e)>-1,i||n})}}})},l={mixins:[d["e"]],data:function(){return{curItemIndex:0,checkList:[],groupName:"",isLoading:!1,showNum:0,meechatType:Object(p["o"])()}},computed:Object(u["a"])({checkedNum:function(){return this.checkList.filter(function(t){return t.isChecked}).length}},Object(h["e"])({userId:function(t){return t.userId},friendList:function(t){return t.chat.friendList},groupId:function(t){return t.group.groupId},group:function(t){return t.group},members:function(t){return t.group.members},membersArray:function(t){return t.group.membersArray},membersNum:function(t){return t.group.membersNum},adminList:function(t){return t.group.adminList}}),{inviteList:function(){return this.checkList.filter(function(t){return t.isChecked}).map(function(t){return t.user_id}).join(",")},resultList:function(){return this.checkList&&this.checkList.filter(function(t){return t.isChecked})||[]}}),methods:Object(u["a"])({},Object(h["b"])(["getGroupInfo"]),Object(h["d"])(["initGroup","changeSessionId"]),{getItemByUid:function(t){var e=this;return this.checkList.filter(function(i,n){return i.user_id==t&&(e.curItemIndex=n),i.user_id==t})[0]},changeState:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.getItemByUid(t);i.isChoosed||(4==this.inviteType&&e&&this.adminList.length+this.checkedNum>5?this.$showTips(this.$t("group.groupMgrMostTips")):(5==this.inviteType&&this.checkList.forEach(function(t){t.isChecked=!1}),i["isChecked"]=e,this.$set(this.checkList,this.curItemIndex,i)))},changeStateForH5:function(t){var e=this.getItemByUid(t),i=!e.isChecked;4==this.inviteType&&i&&this.adminList.length+this.checkedNum>5?this.$showTips(this.$t("group.groupMgrMostTips")):(5==this.inviteType&&this.checkList.forEach(function(t){t.isChecked=!1}),e["isChecked"]=i,this.$set(this.checkList,this.curItemIndex,e))},initList:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:t.t0=this.inviteType,t.next=1===t.t0?3:2===t.t0?3:3===t.t0?7:4===t.t0?7:5===t.t0?7:9;break;case 3:return t.next=5,this.$store.dispatch("getFriendList");case 5:return this.checkList=this.friendList,t.abrupt("break",9);case 7:return this.checkList=this.membersArray,t.abrupt("break",9);case 9:this.checkList=m.a.filter(this.checkList,function(t){if(t.isChecked=!1,t.isChoosed=!1,t.isShow=!0,2==e.inviteType){var i=e.membersArray.some(function(e){return e.user_id==t.user_id});return!i}return 4==e.inviteType&&1==t.is_admin&&(t.isChoosed=!0),t.user_id!=e.userId}),this.showNum=this.checkList.length;case 11:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),optSubmit:function(){switch(this.inviteType){case 1:this.createGroup();break;case 2:this.invitesMember();break;case 3:this.removesMember();break;case 4:this.addAdmin();break;case 5:this.changeCreator();break;case 6:this.createGroup();break}},createGroup:function(){var t=this;this.groupName.length>16?this.$showTips(this.$t("group.groupNameLengthTips")):this.groupName?(this.isLoading=!0,c["a"].group.createGroup({group_title:this.groupName,user_id_list:this.inviteList}).then(function(e){var i=e.data,n=i.data.session_id;t.$showTips(t.$t("group.createSuccess")),t.$store.commit("addSessionItem",i.data),t.ext&&t.ext.tgGroupId?t.doSyncTelegram(n):t.$router.push("/group/".concat(n)),"h5"!=t.meechatType&&t.hidePopup()})):o()({message:this.$t("group.groupNameTips"),type:"warning"})},doSyncTelegram:function(t){var e=this;c["a"].tg.doSync({group_id:t,tg_group_id:this.ext.tgGroupId}).then(function(){e.$router.replace("/group/".concat(t))}).catch(function(t){console.log(t),"h5"==e.meechatType&&e.$router.replace("/")})},invitesMember:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.next=3,c["a"].group.invites({user_ids:this.inviteList,group_id:this.groupId});case 3:return t.next=5,this.getGroupInfo();case 5:"h5"==this.meechatType?this.$router.go(-1):this.hidePopup();case 6:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),removesMember:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.next=3,c["a"].group.removes({user_ids:this.inviteList,group_id:this.groupId});case 3:return t.next=5,this.getGroupInfo();case 5:"h5"==this.meechatType?this.$router.go(-1):this.hidePopup();case 6:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),addAdmin:function(){var t=this;this.isLoading=!0,c["a"].group.addAdmin({user_ids:this.inviteList,group_id:this.groupId}).then(function(e){e.data;t.getGroupInfo(),"h5"==t.meechatType?t.$router.go(-1):t.hidePopup()})},changeCreator:function(){var t=this;if(!(this.checkedNum<=0)){var e=this.checkList[this.curItemIndex],i=e.nick_name||e.user_name;r.a.confirm("".concat(this.$t("group.groupMgrComfime")," ").concat(i)).then(function(){t.isLoading=!0,c["a"].group.changeCreator({new_creator:t.inviteList,group_id:t.groupId}).then(function(e){e.data;"h5"==t.meechatType?t.$router.go(-1):t.hidePopup(),t.$store.dispatch("getGroupInfo"),o()({message:"".concat(t.$t("group.groupMgrResult")," ").concat(i),type:"warning"})})}).catch(function(t){console.log(t)})}}}),mounted:function(){this.initList()}},v={props:{searchTxt:String},data:function(){return{}},components:{},computed:Object(u["a"])({},Object(h["e"])(["hotList"]),{showHotList:function(){var t=this.searchTxt&&this.searchTxt.trim();if(!t)return this.hotList;var e=this.hotList.filter(function(e){var i=e.group_title&&e.group_title.toLocaleLowerCase()||"";return i.match(t)});return e}}),methods:Object(u["a"])({},Object(h["d"])(["changeHotGroupStatus"]),{bgColorNum:function(t){return Object(p["l"])(t,this.userId)},joinGroup:function(t,e){var i=this;1==e?this.$router.push("/group/".concat(t)):c["a"].group.joinGroup({group_id:t}).then(function(){i.changeHotGroupStatus({groupId:t,isJoin:1}),i.$router.push("/group/".concat(t))})}}),mounted:function(){this.$store.commit("changeSessionId","0"),this.$store.dispatch("getHotList")}}}}]);
|