|
|
|
|
@@ -5,6 +5,9 @@ require("../adapter-vue.js");
|
|
|
|
|
const TUIKit_utils_env = require("../utils/env.js");
|
|
|
|
|
const TUIKit_components_TUIChat_config = require("./TUIChat/config.js");
|
|
|
|
|
const TUIKit_components_TUIChat_entryChatOnly = require("./TUIChat/entry-chat-only.js");
|
|
|
|
|
const TUIKit_components_TUIChat_utils_utils = require("./TUIChat/utils/utils.js");
|
|
|
|
|
const TUIKit_components_TUIChat_offlinePushInfoManager_index = require("./TUIChat/offlinePushInfoManager/index.js");
|
|
|
|
|
const stores_counter = require("../../stores/counter.js");
|
|
|
|
|
const TUIKit_components_TUIChat_server = require("./TUIChat/server.js");
|
|
|
|
|
const TUIKit_components_TUIConversation_server = require("./TUIConversation/server.js");
|
|
|
|
|
const TUIKit_components_TUISearch_searchTypeList = require("./TUISearch/search-type-list.js");
|
|
|
|
|
@@ -26,8 +29,20 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
__name: "index",
|
|
|
|
|
emits: ["closeChat"],
|
|
|
|
|
setup(__props, { emit: __emit }) {
|
|
|
|
|
const counter = stores_counter.useCounterStore();
|
|
|
|
|
let myitem = common_vendor.ref();
|
|
|
|
|
let youritem = common_vendor.ref();
|
|
|
|
|
common_vendor.onLoad((options) => {
|
|
|
|
|
TUIKit_components_TUIChat_entryChatOnly.initChat(options);
|
|
|
|
|
if (options.myitem) {
|
|
|
|
|
myitem.value = JSON.parse(options.myitem);
|
|
|
|
|
counter.$patch({ myitem: myitem.value });
|
|
|
|
|
youritem.value = JSON.parse(options.youritem);
|
|
|
|
|
counter.$patch({ youritem: youritem.value });
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
sendCustomMessage(myitem, youritem);
|
|
|
|
|
}, 1e3);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
common_vendor.onUnload(() => {
|
|
|
|
|
TUIKit_components_TUIChat_entryChatOnly.logout(false).then(() => {
|
|
|
|
|
@@ -57,6 +72,46 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
});
|
|
|
|
|
reset();
|
|
|
|
|
});
|
|
|
|
|
let currentConversation = common_vendor.ref();
|
|
|
|
|
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
|
|
|
|
currentConversation: (conversation) => {
|
|
|
|
|
currentConversation.value = conversation;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
function sendCustomMessage(myitem2, youritem2) {
|
|
|
|
|
var _a, _b, _c, _d, _e;
|
|
|
|
|
const payload = {
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
businessID: "pk",
|
|
|
|
|
title: "PK邀请",
|
|
|
|
|
buttonText1: "接受邀请",
|
|
|
|
|
buttonText2: "拒绝邀请"
|
|
|
|
|
}),
|
|
|
|
|
description: "邀请参加PK",
|
|
|
|
|
extension: "邀请参加PK"
|
|
|
|
|
};
|
|
|
|
|
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);
|
|
|
|
|
common_vendor.Qt.getMessageList().then((res) => {
|
|
|
|
|
common_vendor.index.__f__("log", "at TUIKit/components/TUIChat/index.vue:232", "消息列表···································", res);
|
|
|
|
|
});
|
|
|
|
|
myitem2.value = null;
|
|
|
|
|
youritem2.value = null;
|
|
|
|
|
currentConversation.value = null;
|
|
|
|
|
}
|
|
|
|
|
const isInputToolbarShow = common_vendor.computed(() => {
|
|
|
|
|
return TUIKit_utils_env.isUniFrameWork ? inputToolbarDisplayType.value !== "none" : true;
|
|
|
|
|
});
|
|
|
|
|
@@ -163,7 +218,11 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
headerExtensionList.value = [];
|
|
|
|
|
isMultipleSelectMode.value = false;
|
|
|
|
|
TUIKit_components_TUIChat_config.ChatConfig.setChatType(conversationType);
|
|
|
|
|
common_vendor.R.notifyEvent(common_vendor.E.TUIChat.EVENT.CHAT_STATE_CHANGED, common_vendor.E.TUIChat.EVENT_SUB_KEY.CHAT_OPENED, { groupID: groupID.value });
|
|
|
|
|
common_vendor.R.notifyEvent(
|
|
|
|
|
common_vendor.E.TUIChat.EVENT.CHAT_STATE_CHANGED,
|
|
|
|
|
common_vendor.E.TUIChat.EVENT_SUB_KEY.CHAT_OPENED,
|
|
|
|
|
{ groupID: groupID.value }
|
|
|
|
|
);
|
|
|
|
|
common_vendor.R.callService({
|
|
|
|
|
serviceName: common_vendor.E.TUICustomerServicePlugin.SERVICE.NAME,
|
|
|
|
|
method: common_vendor.E.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION,
|
|
|
|
|
@@ -177,7 +236,9 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (TUIKit_components_TUIChat_config.ChatConfig.getChatType() === common_vendor.E.TUIChat.TYPE.GROUP) {
|
|
|
|
|
headerExtensionList.value = common_vendor.R.getExtensionList(common_vendor.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID);
|
|
|
|
|
headerExtensionList.value = common_vendor.R.getExtensionList(
|
|
|
|
|
common_vendor.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
common_vendor.Jt.update(common_vendor.o.CUSTOM, "activeConversation", conversationID);
|
|
|
|
|
currentConversationID.value = conversationID;
|
|
|
|
|
|