|
@@ -38,14 +38,18 @@
|
|
<view class="other1"><text>{{item.reply[0].content||'暂无'}}</text></view>
|
|
<view class="other1"><text>{{item.reply[0].content||'暂无'}}</text></view>
|
|
<view class="other2">规格:{{item.goodsSpec.name}}</view>
|
|
<view class="other2">规格:{{item.goodsSpec.name}}</view>
|
|
<view class="other2" v-for="(itm, indexx) in item.reply" :key="indexx">
|
|
<view class="other2" v-for="(itm, indexx) in item.reply" :key="indexx">
|
|
- <view :class="[item.customer._id!=user._id?'reply_2':'reply']">
|
|
|
|
- <text>用户评论:{{itm.content||'暂无'}}</text>
|
|
|
|
- <text v-if="itm.reply">商家回复:{{itm.reply||'暂无'}}</text>
|
|
|
|
|
|
+ <view class="other2_1">
|
|
|
|
+ <view :class="[item.customer._id!=user._id?'reply_2':'reply']">
|
|
|
|
+ <text>用户评论:{{itm.content||'暂无'}}</text>
|
|
|
|
+ <text v-if="itm.reply">商家回复:{{itm.reply||'暂无'}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="item.customer._id==user._id" @tap="toReply(item,indexx)">回复</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="item.customer._id==user._id" @tap="toReply(item)">回复</view>
|
|
|
|
|
|
+ <uni-easyinput
|
|
|
|
+ v-if="reply.reply&&reply.customer._id==user._id&&reply._id==item._id&&reply.index==indexx"
|
|
|
|
+ class="input" maxlength=-1 type="textarea" @change="confirm"
|
|
|
|
+ placeholder="回复商家" />
|
|
</view>
|
|
</view>
|
|
- <uni-easyinput v-if="reply.reply" class="input" maxlength=-1 type="textarea"
|
|
|
|
- @change="confirm" placeholder="回复商家" />
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -106,30 +110,36 @@
|
|
methods: {
|
|
methods: {
|
|
async confirm(e) {
|
|
async confirm(e) {
|
|
const that = this;
|
|
const that = this;
|
|
- let reply = that.reply
|
|
|
|
- let obj = {
|
|
|
|
- content: e,
|
|
|
|
- time: moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
- }
|
|
|
|
- reply.reply.push(obj)
|
|
|
|
- const arr = await that.$api(`/goodsRate/${that.reply._id}`, 'POST', reply)
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: `回复成功`,
|
|
|
|
- icon: 'success',
|
|
|
|
- });
|
|
|
|
- that.$set(that, `reply`, {});
|
|
|
|
|
|
+ if (e) {
|
|
|
|
+ let reply = that.reply
|
|
|
|
+ let obj = {
|
|
|
|
+ content: e,
|
|
|
|
+ time: moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ }
|
|
|
|
+ reply.reply.push(obj)
|
|
|
|
+ const arr = await that.$api(`/goodsRate/${that.reply._id}`, 'POST', reply)
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: `回复成功`,
|
|
|
|
+ icon: 'success',
|
|
|
|
+ });
|
|
|
|
+ that.$set(that, `reply`, {});
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: arr.errmsg,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- uni.showToast({
|
|
|
|
- title: arr.errmsg,
|
|
|
|
- icon: 'none',
|
|
|
|
- })
|
|
|
|
|
|
+ that.$set(that, `reply`, {});
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
// 回复
|
|
// 回复
|
|
- toReply(e) {
|
|
|
|
|
|
+ toReply(e, index) {
|
|
const that = this;
|
|
const that = this;
|
|
that.$set(that, `reply`, e);
|
|
that.$set(that, `reply`, e);
|
|
|
|
+ that.$set(that.reply, `index`, index);
|
|
},
|
|
},
|
|
// 放大
|
|
// 放大
|
|
toLarge(e, index) {
|
|
toLarge(e, index) {
|
|
@@ -347,12 +357,15 @@
|
|
}
|
|
}
|
|
|
|
|
|
.other2 {
|
|
.other2 {
|
|
- display: flex;
|
|
|
|
- justify-content: space-between;
|
|
|
|
font-size: var(--font12Size);
|
|
font-size: var(--font12Size);
|
|
color: var(--f85Color);
|
|
color: var(--f85Color);
|
|
margin: 2vw 0 0 0;
|
|
margin: 2vw 0 0 0;
|
|
|
|
|
|
|
|
+ .other2_1 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ }
|
|
|
|
+
|
|
.reply {
|
|
.reply {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|