|
@@ -9,14 +9,14 @@
|
|
|
<uni-forms-item label="上传评论图片" name="file">
|
|
|
<upload :list="file" name="file" :count="6" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item v-if="!rate_id" label="商品评分" name="goods_score">
|
|
|
- <uni-rate size="18" v-model="form.goods_score" />
|
|
|
+ <uni-forms-item label="商品评分" name="goods_score">
|
|
|
+ <uni-rate :readonly="readonly" size="18" v-model="form.goods_score" />
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item v-if="!rate_id" label="发货评分" name="transport_score">
|
|
|
- <uni-rate size="18" v-model="form.transport_score" />
|
|
|
+ <uni-forms-item label="发货评分" name="transport_score">
|
|
|
+ <uni-rate :readonly="readonly" size="18" v-model="form.transport_score" />
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item v-if="!rate_id" label="店铺评分" name="shop_score">
|
|
|
- <uni-rate size="18" v-model="form.shop_score" />
|
|
|
+ <uni-forms-item label="店铺评分" name="shop_score">
|
|
|
+ <uni-rate :readonly="readonly" size="18" v-model="form.shop_score" />
|
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
|
<view class="btn">
|
|
@@ -57,6 +57,7 @@
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
+ readonly: false,
|
|
|
};
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
@@ -84,30 +85,27 @@
|
|
|
const that = this;
|
|
|
that.$refs[ref].validate().then(async params => {
|
|
|
if (that.rate_id) {
|
|
|
- let res = await that.$api(`/goodsRate/${that.rate_id}`);
|
|
|
- if (res.errcode == '0') {
|
|
|
- let reply = res.data;
|
|
|
- let obj = {
|
|
|
- file: that.file,
|
|
|
- content: params.content,
|
|
|
- time: moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
- }
|
|
|
- reply.reply.push(obj)
|
|
|
- const arr = await that.$api(`/goodsRate/${that.rate_id}`, 'POST', reply)
|
|
|
- if (arr.errcode == '0') {
|
|
|
- uni.showToast({
|
|
|
- title: `追加成功`,
|
|
|
- icon: 'success',
|
|
|
- });
|
|
|
- uni.navigateBack({
|
|
|
- detail: 1
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: arr.errmsg,
|
|
|
- icon: 'none',
|
|
|
- })
|
|
|
- }
|
|
|
+ let reply = that.form;
|
|
|
+ let obj = {
|
|
|
+ file: that.file,
|
|
|
+ content: params.content,
|
|
|
+ time: moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+ reply.reply.push(obj)
|
|
|
+ const arr = await that.$api(`/goodsRate/${that.rate_id}`, 'POST', reply)
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ uni.showToast({
|
|
|
+ title: `追加成功`,
|
|
|
+ icon: 'success',
|
|
|
+ });
|
|
|
+ uni.navigateBack({
|
|
|
+ detail: 1
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: arr.errmsg,
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
let reply = [{
|
|
@@ -160,13 +158,21 @@
|
|
|
async search() {
|
|
|
const that = this;
|
|
|
let user = that.user;
|
|
|
+ let res;
|
|
|
if (that.id) {
|
|
|
- let res = await that.$api(`/orderDetail/${that.id}`);
|
|
|
+ res = await that.$api(`/orderDetail/${that.id}`);
|
|
|
if (res.errcode == '0') {
|
|
|
that.$set(that, `info`, res.data.order);
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
}
|
|
|
+ if (that.rate_id) {
|
|
|
+ res = await that.$api(`/goodsRate/${that.rate_id}`);
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `form`, res.data);
|
|
|
+ that.$set(that, `readonly`, true)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
}
|