优化页面

This commit is contained in:
pengxiaolong
2025-06-20 21:55:09 +08:00
parent 2afc95d531
commit acc81963e9
405 changed files with 1362 additions and 1284 deletions

View File

@@ -135,14 +135,34 @@
</view>
<!-- 邀请信息 -->
<view class="button" v-if="PkIDInfodata.pkStatus === 0 && ReceiverData.senderId !== id">
<button class="accept" @click="operation(1)">接受邀请</button>
<button class="reject" @click="operation(2)">拒绝邀请</button>
<button class="accept" @click="AcceptHint()">接受邀请</button>
<button class="reject" @click="RefuseHint()">拒绝邀请</button>
</view>
<view v-if="ReceiverData.senderId === id && PkIDInfodata.pkStatus === 0" class="button buttontext">等待对方接受邀请</view>
<view v-if="PkIDInfodata.pkStatus === 1" class="button buttontext">已接受邀请</view>
<view v-if="PkIDInfodata.pkStatus === 2" class="button buttontext">已拒绝邀请</view>
</view>
</view>
<uni-popup ref="popups" type="center" border-radius="10px 10px 0 0">
<view class="popup-Hintcontent">
<view class="popup-text">提示</view>
<view class="popup-texts">邀请成功后的pk不可修改不可删除请谨慎操作</view>
<view class="popup-btn">
<button class="invite" type="primary" @click="operation(1)">确认</button>
<button class="cancel" type="default" @click="closeHint()">取消</button>
</view>
</view>
</uni-popup>
<uni-popup ref="Refusepopup" type="center" border-radius="10px 10px 0 0">
<view class="popup-Hintcontent">
<view class="popup-text">提示</view>
<view class="popup-texts">您确定要拒绝该邀请吗</view>
<view class="popup-btn">
<button class="invite" type="primary" @click="operation(2)">确认</button>
<button class="cancel" type="default" @click="RefuseHintcloseHint()">取消</button>
</view>
</view>
</uni-popup>
</template>
<script>
@@ -166,6 +186,7 @@ export default {
},
});
this.customData = JSON.parse(options.customData);
console.log("customData", this.customData);
this.getPkyourInfo();
this.getPkmineInfo();
this.getPkIDInfo();
@@ -194,6 +215,7 @@ export default {
},
userInfo: true,
}).then((res) => {
console.log(res.data);
this.SenderData = res.data;
});
},
@@ -207,8 +229,8 @@ export default {
},
userInfo: true,
}).then((res) => {
console.log(res.data);
this.ReceiverData = res.data;
});
},
//返回上一页
@@ -218,6 +240,21 @@ export default {
});
},
formatDate: formatDate,
//接受邀请提示
AcceptHint(){
this.$refs.popups.open('center');
},
closeHint(){
this.$refs.popups.close();
},
//拒绝邀请提示
RefuseHint(){
this.$refs.Refusepopup.open('center');
},
RefuseHintcloseHint(){
this.$refs.Refusepopup.close();
},
//操作
async operation(status) {
const res = await request({
url: "pk/updatePkStatus",
@@ -231,6 +268,8 @@ export default {
const Hinttext = status === 1 ? "接受邀请成功" : "拒绝邀请成功";
if (res.code === 200) {
this.getPkIDInfo()
this.$refs.popups.close();
this.$refs.Refusepopup.close();
wx.showToast({
title: Hinttext,
icon: "success",
@@ -435,4 +474,57 @@ export default {
font-size: 28.63rpx;
line-height: 77.29rpx;
}
.popup-Hintcontent{
width: 600rpx;
height: 500rpx;
background-repeat: no-repeat;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
background-position: center;
}
.popup-text {
color: #161616;
font-size: 36.26rpx;
font-weight: bold;
margin-bottom: 30rpx;
}
.popup-texts{
margin-left: 50rpx;
color: #7e7e7e;
font-size: 26rpx;
margin-right: 50rpx;
margin-top: 70rpx;
margin-bottom: 70rpx;
}
.popup-btn {
display: flex;
justify-content: space-around;
margin-top: 50rpx;
}
.invite {
width: 225.19rpx;
height: 78.24rpx;
font-size: 28.63rpx;
line-height: 80rpx;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-bottom-right-radius: 50rpx;
background-image: linear-gradient(135deg, #4fcacd, #5fdbde);
}
.cancel {
width: 225.19rpx;
height: 78.24rpx;
font-size: 28.63rpx;
line-height: 80rpx;
margin-left: 30rpx;
color: #03aba8;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-bottom-right-radius: 50rpx;
border: 1rpx solid #03aba8;
}
</style>

View File

@@ -98,47 +98,48 @@
<view class="popup-title">
<view class="popup-text">点击选择您要参与的主播</view>
<view v-if="list.length !== 0">
<scroll-view show-scrollbar="false" scroll-y="true" class="scroll">
<view class="card" v-for="(item, index) in list" :key="index">
<view
class="card-content"
@click="Select(item.id, index)"
:style="{
background: selectedId === item.id ? '#b8ff8c74' : '#ffffff',
}"
>
<view class="Avatarimg">
<image class="avatar" :src="item.anchorIcon" mode="scaleToFill" />
</view>
<view class="NameMoney">
<view class="TimeMoney">
<view class="NameMoney_Name">{{ item.anchorId }}</view>
<scroll-view show-scrollbar="false" scroll-y="true" class="scroll">
<view class="card" v-for="(item, index) in list" :key="index">
<view
class="card-content"
@click="Select(item.id, index)"
:style="{
background: selectedId === item.id ? '#b8ff8c74' : '#ffffff',
}"
>
<view class="Avatarimg">
<image class="avatar" :src="item.anchorIcon" mode="scaleToFill" />
</view>
<view class="TimeMoney_Time">
<view class="pkTimeimg">
<image
style="width:31.49rpx; height:31.49rpx;margin-top:3rpx"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/time.png"
mode="scaleToFill"
/>
<view class="NameMoney">
<view class="TimeMoney">
<view class="NameMoney_Name">{{ item.anchorId }}</view>
</view>
<view>{{ TimeFormatting(item.pkTime) }}</view>
<view class="goldimg">
<image
style="width:31.49rpx; height:31.49rpx;margin-top:4rpx"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/species.png"
mode="scaleToFill"
/>
<view class="TimeMoney_Time">
<view class="pkTimeimg">
<image
style="width: 31.49rpx; height: 31.49rpx; margin-top: 3rpx"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/time.png"
mode="scaleToFill"
/>
</view>
<view>{{ TimeFormatting(item.pkTime) }}</view>
<view class="goldimg">
<image
style="width: 31.49rpx; height: 31.49rpx; margin-top: 4rpx"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/species.png"
mode="scaleToFill"
/>
</view>
<view class="goldnb">{{ item.coin }}K</view>
</view>
<view class="goldnb">{{ item.coin }}K</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="noData" v-if="list.length === 0">您还没有可参与的主播PK快去新建一个吧</view>
</scroll-view>
</view>
<view class="noData" v-if="list.length === 0"
>您还没有可参与的主播PK快去新建一个吧</view
>
</view>
<view class="popup-btn">
<button class="invite" type="primary" @click="invite()">邀请</button>
@@ -148,6 +149,16 @@
</uni-popup>
<NewAddedPk class="createModule" ref="createModule"></NewAddedPk>
<!-- <Recompose ref="createModule" class="createModule" :message="parentMessage"></Recompose> -->
<uni-popup ref="popups" type="center" border-radius="10px 10px 0 0">
<view class="popup-Hintcontent">
<view class="popup-text">提示</view>
<view class="popup-texts">邀请成功后的pk不可修改不可删除请谨慎操作</view>
<view class="popup-btn">
<button class="invite" type="primary" @click="inviteHint()">确认</button>
<button class="cancel" type="default" @click="closeHint()">取消</button>
</view>
</view>
</uni-popup>
</template>
<script>
@@ -228,22 +239,30 @@ export default {
this.userlist();
},
invite() {
// if (this.item.pkTime !== this.list[this.InvitingPartyEventindex].pkTime) {
// uni.showToast({
// icon: "none",
// title: "请保持时间一致",
// });
// return;
// }
// 发送邀请消息
if (this.InvitingPartyEventindex === null) {
uni.showToast({
title: "请选择您要参与的PK信息",
icon: "none",
duration: 2000,
});
return;
}
this.$refs.popups.open("center");
},
closeHint(){
this.$refs.popups.close();
},
inviteHint(){
this.$refs.popups.close();
// 发送邀请消息
const conversationID = `C2C${this.item.senderId}`;
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
const youritem = JSON.stringify(this.item);
uni.redirectTo({
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}&myitem=${myitem}&youritem=${youritem}`,
});
/////////
},
// 打开邀请弹窗
close() {
this.$refs.popup.close();
},
@@ -312,6 +331,18 @@ export default {
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
background-position: center;
}
.popup-Hintcontent{
width: 600rpx;
height: 500rpx;
background-repeat: no-repeat;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
background-position: center;
}
.popup-title {
font-size: 30rpx;
margin-top: 50rpx;
@@ -356,6 +387,14 @@ export default {
font-weight: bold;
margin-bottom: 30rpx;
}
.popup-texts{
margin-left: 50rpx;
color: #7e7e7e;
font-size: 26rpx;
margin-right: 50rpx;
margin-top: 70rpx;
margin-bottom: 70rpx;
}
.card-content {
/* width: 445rpx; */
width: 100%;
@@ -612,7 +651,7 @@ export default {
font-size: 28.63rpx;
line-height: 77.29rpx;
}
.noData{
.noData {
width: 500rpx;
height: 400rpx;
border-radius: 10px;