优化页面
This commit is contained in:
@@ -144,7 +144,9 @@ let MessageListinfo = ref();
|
||||
onLoad((options) => {
|
||||
initChat(options);
|
||||
myitem.value = JSON.parse(options.myitem);
|
||||
console.log(myitem.value);
|
||||
youritem.value = JSON.parse(options.youritem);
|
||||
console.log(youritem.value);
|
||||
counter.$patch({ youritem: youritem.value });
|
||||
setTimeout(() => {
|
||||
sendCustomMessage(myitem.value, youritem.value);
|
||||
@@ -200,53 +202,7 @@ TUIStore.watch(StoreName.CONV, {
|
||||
});
|
||||
|
||||
function sendCustomMessage(myitem, youritem) {
|
||||
const keyid = generateMsgId();
|
||||
const payload = {
|
||||
data: JSON.stringify({
|
||||
businessID: "pk",
|
||||
keyid: keyid,
|
||||
myitem: counter.myitem.id,
|
||||
pkIdA: youritem.id,
|
||||
pkIdB: myitem.id,
|
||||
userIdA: youritem.senderId,
|
||||
userIdB: myitem.senderId,
|
||||
pkTime: youritem.pkTime,
|
||||
pkNumber: youritem.pkNumber,
|
||||
link:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/pk.png",
|
||||
btnDisplay: true,
|
||||
}),
|
||||
description: "邀请参加PK",
|
||||
extension: "邀请参加PK",
|
||||
};
|
||||
const options = {
|
||||
to:
|
||||
currentConversation?.value?.groupProfile?.groupID ||
|
||||
currentConversation?.value?.userProfile?.userID,
|
||||
conversationType: currentConversation?.value?.type,
|
||||
payload,
|
||||
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
||||
};
|
||||
const offlinePushInfoCreateParams = {
|
||||
conversation: currentConversation.value,
|
||||
payload: options.payload,
|
||||
messageType: TUIChatEngine.TYPES.MSG_CUSTOM,
|
||||
};
|
||||
const sendMessageOptions = {
|
||||
offlinePushInfo: OfflinePushInfoManager.create(offlinePushInfoCreateParams),
|
||||
};
|
||||
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({
|
||||
request({
|
||||
url: "pk/createPkRecord",
|
||||
method: "POST",
|
||||
data: {
|
||||
@@ -256,13 +212,75 @@ function sendCustomMessage(myitem, youritem) {
|
||||
userIdB: myitem.senderId,
|
||||
pkTime: youritem.pkTime,
|
||||
pkNumber: youritem.pkNumber,
|
||||
status: 0,
|
||||
anchorIdA: youritem.anchorId,
|
||||
anchorIdB: myitem.anchorId,
|
||||
anchorIconA: youritem.anchorIcon,
|
||||
anchorIconB: myitem.anchorIcon,
|
||||
piIdA: youritem.id,
|
||||
piIdB: myitem.id,
|
||||
},
|
||||
userInfo: false,
|
||||
userInfo: true,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
console.log("发送成功", res.data);
|
||||
|
||||
const keyid = generateMsgId();
|
||||
const payload = {
|
||||
data: JSON.stringify({
|
||||
businessID: "pk",
|
||||
keyid: keyid,
|
||||
myitem: counter.myitem.id,
|
||||
pkIdA: youritem.id,
|
||||
pkIdB: myitem.id,
|
||||
userIdA: youritem.senderId,
|
||||
userIdB: myitem.senderId,
|
||||
pkTime: youritem.pkTime,
|
||||
pkNumber: youritem.pkNumber,
|
||||
id:res.data.id,
|
||||
link: "https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/pk.png",
|
||||
btnDisplay: true,
|
||||
}),
|
||||
description: "邀请参加PK",
|
||||
extension: "邀请参加PK",
|
||||
};
|
||||
const options = {
|
||||
to:
|
||||
currentConversation?.value?.groupProfile?.groupID ||
|
||||
currentConversation?.value?.userProfile?.userID,
|
||||
conversationType: currentConversation?.value?.type,
|
||||
payload,
|
||||
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
||||
};
|
||||
const offlinePushInfoCreateParams = {
|
||||
conversation: currentConversation.value,
|
||||
payload: options.payload,
|
||||
messageType: TUIChatEngine.TYPES.MSG_CUSTOM,
|
||||
};
|
||||
const sendMessageOptions = {
|
||||
offlinePushInfo: OfflinePushInfoManager.create(offlinePushInfoCreateParams),
|
||||
};
|
||||
TUIChatService.sendCustomMessage(options, sendMessageOptions).then((res) => {
|
||||
const messagein = request({
|
||||
url: "chat/add",
|
||||
method: "POST",
|
||||
data: {
|
||||
messageInfo: JSON.stringify(res.data.message),
|
||||
keyId: keyid,
|
||||
},
|
||||
userInfo: true,
|
||||
});
|
||||
});
|
||||
myitem.value = null;
|
||||
youritem.value = null;
|
||||
currentConversation.value = null;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
}
|
||||
});
|
||||
myitem.value = null;
|
||||
youritem.value = null;
|
||||
currentConversation.value = null;
|
||||
}
|
||||
//`````````````````````````````````````````````````````````````````````标记
|
||||
const isInputToolbarShow = computed<boolean>(() => {
|
||||
|
||||
Reference in New Issue
Block a user