优化页面

This commit is contained in:
pengxiaolong
2025-06-18 16:01:55 +08:00
parent e464d99af5
commit ec9dcb486f
122 changed files with 349 additions and 251 deletions

View File

@@ -100,6 +100,7 @@
</view>
</view>
<Recompose ref="createModule" class="createModule" :message="parentMessage" @Refresh="onRefresherRefresh"></Recompose>
<!-- 置顶弹窗 -->
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
<view class="popup-container">
<view class="popup-title">选择置顶时长</view>
@@ -114,6 +115,28 @@
</view>
</view>
</uni-popup>
<!-- 取消置顶弹窗 -->
<uni-popup ref="popupOut" type="center" border-radius="10px 10px 0 0">
<view class="popup-container-out">
<view class="popup-title">您确定要取消置顶吗</view>
<view class="popup-text"> 取消置顶后该用户将不再享有置顶特权但仍可继续参与 PK 挑战若置顶时长不足 1 小时系统将按 1 小时计算积分扣除并于取消后按实际使用时长比例返还剩余积分是否确认执行此操作</view>
<view class="popup-btn">
<view class="uni-primary" @click="onOutTopConfirm">确定</view>
<view class="uni-default" @click="closePopupOut">取消</view>
</view>
</view>
</uni-popup>
<!-- 删除弹窗 -->
<uni-popup ref="popupExpurgate" type="center" border-radius="10px 10px 0 0">
<view class="popup-container-expurgate">
<view class="popup-title">您确定要删除该PK吗</view>
<view class="popup-text"> 删除后该用户将无法再参与该 PK 挑战是否确认执行此操作</view>
<view class="popup-btn">
<view class="uni-primary" @click="onExpurgateConfirm">确定</view>
<view class="uni-default" @click="closePopupExpurgate">取消</view>
</view>
</view>
</uni-popup>
</template>
<script>
@@ -134,7 +157,9 @@ export default {
pickerArray: [],
index:0,
topPinnedPersondata:{},
Topdate:0
Topdate:0,
popupOutdata:{},
popupExpurgatedata:{},
};
},
onLoad() {
@@ -142,7 +167,6 @@ export default {
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
console.log(this.userinfo);
this.getpkList();
},
});
@@ -185,7 +209,6 @@ export default {
}).then((res) => {
if (res.code == 200) {
this.pkList.push(...res.data);
console.log(this.pkList);
this.triggered = false;
} else {
console.log(res.msg);
@@ -218,7 +241,6 @@ export default {
}else{
this.Topdate = this.topPinnedPersondata.pkTime
}
console.log(this.Topdate,this.topPinnedPersondata.id);
request({
url: "user/pinToTop",
@@ -232,7 +254,7 @@ export default {
if (res.code == 200) {
this.onRefresherRefresh();
uni.showToast({
title:res.msg,
title:res.data,
icon: "none",
duration: 3000,
});
@@ -248,16 +270,22 @@ export default {
},
//取消置顶
onOutTop(item) {
this.$refs.popupOut.open("center");
this.popupOutdata = item
},
// 确认取消置顶
onOutTopConfirm() {
request({
url: "user/cancelPin",
method: "POST",
data: {
articleId: item.id,
articleId: this.popupOutdata.id,
},
userInfo: true,
}).then((res) => {
if (res.code == 200) {
this.onRefresherRefresh();
this.closePopupOut();
this.onRefresherRefresh()
uni.showToast({
title: res.data,
icon: "none",
@@ -268,28 +296,49 @@ export default {
}
});
},
// 取消取消置顶
closePopupOut() {
this.$refs.popupOut.close();
this.popupOutdata = {}
},
// 删除pk
onExpurgate(item) {
this.$refs.popupExpurgate.open("center");
this.popupExpurgatedata = item
},
// 确认删除pk
onExpurgateConfirm() {
const res = request({
url: "pk/deletePkDataWithId",
method: "POST",
data: {
id: item.id,
id: this.popupExpurgatedata.id,
},
userInfo: true,
}).then((res) => {
if (res.code == 200) {
this.onRefresherRefresh();
this.closePopupExpurgate();
uni.showToast({
title: "删除成功",
title: res.msg,
icon: "none",
duration: 2000,
});
} else {
console.log(res.msg);
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
}
});
},
// 关闭删除弹窗
closePopupExpurgate() {
this.$refs.popupExpurgate.close();
this.popupExpurgatedata = {}
},
//
},
components: {
Recompose,
@@ -462,12 +511,37 @@ export default {
flex-direction: column;
align-items: center;
}
.popup-container-out{
width: 500rpx;
height: 400rpx;
background-color: #ffffff;
border-radius: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx;
}
.popup-container-expurgate{
width: 500rpx;
height: 300rpx;
background-color: #ffffff;
border-radius: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx;
}
.popup-title{
font-size: 30rpx;
color: #161616;
font-weight: bold;
margin-top: 30rpx;
}
.popup-text{
font-size: 25rpx;
color: #959595;
margin-top: 30rpx;
}
.popup-picker{
margin-top: 30rpx;
width: 400rpx;