自定义消息

This commit is contained in:
pengxiaolong
2025-05-16 21:53:47 +08:00
parent 595c5329a0
commit e05d72fccf
43 changed files with 458 additions and 84 deletions

View File

@@ -0,0 +1,80 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const TUIKit_components_TUIChat_config = require("../../config.js");
const common_assets = require("../../../../../common/assets.js");
const TUIKit_components_TUIChat_utils_utils = require("../../utils/utils.js");
const TUIKit_components_TUIChat_offlinePushInfoManager_index = require("../../offlinePushInfoManager/index.js");
if (!Math) {
ToolbarItemContainer();
}
const ToolbarItemContainer = () => "../toolbar-item-container/index.js";
const _sfc_main = {
__name: "CustomMessage",
emits: ["onDialogPopupShowOrHide"],
setup(__props, { emit: __emit }) {
const evaluateIcon = TUIKit_components_TUIChat_config.ChatConfig.getTheme() === "dark" ? common_assets.InvitationDark : common_assets.InvitationLight;
const emits = __emit;
const onDialogShow = () => {
emits("onDialogPopupShowOrHide", true);
};
const onDialogClose = () => {
emits("onDialogPopupShowOrHide", false);
};
const currentConversation = common_vendor.ref();
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: (conversation) => {
currentConversation.value = conversation;
}
});
const container = common_vendor.ref();
const submitEvaluate = () => {
var _a, _b, _c, _d, _e, _f;
const payload = {
data: JSON.stringify({
businessID: "pk",
title: "PK邀请",
buttonText1: "接受邀请",
buttonText2: "拒绝邀请"
}),
description: "",
extension: ""
};
const options = {
to: ((_b = (_a = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _a.groupProfile) == null ? void 0 : _b.groupID) || ((_d = (_c = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _c.userProfile) == null ? void 0 : _d.userID),
conversationType: (_e = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _e.type,
payload,
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
};
const offlinePushInfoCreateParams = {
conversation: currentConversation.value,
payload: options.payload,
messageType: common_vendor.qt.TYPES.MSG_CUSTOM
};
const sendMessageOptions = {
offlinePushInfo: TUIKit_components_TUIChat_offlinePushInfoManager_index.OfflinePushInfoManager.create(offlinePushInfoCreateParams)
};
common_vendor.Qt.sendCustomMessage(options, sendMessageOptions);
(_f = container == null ? void 0 : container.value) == null ? void 0 : _f.toggleDialogDisplay(false);
};
return (_ctx, _cache) => {
return {
a: common_vendor.o$1(submitEvaluate),
b: common_vendor.sr(container, "241228dc-0", {
"k": "container"
}),
c: common_vendor.o$1(onDialogShow),
d: common_vendor.o$1(onDialogClose),
e: common_vendor.p({
iconFile: common_vendor.unref(evaluateIcon),
title: "邀请",
needBottomPopup: true,
iconWidth: _ctx.isUniFrameWork ? "36px" : "30px",
iconHeight: _ctx.isUniFrameWork ? "36px" : "30px"
})
};
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-241228dc"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input-toolbar/evaluate/CustomMessage.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"toolbar-item-container": "../toolbar-item-container/index"
}
}

View File

@@ -0,0 +1 @@
<toolbar-item-container wx:if="{{e}}" class="r data-v-241228dc" u-s="{{['d']}}" u-r="container" bindonDialogShow="{{c}}" bindonDialogClose="{{d}}" u-i="241228dc-0" bind:__l="__l" u-p="{{e}}"><view class="data-v-241228dc"><view class="container data-v-241228dc"></view><button class="send-btn data-v-241228dc" bindtap="{{a}}">发送邀请</button></view></toolbar-item-container>

View File

@@ -0,0 +1,7 @@
.container.data-v-241228dc {
height: 300rpx;
}
.send-btn.data-v-241228dc {
margin-bottom: 100rpx;
}