Files
tk-mini-program/unpackage/dist/build/mp-weixin/index.js
pengxiaolong 8c70c2c850 优化页面
2025-06-09 23:02:05 +08:00

2 lines
3.7 KiB
JavaScript

"use strict";const e=require("./common/vendor.js");require("./TUIKit/adapter-vue.js");const t=require("./common/assets.js"),n=require("./TUIKit/utils/env.js");Math||(s+i+o)();const o=()=>"./TUIKit/components/common/Icon.js",i=()=>"./TUIKit/components/common/Avatar/index.js",s=()=>"./TUIKit/components/TUIConversation/actions-menu/index.js",r=e.defineComponent({__name:"index",emits:["handleSwitchConversation","getPassingRef"],setup(o,{expose:i,emit:s}){const r=s,u=e.ref(),a=e.ref(),c=e.ref(),l=e.ref(!1),v=e.ref([]),f=e.ref(),d=e.ref(),m=e.ref({top:0,left:void 0,conversationHeight:void 0}),g=e.ref(!1),p=e.ref();let C=null;e.onMounted((()=>{e.Jt.watch(e.o.CONV,{currentConversationID:M,conversationList:D,currentConversation:x}),e.Jt.watch(e.o.USER,{displayOnlineStatus:S,userStatusList:T}),n.isUniFrameWork||!e.f$1||n.isPC||function(){if(!d.value)return;e.k({element:d.value,onLongPress:(e,t)=>{const n=Array.from(d.value.children).indexOf(t);I(e,v.value[n],n)},options:{eventDelegation:{subSelector:".tui-conversation-content"}}})}()})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.CONV,{currentConversationID:M,conversationList:D,currentConversation:x}),e.Jt.unwatch(e.o.USER,{displayOnlineStatus:S,userStatusList:T})}));const h=t=>g.value&&t.type===e.qt.TYPES.CONV_C2C,I=(e,t,o,i)=>{i&&(e.preventDefault(),n.isUniFrameWork)||(u.value=t,C=Date.now(),U(e,o))},P=()=>{C&&Date.now()-C>300&&(u.value=void 0,l.value=!1)},U=(t,o)=>{var i,s;if(n.isUniFrameWork){void 0===f.value&&r("getPassingRef",f);(null==(i=e.i)?void 0:i.createSelectorQuery().in(f.value)).select(`#convlistitem-${o}`).boundingClientRect((e=>{e&&(m.value={top:e.bottom+(n.isH5?44:0),left:t.touches[0].pageX,conversationHeight:e.height},l.value=!0)})).exec()}else{const e=(null==(s=t.currentTarget||t.target)?void 0:s.getBoundingClientRect())||{};e&&(m.value={top:e.bottom,left:n.isPC?t.clientX:void 0,conversationHeight:e.height}),l.value=!0}};function x(e){u.value=e}function D(e){v.value=e}function M(e){a.value=e}function S(e){g.value=e}function T(e){0!==e.size&&(p.value=[...e.entries()].reduce(((e,[t,n])=>(e[t]=n,e)),{}))}return i({closeChildren:P}),(o,i)=>e.e({a:e.unref(l)},e.unref(l)?{b:e.o$1(P),c:e.p({selectedConversation:e.unref(u),actionsMenuPosition:e.unref(m),selectedConversationDomRect:e.unref(c)})}:{},{d:e.f(e.unref(v),((n,o,i)=>e.e({a:"55e2625d-1-"+i,b:e.p({useSkeletonAnimation:!0,url:n.getAvatar(),size:"30px"}),c:e.unref(p)&&h(n)},e.unref(p)&&h(n)?{d:e.n(Object.keys(e.unref(p)).length>0&&Object.keys(e.unref(p)).includes(n.userProfile.userID)&&1===e.unref(p)[n.userProfile.userID].statusType?"online-status-online":"online-status-offline")}:{},{e:n.unreadCount>0&&!n.isMuted},n.unreadCount>0&&!n.isMuted?{f:e.t(n.unreadCount>99?"99+":n.unreadCount)}:{},{g:n.unreadCount>0&&n.isMuted},(n.unreadCount>0&&n.isMuted,{}),{h:e.t(n.getShowName()),i:n.draftText&&n.conversationID!==e.unref(a)},n.draftText&&n.conversationID!==e.unref(a)?{j:e.t(e.unref(e.Wt).t("TUIChat.[草稿]"))}:"GROUP"===n.type&&n.groupAtInfoList&&n.groupAtInfoList.length>0?{l:e.t(n.getGroupAtInfo())}:{},{k:"GROUP"===n.type&&n.groupAtInfoList&&n.groupAtInfoList.length>0,m:e.t(n.getLastMessage("text")),n:e.t(n.getLastMessage("time")),o:n.isMuted},n.isMuted?{p:"55e2625d-2-"+i,q:e.p({file:e.unref(t.muteIcon)})}:{},{r:e.n(e.unref(a)===n.conversationID&&"tui-conversation-item-selected"),s:e.n(n.isPinned&&"tui-conversation-item-pinned"),t:e.o$1((t=>{return o=n.conversationID,r("handleSwitchConversation",o),void e.Xt.switchConversation(o);var o}),o),v:e.o$1((e=>I(e,n,o)),o),w:e.o$1((e=>I(e,n,o,!0)),o),x:`convlistitem-${o}`,y:o}))),e:e.n(e.unref(n.isPC)&&"isPC"),f:e.n(e.unref(n.isMobile)&&"tui-conversation-content-h5 disable-select")})}}),u=e._export_sfc(r,[["__scopeId","data-v-55e2625d"]]);exports.MiniProgramPage=u;