优化评价页面
This commit is contained in:
parent
617ef9d3c2
commit
2cadcf1be5
|
@ -8,17 +8,21 @@
|
||||||
@changeCate="changeAppraiseCate"
|
@changeCate="changeAppraiseCate"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="loadmore-box">
|
||||||
|
<app-load-more :hasMore="currentCate.more" @loadmore="loadAppraiseData" />
|
||||||
|
</view>
|
||||||
</app-layout>
|
</app-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AppLayout from "@/components/layout/layout";
|
import AppLayout from "@/components/layout/layout";
|
||||||
import AppAppraiseSection from "@/components/appraise/section";
|
import AppAppraiseSection from "@/components/appraise/section";
|
||||||
|
import AppLoadMore from "@/components/widgets/loadmore";
|
||||||
export default {
|
export default {
|
||||||
name: "member-appraise",
|
name: "member-appraise",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentAppraiseCateIndex: 0,
|
currentCate: {},
|
||||||
appraise: {
|
appraise: {
|
||||||
total: 0,
|
total: 0,
|
||||||
tags: [],
|
tags: [],
|
||||||
|
@ -29,6 +33,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
AppLayout,
|
AppLayout,
|
||||||
AppAppraiseSection,
|
AppAppraiseSection,
|
||||||
|
AppLoadMore,
|
||||||
},
|
},
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
// 评价
|
// 评价
|
||||||
|
@ -57,38 +62,36 @@ export default {
|
||||||
onReady() {},
|
onReady() {},
|
||||||
onHide() {},
|
onHide() {},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let currentCate = this.appraise.cate[this.currentAppraiseCateIndex];
|
this.loadAppraiseData();
|
||||||
if (currentCate.more) {
|
|
||||||
this.loadAppraiseData(currentCate);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 切换评价分类
|
* 切换评价分类
|
||||||
*/
|
*/
|
||||||
changeAppraiseCate(currentCate, index) {
|
changeAppraiseCate(currentCate) {
|
||||||
this.currentAppraiseCateIndex = index;
|
|
||||||
currentCate.list = [];
|
currentCate.list = [];
|
||||||
currentCate.more = true;
|
currentCate.more = true;
|
||||||
currentCate.page = 1;
|
currentCate.page = 1;
|
||||||
this.loadAppraiseData(currentCate);
|
this.currentCate = currentCate;
|
||||||
|
this.loadAppraiseData();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 加载评价数据
|
* 加载评价数据
|
||||||
*/
|
*/
|
||||||
loadAppraiseData(currentCate) {
|
loadAppraiseData() {
|
||||||
|
if (!this.currentCate.more) return;
|
||||||
this.$models.user.appraise
|
this.$models.user.appraise
|
||||||
.list({
|
.list({
|
||||||
status: currentCate.status,
|
status: this.currentCate.status,
|
||||||
page: currentCate.page,
|
page: this.currentCate.page,
|
||||||
})
|
})
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
currentCate.page++;
|
this.currentCate.page++;
|
||||||
currentCate.list = currentCate.list.concat(list);
|
this.currentCate.list = this.currentCate.list.concat(list);
|
||||||
} else {
|
} else {
|
||||||
currentCate.more = false;
|
this.currentCate.more = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -96,4 +99,8 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped>
|
||||||
|
.loadmore-box {
|
||||||
|
padding: 40rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue