|
|
@@ -17,7 +17,7 @@
|
|
|
<div>
|
|
|
<img :src="info.userInfo.icon" style="width:50px;height:50px;border-radius:100%;display:block;margin:auto;" alt="">
|
|
|
<div style="margin:10px;font-size:16px;font-weight:bold;text-align:center;color:#000">{{info.userInfo.nickname}}</div>
|
|
|
- <el-rate style="text-align:center" :disabled="true" v-model="starLevel" :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
|
|
|
+ <el-rate style="text-align:center" :disabled="true" v-model="info.productComment.starLevel" :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
|
|
|
</el-rate>
|
|
|
<div style="text-align:center">{{info.productComment.commentCount}}人评论</div>
|
|
|
</div>
|
|
|
@@ -39,7 +39,7 @@
|
|
|
</div>
|
|
|
<span style="width:56px;color:#FD9501">{{info.unitPrice}}</span>
|
|
|
<span style="width:56px">{{info.quantity}}</span>
|
|
|
- <template v-if="info.productType==0 && info.statusFlag>1&&type=='user'">
|
|
|
+ <template v-if="info.productType==0 && info.statusFlag>1&&type=='user'&&info.statusFlag!=8">
|
|
|
<div class="preview" @click="goNext('orderPreview')">
|
|
|
<img src="../assetsPre/prePhoto.png" alt="">
|
|
|
<span>照片预览</span>
|
|
|
@@ -118,6 +118,12 @@
|
|
|
<template v-if="statusName=='待修图'">
|
|
|
<el-button type="primary" size="mini" @click="goNextquery('orderUploadChange',{type:1})">上传修图</el-button>
|
|
|
</template>
|
|
|
+ <template v-if="statusName=='订单完成'&&!info.commentFlag">
|
|
|
+ <div style="display:block">
|
|
|
+ <el-button type="warining" size="mini" @click="comment=true">评价对方</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </template>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -171,6 +177,24 @@
|
|
|
<el-progress style="margin:10px auto" type="circle" :percentage="temp" :status="isSuccess?'success':''"></el-progress>
|
|
|
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="'评价'+info.orderCode" :visible.sync="comment" width="20%">
|
|
|
+ <div style="padding:20px 0">
|
|
|
+ <img :src="info.userInfo.icon" style="width:50px;height:50px;border-radius:100%;display:block;margin:auto;" alt="">
|
|
|
+ <div style="margin:10px;font-size:16px;font-weight:bold;text-align:center;color:#000">{{info.userInfo.nickname}}</div>
|
|
|
+ <el-rate style="text-align:center" v-model="commentInfo.starLevel" :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
|
|
|
+ </el-rate>
|
|
|
+
|
|
|
+ <el-input type="textarea" style="margin-top:20px;" :rows="2" placeholder="请输入评价内容" v-model="commentInfo.content">
|
|
|
+ </el-input>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="comment = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitComment">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -195,14 +219,13 @@ export default {
|
|
|
isSuccess: false,
|
|
|
tip: '',
|
|
|
temp: 0,
|
|
|
- starLevel:0
|
|
|
- }
|
|
|
- },
|
|
|
- created(){
|
|
|
- if(this.info.productComment){
|
|
|
- if(this.info.productComment.starLevel){
|
|
|
- this.starLevel=Number(this.info.productComment.starLevel)
|
|
|
- }
|
|
|
+ starLevel: 0,
|
|
|
+ comment: false,
|
|
|
+ commentInfo: {
|
|
|
+ starLevel: 5,
|
|
|
+ content: ''
|
|
|
+ },
|
|
|
+ isComment: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -379,6 +402,23 @@ export default {
|
|
|
}).then(res => {
|
|
|
if (res.success) {
|
|
|
this.$message.success('取消成功');
|
|
|
+ this.$http.get({
|
|
|
+ url: '/userOrder/getOne',
|
|
|
+ data: {
|
|
|
+ id: this.info.id
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ if ( res.data.productComment.starLevel) {
|
|
|
+ res.data.productComment.starLevel = Number( res.data.productComment.starLevel)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ res.data.productComment.starLevel = 0
|
|
|
+ }
|
|
|
+ this.$emit('changeData', res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
} else {
|
|
|
this.$message.warning('失败')
|
|
|
}
|
|
|
@@ -386,6 +426,28 @@ export default {
|
|
|
}).catch(() => {
|
|
|
|
|
|
});
|
|
|
+ },
|
|
|
+ submitComment() {
|
|
|
+ this.$http.post({
|
|
|
+ url: '/productComment/save',
|
|
|
+ data: {
|
|
|
+ productId: this.info.productId,
|
|
|
+ orderId: this.info.id,
|
|
|
+ userId: this.info.userId,
|
|
|
+ storeId: this.info.storeId,
|
|
|
+ context: this.commentInfo.content,
|
|
|
+ starLevel: this.commentInfo.starLevel,
|
|
|
+ typeFlag: 1,
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ this.comment = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('评价成功')
|
|
|
+ this.$emit('changeorderinfo', this.info.id)
|
|
|
+ } else {
|
|
|
+ this.$message.warning('失败')
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|