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

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

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

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

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

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-15 17:46:10 * @Date: 2022-04-15 17:46:10
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-28 16:43:57 * @LastEditTime: 2022-06-29 20:39:45
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -18,7 +18,7 @@
@click="$Router.push(`/comment?orderId=${orderInfo.orderId}`)">去评价</UiButton> @click="$Router.push(`/comment?orderId=${orderInfo.orderId}`)">去评价</UiButton>
<UiButton size="min" type="primaryLine" v-if="orderInfo.orderStatus === ORDER.STATUS.FINISH" <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"> <template v-if="orderInfo.orderStatus === 1">

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

Loading…
Cancel
Save