优化页面

This commit is contained in:
pengxiaolong
2025-05-27 13:06:24 +08:00
parent 728dfd501f
commit cf8728f0d7
29 changed files with 357 additions and 137 deletions

View File

@@ -37,22 +37,37 @@
<!-- 弹窗 -->
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
<view class="popup-content">
<view class="popup-title">您确定要邀请主播PK吗</view>
<view class="popup-title">
<scroll-view scroll-y="true" class="scroll">
<!-- <uni-card v-for="(item, index) in list"> -->
<view class="card" v-for="(item, index) in list">
<view class="card-content">
</view>
</view>
<!-- `````````````` -->
</scroll-view>
</view>
<view class="popup-btn">
<button class="invite" type="primary" @click="invite()">邀请</button>
<button class="cancel" type="default" @click="close()">取消</button>
</view>
</view>
</uni-popup>
<NewAddedPk class="createModule" ref="createModule"></NewAddedPk>
</template>
<script>
import formatDate from "../../components/formatDate.js";
import VerifyLogin from "../../components/VerifyLogin.js";
import NewAddedPk from "../../pages/NewAddedPk/NewAddedPk.vue";
import request from "../../components/request.js";
export default {
data() {
return {
item: {},
id: 0,
list: [],
};
},
onLoad(options) {
@@ -63,7 +78,13 @@ export default {
this.item = data.item; // 将接收到的数据赋值给item
console.log("接收到的数据:", this.item);
});
uni.getStorage({
key: "userinfo",
success: (res) => {
this.id = res.data.id;
},
});
},
methods: {
formatDate: formatDate,
@@ -74,6 +95,7 @@ export default {
},
open() {
this.$refs.popup.open("center");
this.userlist()
},
invite() {
// 发送邀请消息
@@ -91,7 +113,46 @@ export default {
});
});
},
async userlist() {
uni.showLoading({
title: "加载中...",
mask: true,
});
const res = await request({
url: "pk/queryMyPkData",
method: "POST",
data: {
userId: this.id,
},
userInfo: true,
});
if (res.code === 200) {
if(res.data.length !== 0){
uni.hideLoading();
console.log("res.data",res.data);
this.list = res.data;
}else{
uni.hideLoading();
this.openPopupQuantity()
}
} else {
uni.hideLoading();
uni.showToast({
title: "加载失败",
icon: "none",
duration: 2000,
});
}
},
openPopupQuantity() {
this.$refs.createModule.open();
},
},
components: {
NewAddedPk
}
};
</script>
@@ -135,7 +196,7 @@ export default {
}
.popup-content {
width: 500rpx;
height: 300rpx;
height: 700rpx;
background-color: #fff;
border-radius: 10px;
display: flex;
@@ -169,4 +230,31 @@ export default {
margin-left: 30rpx;
border-radius: 20rpx;
}
.scroll {
width: 470rpx;
height: 500rpx;
border: 1px solid #afafaf;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.card {
margin-top: 10rpx;
margin-left: 10rpx;
}
.card-content {
width: 445rpx;
height: 70rpx;
border: 1px solid #afafaf;
border-radius: 10px;
}
.createModule{
position: fixed;
bottom: 0;
right: 0;
z-index: 998;
width: 100vw;
}
</style>