优化页面
This commit is contained in:
144
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.js
vendored
Normal file
144
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.js
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_components_common_Toast_index = require("../../common/Toast/index.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
const TUIKit_components_TUIChat_utils_utils = require("../utils/utils.js");
|
||||
const TUIKit_components_TUIChat_offlinePushInfoManager_index = require("../offlinePushInfoManager/index.js");
|
||||
const TUIKit_components_common_Toast_type = require("../../common/Toast/type.js");
|
||||
if (!Math) {
|
||||
(Transfer + Overlay)();
|
||||
}
|
||||
const Overlay = () => "../../common/Overlay/index.js";
|
||||
const Transfer = () => "../../common/Transfer/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
emits: ["toggleMultipleSelectMode"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const emits = __emit;
|
||||
let selectedToForwardMessageIDList = [];
|
||||
let isMergeForward = false;
|
||||
const isShowForwardPanel = common_vendor.ref(false);
|
||||
const customConversationList = common_vendor.ref();
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CUSTOM, {
|
||||
singleForwardMessageID: onSingleForwardMessageIDUpdated,
|
||||
multipleForwardMessageID: onMultipleForwardMessageIDUpdated
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CUSTOM, {
|
||||
singleForwardMessageID: onSingleForwardMessageIDUpdated,
|
||||
multipleForwardMessageID: onMultipleForwardMessageIDUpdated
|
||||
});
|
||||
clearStoreData();
|
||||
});
|
||||
function onSingleForwardMessageIDUpdated(messageID) {
|
||||
if (typeof messageID !== "undefined") {
|
||||
isMergeForward = false;
|
||||
selectedToForwardMessageIDList = [messageID];
|
||||
openForwardPanel();
|
||||
}
|
||||
}
|
||||
function onMultipleForwardMessageIDUpdated(params) {
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
isMergeForward = false;
|
||||
const {
|
||||
isMergeForward: _isMergeForward,
|
||||
messageIDList: selectedMessageIDList
|
||||
} = params || {};
|
||||
if ((selectedMessageIDList == null ? void 0 : selectedMessageIDList.length) > 0) {
|
||||
isMergeForward = _isMergeForward;
|
||||
selectedToForwardMessageIDList = selectedMessageIDList;
|
||||
openForwardPanel();
|
||||
} else {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIChat.未选择消息"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
}
|
||||
}
|
||||
function clearStoreData() {
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "singleForwardMessageID", void 0);
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "multipleForwardMessageID", void 0);
|
||||
}
|
||||
function closeForwardPanel() {
|
||||
clearStoreData();
|
||||
isShowForwardPanel.value = false;
|
||||
}
|
||||
function openForwardPanel() {
|
||||
getTransforRenderDataList();
|
||||
isShowForwardPanel.value = true;
|
||||
}
|
||||
function finishSelected(selectedConvIDWrapperList) {
|
||||
if ((selectedConvIDWrapperList == null ? void 0 : selectedConvIDWrapperList.length) === 0)
|
||||
return;
|
||||
const selectedConversationList = selectedConvIDWrapperList.map((IDWrapper) => common_vendor.Jt.getConversationModel(IDWrapper.userID));
|
||||
const unsentMessageQueue = selectedToForwardMessageIDList.map((messageID) => common_vendor.Jt.getMessageModel(messageID)).sort((a, b) => a.time - b.time);
|
||||
const forwardPromises = selectedConversationList.map((conversation) => {
|
||||
const offlinePushInfoCreateParams = {
|
||||
conversation,
|
||||
messageType: common_vendor.qt.TYPES.MSG_MERGER
|
||||
};
|
||||
return common_vendor.Qt.sendForwardMessage(
|
||||
[conversation],
|
||||
unsentMessageQueue,
|
||||
{
|
||||
needMerge: isMergeForward,
|
||||
offlinePushInfo: TUIKit_components_TUIChat_offlinePushInfoManager_index.OfflinePushInfoManager.create(offlinePushInfoCreateParams),
|
||||
params: {
|
||||
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
Promise.allSettled(forwardPromises).then((results) => {
|
||||
for (const result of results) {
|
||||
const { status } = result;
|
||||
if (status === "rejected") {
|
||||
const errorMessage = result.reason.code === 80001 ? common_vendor.Wt.t("TUIChat.内容包含敏感词汇") : result.reason.message;
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: errorMessage,
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
closeForwardPanel();
|
||||
emits("toggleMultipleSelectMode", false);
|
||||
}
|
||||
function getTransforRenderDataList() {
|
||||
const conversationList = common_vendor.Jt.getData(common_vendor.o.CONV, "conversationList");
|
||||
customConversationList.value = conversationList.map((conversation) => {
|
||||
return {
|
||||
// To achieve reusability of Transfer, userID is used here instead of ConversationID
|
||||
userID: conversation.conversationID,
|
||||
nick: conversation.getShowName(),
|
||||
avatar: conversation.getAvatar()
|
||||
};
|
||||
});
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o$1(closeForwardPanel),
|
||||
b: common_vendor.o$1(finishSelected),
|
||||
c: common_vendor.p({
|
||||
title: common_vendor.unref(common_vendor.Wt).t("TUIChat.转发"),
|
||||
isSearch: false,
|
||||
isCustomItem: false,
|
||||
list: common_vendor.unref(customConversationList),
|
||||
isHiddenBackIcon: common_vendor.unref(TUIKit_utils_env.isUniFrameWork)
|
||||
}),
|
||||
d: common_vendor.p({
|
||||
visible: common_vendor.unref(isShowForwardPanel),
|
||||
useMask: false
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/forward/index.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"overlay": "../../common/Overlay/index",
|
||||
"transfer": "../../common/Transfer/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<overlay wx:if="{{d}}" u-s="{{['d']}}" u-i="3f0343b7-0" bind:__l="__l" u-p="{{d}}"><transfer wx:if="{{c}}" bindcancel="{{a}}" bindsubmit="{{b}}" u-i="3f0343b7-1,3f0343b7-0" bind:__l="__l" u-p="{{c}}"/></overlay>
|
||||
0
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.wxss
vendored
Normal file
0
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/forward/index.wxss
vendored
Normal file
Reference in New Issue
Block a user