Compare commits
No commits in common. 'main' and 'feature/pay-0615-ch' have entirely different histories.
main
...
feature/pa
@ -1,3 +1,4 @@
|
||||
VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.cn
|
||||
VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.cn
|
||||
#VUE_APP_IM_URL = ws://192.168.10.94:8090
|
||||
VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn
|
@ -1,3 +1,3 @@
|
||||
VUE_APP_BASE_URL = https://you-gateway.mashibing.com
|
||||
VUE_APP_STATIC_URL = https://you-app.mashibing.com
|
||||
VUE_APP_STATIC_URL = https://you-gateway.mashibing.com
|
||||
VUE_APP_IM_URL = wss://you-gateway.mashibing.com
|
@ -1,3 +1,3 @@
|
||||
VUE_APP_BASE_URL = https://you-gateway.mashibing.com
|
||||
VUE_APP_STATIC_URL = https://you-app.mashibing.com
|
||||
VUE_APP_STATIC_URL = https://you-gateway.mashibing.com
|
||||
VUE_APP_IM_URL = wss://you-gateway.mashibing.com
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 11:38:48
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 11:53:57
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils';
|
||||
|
||||
const BASE_URL = '/mall/comment';
|
||||
|
||||
/**
|
||||
* 根据商品获取评论列表
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentList = (params) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment`,params, {
|
||||
notVerifyToken: true
|
||||
}));
|
||||
/**
|
||||
* 根据商品获取评论总数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentCount = ({productId}) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/getAllCommentCountByProductId/${productId}`,{}, {
|
||||
notVerifyToken: true
|
||||
}));
|
||||
/**
|
||||
* 根据商品获取标签评论总数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentTabCount = ({productId}) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/listCommentLabel/${productId}`,{}, {
|
||||
notVerifyToken: true
|
||||
}));
|
||||
/**
|
||||
* 获取订单评论详情
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetOrderCommentDetail = ({orderId}) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/listOrderCommentByOrderId/${orderId}`));
|
||||
/**
|
||||
* 获取评论详情
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentDetail = ({commentId}) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/getCommentDetail/${commentId}`,{}, {
|
||||
notVerifyToken: true
|
||||
}));
|
||||
/**
|
||||
* 新增评论
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiPostComment = (data) =>
|
||||
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/app/comment`, data));
|
||||
|
||||
|
||||
/**
|
||||
* 更新评论有用数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiPutCommentUseful = (data) =>
|
||||
ToAsyncAwait(MsbRequestTk.put(`${BASE_URL}/app/comment/updateUsefulCount`,data));
|
||||
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 11:10:23
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-28 16:33:25
|
||||
* @Description: file content
|
||||
*/
|
||||
export default {
|
||||
TYPE : {
|
||||
// 评价
|
||||
COMMENT: 1,
|
||||
// 追评
|
||||
FOLLOW_COMMENT: 2,
|
||||
// 回复
|
||||
ANSWER: 3,
|
||||
},
|
||||
// 是否显示
|
||||
DISPLAY: {
|
||||
SHOW: 1,
|
||||
HIDE : 0
|
||||
},
|
||||
// 用户类型
|
||||
USER_TYPE: {
|
||||
STORE : 1,
|
||||
USER : 2
|
||||
},
|
||||
// 是否默认评价
|
||||
IS_DEFAULT_COMMENT: {
|
||||
YES: 1,
|
||||
NOT : 0
|
||||
},
|
||||
RATE_LABEL : ['非常不满意','不满意','一般','满意','非常满意']
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-04-29 14:26:10
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-13 10:37:21
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
import { ApiPostAliH5Pay, ApiPostAliAppPay } from '@/common/api/pay';
|
||||
const ENV = process.env;
|
||||
export const Alipay = async ({orderId})=>{
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const {error, result} = await ApiPostAliAppPay({orderId});
|
||||
if(error){
|
||||
uni.$u.toast(error.message);
|
||||
return false;
|
||||
}
|
||||
const par = result.payDataInfo;
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo :par.payData,
|
||||
success(res) {
|
||||
uni.navigateTo({
|
||||
url : `/payResult?orderId=${orderId}&payType=appWx`
|
||||
});
|
||||
},
|
||||
fail(e) {
|
||||
uni.navigateTo({
|
||||
url : `/payResult?orderId=${orderId}&payType=appWx`
|
||||
});
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('res',res);
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
const { error, result } = await ApiPostAliH5Pay({
|
||||
orderId,
|
||||
returnUrl : decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=alih5`)
|
||||
});
|
||||
if(error){
|
||||
uni.$u.toast(error.message);
|
||||
return false;
|
||||
}
|
||||
window.location.href = result.payDataInfo.payUrl;
|
||||
// #endif
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-23 10:40:04
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 18:01:46
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="follow">
|
||||
<view class="follow--title">{{day}}追评:</view>
|
||||
<view class="follow--ctx">{{followComment.commentContent}}</view>
|
||||
<view class="follow--img" v-if="imgs.length">
|
||||
<image class="follow--img-item" v-for="(item, idx) in imgs" :src="item" :key="idx" @click="preview(idx)" mode="aspectFit"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
followComment(){
|
||||
return this.commentDetail.followComment || {}
|
||||
},
|
||||
day(){
|
||||
const followTime = (new Date(this.followComment.createTime)).getTime();
|
||||
const commentTime = (new Date(this.commentDetail.createTime)).getTime();
|
||||
const day = Math.floor((followTime - commentTime) / (24 * 60 * 60 * 1000));
|
||||
return day > 0 ? `${day}天后` : `当天`;
|
||||
},
|
||||
|
||||
imgs (){
|
||||
let urls = this.followComment.pictureUrl || '';
|
||||
return urls ? urls.split(',') : [];
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
preview(idx){
|
||||
this.$store.commit('SET_COMMENT_PREVIEW', {
|
||||
...this.commentDetail,
|
||||
commentContent : this.followComment.commentContent,
|
||||
pictureUrl : this.followComment.pictureUrl
|
||||
});
|
||||
this.$Router.push({
|
||||
path : '/goodsCommentPreview',
|
||||
query : {
|
||||
idx
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.follow{
|
||||
margin-top: 40rpx;
|
||||
&--title{
|
||||
color: $color-yellow3;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
&--ctx{
|
||||
margin-top: 20rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 46rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
&--img{
|
||||
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
&-item{
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
margin:20rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,66 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 14:30:45
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-28 21:14:46
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="goods" @click="$Router.push(`/goodsDetail?id=${goods.productId}`)">
|
||||
<image class="goods--img" :src="goods.productPicture" mode="aspectFit" ></image>
|
||||
<view class="goods--ctx">
|
||||
<view class="goods--title">{{ goods.productName }}</view>
|
||||
<view class="goods--footer">
|
||||
<view class="goods--sku">{{ goods.skuName }}</view>
|
||||
<view><slot name="btns"></slot></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
goods : {
|
||||
type : Object,
|
||||
default : ()=>({})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.goods {
|
||||
display: flex;
|
||||
&--img {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
&--ctx{
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
&--title{
|
||||
font-size: 28rpx;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-right: 30rpx;
|
||||
|
||||
}
|
||||
&--footer{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
&--sku{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 20rpx;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,93 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 15:50:01
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 18:00:16
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view>
|
||||
<view class="top">
|
||||
<u-rate count="5" size="30rpx" :value="commentDetail.commentScore" activeColor="#FFA35B" readonly inactiveColor="#DDD"></u-rate>
|
||||
|
||||
<text class="top--time">{{ FormatDate(commentDetail.createTime, 'yyyy-mm-dd hh:ii') }}</text>
|
||||
</view>
|
||||
<view class="ctx">{{ commentDetail.commentContent }}</view>
|
||||
<view class="img" v-if="imgs.length">
|
||||
<image class="img--item" mode="aspectFit"
|
||||
v-for="(item, idx) in imgs" :src="item" :key="idx" @click="preview(idx)"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {FormatDate} from '@/common/utils';
|
||||
export default {
|
||||
props : {
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
},
|
||||
imgPreview : {
|
||||
type: Boolean,
|
||||
default : true,
|
||||
require : true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
curPreview : -1
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
imgs (){
|
||||
let urls = this.commentDetail.pictureUrl || '';
|
||||
return urls ? urls.split(',') : [];
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
FormatDate,
|
||||
preview(idx){
|
||||
if(!this.imgPreview){
|
||||
return false
|
||||
}
|
||||
this.$store.commit('SET_COMMENT_PREVIEW', this.commentDetail);
|
||||
this.$Router.push({
|
||||
path : '/goodsCommentPreview',
|
||||
query : {
|
||||
idx
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.top{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20rpx 0;
|
||||
&--time{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.ctx{
|
||||
font-size: 30rpx;
|
||||
line-height: 46rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
.img{
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
&--item{
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
margin:20rpx 0;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
@ -1,56 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 15:59:23
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 17:57:25
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="merchant">
|
||||
<view class="merchant--title">
|
||||
<text class="merchant--name">{{merchantComment.userName}}</text>
|
||||
<text class="merchant--time">{{ FormatDate(merchantComment.createTime, 'yyyy-mm-dd hh:ii') }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="merchant--ctx">{{merchantComment.commentContent}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {FormatDate} from '@/common/utils';
|
||||
export default {
|
||||
props : {
|
||||
merchantComment : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
FormatDate
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.merchant{
|
||||
margin-top: 40rpx;
|
||||
padding: 30rpx;
|
||||
background: #F5F5F5;
|
||||
&--title{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
&--time{
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
&--ctx,&--name{
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,138 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 16:36:14
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 21:06:31
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view>
|
||||
<view class="rate" v-if="type === COMMENT.TYPE.COMMENT">
|
||||
<text class="rate--title">满意度评分</text>
|
||||
<u-rate :count="5" v-model="rate" size="47rpx" activeColor="#FFA35B" inactiveColor="#DDD"></u-rate>
|
||||
<text class="rate--desc">{{rateDesc}}</text>
|
||||
</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 class="footer">
|
||||
<UiButton type="solid" :disable="isVerify" @click="handleSubmit">
|
||||
{{type === COMMENT.TYPE.COMMENT ? '发表评价' : '发表追评'}}
|
||||
</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, HandleApiError} from '@/common/utils';
|
||||
export default {
|
||||
components: { UiButton },
|
||||
props:{
|
||||
type : {
|
||||
type : String | Number,
|
||||
default : COMMENT.TYPE.COMMENT
|
||||
},
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : ()=> ({})
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
COMMENT,
|
||||
rate : 5,
|
||||
commentContent : '',
|
||||
fileList : []
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
isVerify(){
|
||||
if(this.type === COMMENT.TYPE.COMMENT){
|
||||
return !this.rate || !this.commentContent.trim();
|
||||
}else{
|
||||
return !this.commentContent.trim();
|
||||
}
|
||||
},
|
||||
isEdit (){
|
||||
return ( this.commentContent || this.fileList.length > 0) ? true : false
|
||||
},
|
||||
rateDesc(){
|
||||
return COMMENT.RATE_LABEL[this.rate-1];
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
isEdit(){
|
||||
this.$emit('editChang',this.isEdit)
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async handleSubmit(){
|
||||
let data = {
|
||||
commentContent : this.commentContent,
|
||||
commentType : this.type,
|
||||
orderProductId : this.commentDetail.orderProductId,
|
||||
pictureUrl : this.fileList.map(i => i.url).join(',')
|
||||
}
|
||||
if(this.type === COMMENT.TYPE.COMMENT){
|
||||
data.productId = this.commentDetail.productId;
|
||||
data.commentScore = this.rate;
|
||||
}else if(this.type === COMMENT.TYPE.FOLLOW_COMMENT){
|
||||
data.originId = data.parentId = this.commentDetail.id;
|
||||
}
|
||||
const {error, result} = await ApiPostComment(data);
|
||||
if(!HandleApiError(error)){
|
||||
this.commentContent = '';
|
||||
this.fileList = [];
|
||||
this.$nextTick(()=>{
|
||||
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>
|
@ -1,96 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 16:01:19
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-01 17:55:01
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="thumb">
|
||||
<view class="thumb--item" @click="handleUseful">
|
||||
<u-icon name="thumb-up-fill" v-if="isLike"></u-icon>
|
||||
<u-icon name="thumb-up" v-else></u-icon>
|
||||
<text>{{usefulCount}}</text>
|
||||
</view>
|
||||
<view class="thumb--item" @click="$Router.push(`/goodsCommentDetail?id=${commentDetail.id}`)">
|
||||
<u-icon name="chat"></u-icon>
|
||||
<text>{{commentDetail.replyCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {Debounce, HandleApiError} from '@/common/utils';
|
||||
import {ApiPutCommentUseful} from '@/common/api/comment'
|
||||
export default {
|
||||
props : {
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : ()=>({})
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
debounce : null,
|
||||
isLike : false,
|
||||
usefulCount : 0
|
||||
}
|
||||
},
|
||||
watch :{
|
||||
commentDetail :{
|
||||
handler(){
|
||||
this.isLike = this.commentDetail.isLike;
|
||||
this.usefulCount = this.commentDetail.usefulCount;
|
||||
},
|
||||
deep:true
|
||||
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.isLike = this.commentDetail.isLike;
|
||||
// console.log('---',this.isLike,this.commentDetail.usefulCount);
|
||||
this.usefulCount = this.commentDetail.usefulCount;
|
||||
},
|
||||
methods:{
|
||||
handleUseful(){
|
||||
this.isLike = !this.isLike
|
||||
if(this.isLike){
|
||||
this.usefulCount++;
|
||||
}else{
|
||||
this.usefulCount--;
|
||||
}
|
||||
if(!this.debounce){
|
||||
this.debounce = Debounce(this.updateUseFul, 500);
|
||||
}
|
||||
this.debounce();
|
||||
},
|
||||
async updateUseFul(){
|
||||
if(this.isLike === this.commentDetail.isLike){
|
||||
return false
|
||||
}
|
||||
const {error, result} = await ApiPutCommentUseful({
|
||||
commentId : this.commentDetail.id,
|
||||
isLike : this.isLike
|
||||
});
|
||||
HandleApiError(error);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.thumb{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 40rpx;
|
||||
&--item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 50rpx;
|
||||
text{
|
||||
font-size: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,47 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 22:27:52
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-01 17:14:36
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="comment-user">
|
||||
<image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/>
|
||||
<view>
|
||||
<view class="comment-user--name">{{userData.userName}}</view>
|
||||
<text class="comment-user--sku" v-if="userData.skuName">已购买{{userData.skuName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
userData : {
|
||||
type : Object,
|
||||
default : ()=> ({})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.comment-user{
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
&--avatr{
|
||||
width: 71rpx;
|
||||
height: 71rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
&--name{
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
&--sku{
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,268 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 18:19:13
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-01 17:12:16
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view>
|
||||
<view class="box">
|
||||
<BsCommentUserInfo :userData="detail"/>
|
||||
<BsCommentInfo :commentDetail="detail"/>
|
||||
<BsCommentFollowInfo v-if="detail.followComment" :commentDetail="detail"/>
|
||||
<BsCommentGoodsInfo class="goods-info" :goods="detail" />
|
||||
</view>
|
||||
<view class="reply-title">全部评论( {{detail.replyCount}}条)</view>
|
||||
<view class="reply">
|
||||
<template v-if="detail.replyCount">
|
||||
<view class="reply--item" v-if="detail.merchantComment">
|
||||
<view class="reply--title">
|
||||
<text>
|
||||
{{detail.merchantComment.userName}}
|
||||
</text>
|
||||
<text>{{FormatDate(detail.merchantComment.createTime, 'yyyy-mm-dd hh:ii')}}</text>
|
||||
</view>
|
||||
<view class="reply--ctx">{{detail.merchantComment.commentContent}}</view>
|
||||
</view>
|
||||
<view class="reply--item" v-for="item in detail.answerCommentList" :key="item.id" @click="handleAnswer(item)">
|
||||
<view class="reply--title">
|
||||
<text>
|
||||
{{item.userName}} {{item.parentId !== detail.id ? ` 回复 ${item.parentUserName}` : ''}}
|
||||
</text>
|
||||
<text>{{FormatDate(item.createTime, 'yyyy-mm-dd hh:ii')}}</text>
|
||||
</view>
|
||||
<view class="reply--ctx">{{item.commentContent}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<BsEmpty v-else tips="还没有人评论哦,快来抢沙发~"/>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view class="footer--item" v-if="!detail.followComment && detail.userId === $store.state.userInfo.id"
|
||||
@click="$Router.push(`/comment?commentId=${commentId}&follow=true`)">
|
||||
<u-icon name="chat" size="28rpx"></u-icon>
|
||||
追评
|
||||
</view>
|
||||
<view class="footer--item" @click="isShowAnswer = true">
|
||||
<u-icon name="chat" size="28rpx"></u-icon>
|
||||
评论
|
||||
</view>
|
||||
<view class="footer--item" :class="{'footer--item__active' : isLike}" @click="handleUseful">
|
||||
<u-icon name="thumb-up" size="28rpx" :color="isLike ? '#FF875B' : ''"></u-icon>
|
||||
有用<template v-if="detail.usefulCount">({{detail.usefulCount}})</template>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="isShowAnswer" >
|
||||
<view class="reply-comment--bg" @click="handleHideAnswer"></view>
|
||||
<view class="reply-comment">
|
||||
<view class="reply-comment--box">
|
||||
<input class="reply-comment--input" maxlength="500" v-model="commentContent" :placeholder="placeholder" />
|
||||
<UiButton type="gradual" :disable="!commentContent.trim()" @click="handleSubmit">发表</UiButton>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import BsCommentGoodsInfo from '../../../components/BsCommentGoodsInfo.vue'
|
||||
import BsCommentInfo from '../../../components/BsCommentInfo.vue'
|
||||
import BsCommentUserInfo from '../../../components/BsCommentUserInfo.vue'
|
||||
import UiButton from '../../../components/UiButton.vue'
|
||||
import {ApiGetCommentDetail, ApiPostComment, ApiPutCommentUseful} from '@/common/api/comment'
|
||||
import {HandleApiError, Debounce, FormatDate} from '@/common/utils'
|
||||
import COMMENT from '@/common/dicts/comment'
|
||||
import BsEmpty from '../../../components/BsEmpty.vue'
|
||||
import BsCommentFollowInfo from '../../../components/BsCommentFollowInfo.vue'
|
||||
export default {
|
||||
components: { BsCommentGoodsInfo, BsCommentInfo, UiButton, BsCommentUserInfo, BsEmpty, BsCommentFollowInfo },
|
||||
data(){
|
||||
return {
|
||||
isShowAnswer : false,
|
||||
answer : null,
|
||||
commentId : this.$Route.query.id,
|
||||
detail : {},
|
||||
commentContent : '',
|
||||
isLike : false
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
placeholder(){
|
||||
return this.answer ? `回复:${this.answer.userName}` : '说点什么吧?'
|
||||
},
|
||||
replyCount(){
|
||||
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
this.getDetail();
|
||||
},
|
||||
methods:{
|
||||
FormatDate,
|
||||
async getDetail(){
|
||||
const {error, result} = await ApiGetCommentDetail({
|
||||
commentId : this.commentId
|
||||
});
|
||||
if(!HandleApiError(error,'getDetail')){
|
||||
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,
|
||||
// parentId : result.id
|
||||
// })
|
||||
// }
|
||||
}
|
||||
},
|
||||
async handleSubmit(){
|
||||
let data = {
|
||||
commentContent : this.commentContent,
|
||||
commentType : COMMENT.TYPE.ANSWER,
|
||||
originId : this.detail.id,
|
||||
parentId : this.answer ? this.answer.id : this.detail.id
|
||||
}
|
||||
const {error, result} = await ApiPostComment(data);
|
||||
if(!HandleApiError(error)){
|
||||
this.detail.answerCommentList.unshift({
|
||||
...result,
|
||||
userName : this.$store.state.userInfo.nickname,
|
||||
parentUserName: this.answer ? this.answer.userName : ''
|
||||
});
|
||||
this.commentContent = '';
|
||||
this.detail.replyCount++;
|
||||
uni.$u.toast('评论成功!');
|
||||
}
|
||||
},
|
||||
handleAnswer(item){
|
||||
this.isShowAnswer = true;
|
||||
this.answer = item;
|
||||
},
|
||||
handleHideAnswer(...e){
|
||||
this.isShowAnswer = false;
|
||||
this.answer = null;
|
||||
},
|
||||
|
||||
handleUseful(){
|
||||
this.isLike = !this.isLike
|
||||
if(this.isLike){
|
||||
this.detail.usefulCount++;
|
||||
}else{
|
||||
this.detail.usefulCount--;
|
||||
}
|
||||
if(!this.debounce){
|
||||
this.debounce = Debounce(this.updateUseFul, 500);
|
||||
}
|
||||
this.debounce();
|
||||
},
|
||||
async updateUseFul(){
|
||||
if(this.isLike === this.detail.isLike){
|
||||
return false
|
||||
}
|
||||
const {error, result} = await ApiPutCommentUseful({
|
||||
commentId : this.detail.id,
|
||||
isLike : this.isLike
|
||||
});
|
||||
|
||||
HandleApiError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page{
|
||||
background: $color-grey1;
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.box{
|
||||
background: $color-grey0;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.goods-info{
|
||||
margin-top: 30rpx;
|
||||
border: 1px solid #f8f8f8;
|
||||
}
|
||||
.reply-title{
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
margin-bottom:1rpx;
|
||||
margin-top: 20rpx;
|
||||
background: #fff;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
.reply{
|
||||
background: #fff;
|
||||
padding: 0 40rpx;
|
||||
overflow: hidden;
|
||||
&--item{
|
||||
border-bottom: 1px solid $color-grey1;
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
&--title{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text{
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
&--ctx{
|
||||
margin: 26rpx 0;
|
||||
line-height: 36rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
height: 124rpx;
|
||||
position: fixed;
|
||||
bottom: var(--window-bottom);
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-top: 1px solid #f8f8f8;
|
||||
&--item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&__active{
|
||||
color: $color-yellow3;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply-comment--bg{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.reply-comment{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
height: 124rpx;
|
||||
padding: 24rpx 40rpx;
|
||||
border-top: 1px solid #f8f8f8;
|
||||
&--box{
|
||||
display: flex;
|
||||
background: #F5F5F5;
|
||||
border-radius: 38rpx;
|
||||
}
|
||||
&--input{
|
||||
flex: 1;
|
||||
padding:0 20rpx 0 40rpx;
|
||||
height: 76rpx;
|
||||
line-height: 76rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,109 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 16:51:03
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-28 20:44:13
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view>
|
||||
<view class="comment" v-for="item in list" :key="item.id">
|
||||
<BsCommentUserInfo :userData="item"/>
|
||||
<BsCommentInfo :commentDetail="item"/>
|
||||
<BsCommentThumbup :commentDetail="item"/>
|
||||
</view>
|
||||
<u-loadmore :status="loadingStatus" v-if="loadingStatus === 'loading'"/>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import BsCommentInfo from '../../../components/BsCommentInfo.vue'
|
||||
import BsCommentUserInfo from '../../../components/BsCommentUserInfo.vue'
|
||||
import {ApiGetCommentList, ApiGetCommentCount, ApiGetCommentTabCount} from '@/common/api/comment';
|
||||
import {HandleApiError} from '@/common/utils'
|
||||
import BsCommentThumbup from '../../../components/BsCommentThumbup.vue';
|
||||
export default {
|
||||
components: { BsCommentInfo, BsCommentUserInfo, BsCommentThumbup },
|
||||
data (){
|
||||
return {
|
||||
list : [],
|
||||
pageIndex : 1,
|
||||
pageSize : 10,
|
||||
productId : this.$Route.query.id,
|
||||
loadingStatus : ''
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.getList();
|
||||
},
|
||||
onReachBottom(){
|
||||
this.next();
|
||||
},
|
||||
methods:{
|
||||
async getList(){
|
||||
if(this.loadingStatus === 'loading'){
|
||||
return false
|
||||
}
|
||||
this.loadingStatus = 'loading';
|
||||
const {error, result} = await ApiGetCommentList({
|
||||
pageIndex : 1,
|
||||
length : this.pageSize,
|
||||
productId : this.productId,
|
||||
sortType : 1,
|
||||
isContent : false
|
||||
});
|
||||
if(!HandleApiError(error, 'getList')){
|
||||
this.list = result.records;
|
||||
// 标记是否为最后一页
|
||||
if(result.records.length < this.pageSize){
|
||||
this.loadingStatus = 'nomore';
|
||||
}
|
||||
}
|
||||
},
|
||||
next(){
|
||||
if(this.loadingStatus === 'nomore'){
|
||||
return false
|
||||
}
|
||||
this.pageIndex++;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page{
|
||||
background: $color-grey1;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.header{
|
||||
background: $color-grey0;
|
||||
height: 79rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 40rpx;
|
||||
.tab{
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
&--item{
|
||||
font-size: 28rpx;
|
||||
line-height: 75rpx;
|
||||
margin-right: 64rpx;
|
||||
&__active{
|
||||
border-bottom: 4rpx solid $color-yellow3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment{
|
||||
margin-top:20rpx ;
|
||||
background: $color-grey0;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.other{
|
||||
text-align: center;
|
||||
color: #999;
|
||||
margin: 40rpx 0 20rpx;
|
||||
}
|
||||
</style>
|
@ -1,187 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-22 15:15:22
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-01 17:14:16
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="preview">
|
||||
<view class="preview--top">
|
||||
<image class="preview--back" src="@/static/common/back_white.png" @click="$Router.back()"></image>
|
||||
<view class="preview--title">{{current + 1}}/{{imgs.length}}</view>
|
||||
|
||||
</view>
|
||||
<u-swiper height="calc(100vh - 420rpx)" :list="imgs" :current="current"
|
||||
@change="handleChange" :autoplay="false" imgMode="aspectFit" radius="0"/>
|
||||
<view class="preview--footer">
|
||||
<view class="preview--user">
|
||||
<image class="preview--avatar" :src="data.userAvatar"></image>
|
||||
<view>
|
||||
<view>{{data.userName}}</view>
|
||||
<view v-if="data.skuName">已购买{{data.skuName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="preview--rate">
|
||||
<u-rate count="5" size="30rpx" :value="data.commentScore" activeColor="#FFA35B" readonly inactiveColor="#DDD"></u-rate>
|
||||
<text class="preview--time">{{FormatDate(data.createTime, 'yyyy-mm-dd hh:ii')}}</text>
|
||||
</view>
|
||||
<view class="preview--ctx">{{ data.commentContent }}</view>
|
||||
</view>
|
||||
<view class="thumb">
|
||||
<view class="thumb--item" @click="handleUseful">
|
||||
<u-icon color="#fff" :name="isLike ? 'thumb-up-fill' : 'thumb-up'"></u-icon>
|
||||
<text>{{data.usefulCount || 0}}</text>
|
||||
</view>
|
||||
<view class="thumb--item" @click="$Router.replace(`/goodsCommentDetail?id=${data.id}`)">
|
||||
<u-icon color="#fff" name="chat"></u-icon>
|
||||
<text>{{data.replyCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import BsCommentUserInfo from '@/components/BsCommentUserInfo.vue';
|
||||
import BsCommentThumbup from '../../../components/BsCommentThumbup.vue';
|
||||
import {ApiPutCommentUseful} from '@/common/api/comment'
|
||||
import { Debounce,FormatDate, HandleApiError} from '@/common/utils'
|
||||
|
||||
export default {
|
||||
components: { BsCommentUserInfo,BsCommentThumbup },
|
||||
data (){
|
||||
return {
|
||||
data : this.$store.state.comment_preview,
|
||||
current : Number(this.$Route.query.idx),
|
||||
isLike : false
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
imgs(){
|
||||
const arr = this.data.pictureUrl || [];
|
||||
return arr.split(',')
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
if(!this.data.id){
|
||||
this.$Router.back();
|
||||
};
|
||||
this.isLike = this.data.isLike
|
||||
},
|
||||
methods:{
|
||||
FormatDate,
|
||||
handleChange(idx){
|
||||
this.current = idx.current
|
||||
},
|
||||
|
||||
handleUseful(){
|
||||
this.isLike = !this.isLike
|
||||
if(this.isLike){
|
||||
this.data.usefulCount++;
|
||||
}else{
|
||||
this.data.usefulCount--;
|
||||
}
|
||||
if(!this.debounce){
|
||||
this.debounce = Debounce(this.updateUseFul, 500);
|
||||
}
|
||||
this.debounce();
|
||||
},
|
||||
async updateUseFul(){
|
||||
if(this.isLike === this.data.isLike){
|
||||
return false
|
||||
}
|
||||
const {error, result} = await ApiPutCommentUseful({
|
||||
commentId : this.data.id,
|
||||
isLike : this.isLike
|
||||
});
|
||||
|
||||
HandleApiError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page{
|
||||
background: #000;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.preview{
|
||||
&--top{
|
||||
height: 44px;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: var(--window-top);
|
||||
z-index: 999;
|
||||
}
|
||||
&--back{
|
||||
width: 14rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
&--title{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
&--footer{
|
||||
padding: 40rpx;
|
||||
}
|
||||
&--user{
|
||||
display: flex;
|
||||
view{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
&--avatar{
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
background: #ccc;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
&--rate{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 20rpx 0 ;
|
||||
}
|
||||
&--time{
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
&--ctx{
|
||||
color: #fff;
|
||||
@include ellipses(2);
|
||||
line-height: 32rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.thumb{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 20rpx;
|
||||
&--item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 50rpx;
|
||||
text{
|
||||
font-size: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
&--icon{
|
||||
font-size: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,90 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 16:23:27
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-28 11:31:02
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
|
||||
<UiWhiteBox @click="handleJumpCmment">
|
||||
<view class="comment-title">
|
||||
<text class="comment-title--left">用户评价({{count}})</text>
|
||||
<text class="comment-title--right">查看全部</text>
|
||||
</view>
|
||||
<view class="comment-ctx" v-if="commentList && commentList.length">
|
||||
<view v-for="item in commentList" :key="item.id">
|
||||
<BsCommentUserInfo :userData="item"/>
|
||||
<BsCommentInfo class="comment-ctx--item" :commentDetail="item" :imgPreview="false"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</UiWhiteBox>
|
||||
</template>
|
||||
<script>
|
||||
import BsCommentInfo from '../../../../components/BsCommentInfo.vue'
|
||||
import BsCommentUserInfo from '../../../../components/BsCommentUserInfo.vue'
|
||||
import UiCell from '../../../../components/UiCell.vue'
|
||||
import UiWhiteBox from '../../../../components/UiWhiteBox.vue'
|
||||
export default {
|
||||
components: { BsCommentInfo, UiCell, UiWhiteBox, BsCommentUserInfo },
|
||||
props : {
|
||||
count : {
|
||||
type : Number,
|
||||
default : 0
|
||||
},
|
||||
productId : {
|
||||
type : Number | String,
|
||||
default : 0
|
||||
},
|
||||
commentList : {
|
||||
type : Array,
|
||||
default : () => ([])
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handleJumpCmment(){
|
||||
let url = '/goodsCommentOtherList'
|
||||
if(this.commentList.length){
|
||||
url = '/goodsCommentList'
|
||||
}
|
||||
this.$Router.push({
|
||||
path : url,
|
||||
query : {
|
||||
id : this.productId
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.comment-title{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding:30rpx;
|
||||
align-items: center;
|
||||
&--left{
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
&--right{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
background: url('@/static/common/arrow.png') no-repeat right center;
|
||||
background-size: 10rpx;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
}
|
||||
.comment-ctx{
|
||||
padding: 0 30rpx;
|
||||
&--item{
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,83 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-03-28 17:16:44
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-07-13 20:05:42
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view>
|
||||
<UiWhiteBox class="main">
|
||||
<image class="icon" src="@/static/goods/cart.png"/>
|
||||
<view class="title">商品已下架</view>
|
||||
<view class="btns">
|
||||
<UiButton class="btn" @click="$Router.pushTab('/')">返回首页</UiButton>
|
||||
</view>
|
||||
</UiWhiteBox>
|
||||
|
||||
<view class="recommend-title">为您推荐</view>
|
||||
<BsChoiceGoods/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue'
|
||||
import BsChoiceGoods from '../../components/BsChoiceGoods.vue'
|
||||
import UiWhiteBox from '../../components/UiWhiteBox.vue'
|
||||
export default {
|
||||
components: { UiButton, BsChoiceGoods, UiWhiteBox }
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: $color-grey1;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.main{
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.icon{
|
||||
width: 400rpx;
|
||||
height: 256rpx;
|
||||
margin: 169rpx auto 42rpx;
|
||||
}
|
||||
.title{
|
||||
font-size: $font-size-lg;
|
||||
line-height: 44rpx;
|
||||
color: $color-grey6;
|
||||
}
|
||||
.desc{
|
||||
font-size: $font-size-sm;
|
||||
line-height: 34rpx;
|
||||
color: $color-grey4;
|
||||
}
|
||||
.btns{
|
||||
margin: 74rpx 105rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.recommend-title{
|
||||
font-size: $font-size-lg;
|
||||
text-align: center;
|
||||
margin: 51rpx auto 30rpx auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 500rpx;
|
||||
&::after,&::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 160rpx;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(90deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
|
||||
|
||||
}
|
||||
&::before{
|
||||
|
||||
background: linear-gradient(270deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,74 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 16:36:41
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-29 20:32:02
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="follow">
|
||||
<BsCommentFollowInfo v-if="commentDetail.followComment"
|
||||
:commentDetail="commentDetail" />
|
||||
<template v-else>
|
||||
<UiButton type="primaryLine" @click="showInput = true" v-if="!showInput">发表追评</UiButton>
|
||||
<template v-else>
|
||||
<BsCommentSubmit :commentDetail="commentDetail" :type="COMMENT.TYPE.FOLLOW_COMMENT"
|
||||
@submit="handleSubmit" @editChang="handleEditChange"/>
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue'
|
||||
import BsCommentFollowInfo from '@/components/BsCommentFollowInfo.vue';
|
||||
import BsCommentSubmit from '@/components/BsCommentSubmit.vue';
|
||||
import COMMENT from '@/common/dicts/comment';
|
||||
export default {
|
||||
components: { UiButton, BsCommentFollowInfo, BsCommentSubmit },
|
||||
props : {
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
},
|
||||
isFollow : {
|
||||
type : Boolean,
|
||||
default : false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
showInput : this.isFollow,
|
||||
COMMENT,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
},
|
||||
methods:{
|
||||
async handleSubmit(data){
|
||||
this.$emit('submit',data);
|
||||
},
|
||||
handleEditChange(data){
|
||||
this.$emit('editChange',data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.follow{
|
||||
margin-top: 40rpx;
|
||||
&--title{
|
||||
color: $color-yellow3;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
&--ctx{
|
||||
margin-top: 20rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
@ -1,137 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-21 15:32:28
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 17:23:32
|
||||
* @Description: file content
|
||||
-->
|
||||
|
||||
<template>
|
||||
<view class="main">
|
||||
<view class="ctx">
|
||||
<image class="icon" src="@/static/order/paySuccess.png"/>
|
||||
<view class="title">评价成功</view>
|
||||
<view class="btns">
|
||||
<UiButton class="btn" @click="$Router.back()">返回</UiButton>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="await" v-if="goodsList.length">
|
||||
<view class="await--title">这些宝贝还在等你的评价哦~</view>
|
||||
<BsCommentGoodsInfo class="await--goods" :goods="item" v-for="item in goodsList" :key="item.productId">
|
||||
<UiButton slot="btns" size="small" type="primaryLine"
|
||||
@click="$Router.push(`/comment?commentId=${item.orderId}`)">
|
||||
{{item.commentStatus == 1 ? '评价' : '追评'}}
|
||||
</UiButton>
|
||||
</BsCommentGoodsInfo>
|
||||
</view>
|
||||
<view class="recommend-title">为您推荐</view>
|
||||
<BsChoiceGoods></BsChoiceGoods>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue'
|
||||
import BsChoiceGoods from '../../../components/BsChoiceGoods.vue';
|
||||
import {ApiGetCommentOrderDetailList} from '@/common/api/order';
|
||||
import {HandleApiError} from '@/common/utils'
|
||||
import BsCommentGoodsInfo from '../../../components/BsCommentGoodsInfo.vue';
|
||||
export default {
|
||||
components: { UiButton, BsChoiceGoods, BsCommentGoodsInfo },
|
||||
data(){
|
||||
return {
|
||||
goodsList : []
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.getAwaitGoodsList();
|
||||
},
|
||||
methods:{
|
||||
async getAwaitGoodsList (){
|
||||
const {error, result} = await ApiGetCommentOrderDetailList({
|
||||
length:2,
|
||||
pageIndex : 1
|
||||
});
|
||||
if(!HandleApiError(error, 'getAwaitGoodsList')){
|
||||
this.goodsList = result.records.map(item => {
|
||||
return {
|
||||
productPicture : item.productImageUrl,
|
||||
productName : item.productName,
|
||||
skuName : item.skuDescribe,
|
||||
commentStatus : item.commentStatus,
|
||||
orderId : item.orderId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page{
|
||||
background: $color-grey1;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.main {
|
||||
text-align: center;
|
||||
}
|
||||
.ctx{
|
||||
background: $color-grey0;
|
||||
padding-bottom: 40rpx;
|
||||
.icon{
|
||||
width: 400rpx;
|
||||
height: 256rpx;
|
||||
margin: 169rpx auto 42rpx;
|
||||
}
|
||||
.title{
|
||||
font-size: $font-size-lg;
|
||||
line-height: 44rpx;
|
||||
color: $color-grey6;
|
||||
}
|
||||
.desc{
|
||||
font-size: $font-size-sm;
|
||||
line-height: 34rpx;
|
||||
color: $color-grey4;
|
||||
}
|
||||
.btns{
|
||||
margin: 74rpx 105rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.await{
|
||||
margin-top: 20rpx;
|
||||
background: $color-grey0;
|
||||
&--title{
|
||||
text-align: left;
|
||||
padding: 40rpx;
|
||||
border-bottom: 1px solid #f8f8f8;
|
||||
}
|
||||
&--goods{
|
||||
padding: 20rpx 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.recommend-title{
|
||||
font-size: $font-size-lg;
|
||||
text-align: center;
|
||||
margin: 51rpx auto 30rpx auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 500rpx;
|
||||
&::after,&::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 160rpx;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(90deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
|
||||
|
||||
}
|
||||
&::before{
|
||||
|
||||
background: linear-gradient(270deg, $color-grey3 0%, rgba(204, 204, 204, 0) 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
Before Width: | Height: | Size: 791 B |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 341 B |