|
@@ -3,6 +3,12 @@
|
|
|
<view class="info">
|
|
|
<view class="one">
|
|
|
<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
|
|
|
+ <uni-forms-item label="评论商品" name="goods">
|
|
|
+ <picker class="picker" mode="selector" :range="goodsList" @change="goodsChange"
|
|
|
+ range-key="goods_name">
|
|
|
+ <view>{{form.goods_name||'请选择退款商品'}}</view>
|
|
|
+ </picker>
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="评论内容" name="content">
|
|
|
<uni-easyinput maxlength=-1 type="textarea" v-model="form.content" placeholder="请输入评论内容" />
|
|
|
</uni-forms-item>
|
|
@@ -43,6 +49,8 @@
|
|
|
form: {},
|
|
|
info: {},
|
|
|
file: [],
|
|
|
+ // 商品
|
|
|
+ goodsList: [],
|
|
|
rules: {
|
|
|
content: {
|
|
|
rules: [{
|
|
@@ -55,7 +63,13 @@
|
|
|
required: true,
|
|
|
errorMessage: '请输入评论等级',
|
|
|
}]
|
|
|
- }
|
|
|
+ },
|
|
|
+ goods: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请选择评论商品',
|
|
|
+ }]
|
|
|
+ },
|
|
|
},
|
|
|
readonly: false,
|
|
|
};
|
|
@@ -94,6 +108,8 @@
|
|
|
res = await that.$api(`/orderDetail/${that.id}`);
|
|
|
if (res.errcode == '0') {
|
|
|
that.$set(that, `info`, res.data.order);
|
|
|
+ for (let val of res.data.goods) val.goods_name = val.goods.name
|
|
|
+ that.$set(that, `goodsList`, res.data.goods);
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
}
|
|
@@ -105,6 +121,14 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ goodsChange(e) {
|
|
|
+ const that = this;
|
|
|
+ let data = that.goodsList[e.detail.value];
|
|
|
+ console.log(data);
|
|
|
+ that.$set(that.form, `goods`, data.goods._id);
|
|
|
+ that.$set(that.form, `goods_name`, data.goods_name);
|
|
|
+ that.$set(that.form, `goodsSpec`, data._id);
|
|
|
+ },
|
|
|
// 图片上传
|
|
|
uplSuc(e) {
|
|
|
const that = this;
|
|
@@ -154,8 +178,6 @@
|
|
|
params.reply = reply;
|
|
|
params.customer = that.user?._id;
|
|
|
params.shop = that.info?.goods[0]?.shop;
|
|
|
- params.goods = that.info?.goods[0]?.goods[0]?.goods?._id;
|
|
|
- params.goodsSpec = that.info?.goods[0]?.goods[0]?._id;
|
|
|
const arr = await that.$api(`/goodsRate`, 'POST', params);
|
|
|
if (arr.errcode == '0') {
|
|
|
uni.showToast({
|
|
@@ -188,6 +210,12 @@
|
|
|
.one {
|
|
|
padding: 2vw;
|
|
|
|
|
|
+ .picker {
|
|
|
+ border: 1px solid #3333;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 2vw;
|
|
|
+ }
|
|
|
+
|
|
|
.uni-input {
|
|
|
border: #f1f1ff 1px solid;
|
|
|
padding: 2vw 2vw;
|