fix:点赞提示,已够吗问题

fix/0701-ch
ch 3 years ago
parent c010790f96
commit a35cb72501

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 16:01:19 * @Date: 2022-06-21 16:01:19
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-29 10:20:40 * @LastEditTime: 2022-07-01 17:55:01
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -19,7 +19,7 @@
</view> </view>
</template> </template>
<script> <script>
import {Debounce} from '@/common/utils'; import {Debounce, HandleApiError} from '@/common/utils';
import {ApiPutCommentUseful} from '@/common/api/comment' import {ApiPutCommentUseful} from '@/common/api/comment'
export default { export default {
props : { props : {
@ -36,13 +36,18 @@ export default {
} }
}, },
watch :{ watch :{
commentDetail (){ commentDetail :{
this.isLike = this.commentDetail.isLike; handler(){
this.usefulCount = this.commentDetail.usefulCount; this.isLike = this.commentDetail.isLike;
this.usefulCount = this.commentDetail.usefulCount;
},
deep:true
} }
}, },
mounted(){ mounted(){
this.isLike = this.commentDetail.isLike; this.isLike = this.commentDetail.isLike;
// console.log('---',this.isLike,this.commentDetail.usefulCount);
this.usefulCount = this.commentDetail.usefulCount; this.usefulCount = this.commentDetail.usefulCount;
}, },
methods:{ methods:{
@ -66,6 +71,7 @@ export default {
commentId : this.commentDetail.id, commentId : this.commentDetail.id,
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-21 22:27:52 * @Date: 2022-06-21 22:27:52
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-21 22:29:18 * @LastEditTime: 2022-07-01 17:14:36
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -10,7 +10,7 @@
<image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/> <image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/>
<view> <view>
<view class="comment-user--name">{{userData.userName}}</view> <view class="comment-user--name">{{userData.userName}}</view>
<text class="comment-user--sku">已购买{{userData.skuName}}</text> <text class="comment-user--sku" v-if="userData.skuName">{{userData.skuName}}</text>
</view> </view>
</view> </view>
</template> </template>

@ -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-30 17:58:44 * @LastEditTime: 2022-07-01 17:12:16
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -164,6 +164,7 @@ export default {
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-06-22 15:15:22 * @Date: 2022-06-22 15:15:22
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-06-30 17:59:59 * @LastEditTime: 2022-07-01 17:14:16
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -19,7 +19,7 @@
<image class="preview--avatar" :src="data.userAvatar"></image> <image class="preview--avatar" :src="data.userAvatar"></image>
<view> <view>
<view>{{data.userName}}</view> <view>{{data.userName}}</view>
<view>已购买{{data.skuName}}</view> <view v-if="data.skuName">{{data.skuName}}</view>
</view> </view>
</view> </view>
<view> <view>
@ -46,7 +46,7 @@
import BsCommentUserInfo from '@/components/BsCommentUserInfo.vue'; import BsCommentUserInfo from '@/components/BsCommentUserInfo.vue';
import BsCommentThumbup from '../../../components/BsCommentThumbup.vue'; import BsCommentThumbup from '../../../components/BsCommentThumbup.vue';
import {ApiPutCommentUseful} from '@/common/api/comment' import {ApiPutCommentUseful} from '@/common/api/comment'
import { Debounce,FormatDate} from '@/common/utils' import { Debounce,FormatDate, HandleApiError} from '@/common/utils'
export default { export default {
components: { BsCommentUserInfo,BsCommentThumbup }, components: { BsCommentUserInfo,BsCommentThumbup },
@ -96,6 +96,7 @@ export default {
isLike : this.isLike isLike : this.isLike
}); });
HandleApiError(error);
} }
} }
} }

Loading…
Cancel
Save