优化页面

This commit is contained in:
pengxiaolong
2025-06-09 19:18:38 +08:00
parent d30589fd05
commit c5042d08c3
811 changed files with 2799 additions and 503 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../../../constant.js"),o=require("../../../utils/env.js");Math||(i+t)();const t=()=>"../../common/Overlay/index.js",i=()=>"../../common/Dialog/index.js",s=e.defineComponent({__name:"index",props:{actionsMenuPosition:{},selectedConversation:{},selectedConversationDomRect:{}},emits:["closeConversationActionMenu"],setup(t,{emit:i}){var s,r;const a=i,c=t,l=(null==(s=e.getCurrentInstance())?void 0:s.proxy)||e.getCurrentInstance(),u=e.ref(),v=e.ref(!0),d=e.ref(!1),C=e.Jt.getConversationModel((null==(r=c.selectedConversation)?void 0:r.conversationID)||""),f=e.ref(c.actionsMenuPosition);e.onMounted((()=>{e.nextTick$1((()=>{var n,t;if(o.isUniFrameWork)(null==(n=e.i)?void 0:n.createSelectorQuery().in(l)).select("#conversation-actions-menu").boundingClientRect((n=>{var o,t;n&&(n.bottom>(null==(t=null==(o=e.i)?void 0:o.getWindowInfo)?void 0:t.call(o).windowHeight)&&(f.value={...c.actionsMenuPosition,top:c.actionsMenuPosition.top-(c.actionsMenuPosition.conversationHeight||0)-n.height}),f.value.left+n.width+5>e.i.getWindowInfo().windowWidth&&(f.value.left=e.i.getWindowInfo().windowWidth-n.width-5)),v.value=!1})).exec();else{const e=null==(t=u.value)?void 0:t.getBoundingClientRect();o.isPC&&void 0!==c.actionsMenuPosition.left&&(f.value.left=c.actionsMenuPosition.left),e&&e.bottom>window.innerHeight&&(f.value.top=c.actionsMenuPosition.top-(c.actionsMenuPosition.conversationHeight||0)-e.height),v.value=!1}}))}));const O=e.computed((()=>{var n,o;return(null==(n=c.selectedConversation)?void 0:n.type)===e.qt.TYPES.CONV_C2C?"TUIConversation.删除后,将清空该聊天的消息记录":(null==(o=c.selectedConversation)?void 0:o.type)===e.qt.TYPES.CONV_GROUP?"TUIConversation.删除后,将清空该群聊的消息记录":""}));const I=e=>{const{name:o}=e,t=C;if(o&&t&&t.conversationID){switch(o){case n.CONV_OPERATION.DELETE:null==t||t.deleteConversation();break;case n.CONV_OPERATION.ISPINNED:case n.CONV_OPERATION.DISPINNED:null==t||t.pinConversation();break;case n.CONV_OPERATION.MUTE:case n.CONV_OPERATION.NOTMUTE:null==t||t.muteConversation()}a("closeConversationActionMenu")}},P=e=>{e||a("closeConversationActionMenu"),d.value=e};return(t,i)=>e.e({a:e.t(e.unref(e.Wt).t("TUIConversation.删除会话")),b:e.o$1((e=>{d.value=!0})),c:!(c.selectedConversation&&c.selectedConversation.isPinned)},c.selectedConversation&&c.selectedConversation.isPinned?{}:{d:e.t(e.unref(e.Wt).t("TUIConversation.置顶会话")),e:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).ISPINNED})))},{f:c.selectedConversation&&c.selectedConversation.isPinned},c.selectedConversation&&c.selectedConversation.isPinned?{g:e.t(e.unref(e.Wt).t("TUIConversation.取消置顶")),h:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).DISPINNED})))}:{},{i:!(c.selectedConversation&&c.selectedConversation.isMuted)},c.selectedConversation&&c.selectedConversation.isMuted?{}:{j:e.t(e.unref(e.Wt).t("TUIConversation.消息免打扰")),k:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).MUTE})))},{l:c.selectedConversation&&c.selectedConversation.isMuted},c.selectedConversation&&c.selectedConversation.isMuted?{m:e.t(e.unref(e.Wt).t("TUIConversation.取消免打扰")),n:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).NOTMUTE})))}:{},{o:e.n(e.unref(o.isPC)&&"actions-menu-pc"),p:e.n(!e.unref(v)&&"cancel-hidden"),q:`${e.unref(f).top}px`,r:`${e.unref(f).left}px`,s:e.t(e.unref(e.Wt).t(e.unref(O))),t:e.o$1((o=>I({name:e.unref(n.CONV_OPERATION).DELETE}))),v:e.o$1(P),w:e.p({show:e.unref(d),center:!0,isHeaderShow:e.unref(o.isPC)}),x:e.o$1((()=>a("closeConversationActionMenu"))),y:e.p({maskColor:"transparent"})})}}),r=e._export_sfc(s,[["__scopeId","data-v-6ae97666"]]);wx.createComponent(r);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"overlay": "../../common/Overlay/index",
"dialog": "../../common/Dialog/index"
}
}

View File

@@ -0,0 +1 @@
<overlay wx:if="{{y}}" class="data-v-6ae97666" u-s="{{['d']}}" bindonOverlayClick="{{x}}" u-i="6ae97666-0" bind:__l="__l" u-p="{{y}}"><view id="conversation-actions-menu" ref="actionsMenuDomRef" class="{{['data-v-6ae97666', o, 'actions-menu', p]}}" style="{{'top:' + q + ';' + ('left:' + r)}}"><view class="{{['data-v-6ae97666', 'actions-menu-item']}}" catchtap="{{b}}">{{a}}</view><view wx:if="{{c}}" class="{{['data-v-6ae97666', 'actions-menu-item']}}" catchtap="{{e}}">{{d}}</view><view wx:if="{{f}}" class="{{['data-v-6ae97666', 'actions-menu-item']}}" catchtap="{{h}}">{{g}}</view><view wx:if="{{i}}" class="{{['data-v-6ae97666', 'actions-menu-item']}}" catchtap="{{k}}">{{j}}</view><view wx:if="{{l}}" class="{{['data-v-6ae97666', 'actions-menu-item']}}" catchtap="{{n}}">{{m}}</view></view><dialog wx:if="{{w}}" class="data-v-6ae97666" u-s="{{['d']}}" bindsubmit="{{t}}" bindupdateShow="{{v}}" u-i="6ae97666-1,6ae97666-0" bind:__l="__l" u-p="{{w}}"><view class="delDialog-title data-v-6ae97666">{{s}}</view></dialog></overlay>

View File

@@ -0,0 +1 @@
.cancel-hidden.data-v-6ae97666{opacity:1!important}.actions-menu.data-v-6ae97666{position:absolute;left:164px;border-radius:8px;border:1px solid #e0e0e0;box-shadow:0 -4px 12px rgba(0,0,0,.06);background-color:#fff;overflow:hidden;opacity:0}.actions-menu .actions-menu-item.data-v-6ae97666{cursor:pointer;padding:10px 20px;font-size:12px;word-break:keep-all}.actions-menu.actions-menu-pc .actions-menu-item.data-v-6ae97666:hover{background-color:#eee}

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("./server.js");Math||t();const t=()=>"../../common/Icon.js",o=e.defineComponent({__name:"index",setup(t,{expose:o}){const r=e.ref([]),c=e.ref(),a=e.computed((()=>n.ConversationHeaderServer.getInstance().getMenu()));e.onMounted((()=>{r.value=[]}));const i=e=>{const{data:{children:n},listener:t={onClicked:()=>{}}}=e;n?r.value=r.value.length>0?[]:n:(t.onClicked(e),d())},d=()=>{r.value=[]};return o({closeChildren:d}),(n,t)=>e.e({a:e.unref(a).length>0},e.unref(a).length>0?{b:e.f(e.unref(a),((n,t,o)=>e.e({a:n.icon&&!n.data.children},n.icon&&!n.data.children?{b:"95371663-0-"+o,c:e.p({file:n.icon})}:{},{d:e.t(n.text),e:e.o$1((e=>i(n)),t),f:t})))}:{},{c:e.unref(r).length>0},e.unref(r).length>0?{d:e.f(e.unref(r),((n,t,o)=>e.e({a:n.icon},n.icon?{b:"95371663-1-"+o,c:e.p({file:n.icon})}:{},{d:e.t(n.text),e:e.o$1((e=>i(n)),t),f:t})))}:{},{e:e.unref(c)})}}),r=e._export_sfc(o,[["__scopeId","data-v-95371663"]]);wx.createComponent(r);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "../../common/Icon"
}
}

View File

@@ -0,0 +1 @@
<view ref="{{e}}" class="tui-conversation-header data-v-95371663"><view wx:if="{{a}}" class="list data-v-95371663"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="list-item data-v-95371663"><view class="tui-conversation-header-item data-v-95371663" catchtap="{{item.e}}"><icon wx:if="{{item.a}}" class="tui-conversation-header-item-icon data-v-95371663" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/><view wx:else class="plus data-v-95371663"/><view class="tui-conversation-header-item-title data-v-95371663">{{item.d}}</view></view></view></view><view wx:if="{{c}}" class="tui-conversation-header-children list data-v-95371663"><view wx:for="{{d}}" wx:for-item="childrenItem" wx:key="f" class="list-item data-v-95371663"><view class="tui-conversation-header-item data-v-95371663" bindtap="{{childrenItem.e}}"><icon wx:if="{{childrenItem.a}}" class="tui-conversation-header-item-icon data-v-95371663" u-i="{{childrenItem.b}}" bind:__l="__l" u-p="{{childrenItem.c}}"/><view class="tui-conversation-header-item-title data-v-95371663">{{childrenItem.d}}</view></view></view></view></view>

View File

@@ -0,0 +1 @@
body.data-v-95371663,div.data-v-95371663,ul.data-v-95371663,ol.data-v-95371663,dt.data-v-95371663,dd.data-v-95371663,li.data-v-95371663,dl.data-v-95371663,h1.data-v-95371663,h2.data-v-95371663,h3.data-v-95371663,h4.data-v-95371663,p.data-v-95371663{margin:0;padding:0;font-style:normal}ol.data-v-95371663,ul.data-v-95371663,li.data-v-95371663{list-style:none}img.data-v-95371663{border:0;vertical-align:middle;pointer-events:none}body.data-v-95371663{color:#000;background:#fff}.clear.data-v-95371663{clear:both;height:1px;width:100%;overflow:hidden;margin-top:-1px}a.data-v-95371663{color:#000;text-decoration:none;cursor:pointer}a.data-v-95371663:hover{text-decoration:none}input.data-v-95371663,textarea.data-v-95371663{-webkit-user-select:auto;user-select:auto}input.data-v-95371663:focus,input.data-v-95371663:active,textarea.data-v-95371663:focus,textarea.data-v-95371663:active{outline:none}.chat-aside.data-v-95371663{position:absolute;top:50px;right:0;box-sizing:border-box;width:360px!important;border-radius:8px 0 0 8px;z-index:9999;max-height:calc(100% - 50px)}.tui-conversation.data-v-95371663{width:100%;height:100%;flex:1;overflow:hidden;display:flex;flex-direction:column}.tui-conversation-list.data-v-95371663{overflow:auto}.tui-conversation-header.data-v-95371663{width:100%;position:relative}.tui-conversation-header .list.data-v-95371663{display:flex;align-items:center;border-bottom:1px solid #F4F5F9;padding:7px 0}.tui-conversation-header .list-item.data-v-95371663{flex:1;display:flex;position:relative;padding:7px;cursor:pointer;-webkit-user-select:none;user-select:none}.tui-conversation-header-item.data-v-95371663{flex:1;display:flex;align-items:center}.tui-conversation-header-item-title.data-v-95371663{padding:0 8px;font-size:16px;font-weight:400}.tui-conversation-header-children.data-v-95371663{position:absolute;top:100%;z-index:3;padding:7px 9px;border-bottom:none;box-shadow:0 3px 7px rgba(0,0,0,.2);flex-direction:column}.network.data-v-95371663{padding:0 12px;display:flex;align-items:center}.network .icon-error.data-v-95371663{display:flex;justify-content:center;align-items:center;width:15px;height:15px;border-radius:15px;color:#fff;font-style:normal}.network-content.data-v-95371663{padding:5px;font-size:12px;line-height:22px}.plus.data-v-95371663{display:inline-block;width:30px;height:30px;position:relative}.plus.data-v-95371663:before,.plus.data-v-95371663:after{content:"";position:absolute;background-color:#232832;border-radius:.5px;width:1px;height:14px;left:0;right:0;top:0;bottom:0;margin:auto}.plus.data-v-95371663:after{transform:rotate(90deg);width:.5px}.network-content.data-v-95371663{font-family:PingFangSC-Regular;font-weight:400;color:#e54545;letter-spacing:0}

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),t=require("../../../utils/env.js"),n=require("../../../../common/assets.js"),r=require("../../../constant.js");class s{static getInstance(){return s.instance||(s.instance=new s),s.instance}getMenu(){const n=this.generateMenuList();return!t.isPC&&n.length>0?[{text:e.Wt.t("TUIConversation.发起会话"),data:{name:"all",children:n}}]:n}generateMenuList(){return[{icon:n.C2C,text:e.Wt.t("TUIConversation.发起单聊"),data:{name:r.CONV_CREATE_TYPE.TYPEC2C},listener:{onClicked:this.createConversation.bind(this)}},{icon:n.createGroup,text:e.Wt.t("TUIConversation.发起群聊"),data:{name:r.CONV_CREATE_TYPE.TYPEGROUP},listener:{onClicked:this.createConversation.bind(this)}}]}createConversation(t){e.R.callService({serviceName:e.E.TUIConversation.SERVICE.NAME,method:e.E.TUIConversation.SERVICE.METHOD.CREATE_CONVERSATION,params:t})}}exports.ConversationHeaderServer=s;

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../index.js");wx.createPage(e.MiniProgramPage);

View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "列表",
"usingComponents": {
"icon": "../../common/Icon",
"avatar": "../../common/Avatar/index",
"actions-menu": "../actions-menu/index"
}
}

View File

@@ -0,0 +1 @@
<view ref="conversationListInnerDomRef" class="tui-conversation-list data-v-a99b935a"><actions-menu wx:if="{{a}}" class="data-v-a99b935a" bindcloseConversationActionMenu="{{b}}" u-i="a99b935a-0" bind:__l="__l" u-p="{{c}}"/><view wx:for="{{d}}" wx:for-item="conversation" wx:key="y" id="{{conversation.x}}" class="{{['data-v-a99b935a', 'tui-conversation-content', f]}}"><view class="{{['data-v-a99b935a', e, 'tui-conversation-item', conversation.r, conversation.s]}}" bindtap="{{conversation.t}}" bindlongpress="{{conversation.v}}" bindcontextmenu="{{conversation.w}}"><view class="left data-v-a99b935a"><avatar wx:if="{{conversation.b}}" class="data-v-a99b935a" u-i="{{conversation.a}}" bind:__l="__l" u-p="{{conversation.b}}"/><view wx:if="{{conversation.c}}" class="{{['data-v-a99b935a', 'online-status', conversation.d]}}"/><label wx:if="{{conversation.e}}" class="num data-v-a99b935a">{{conversation.f}}</label><label wx:if="{{conversation.g}}" class="num-notify data-v-a99b935a"/></view><view class="content data-v-a99b935a"><view class="content-header data-v-a99b935a"><label class="content-header-label data-v-a99b935a"><view class="name data-v-a99b935a">{{conversation.h}}</view></label><view class="middle-box data-v-a99b935a"><label wx:if="{{conversation.i}}" class="middle-box-draft data-v-a99b935a">{{conversation.j}}</label><label wx:elif="{{conversation.k}}" class="middle-box-at data-v-a99b935a">{{conversation.l}}</label><view class="middle-box-content data-v-a99b935a">{{conversation.m}}</view></view></view><view class="content-footer data-v-a99b935a"><label class="time data-v-a99b935a">{{conversation.n}}</label><icon wx:if="{{conversation.o}}" class="data-v-a99b935a" u-i="{{conversation.p}}" bind:__l="__l" u-p="{{conversation.q}}"/></view></view></view></view></view>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../index.js");wx.createPage(e.MiniProgramPage);

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const t=e.defineComponent({__name:"index",setup(t){const n=e.ref(!1);return e.Jt.watch(e.o.USER,{netStateChange:t=>{n.value=t===e.qt.TYPES.NET_STATE_DISCONNECTED}}),(t,r)=>e.e({a:e.unref(n)},e.unref(n)?{b:e.t(e.unref(e.Wt).t("TUIConversation.网络异常,请您检查网络设置"))}:{})}}),n=e._export_sfc(t,[["__scopeId","data-v-40d4b024"]]);wx.createComponent(n);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="network data-v-40d4b024"><view class="icon icon-error data-v-40d4b024">!</view><view class="network-content data-v-40d4b024">{{b}}</view></view>

View File

@@ -0,0 +1 @@
body.data-v-40d4b024,div.data-v-40d4b024,ul.data-v-40d4b024,ol.data-v-40d4b024,dt.data-v-40d4b024,dd.data-v-40d4b024,li.data-v-40d4b024,dl.data-v-40d4b024,h1.data-v-40d4b024,h2.data-v-40d4b024,h3.data-v-40d4b024,h4.data-v-40d4b024,p.data-v-40d4b024{margin:0;padding:0;font-style:normal}ol.data-v-40d4b024,ul.data-v-40d4b024,li.data-v-40d4b024{list-style:none}img.data-v-40d4b024{border:0;vertical-align:middle;pointer-events:none}body.data-v-40d4b024{color:#000;background:#fff}.clear.data-v-40d4b024{clear:both;height:1px;width:100%;overflow:hidden;margin-top:-1px}a.data-v-40d4b024{color:#000;text-decoration:none;cursor:pointer}a.data-v-40d4b024:hover{text-decoration:none}input.data-v-40d4b024,textarea.data-v-40d4b024{-webkit-user-select:auto;user-select:auto}input.data-v-40d4b024:focus,input.data-v-40d4b024:active,textarea.data-v-40d4b024:focus,textarea.data-v-40d4b024:active{outline:none}.chat-aside.data-v-40d4b024{position:absolute;top:50px;right:0;box-sizing:border-box;width:360px!important;border-radius:8px 0 0 8px;z-index:9999;max-height:calc(100% - 50px)}.tui-conversation.data-v-40d4b024{width:100%;height:100%;flex:1;overflow:hidden;display:flex;flex-direction:column}.tui-conversation-list.data-v-40d4b024{overflow:auto}.tui-conversation-header.data-v-40d4b024{width:100%;position:relative}.tui-conversation-header .list.data-v-40d4b024{display:flex;align-items:center;border-bottom:1px solid #F4F5F9;padding:7px 0}.tui-conversation-header .list-item.data-v-40d4b024{flex:1;display:flex;position:relative;padding:7px;cursor:pointer;-webkit-user-select:none;user-select:none}.tui-conversation-header-item.data-v-40d4b024{flex:1;display:flex;align-items:center}.tui-conversation-header-item-title.data-v-40d4b024{padding:0 8px;font-size:16px;font-weight:400}.tui-conversation-header-children.data-v-40d4b024{position:absolute;top:100%;z-index:3;padding:7px 9px;border-bottom:none;box-shadow:0 3px 7px rgba(0,0,0,.2);flex-direction:column}.network.data-v-40d4b024{padding:0 12px;display:flex;align-items:center}.network .icon-error.data-v-40d4b024{display:flex;justify-content:center;align-items:center;width:15px;height:15px;border-radius:15px;color:#fff;font-style:normal}.network-content.data-v-40d4b024{padding:5px;font-size:12px;line-height:22px}.plus.data-v-40d4b024{display:inline-block;width:30px;height:30px;position:relative}.plus.data-v-40d4b024:before,.plus.data-v-40d4b024:after{content:"";position:absolute;background-color:#232832;border-radius:.5px;width:1px;height:14px;left:0;right:0;top:0;bottom:0;margin:auto}.plus.data-v-40d4b024:after{transform:rotate(90deg);width:.5px}.network-content.data-v-40d4b024{font-family:PingFangSC-Regular;font-weight:400;color:#e54545;letter-spacing:0}

View File

@@ -0,0 +1 @@
"use strict";var i;null==(i=require("../../index.js").TUIChatKit)||i.init();

View File

@@ -0,0 +1 @@
"use strict";const e=require("../index.js");wx.createPage(e.MiniProgramPage);

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "腾讯云 IM",
"usingComponents": {
"t-u-i-search": "../TUISearch/index",
"conversation-list": "./conversation-list/index",
"conversation-header": "./conversation-header/index",
"conversation-network": "./conversation-network/index",
"tab-bar": "../../../components/tabBar/tabBar"
}
}

View File

@@ -0,0 +1 @@
<view class="Navigation-left data-v-84285e97"></view><view class="Navigation data-v-84285e97"><image src="{{a}}" mode="scaleToFill" class="Navigationimg data-v-84285e97"/><view class="Return data-v-84285e97">消息</view></view><view class="tui-conversation data-v-84285e97" bindtap="{{h}}" bindtouchstart="{{i}}" bindtouchend="{{j}}"><t-u-i-search wx:if="{{b}}" class="data-v-84285e97" u-i="84285e97-0" bind:__l="__l" u-p="{{b}}"/><conversation-header wx:if="{{c}}" class="r data-v-84285e97" u-r="headerRef" u-i="84285e97-1" bind:__l="__l"/><conversation-network class="data-v-84285e97" u-i="84285e97-2" bind:__l="__l"/><conversation-list u-r="conversationListDomRef" class="tui-conversation-list r data-v-84285e97" bindhandleSwitchConversation="{{f}}" bindgetPassingRef="{{g}}" u-i="84285e97-3" bind:__l="__l"/></view><view class="data-v-84285e97"><tab-bar class="data-v-84285e97" u-i="84285e97-4" bind:__l="__l"></tab-bar></view>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../common/vendor.js"),t=require("../../constant.js"),a=require("../../utils/env.js"),n=require("../../../common/assets.js"),r=require("../../utils/enableSampleTaskStatus.js");class s{constructor(){this.hideConversationHeader=()=>{e.Jt.update(e.o.CUSTOM,"isShowConversationHeader",!1)},e.R.registerService(e.E.TUIConversation.SERVICE.NAME,this),e.R.registerExtension(e.E.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID,this),this.onCallParamsMap=new Map,this.onCallCallbackMap=new Map,this.constants=e.E}static getInstance(){return s.instance||(s.instance=new s),s.instance}getOnCallParams(e){return this.onCallParamsMap.get(e)}getOnCallCallback(e){return this.onCallCallbackMap.get(e)}onCall(t,a,n){switch(this.onCallParamsMap.set(t,a),this.onCallCallbackMap.set(t,n),t){case e.E.TUIConversation.SERVICE.METHOD.CREATE_CONVERSATION:this.createConversation(a);break;case e.E.TUIConversation.SERVICE.METHOD.HIDE_CONVERSATION_HEADER:this.hideConversationHeader()}}onGetExtension(a){if(a===e.E.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID){return[{weight:100,icon:n.C2C,text:e.Wt.t("TUIConversation.发起单聊"),data:{name:t.CONV_CREATE_TYPE.TYPEC2C},listener:{onClicked:this.createConversation.bind(this)}},{weight:100,icon:n.createGroup,text:e.Wt.t("TUIConversation.发起群聊"),data:{name:t.CONV_CREATE_TYPE.TYPEGROUP},listener:{onClicked:this.createConversation.bind(this)}}]}}createConversation(a){e.R.callService({serviceName:e.E.TUIContact.SERVICE.NAME,method:e.E.TUIContact.SERVICE.METHOD.SELECT_FRIEND,params:{title:a.text,isRadio:a.data.name!==t.CONV_CREATE_TYPE.TYPEGROUP,isNeedSearch:!e.Jt.getData(e.o.APP,"isOfficial")},callback:async e=>{if(!e||0===e.length)return this.routerForward(null);if(a.data.name===t.CONV_CREATE_TYPE.TYPEGROUP)this.createGroup(e);else{const{userID:t}=e[0];await this.generateConversation(`C2C${t}`),this.routerForward(`C2C${t}`)}}})}createGroup(t){e.R.callService({serviceName:e.E.TUIGroup.SERVICE.NAME,method:e.E.TUIGroup.SERVICE.METHOD.CREATE_GROUP,params:{title:e.Wt.t("TUIConversation.发起群聊"),memberList:t},callback:async e=>{let t=null;if(e){const{groupID:a}=e;await this.generateConversation(`GROUP${a}`),t=`GROUP${a}`}this.routerForward(t)}})}async routerForward(t){var n,r;a.isUniFrameWork&&(await(null==(n=e.i)?void 0:n.reLaunch({url:"/TUIKit/components/TUIConversation/index"})),t&&(null==(r=e.i)||r.navigateTo({url:"/TUIKit/components/TUIChat/index"})))}generateConversation(t){e.Xt.switchConversation(t).then((()=>{t.startsWith("GROUP")&&r.enableSampleTaskStatus("groupChat"),console.warn("打开会话成功")})).catch((e=>{console.warn("打开会话失败",e.code,e.msg)}))}}exports.TUIConversationServer=s;