|
@@ -2,11 +2,43 @@
|
|
|
<mobile-frame>
|
|
|
<view class="info">
|
|
|
<view class="one">
|
|
|
+ <view class="one_1">
|
|
|
+ <text>评论商品</text>
|
|
|
+ </view>
|
|
|
+ <view class="one_2">
|
|
|
+ <view class="list" v-for="(item,index) in goodsList" :key="index">
|
|
|
+ <view class="list_1">
|
|
|
+ <image class="image"
|
|
|
+ :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
+ <view class="list_2">
|
|
|
+ <view class="name">
|
|
|
+ {{item.goods_name}}
|
|
|
+ </view>
|
|
|
+ <view class="other_1">
|
|
|
+ <text>规格:</text>
|
|
|
+ <text>{{item.name}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="other_1">
|
|
|
+ <text>金额:</text>
|
|
|
+ <text class="money">¥{{info.type=='0'?item.sell_money:item.group_config.money}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="other_1">
|
|
|
+ <text>数量:</text>
|
|
|
+ <text>×{{item.buy_num}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="two">
|
|
|
<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>
|
|
|
+ <view>{{form.goods_name||'请选择评论商品'}}</view>
|
|
|
</picker>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="评论内容" name="content">
|
|
@@ -77,7 +109,6 @@
|
|
|
onLoad: function(e) {
|
|
|
const that = this;
|
|
|
that.$set(that, `id`, e.id || '');
|
|
|
- that.$set(that, `rate_id`, e.rate_id || '');
|
|
|
// 监听用户是否登录
|
|
|
that.watchLogin();
|
|
|
},
|
|
@@ -113,22 +144,25 @@
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
}
|
|
|
- if (that.rate_id) {
|
|
|
- res = await that.$api(`/goodsRate/${that.rate_id}`);
|
|
|
+ },
|
|
|
+ async goodsChange(e) {
|
|
|
+ const that = this;
|
|
|
+ let data = that.goodsList[e.detail.value];
|
|
|
+ if (data) that.$set(that, `goodsList`, [data])
|
|
|
+ if (data.rate) {
|
|
|
+ that.$set(that, `rate_id`, data.rate);
|
|
|
+ let res = await that.$api(`/goodsRate/${data.rate}`);
|
|
|
if (res.errcode == '0') {
|
|
|
that.$set(that, `form`, res.data);
|
|
|
+ that.$set(that.form, `goods_name`, data.goods_name);
|
|
|
that.$set(that, `readonly`, true)
|
|
|
}
|
|
|
+ } else {
|
|
|
+ that.$set(that.form, `goods`, data.goods._id);
|
|
|
+ that.$set(that.form, `goods_name`, data.goods_name);
|
|
|
+ that.$set(that.form, `goodsSpec`, data._id);
|
|
|
}
|
|
|
},
|
|
|
- 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;
|
|
@@ -178,6 +212,7 @@
|
|
|
params.reply = reply;
|
|
|
params.customer = that.user?._id;
|
|
|
params.shop = that.info?.goods[0]?.shop;
|
|
|
+ params.goodsSpec = that.form.goodsSpec;
|
|
|
const arr = await that.$api(`/goodsRate`, 'POST', params);
|
|
|
if (arr.errcode == '0') {
|
|
|
uni.showToast({
|
|
@@ -208,9 +243,78 @@
|
|
|
height: 100vh;
|
|
|
|
|
|
.one {
|
|
|
+ margin: 2vw;
|
|
|
+ border: 1px solid #f1f1f1;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 2vw;
|
|
|
+
|
|
|
+ .one_1 {
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .one_2 {
|
|
|
+ .list {
|
|
|
+ display: flex;
|
|
|
+ background-color: #f1f1f1;
|
|
|
+ padding: 2vw;
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+ border-radius: 5px;
|
|
|
+
|
|
|
+ .list_1 {
|
|
|
+ width: 22vw;
|
|
|
+ height: 22vw;
|
|
|
+ border-radius: 5px;
|
|
|
+
|
|
|
+ .image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list_2 {
|
|
|
+ width: 63vw;
|
|
|
+ padding: 0 0 0 2vw;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 0 0 0.5vw 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .other_1 {
|
|
|
+ .money {
|
|
|
+ color: #ff0000 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #858585;
|
|
|
+ }
|
|
|
+
|
|
|
+ text:last-child {
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list:last-child {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .two {
|
|
|
padding: 2vw;
|
|
|
|
|
|
.picker {
|
|
|
+ width: 100%;
|
|
|
border: 1px solid #3333;
|
|
|
border-radius: 5px;
|
|
|
padding: 2vw;
|