优化代码

This commit is contained in:
pengxiaolong
2025-08-05 22:05:56 +08:00
parent 3eddd94922
commit 40c3282515
86 changed files with 1700 additions and 399 deletions

View File

@@ -50,7 +50,7 @@
</view>
<view class="nation">{{ item.country }}</view>
</view>
<view class="Time">PK时间:{{ formatDate(item.pkTime) }}</view>
<view class="Time">PK时间北京时间:{{ formatDate(item.pkTime) }}</view>
<view class="SessionAndGoldCoin">
<view class="goldCoin">
<image
@@ -82,12 +82,12 @@
</scroll-view>
</view>
<view class="buttonflex">
<view class="button" v-if="item.senderId !== id">
<button class="accept" @click="openChat()">聊了个天</button>
<button class="reject" @click="open()">立即邀请</button>
<view class="button" v-if="item.senderId !== id">
<button class="accept" @click="openChat()">聊了个天</button>
<button class="reject" @click="open()">立即邀请</button>
</view>
</view>
</view>
</view>
</view>
<!-- 弹窗 -->
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
@@ -119,7 +119,7 @@
mode="scaleToFill"
/>
</view>
<view>{{ TimeFormatting(item.pkTime*1000) }}</view>
<view>{{ TimeFormatting(item.pkTime * 1000) }}</view>
<view class="goldimg">
<image
style="width: 31.49rpx; height: 31.49rpx; margin-top: 4rpx"
@@ -163,6 +163,7 @@ import formatDate from "../../components/formatDate.js";
import TimeFormatting from "../../components/TimeFormatting.js";
import NewAddedPk from "../../pages/NewAddedPk/NewAddedPk.vue";
import request from "../../components/request.js";
import VerifyLogin from "../../components/VerifyLogin.js";
export default {
data() {
return {
@@ -179,15 +180,19 @@ export default {
};
},
onShareAppMessage(res) {
if (res.from === 'menu') {
if (res.from === "menu") {
return {
title: '分享',
path: `${getCurrentPages()[getCurrentPages().length - 1].route}?inid=${this.item.id}`,
}
title: "分享",
path: `${getCurrentPages()[getCurrentPages().length - 1].route}?inid=${
this.item.id
}`,
};
}
},
onLoad(options) {
this.inid = options.inid;
console.log(this.inid);
if (this.inid) {
this.GetonShareAppMessagedata();
}
@@ -203,7 +208,7 @@ export default {
data: {
id: data.item.senderId,
},
userInfo: true,
userInfo: false,
}).then((res) => {
if (res.code === 200) {
this.chatPartnerinfo = res.data;
@@ -227,7 +232,7 @@ export default {
methods: {
//分享直接获取数据
GetonShareAppMessagedata() {
request({
request({
url: "pk/pkInfoDetail",
method: "POST",
data: {
@@ -247,7 +252,6 @@ export default {
});
}
});
},
//修改信息
// onRecompose(item) {
@@ -272,14 +276,16 @@ export default {
delta: 1,
fail: () => {
uni.reLaunch({
url: '/pages/Home/Home',
url: "/pages/Home/Home",
});
}
},
});
},
open() {
this.$refs.popup.open("center");
this.userlist();
VerifyLogin(this.item.id).then((res) => {
this.$refs.popup.open("center");
this.userlist();
});
},
invite() {
if (this.InvitingPartyEventindex === null) {
@@ -292,12 +298,12 @@ export default {
}
this.$refs.popups.open("center");
},
closeHint(){
closeHint() {
this.$refs.popups.close();
},
inviteHint(){
inviteHint() {
this.$refs.popups.close();
// 发送邀请消息
// 发送邀请消息
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
const youritem = JSON.stringify(this.item);
uni.redirectTo({
@@ -309,8 +315,10 @@ export default {
this.$refs.popup.close();
},
openChat() {
wx.navigateTo({
url: `/pages/index/chat/chat?userId=${this.chatPartnerinfo.id}&nickname=${this.chatPartnerinfo.nickName}&avatar=${this.chatPartnerinfo.headerIcon}`,
VerifyLogin(this.item.id).then((res) => {
wx.navigateTo({
url: `/pages/index/chat/chat?userId=${this.chatPartnerinfo.id}&nickname=${this.chatPartnerinfo.nickName}&avatar=${this.chatPartnerinfo.headerIcon}`,
});
});
},
@@ -371,7 +379,7 @@ export default {
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
background-position: center;
}
.popup-Hintcontent{
.popup-Hintcontent {
width: 600rpx;
height: 500rpx;
background-repeat: no-repeat;
@@ -433,7 +441,7 @@ export default {
font-weight: bold;
margin-bottom: 30rpx;
}
.popup-texts{
.popup-texts {
margin-left: 50rpx;
color: #7e7e7e;
font-size: 26rpx;
@@ -670,7 +678,7 @@ export default {
margin-top: 60rpx;
width: 90%;
}
.Remarkscroll{
.Remarkscroll {
width: 100%;
height: 300rpx;
}
@@ -680,14 +688,14 @@ export default {
color: transparent;
display: none;
}
.Remarkscss{
.Remarkscss {
padding: 20rpx;
word-break: break-all; /* 强制换行 */
white-space: pre-line; /* 保留空白符并换行 */
width: 100%;
font-size: 28rpx;
}
.buttonflex{
.buttonflex {
position: fixed;
left: 0;
right: 0;