优化页面

This commit is contained in:
pengxiaolong
2025-06-09 19:18:38 +08:00
parent d30589fd05
commit c5042d08c3
811 changed files with 2799 additions and 503 deletions

View File

@@ -134,10 +134,12 @@
</view>
</view>
<view class="button">
<view class="button" v-if="PkIDInfodata.pkStatus === 0">
<button class="accept" @click="operation(1)">接受邀请</button>
<button class="reject" @click="operation(2)">拒绝邀请</button>
</view>
<view v-if="PkIDInfodata.pkStatus === 1" class="button buttontext">已接受邀请</view>
<view v-if="PkIDInfodata.pkStatus === 2" class="button buttontext">已拒绝邀请</view>
</view>
</view>
</template>
@@ -151,14 +153,30 @@ export default {
customData: {},
SenderData: {},
ReceiverData: {},
PkIDInfodata: {},
};
},
onLoad(options) {
this.customData = JSON.parse(options.customData);
this.getPkyourInfo();
this.getPkmineInfo();
this.getPkIDInfo();
},
methods: {
//根据当前消息ID查询pk信息
async getPkIDInfo() {
const res = await request({
url: "pk/singleRecord",
method: "POST",
data: {
id: this.customData.id,
},
userInfo: true
}).then((res) => {
this.PkIDInfodata = res.data;
console.log(this.PkIDInfodata);
});
},
//发布者
async getPkyourInfo() {
const res = await request({
@@ -167,7 +185,7 @@ export default {
data: {
id: this.customData.pkIdA,
},
userInfo: false,
userInfo: true,
}).then((res) => {
this.SenderData = res.data;
console.log(this.SenderData);
@@ -181,7 +199,7 @@ export default {
data: {
id: this.customData.pkIdB,
},
userInfo: false,
userInfo: true,
}).then((res) => {
this.ReceiverData = res.data;
console.log(this.ReceiverData);
@@ -202,19 +220,15 @@ export default {
url: "pk/updatePkStatus",
method: "POST",
data: {
pkIdA: this.customData.pkIdA,
pkIdB: this.customData.pkIdB,
userIdA: this.customData.userIdA,
userIdB: this.customData.userIdB,
pkTime: this.customData.pkTime,
pkNumber: this.customData.pkNumber,
id: this.customData.id,
pkStatus: status,
},
userInfo: false,
userInfo: true,
}).then((res) => {
console.log(res.data);
const Hinttext = status === 1 ? "接受邀请成功" : "拒绝邀请成功";
if (res.code === 200) {
this.getPkIDInfo()
wx.showToast({
title: Hinttext,
icon: "success",
@@ -392,6 +406,12 @@ export default {
align-items: center;
margin-top: 150rpx;
}
.buttontext{
font-size: 40rpx;
color: #666666;
font-weight: bold;
}
.accept {
width: 325.38rpx;
height: 77.29rpx;