消息
This commit is contained in:
@@ -1,216 +1,4 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
if (!Math) {
|
||||
(ActionsMenu + Avatar + Icon)();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const Avatar = () => "../../common/Avatar/index.js";
|
||||
const ActionsMenu = () => "../actions-menu/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
emits: ["handleSwitchConversation", "getPassingRef"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const emits = __emit;
|
||||
const currentConversation = common_vendor.ref();
|
||||
const currentConversationID = common_vendor.ref();
|
||||
const currentConversationDomRect = common_vendor.ref();
|
||||
const isShowOverlay = common_vendor.ref(false);
|
||||
const conversationList = common_vendor.ref([]);
|
||||
const conversationListDomRef = common_vendor.ref();
|
||||
const conversationListInnerDomRef = common_vendor.ref();
|
||||
const actionsMenuPosition = common_vendor.ref({
|
||||
top: 0,
|
||||
left: void 0,
|
||||
conversationHeight: void 0
|
||||
});
|
||||
const displayOnlineStatus = common_vendor.ref(false);
|
||||
const userOnlineStatusMap = common_vendor.ref();
|
||||
let lastestOpenActionsMenuTime = null;
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
||||
currentConversationID: onCurrentConversationIDUpdated,
|
||||
conversationList: onConversationListUpdated,
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.USER, {
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
if (!TUIKit_utils_env.isUniFrameWork && common_vendor.f$1 && !TUIKit_utils_env.isPC) {
|
||||
addLongPressHandler();
|
||||
}
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
|
||||
currentConversationID: onCurrentConversationIDUpdated,
|
||||
conversationList: onConversationListUpdated,
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.USER, {
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
});
|
||||
const isShowUserOnlineStatus = (conversation) => {
|
||||
return displayOnlineStatus.value && conversation.type === common_vendor.qt.TYPES.CONV_C2C;
|
||||
};
|
||||
const showConversationActionMenu = (event, conversation, index, isContextMenuEvent) => {
|
||||
if (isContextMenuEvent) {
|
||||
event.preventDefault();
|
||||
if (TUIKit_utils_env.isUniFrameWork) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
currentConversation.value = conversation;
|
||||
lastestOpenActionsMenuTime = Date.now();
|
||||
getActionsMenuPosition(event, index);
|
||||
};
|
||||
const closeConversationActionMenu = () => {
|
||||
if (lastestOpenActionsMenuTime && Date.now() - lastestOpenActionsMenuTime > 300) {
|
||||
currentConversation.value = void 0;
|
||||
isShowOverlay.value = false;
|
||||
}
|
||||
};
|
||||
const getActionsMenuPosition = (event, index) => {
|
||||
var _a, _b;
|
||||
if (TUIKit_utils_env.isUniFrameWork) {
|
||||
if (typeof conversationListDomRef.value === "undefined") {
|
||||
emits("getPassingRef", conversationListDomRef);
|
||||
}
|
||||
const query = (_a = common_vendor.i) == null ? void 0 : _a.createSelectorQuery().in(conversationListDomRef.value);
|
||||
query.select(`#convlistitem-${index}`).boundingClientRect((data) => {
|
||||
if (data) {
|
||||
actionsMenuPosition.value = {
|
||||
// The uni-page-head of uni-h5 is not considered a member of the viewport, so the height of the head is manually increased.
|
||||
top: data.bottom + (TUIKit_utils_env.isH5 ? 44 : 0),
|
||||
// @ts-expect-error in uniapp event has touches property
|
||||
left: event.touches[0].pageX,
|
||||
conversationHeight: data.height
|
||||
};
|
||||
isShowOverlay.value = true;
|
||||
}
|
||||
}).exec();
|
||||
} else {
|
||||
const rect = ((_b = event.currentTarget || event.target) == null ? void 0 : _b.getBoundingClientRect()) || {};
|
||||
if (rect) {
|
||||
actionsMenuPosition.value = {
|
||||
top: rect.bottom,
|
||||
left: TUIKit_utils_env.isPC ? event.clientX : void 0,
|
||||
conversationHeight: rect.height
|
||||
};
|
||||
}
|
||||
isShowOverlay.value = true;
|
||||
}
|
||||
};
|
||||
const enterConversationChat = (conversationID) => {
|
||||
emits("handleSwitchConversation", conversationID);
|
||||
common_vendor.Xt.switchConversation(conversationID);
|
||||
};
|
||||
function addLongPressHandler() {
|
||||
if (!conversationListInnerDomRef.value) {
|
||||
return;
|
||||
}
|
||||
common_vendor.k({
|
||||
element: conversationListInnerDomRef.value,
|
||||
onLongPress: (event, target) => {
|
||||
const index = Array.from(conversationListInnerDomRef.value.children).indexOf(target);
|
||||
showConversationActionMenu(event, conversationList.value[index], index);
|
||||
},
|
||||
options: {
|
||||
eventDelegation: {
|
||||
subSelector: ".tui-conversation-content"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function onCurrentConversationUpdated(conversation) {
|
||||
currentConversation.value = conversation;
|
||||
}
|
||||
function onConversationListUpdated(list) {
|
||||
conversationList.value = list;
|
||||
}
|
||||
function onCurrentConversationIDUpdated(id) {
|
||||
currentConversationID.value = id;
|
||||
}
|
||||
function onDisplayOnlineStatusUpdated(status) {
|
||||
displayOnlineStatus.value = status;
|
||||
}
|
||||
function onUserStatusListUpdated(list) {
|
||||
if (list.size !== 0) {
|
||||
userOnlineStatusMap.value = [...list.entries()].reduce(
|
||||
(obj, [key, value]) => {
|
||||
obj[key] = value;
|
||||
return obj;
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
}
|
||||
__expose({ closeChildren: closeConversationActionMenu });
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(isShowOverlay)
|
||||
}, common_vendor.unref(isShowOverlay) ? {
|
||||
b: common_vendor.o$1(closeConversationActionMenu),
|
||||
c: common_vendor.p({
|
||||
selectedConversation: common_vendor.unref(currentConversation),
|
||||
actionsMenuPosition: common_vendor.unref(actionsMenuPosition),
|
||||
selectedConversationDomRect: common_vendor.unref(currentConversationDomRect)
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.f(common_vendor.unref(conversationList), (conversation, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: "4ef42c1d-1-" + i0,
|
||||
b: common_vendor.p({
|
||||
useSkeletonAnimation: true,
|
||||
url: conversation.getAvatar(),
|
||||
size: "30px"
|
||||
}),
|
||||
c: common_vendor.unref(userOnlineStatusMap) && isShowUserOnlineStatus(conversation)
|
||||
}, common_vendor.unref(userOnlineStatusMap) && isShowUserOnlineStatus(conversation) ? {
|
||||
d: common_vendor.n(Object.keys(common_vendor.unref(userOnlineStatusMap)).length > 0 && Object.keys(common_vendor.unref(userOnlineStatusMap)).includes(conversation.userProfile.userID) && common_vendor.unref(userOnlineStatusMap)[conversation.userProfile.userID].statusType === 1 ? "online-status-online" : "online-status-offline")
|
||||
} : {}, {
|
||||
e: conversation.unreadCount > 0 && !conversation.isMuted
|
||||
}, conversation.unreadCount > 0 && !conversation.isMuted ? {
|
||||
f: common_vendor.t(conversation.unreadCount > 99 ? "99+" : conversation.unreadCount)
|
||||
} : {}, {
|
||||
g: conversation.unreadCount > 0 && conversation.isMuted
|
||||
}, conversation.unreadCount > 0 && conversation.isMuted ? {} : {}, {
|
||||
h: common_vendor.t(conversation.getShowName()),
|
||||
i: conversation.draftText && conversation.conversationID !== common_vendor.unref(currentConversationID)
|
||||
}, conversation.draftText && conversation.conversationID !== common_vendor.unref(currentConversationID) ? {
|
||||
j: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.[草稿]"))
|
||||
} : conversation.type === "GROUP" && conversation.groupAtInfoList && conversation.groupAtInfoList.length > 0 ? {
|
||||
l: common_vendor.t(conversation.getGroupAtInfo())
|
||||
} : {}, {
|
||||
k: conversation.type === "GROUP" && conversation.groupAtInfoList && conversation.groupAtInfoList.length > 0,
|
||||
m: common_vendor.t(conversation.getLastMessage("text")),
|
||||
n: common_vendor.t(conversation.getLastMessage("time")),
|
||||
o: conversation.isMuted
|
||||
}, conversation.isMuted ? {
|
||||
p: "4ef42c1d-2-" + i0,
|
||||
q: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.muteIcon)
|
||||
})
|
||||
} : {}, {
|
||||
r: common_vendor.n(common_vendor.unref(currentConversationID) === conversation.conversationID && "tui-conversation-item-selected"),
|
||||
s: common_vendor.n(conversation.isPinned && "tui-conversation-item-pinned"),
|
||||
t: common_vendor.o$1(($event) => enterConversationChat(conversation.conversationID), index),
|
||||
v: common_vendor.o$1(($event) => showConversationActionMenu($event, conversation, index), index),
|
||||
w: common_vendor.o$1(($event) => showConversationActionMenu($event, conversation, index, true), index),
|
||||
x: `convlistitem-${index}`,
|
||||
y: index
|
||||
});
|
||||
}),
|
||||
e: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isPC) && "isPC"),
|
||||
f: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isMobile) && "tui-conversation-content-h5 disable-select")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4ef42c1d"]]);
|
||||
wx.createComponent(Component);
|
||||
const index = require("../../../../index.js");
|
||||
wx.createPage(index.MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIConversation/conversation-list/index.js.map
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"navigationBarTitleText": "列表",
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon",
|
||||
"avatar": "../../common/Avatar/index",
|
||||
|
||||
4
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-list/index2.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-list/index2.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const index = require("../../../../index.js");
|
||||
wx.createPage(index.MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIConversation/conversation-list/index2.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/app.js
vendored
10
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -2,9 +2,10 @@
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
if (!Math) {
|
||||
"./pages/index/index.js";
|
||||
"./pages/Home/Home.js";
|
||||
"./pages/index/index.js";
|
||||
"./pages/Message/Message.js";
|
||||
"./pages/Mine/Mine.js";
|
||||
"./TUIKit/components/TUIConversation/index.js";
|
||||
"./TUIKit/components/TUIChat/index.js";
|
||||
"./TUIKit/components/TUIChat/video-play.js";
|
||||
@@ -12,12 +13,13 @@ if (!Math) {
|
||||
"./TUIKit/components/TUIContact/index.js";
|
||||
"./TUIKit/components/TUIGroup/index.js";
|
||||
"./TUIKit/components/TUISearch/index2.js";
|
||||
"./TUIKit/components/TUIConversation/conversation-list/index2.js";
|
||||
}
|
||||
let vueVersion = 2;
|
||||
vueVersion = 3;
|
||||
common_vendor.index.$SDKAppID = 0;
|
||||
common_vendor.index.$userID = "";
|
||||
common_vendor.index.$userSig = "";
|
||||
common_vendor.index.$SDKAppID = 1600086550;
|
||||
common_vendor.index.$userID = "123";
|
||||
common_vendor.index.$userSig = "eJyrVgrxCdYrSy1SslIy0jNQ0gHzM1NS80oy0zLBwoZGxlDh4pTsxIKCzBQlK0MzAwMDCzNTUwOITGpFQWZRKlDc1NTUCCgFES3JzAWJmZuYGxpbALVATclMB5qaUmwRlpvkHBmcHWps7hScoe3sm6PtmRxZXOWZkZYbWGKYXlVo6ByUUlqRbqtUCwBTujBs";
|
||||
const _sfc_main = {
|
||||
onLaunch: function() {
|
||||
common_vendor.A.login({
|
||||
|
||||
12
unpackage/dist/dev/mp-weixin/app.json
vendored
12
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/Home/Home",
|
||||
"pages/Message/Message"
|
||||
"pages/index/index",
|
||||
"pages/Message/Message",
|
||||
"pages/Mine/Mine"
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
@@ -14,7 +15,8 @@
|
||||
"components/TUIChat/web-view",
|
||||
"components/TUIContact/index",
|
||||
"components/TUIGroup/index",
|
||||
"components/TUISearch/index"
|
||||
"components/TUISearch/index",
|
||||
"components/TUIConversation/conversation-list/index"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -36,6 +38,10 @@
|
||||
{
|
||||
"pagePath": "pages/Message/Message",
|
||||
"text": "消息"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/Mine/Mine",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ const _imports_0$2 = "/static/HomeBackground.png";
|
||||
const createGroup = "/assets/start-group.6d6b5fbb.svg";
|
||||
const C2C = "/assets/icon-c2c.d80299ab.svg";
|
||||
const settingSVG = "/assets/setting.a15e5daf.svg";
|
||||
const muteIcon = "/assets/mute.94c8513a.svg";
|
||||
const _imports_0$1 = "/static/Searching.png";
|
||||
const _imports_0 = "/static/logo.png";
|
||||
const _imports_1 = "/static/female.png";
|
||||
@@ -21,7 +22,6 @@ const addSVG = "/assets/add.ea3b9dc9.svg";
|
||||
const backIcon = "/assets/back.e9626a2e.svg";
|
||||
const editIcon = "/assets/edit.4601124c.svg";
|
||||
const closeIcon = "/assets/icon-close.00e2ef94.svg";
|
||||
const muteIcon = "/assets/mute.94c8513a.svg";
|
||||
const playIcon = "/assets/video-play.58b451c9.png";
|
||||
const audioIcon$1 = "/assets/msg-audio.ac2cd1c9.svg";
|
||||
const files = "/assets/file-light.7beeea9d.svg";
|
||||
|
||||
@@ -7770,7 +7770,7 @@ function isConsoleWritable() {
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "192.168.0.107,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_qYuC86";
|
||||
const id = "mp-weixin_9hN2YW";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
@@ -29635,4 +29635,5 @@ exports.withDefaults = withDefaults;
|
||||
exports.withDirectives = withDirectives;
|
||||
exports.withModifiers = withModifiers;
|
||||
exports.withScopeId = withScopeId;
|
||||
exports.wx$1 = wx$1;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|
||||
|
||||
@@ -18,7 +18,6 @@ const _sfc_main = {
|
||||
{
|
||||
iconPath: "../../static/Forum.png",
|
||||
selectedIconPath: "../../static/Forumclick.png",
|
||||
// text: '消息',
|
||||
text: "论坛",
|
||||
pagePath: "",
|
||||
middleClass: ""
|
||||
@@ -34,14 +33,13 @@ const _sfc_main = {
|
||||
iconPath: "../../static/Message.png",
|
||||
selectedIconPath: "../../static/Messageclick.png",
|
||||
text: "消息",
|
||||
// text: '社区',
|
||||
pagePath: "../../pages/Message/Message"
|
||||
pagePath: "../../pages/index/index"
|
||||
},
|
||||
{
|
||||
iconPath: "../../static/Mine.png",
|
||||
selectedIconPath: "../../static/Mineclick.png",
|
||||
text: "我的",
|
||||
pagePath: "",
|
||||
pagePath: "../../pages/Mine/Mine",
|
||||
middleClass: ""
|
||||
}
|
||||
]);
|
||||
@@ -50,9 +48,9 @@ const _sfc_main = {
|
||||
});
|
||||
common_vendor.index.getSystemInfo({
|
||||
success: function(res) {
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:85", "机型", res.deviceType);
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:83", "机型", res.deviceType);
|
||||
if (res.safeArea.top > 40) {
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:87", "苹果的底部栏大小", res.safeArea.top);
|
||||
common_vendor.index.__f__("log", "at components/tabBar/tabBar.vue:85", "苹果的底部栏大小", res.safeArea.top);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
216
unpackage/dist/dev/mp-weixin/index.js
vendored
Normal file
216
unpackage/dist/dev/mp-weixin/index.js
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
"use strict";
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
require("./TUIKit/adapter-vue.js");
|
||||
const common_assets = require("./common/assets.js");
|
||||
const TUIKit_utils_env = require("./TUIKit/utils/env.js");
|
||||
if (!Math) {
|
||||
(ActionsMenu + Avatar + Icon)();
|
||||
}
|
||||
const Icon = () => "./TUIKit/components/common/Icon.js";
|
||||
const Avatar = () => "./TUIKit/components/common/Avatar/index.js";
|
||||
const ActionsMenu = () => "./TUIKit/components/TUIConversation/actions-menu/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
emits: ["handleSwitchConversation", "getPassingRef"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const emits = __emit;
|
||||
const currentConversation = common_vendor.ref();
|
||||
const currentConversationID = common_vendor.ref();
|
||||
const currentConversationDomRect = common_vendor.ref();
|
||||
const isShowOverlay = common_vendor.ref(false);
|
||||
const conversationList = common_vendor.ref([]);
|
||||
const conversationListDomRef = common_vendor.ref();
|
||||
const conversationListInnerDomRef = common_vendor.ref();
|
||||
const actionsMenuPosition = common_vendor.ref({
|
||||
top: 0,
|
||||
left: void 0,
|
||||
conversationHeight: void 0
|
||||
});
|
||||
const displayOnlineStatus = common_vendor.ref(false);
|
||||
const userOnlineStatusMap = common_vendor.ref();
|
||||
let lastestOpenActionsMenuTime = null;
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
||||
currentConversationID: onCurrentConversationIDUpdated,
|
||||
conversationList: onConversationListUpdated,
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.USER, {
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
if (!TUIKit_utils_env.isUniFrameWork && common_vendor.f$1 && !TUIKit_utils_env.isPC) {
|
||||
addLongPressHandler();
|
||||
}
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
|
||||
currentConversationID: onCurrentConversationIDUpdated,
|
||||
conversationList: onConversationListUpdated,
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.USER, {
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
});
|
||||
const isShowUserOnlineStatus = (conversation) => {
|
||||
return displayOnlineStatus.value && conversation.type === common_vendor.qt.TYPES.CONV_C2C;
|
||||
};
|
||||
const showConversationActionMenu = (event, conversation, index, isContextMenuEvent) => {
|
||||
if (isContextMenuEvent) {
|
||||
event.preventDefault();
|
||||
if (TUIKit_utils_env.isUniFrameWork) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
currentConversation.value = conversation;
|
||||
lastestOpenActionsMenuTime = Date.now();
|
||||
getActionsMenuPosition(event, index);
|
||||
};
|
||||
const closeConversationActionMenu = () => {
|
||||
if (lastestOpenActionsMenuTime && Date.now() - lastestOpenActionsMenuTime > 300) {
|
||||
currentConversation.value = void 0;
|
||||
isShowOverlay.value = false;
|
||||
}
|
||||
};
|
||||
const getActionsMenuPosition = (event, index) => {
|
||||
var _a, _b;
|
||||
if (TUIKit_utils_env.isUniFrameWork) {
|
||||
if (typeof conversationListDomRef.value === "undefined") {
|
||||
emits("getPassingRef", conversationListDomRef);
|
||||
}
|
||||
const query = (_a = common_vendor.i) == null ? void 0 : _a.createSelectorQuery().in(conversationListDomRef.value);
|
||||
query.select(`#convlistitem-${index}`).boundingClientRect((data) => {
|
||||
if (data) {
|
||||
actionsMenuPosition.value = {
|
||||
// The uni-page-head of uni-h5 is not considered a member of the viewport, so the height of the head is manually increased.
|
||||
top: data.bottom + (TUIKit_utils_env.isH5 ? 44 : 0),
|
||||
// @ts-expect-error in uniapp event has touches property
|
||||
left: event.touches[0].pageX,
|
||||
conversationHeight: data.height
|
||||
};
|
||||
isShowOverlay.value = true;
|
||||
}
|
||||
}).exec();
|
||||
} else {
|
||||
const rect = ((_b = event.currentTarget || event.target) == null ? void 0 : _b.getBoundingClientRect()) || {};
|
||||
if (rect) {
|
||||
actionsMenuPosition.value = {
|
||||
top: rect.bottom,
|
||||
left: TUIKit_utils_env.isPC ? event.clientX : void 0,
|
||||
conversationHeight: rect.height
|
||||
};
|
||||
}
|
||||
isShowOverlay.value = true;
|
||||
}
|
||||
};
|
||||
const enterConversationChat = (conversationID) => {
|
||||
emits("handleSwitchConversation", conversationID);
|
||||
common_vendor.Xt.switchConversation(conversationID);
|
||||
};
|
||||
function addLongPressHandler() {
|
||||
if (!conversationListInnerDomRef.value) {
|
||||
return;
|
||||
}
|
||||
common_vendor.k({
|
||||
element: conversationListInnerDomRef.value,
|
||||
onLongPress: (event, target) => {
|
||||
const index = Array.from(conversationListInnerDomRef.value.children).indexOf(target);
|
||||
showConversationActionMenu(event, conversationList.value[index], index);
|
||||
},
|
||||
options: {
|
||||
eventDelegation: {
|
||||
subSelector: ".tui-conversation-content"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function onCurrentConversationUpdated(conversation) {
|
||||
currentConversation.value = conversation;
|
||||
}
|
||||
function onConversationListUpdated(list) {
|
||||
conversationList.value = list;
|
||||
}
|
||||
function onCurrentConversationIDUpdated(id) {
|
||||
currentConversationID.value = id;
|
||||
}
|
||||
function onDisplayOnlineStatusUpdated(status) {
|
||||
displayOnlineStatus.value = status;
|
||||
}
|
||||
function onUserStatusListUpdated(list) {
|
||||
if (list.size !== 0) {
|
||||
userOnlineStatusMap.value = [...list.entries()].reduce(
|
||||
(obj, [key, value]) => {
|
||||
obj[key] = value;
|
||||
return obj;
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
}
|
||||
__expose({ closeChildren: closeConversationActionMenu });
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(isShowOverlay)
|
||||
}, common_vendor.unref(isShowOverlay) ? {
|
||||
b: common_vendor.o$1(closeConversationActionMenu),
|
||||
c: common_vendor.p({
|
||||
selectedConversation: common_vendor.unref(currentConversation),
|
||||
actionsMenuPosition: common_vendor.unref(actionsMenuPosition),
|
||||
selectedConversationDomRect: common_vendor.unref(currentConversationDomRect)
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.f(common_vendor.unref(conversationList), (conversation, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: "4ef42c1d-1-" + i0,
|
||||
b: common_vendor.p({
|
||||
useSkeletonAnimation: true,
|
||||
url: conversation.getAvatar(),
|
||||
size: "30px"
|
||||
}),
|
||||
c: common_vendor.unref(userOnlineStatusMap) && isShowUserOnlineStatus(conversation)
|
||||
}, common_vendor.unref(userOnlineStatusMap) && isShowUserOnlineStatus(conversation) ? {
|
||||
d: common_vendor.n(Object.keys(common_vendor.unref(userOnlineStatusMap)).length > 0 && Object.keys(common_vendor.unref(userOnlineStatusMap)).includes(conversation.userProfile.userID) && common_vendor.unref(userOnlineStatusMap)[conversation.userProfile.userID].statusType === 1 ? "online-status-online" : "online-status-offline")
|
||||
} : {}, {
|
||||
e: conversation.unreadCount > 0 && !conversation.isMuted
|
||||
}, conversation.unreadCount > 0 && !conversation.isMuted ? {
|
||||
f: common_vendor.t(conversation.unreadCount > 99 ? "99+" : conversation.unreadCount)
|
||||
} : {}, {
|
||||
g: conversation.unreadCount > 0 && conversation.isMuted
|
||||
}, conversation.unreadCount > 0 && conversation.isMuted ? {} : {}, {
|
||||
h: common_vendor.t(conversation.getShowName()),
|
||||
i: conversation.draftText && conversation.conversationID !== common_vendor.unref(currentConversationID)
|
||||
}, conversation.draftText && conversation.conversationID !== common_vendor.unref(currentConversationID) ? {
|
||||
j: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.[草稿]"))
|
||||
} : conversation.type === "GROUP" && conversation.groupAtInfoList && conversation.groupAtInfoList.length > 0 ? {
|
||||
l: common_vendor.t(conversation.getGroupAtInfo())
|
||||
} : {}, {
|
||||
k: conversation.type === "GROUP" && conversation.groupAtInfoList && conversation.groupAtInfoList.length > 0,
|
||||
m: common_vendor.t(conversation.getLastMessage("text")),
|
||||
n: common_vendor.t(conversation.getLastMessage("time")),
|
||||
o: conversation.isMuted
|
||||
}, conversation.isMuted ? {
|
||||
p: "4ef42c1d-2-" + i0,
|
||||
q: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.muteIcon)
|
||||
})
|
||||
} : {}, {
|
||||
r: common_vendor.n(common_vendor.unref(currentConversationID) === conversation.conversationID && "tui-conversation-item-selected"),
|
||||
s: common_vendor.n(conversation.isPinned && "tui-conversation-item-pinned"),
|
||||
t: common_vendor.o$1(($event) => enterConversationChat(conversation.conversationID), index),
|
||||
v: common_vendor.o$1(($event) => showConversationActionMenu($event, conversation, index), index),
|
||||
w: common_vendor.o$1(($event) => showConversationActionMenu($event, conversation, index, true), index),
|
||||
x: `convlistitem-${index}`,
|
||||
y: index
|
||||
});
|
||||
}),
|
||||
e: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isPC) && "isPC"),
|
||||
f: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isMobile) && "tui-conversation-content-h5 disable-select")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4ef42c1d"]]);
|
||||
exports.MiniProgramPage = MiniProgramPage;
|
||||
//# sourceMappingURL=../.sourcemap/mp-weixin/index.js.map
|
||||
16
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
16
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
@@ -10,9 +10,23 @@ const _sfc_main = {
|
||||
return {};
|
||||
},
|
||||
onLoad() {
|
||||
this.requestSomething();
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
requestSomething() {
|
||||
common_vendor.wx$1.request({
|
||||
url: "http://192.168.0.218:8086/user/login",
|
||||
// 请求的 URL
|
||||
method: "POST",
|
||||
// 请求方式
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:37", "请求成功", res.data);
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/Home/Home.vue:40", "请求失败", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
components: {
|
||||
topNavigation,
|
||||
|
||||
@@ -20,18 +20,17 @@
|
||||
height: 114.5rpx;
|
||||
}
|
||||
.Advertisement.data-v-7ffebbf4 {
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
.contentList.data-v-7ffebbf4 {
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 1300rpx;
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 1300rpx;
|
||||
}
|
||||
|
||||
|
||||
20
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.js
vendored
Normal file
20
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
methods: {
|
||||
openChat() {
|
||||
const conversationID = "C2Cqwe";
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o$1((...args) => $options.openChat && $options.openChat(...args))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Mine/Mine.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<button bindtap="{{a}}">OpenChat</button>
|
||||
0
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.wxss
vendored
Normal file
0
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.wxss
vendored
Normal file
@@ -1,23 +1,23 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
title: "Hello"
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.openConversationList();
|
||||
},
|
||||
methods: {
|
||||
// 打开会话列表
|
||||
openConversationList() {
|
||||
common_vendor.index.navigateTo({ url: "/TUIKit/components/TUIConversation/index" });
|
||||
},
|
||||
// 打开联系人
|
||||
openContact() {
|
||||
common_vendor.index.navigateTo({ url: "/TUIKit/components/TUIContact/index" });
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o$1((...args) => $options.openConversationList && $options.openConversationList(...args)),
|
||||
b: common_vendor.o$1((...args) => $options.openContact && $options.openContact(...args))
|
||||
};
|
||||
return {};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<view><button bindtap="{{a}}">打开会话列表</button><button bindtap="{{b}}">打开联系人</button></view>
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
/* 样式定义 */
|
||||
|
||||
Reference in New Issue
Block a user