From 8f010c634cecb41a1e1ff0311b47f691132ff269 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Thu, 10 Sep 2020 09:17:54 +0800 Subject: [PATCH] view goods evaluation --- components/comment/index.vue | 2 +- pageB/comment/index.vue | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/components/comment/index.vue b/components/comment/index.vue index db75f4e..ebf8e69 100644 --- a/components/comment/index.vue +++ b/components/comment/index.vue @@ -37,7 +37,7 @@ export default { content: Object, reply: Boolean, }, - created() { + mounted() { if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two; }, methods: { diff --git a/pageB/comment/index.vue b/pageB/comment/index.vue index 915cdbe..e82b004 100644 --- a/pageB/comment/index.vue +++ b/pageB/comment/index.vue @@ -3,9 +3,9 @@ {{ index + '(' + label + ')' }} - + - + @@ -25,6 +25,7 @@ export default { evaluateSpec: {}, loadStatus: 'loadmore', timer: true, + isShow: false, } }, components: { @@ -50,7 +51,7 @@ export default { if(!this.timer) return false; this.loadStatus = "loading"; this.page++; - this.getAllEvalue({ type: this.current, load: 'more' }).then(length => { + this.getAllEvalue({ type: this.current, load: 'loadmore' }).then(length => { if(length == 0) { this.page--; this.loadStatus = 'nomore'; @@ -72,16 +73,22 @@ export default { } }) }, - async getAllEvalue({ type, load } = {}) { + async getAllEvalue({ type, load = 'reload' } = {}) { let params = { goods_id: this.id, page: this.page, } if(type) Object.assign(params, { type: type }); + this.isShow = false; const res = await this.$u.api.getAllEvalue(params); if (res.errCode == 0) { - if(load) this.evalueList.push(...res.data); - else this.evalueList = res.data; + if(load == 'loadmore') { + this.evalueList.push(...res.data); + this.isShow = true; + } else { + this.evalueList = res.data; + this.isShow = true; + } } else { this.evalueList = []; }