优化页面
This commit is contained in:
@@ -133,22 +133,22 @@ import { initChat, logout } from "./entry-chat-only.ts";
|
||||
import { isEnabledMessageReadReceiptGlobal } from "./utils/utils";
|
||||
import OfflinePushInfoManager from "./offlinePushInfoManager/index";
|
||||
import { TUIChatService } from "@tencentcloud/chat-uikit-engine";
|
||||
import { useCounterStore } from '@/stores/counter'
|
||||
const counter = useCounterStore()
|
||||
import { useCounterStore } from "@/stores/counter";
|
||||
import request from "@/components/request";
|
||||
import generateMsgId from "../../../components/generateMsgId.js";
|
||||
const counter = useCounterStore();
|
||||
|
||||
let myitem = ref();
|
||||
let youritem = ref();
|
||||
let MessageListinfo = ref();
|
||||
onLoad((options) => {
|
||||
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);
|
||||
}, 1000);
|
||||
}
|
||||
myitem.value = JSON.parse(options.myitem);
|
||||
youritem.value = JSON.parse(options.youritem);
|
||||
counter.$patch({ youritem: youritem.value });
|
||||
setTimeout(() => {
|
||||
sendCustomMessage(myitem.value, youritem.value);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
@@ -200,12 +200,17 @@ TUIStore.watch(StoreName.CONV, {
|
||||
});
|
||||
|
||||
function sendCustomMessage(myitem, youritem) {
|
||||
const keyid = generateMsgId();
|
||||
const payload = {
|
||||
data: JSON.stringify({
|
||||
businessID: "pk",
|
||||
title: "PK邀请",
|
||||
buttonText1: "接受邀请",
|
||||
buttonText2: "拒绝邀请",
|
||||
keyid: keyid,
|
||||
myitem: counter.myitem.id,
|
||||
btnDisplay: true,
|
||||
mytitle: "等待对方接受邀请",
|
||||
}),
|
||||
description: "邀请参加PK",
|
||||
extension: "邀请参加PK",
|
||||
@@ -218,7 +223,6 @@ function sendCustomMessage(myitem, youritem) {
|
||||
payload,
|
||||
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
||||
};
|
||||
|
||||
const offlinePushInfoCreateParams = {
|
||||
conversation: currentConversation.value,
|
||||
payload: options.payload,
|
||||
@@ -227,15 +231,36 @@ function sendCustomMessage(myitem, youritem) {
|
||||
const sendMessageOptions = {
|
||||
offlinePushInfo: OfflinePushInfoManager.create(offlinePushInfoCreateParams),
|
||||
};
|
||||
TUIChatService.sendCustomMessage(options, sendMessageOptions);
|
||||
TUIChatService.getMessageList().then((res) => {
|
||||
console.log("消息列表···································",res);
|
||||
TUIChatService.sendCustomMessage(options, sendMessageOptions).then((res) => {
|
||||
const messagein = request({
|
||||
url: "chat/add",
|
||||
method: "POST",
|
||||
data: {
|
||||
messageInfo: JSON.stringify(res.data.message),
|
||||
keyId: keyid,
|
||||
},
|
||||
userInfo: false,
|
||||
});
|
||||
});
|
||||
|
||||
const messageList = request({
|
||||
url: "pk/createPkRecord",
|
||||
method: "POST",
|
||||
data: {
|
||||
pkIdA: youritem.id,
|
||||
pkIdB: myitem.id,
|
||||
userIdA: youritem.senderId,
|
||||
userIdB: myitem.senderId,
|
||||
pkTime: youritem.pkTime,
|
||||
status: 0,
|
||||
},
|
||||
userInfo: false,
|
||||
});
|
||||
myitem.value = null;
|
||||
youritem.value = null;
|
||||
currentConversation.value = null;
|
||||
}
|
||||
//`````````````````````````````````````````````````````````````````````
|
||||
//`````````````````````````````````````````````````````````````````````标记
|
||||
const isInputToolbarShow = computed<boolean>(() => {
|
||||
return isUniFrameWork ? inputToolbarDisplayType.value !== "none" : true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user