mirror of
https://github.com/Dichgrem/Vue.git
synced 2026-02-05 10:31:57 -05:00
fix:select
This commit is contained in:
@@ -109,6 +109,11 @@ export default {
|
||||
const { error, msg } = response.data;
|
||||
if (error === 0) {
|
||||
showSuccessToast("操作成功");
|
||||
if (payload.isApplay === false) {
|
||||
that.data.applyStatus = 0; // Simulate status change to 'not applied'
|
||||
} else {
|
||||
that.data.applyStatus = 1; // Simulate status change to 'under review'
|
||||
}
|
||||
that.fetchDetails();
|
||||
} else {
|
||||
showFailToast(msg || "网络错误,请稍后重试");
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<div class="dataItem">
|
||||
<p class="dataItem-score">{{ totalScore }}</p>
|
||||
<p class="dataItem-label">服务总积分</p>
|
||||
<p class="dataItem-label">{{ scoreLabel }}</p>
|
||||
</div>
|
||||
<div class="dataItem">
|
||||
<p class="dataItem-score">{{ grandeRank }}</p>
|
||||
@@ -64,6 +64,11 @@ export default {
|
||||
grandeRank: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
scoreLabel() {
|
||||
return this.curTab === 0 ? '服务总积分' : '服务年度积分';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabClick(value) {
|
||||
this.curTab = Number(value);
|
||||
@@ -171,6 +176,10 @@ export default {
|
||||
color: #333; /* ⭐ 内容区统一深色 */
|
||||
}
|
||||
|
||||
.rank-hd {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.rank-title {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
@@ -182,6 +191,22 @@ export default {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.rank-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 auto; /* Centering the list */
|
||||
width: 100%;
|
||||
max-width: 300px; /* Constrain width */
|
||||
}
|
||||
|
||||
.rank-list li {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.rank-idx {
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
<div class="list">
|
||||
<van-list
|
||||
v-model:loading="loading"
|
||||
:finished="finished"
|
||||
:finished="true"
|
||||
finished-text="没有更多了"
|
||||
@load="onLoad"
|
||||
>
|
||||
<ActItem
|
||||
v-for="item in actList"
|
||||
:key="item.id"
|
||||
:data="item"
|
||||
:isMyApply="true"
|
||||
@goDetails="goDetails"
|
||||
/>
|
||||
</van-list>
|
||||
@@ -44,58 +44,42 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
curTab: 0,
|
||||
actList: [],
|
||||
allActList: [],
|
||||
loading: false,
|
||||
finished: false,
|
||||
currentPage: 1,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
actList() {
|
||||
if (this.curTab === 0) {
|
||||
return this.allActList;
|
||||
}
|
||||
return this.allActList.filter(item => item.applyStatus === this.curTab);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabClick(value) {
|
||||
this.curTab = value;
|
||||
this.currentPage = 1;
|
||||
this.fetchApplyList(1);
|
||||
},
|
||||
fetchApplyList(currentPage = 1) {
|
||||
const that = this;
|
||||
const payload = {
|
||||
currentPage,
|
||||
pageSize: 10,
|
||||
type: this.curTab,
|
||||
};
|
||||
|
||||
fetchApplyList() {
|
||||
this.loading = true;
|
||||
axios
|
||||
.get("/api/myApplyList", { params: payload })
|
||||
.then(function (response) {
|
||||
.get("/api/myApplyList")
|
||||
.then((response) => {
|
||||
const { error, data = {} } = response.data;
|
||||
if (error === 0) {
|
||||
const currentPage = data.current;
|
||||
const list = data.list;
|
||||
|
||||
if (currentPage === 1) {
|
||||
that.actList = list;
|
||||
} else {
|
||||
that.actList.push(...list);
|
||||
}
|
||||
|
||||
that.currentPage = currentPage;
|
||||
that.finished = data.pageCount === currentPage;
|
||||
this.allActList = data.list || [];
|
||||
}
|
||||
})
|
||||
.finally(function () {
|
||||
that.loading = false;
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
onLoad() {
|
||||
this.fetchApplyList(this.currentPage + 1);
|
||||
},
|
||||
goDetails(id) {
|
||||
this.$router.push("/actDetails?id=" + id);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetchApplyList(1);
|
||||
this.fetchApplyList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user