优化页面
This commit is contained in:
@@ -204,13 +204,16 @@ function sendCustomMessage(myitem, youritem) {
|
||||
const payload = {
|
||||
data: JSON.stringify({
|
||||
businessID: "pk",
|
||||
title: "PK邀请",
|
||||
buttonText1: "接受邀请",
|
||||
buttonText2: "拒绝邀请",
|
||||
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,
|
||||
mytitle: "等待对方接受邀请",
|
||||
}),
|
||||
description: "邀请参加PK",
|
||||
extension: "邀请参加PK",
|
||||
@@ -252,6 +255,7 @@ function sendCustomMessage(myitem, youritem) {
|
||||
userIdA: youritem.senderId,
|
||||
userIdB: myitem.senderId,
|
||||
pkTime: youritem.pkTime,
|
||||
pkNumber: youritem.pkNumber,
|
||||
status: 0,
|
||||
},
|
||||
userInfo: false,
|
||||
|
||||
@@ -63,20 +63,12 @@
|
||||
</template>
|
||||
<!-- `························································标记······················································ -->
|
||||
<template v-else-if="customData.businessID === CHAT_MSG_CUSTOM_TYPE.PK">
|
||||
<div class="pk" v-if="customData.myitem !== counter.myitem.id">
|
||||
<h1>{{ customData.title }}</h1>
|
||||
<div class="button-group" v-if="customData.btnDisplay === true">
|
||||
<button @click="handleAccept(status.agree, customData)" class="buttonAccept">
|
||||
{{ customData.buttonText1 }}
|
||||
</button>
|
||||
<button @click="handleAccept(status.refuse, customData)" class="buttonRefuse">
|
||||
{{ customData.buttonText2 }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pk" v-else>
|
||||
<h1>{{ customData.mytitle }}</h1>
|
||||
<div class="pk" @click="handleAccept(customData)">
|
||||
<image
|
||||
class="Custommessageimage"
|
||||
:src="customData.link"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<!-- ``````````````````````````````````````````````````````````````````````````````````````````````````````````````` -->
|
||||
@@ -104,27 +96,22 @@ import TUIChatEngine, {
|
||||
import { useCounterStore } from "@/stores/counter";
|
||||
import request from "@/components/request";
|
||||
import { Message } from "@tencentcloud/chat";
|
||||
import TencentCloudChat from "@tencentcloud/chat";
|
||||
// import message from '@tencentcloud/chat-uikit-uniapp/locales/en/message';
|
||||
const counter = useCounterStore();
|
||||
|
||||
const status = { agree: 1, refuse: 2 };
|
||||
|
||||
interface Props {
|
||||
messageItem: IMessageModel;
|
||||
content: any;
|
||||
}
|
||||
//```````````````````````````````````````````````````
|
||||
//```````````````````````````````````````````````````标记
|
||||
|
||||
|
||||
function handleAccept(status: number, customData: ICustomMessagePayload) {
|
||||
console.log(custom.value);
|
||||
console.log(message.value);
|
||||
message.value.payload.title = "Hello Tencent";
|
||||
TUIChatService.modifyMessage(message.value).then((res) => {
|
||||
console.log(res);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
function handleAccept(customData: ICustomMessagePayload) {
|
||||
const customDatainfo = JSON.stringify(customData);
|
||||
uni.redirectTo({
|
||||
url: `/pages/PKMessageprocessing/PKMessageprocessing?customData=${customDatainfo}`,
|
||||
});
|
||||
}
|
||||
//```````````````````````````````````````````````````
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -226,7 +213,7 @@ a {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
background-color: #f5f5f5;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
@@ -270,4 +257,8 @@ a {
|
||||
}
|
||||
//``````````````````````````````````````````````````````````````````````````````````
|
||||
}
|
||||
.Custommessageimage{
|
||||
width: 385rpx;
|
||||
height: 195rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user