order 7.25
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="comment">
|
||||
<view class="label-list">
|
||||
<view v-for="(label, index) in 5" :key="index" :class="{'active': current == index}" @click="current=index">{{ '全部(' + label * 389 + '}' }}</view>
|
||||
<view v-for="(label, index) in evaluateSpec" :key="index" :class="{'active': current == index}" @click="current=index">{{ index + '(' + label + '}' }}</view>
|
||||
</view>
|
||||
<view class="comment-container">
|
||||
<view v-for="(item, index) in evalueList" :key="index" class="itme">
|
||||
@@ -16,23 +16,44 @@ import comment from "@/components/comment/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
id: Number,
|
||||
current: '全部',
|
||||
page: 0,
|
||||
evalueList: [],
|
||||
evaluateSpec: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
comment
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getAllEvalue(option.id);
|
||||
this.id = option.id;
|
||||
// this.getAllEvalue();
|
||||
this.getEvaluateSpec();
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.getAllEvalue(value);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAllEvalue(id) {
|
||||
this.$u.api.getAllEvalue({
|
||||
goods_id: id,
|
||||
page: this.page
|
||||
getEvaluateSpec() {
|
||||
this.$u.api.getEvaluateSpec({
|
||||
id: this.id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.evaluateSpec = res.data;
|
||||
this.getAllEvalue();
|
||||
}
|
||||
})
|
||||
},
|
||||
getAllEvalue(type) {
|
||||
let params = {
|
||||
goods_id: this.id,
|
||||
page: this.page,
|
||||
}
|
||||
if(type) Object.assign(params, { type: type });
|
||||
this.$u.api.getAllEvalue(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.evalueList = res.data;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user