feature/comment-0620-ch
ch 2 years ago
parent f6c4182e68
commit 9722f26b90

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-23 10:40:04
* @LastEditors: ch
* @LastEditTime: 2022-06-28 20:18:38
* @LastEditTime: 2022-06-29 20:04:31
* @Description: file content
-->
<template>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-20 16:36:14
* @LastEditors: ch
* @LastEditTime: 2022-06-29 18:04:39
* @LastEditTime: 2022-06-29 19:58:37
* @Description: file content
-->
<template>
@ -57,7 +57,7 @@ export default {
}
},
isEdit (){
return (this.rate || this.commentContent || this.fileList.length > 0) ? true : false
return ( this.commentContent || this.fileList.length > 0) ? true : false
},
rateDesc(){
return COMMENT.RATE_LABEL[this.rate-1];

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-21 18:19:13
* @LastEditors: ch
* @LastEditTime: 2022-06-29 18:08:32
* @LastEditTime: 2022-06-29 20:37:02
* @Description: file content
-->
<template>
@ -10,10 +10,8 @@
<view class="box">
<BsCommentUserInfo :userData="detail"/>
<BsCommentInfo :commentDetail="detail"/>
<BsCommentFollowInfo v-if="detail.followComment" :commentDetail="detail.followComment"/>
<BsCommentFollowInfo v-if="detail.followComment" :commentDetail="detail"/>
<BsCommentGoodsInfo class="goods-info" :goods="detail" />
<!-- <u-icon slot="btns" name="shopping-cart" size="30" color="#FF875B"></u-icon> -->
<!-- </BsCommentGoodsInfo> -->
</view>
<view class="reply-title">全部评论( {{detail.replyCount}})</view>
<view class="reply">
@ -32,7 +30,7 @@
</view>
<view class="footer">
<view class="footer--item" v-if="!detail.followComment && detail.userId === $store.state.userInfo.id"
@click="$Router.push(`/comment?commentId=${commentId}`)">
@click="$Router.push(`/comment?commentId=${commentId}&follow=true`)">
<u-icon name="chat" size="28rpx"></u-icon>
追评
</view>
@ -81,6 +79,9 @@ export default {
computed:{
placeholder(){
return this.answer ? `回复:${this.answer.userName}` : '说点什么吧?'
},
replyCount(){
}
},
onShow(){
@ -96,6 +97,7 @@ export default {
this.detail = result;
this.isLike = result.isLike || false;
this.detail.usefulCount = this.detail.usefulCount || 0;
this.detail.replyCount = this.detail.replyCount || 0;
if(result.merchantComment){
this.detail.answerCommentList.unshift({
...result.merchantComment,
@ -119,6 +121,7 @@ export default {
parentName: this.answer ? this.answer.userName : ''
});
this.commentContent = '';
this.detail.replyCount++;
uni.$u.toast('评论成功!');
}
},

@ -2,13 +2,12 @@
* @Author: ch
* @Date: 2022-06-20 14:55:54
* @LastEditors: ch
* @LastEditTime: 2022-06-28 16:50:14
* @LastEditTime: 2022-06-29 20:36:47
* @Description: file content
-->
<template>
<view>
<view class="box" v-for="(item, idx) in list" :key="item.productId">
<!-- {{item.isEdit}} -->
<BsCommentGoodsInfo :goods="item" />
<BsCommentSubmit v-if="!item.id" :commentDetail="item" :type="COMMENT.TYPE.COMMENT"
@ -18,7 +17,7 @@
<BsCommentInfo :commentDetail="item"/>
<SubmitFollowComment :commentDetail="item"
@submit="submitFollowComment($event, idx)"
@editChange="editChange($event, idx)" :type="getFollowType(item)"/>
@editChange="editChange($event, idx)" :isFollow="isFollow"/>
<BsCommentMerchant v-if="item.merchantComment" :merchantComment="item.merchantComment"/>
<BsCommentThumbup :commentDetail="item"/>
</template>
@ -36,6 +35,7 @@ import BsCommentMerchant from '@/components/BsCommentMerchant.vue';
import BsCommentThumbup from '@/components/BsCommentThumbup.vue';
import SubmitFollowComment from './modules/SubmitFollowComment.vue';
import COMMENT from '@/common/dicts/comment';
const SOURCE = ['goodsComment','orderList','orderDetail','comment']
export default {
components: {
UiWhiteBox,
@ -48,15 +48,16 @@ export default {
SubmitFollowComment,
},
data() {
const query = this.$Route.query;
return {
COMMENT,
list: [],
orderId: this.$Route.query.orderId,
commentId : this.$Route.query.commentId
isFollow : query.follow == 'true' ? true : false,
orderId: query.orderId,
commentId : query.commentId
};
},
onShow() {
console.log(this.orderId, this.commentId);
if(this.orderId){
this.getOrderCommentDetail();
}else if(this.commentId){
@ -90,7 +91,8 @@ export default {
},
getFollowType(item){
let type= 'info'
if(this.commentId && !item.followComment){
//
if(this.isFollow){
type = 'form'
}
return type;

@ -1,106 +0,0 @@
<!--
* @Author: ch
* @Date: 2022-06-20 16:36:14
* @LastEditors: ch
* @LastEditTime: 2022-06-23 11:41:09
* @Description: file content
-->
<template>
<view>
<view class="rate">
<text class="rate--title">满意度评分</text>
<u-rate :count="5" v-model="rate" size="47rpx" activeColor="#FFA35B" inactiveColor="#DDD"></u-rate>
<text class="rate--desc">满意</text>
</view>
<view>
<textarea class="textarea" placeholder="从多个维度评价,可以帮助更多想买的人哦~"
:maxlength="500" v-model="commentContent"></textarea>
<u-upload class="upload"
@afterRead="handleUpdateImg" @delete="handleDelImg"
:fileList="fileList" :maxCount="6" :previewFullImage="true">
</u-upload>
</view>
<view class="footer">
<UiButton type="solid" :disable="!rate" @click="handleSubmit"></UiButton>
</view>
</view>
</template>
<script>
import UiButton from '@/components/UiButton.vue';
import {ApiPostComment} from '@/common/api/comment';
import COMMENT from '@/common/dicts/comment';
import {uploadFileOss} from '@/common/utils';
export default {
components: { UiButton },
props:{
commentDetail : {
type : Object,
default : ()=> ({})
}
},
data(){
return {
rate : 0,
commentContent : '',
fileList : []
}
},
methods:{
async handleSubmit(){
let data = {
commentScore : this.rate,
commentContent : this.commentContent,
commentType : COMMENT.TYPE.COMMENT,
orderProductId : this.commentDetail.orderProductId,
productId : this.commentDetail.productId,
pictureUrl : this.fileList.map(i => i.url).join(',')
}
const {error, result} = await ApiPostComment(data);
if(error){
uni.$u.toast(error.message);
return false;
}
this.$emit('submit',result);
},
async handleUpdateImg(val){
const {error, result} = await uploadFileOss(val.file, {
configId : 'account-comment',
serviceName : 'comment'
})
if(error){
uni.$u.toast(error);
}
this.fileList.push({url : result});
},
handleDelImg(target){
this.fileList.splice(target.index, 1)
}
}
}
</script>
<style lang="scss" scoped>
.rate{
display: flex;
margin: 50rpx 0;
align-items: center;
&--title{
font-size: 28rpx;
margin-right: 30rpx;
}
&--desc{
font-size: 30rpx;
color: #999;
margin-left: 40rpx;
}
}
.textarea{
height: 200rpx;
margin-bottom: 40rpx;
}
.footer{
width: 100%;
text-align: right;
margin-top: 50rpx;
}
</style>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-20 16:36:41
* @LastEditors: ch
* @LastEditTime: 2022-06-28 19:26:07
* @LastEditTime: 2022-06-29 20:32:02
* @Description: file content
-->
<template>
@ -30,14 +30,14 @@ export default {
type : Object,
default : () => ({})
},
type : {
type : String,
default : 'info' //info form
isFollow : {
type : Boolean,
default : false
}
},
data(){
return {
showInput : this.type === 'info' ? false : true,
showInput : this.isFollow,
COMMENT,
}
},

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-04-15 17:46:10
* @LastEditors: ch
* @LastEditTime: 2022-06-28 16:43:57
* @LastEditTime: 2022-06-29 20:39:45
* @Description: file content
-->
<template>
@ -18,7 +18,7 @@
@click="$Router.push(`/comment?orderId=${orderInfo.orderId}`)">去评价</UiButton>
<UiButton size="min" type="primaryLine" v-if="orderInfo.orderStatus === ORDER.STATUS.FINISH"
@click="$Router.push(`/comment?commentId=${orderInfo.orderId}`)">去追评</UiButton>
@click="$Router.push(`/comment?orderId=${orderInfo.orderId}&follow=true`)">去追评</UiButton>
<!-- 待支付可以取消支付订单 -->
<template v-if="orderInfo.orderStatus === 1">

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 10:58:24
* @LastEditors: ch
* @LastEditTime: 2022-06-28 21:23:25
* @LastEditTime: 2022-06-29 20:29:48
* @Description: file content
-->
<template>
@ -42,7 +42,7 @@
@click="$Router.push(`/comment?orderId=${item.orderId}`)">去评价</UiButton>
<UiButton size="min" type="primaryLine"
v-if="item.orderStatus === ORDER.STATUS.FINISH"
@click="$Router.push(`/comment?orderId=${item.orderId}`)">去追评</UiButton>
@click="$Router.push(`/comment?orderId=${item.orderId}&follow=true`)">去追评</UiButton>
<UiButton size="min" type="gradual" v-if="item.orderStatus === ORDER.STATUS.FINISH_SEND_GOODS" @click="receive(item)"></UiButton>
</view>

Loading…
Cancel
Save