Commit 3f8827fa authored by Mac's avatar Mac

评论提交

parent 2a77da42
<template>
<view class="comment-list" v-if="commentCount && commentCount.length > 0">
<view class="comment-list" >
<u-tabs
name="name"
:list="commentCount"
:list="list"
:is-scroll="false"
:active-color="mc"
:current="current"
......@@ -21,7 +21,16 @@
<view class="u-box">
<view class="user">
<u-avatar :src="x.UserPhotoPath" :size="50"></u-avatar>
<text style="margin-left: 10px;">{{ x.UserName }}</text>
<text style="margin:0 10px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;max-width: 130px;">{{ x.UserName }}</text>
<u-rate
:current="x.CommentScore"
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="20"
:disabled="true"
></u-rate>
</view>
<view class="timer">{{ x.CreateDate }}</view>
</view>
......@@ -85,6 +94,7 @@ export default {
pageTitle: "全部评论",
status: "loadmore",
isover: false,
list:[],
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
......@@ -102,8 +112,9 @@ export default {
uni.showNavigationBarLoading();
this.id = option.id || 46942;
this.mc = this.$uiConfig.mainColor;
this.init();
this.initPage();
this.getCommentStatistics()
},
methods: {
previewImage(i,images) {
......@@ -142,6 +153,27 @@ export default {
title: this.pageTitle,
});
},
getCommentStatistics(){
this.request2(
{
url: "/api/AppletOrder/GetAppletGoodsCommentStatistics",
data: {
GoodsId:this.id
},
},
(res) => {
let data = res.data.List
data.forEach(x=>{
x.name = x.Name+'(' + x.Count + ')'
})
data.unshift({name:'全部',Id:0})
this.list = data
this.msg.CommentGrade = data[0].Id
this.init();
}
);
},
init() {
this.isover = false;
this.loading = true;
......@@ -199,6 +231,8 @@ export default {
},
tabsChange(index) {
this.current = index;
this.msg.pageIndex = 1;
this.msg.CommentGrade = this.list[index].Id
this.init()
this.page=1
},
......@@ -247,7 +281,10 @@ export default {
.comment-list .comment-details .comment .content .u-box {
display: flex;
margin-bottom: 10px;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.comment-list .comment-details .comment .content .u-box .user {
flex: 1;
......
......@@ -7,12 +7,13 @@
<view class="good-info">{{goodsName}}</view>
<view class="op-box">
<u-rate
:current="msg.CommentGrade"
:current="msg.CommentScore"
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="40"
@change='change'
></u-rate>
</view>
</view>
......@@ -67,11 +68,12 @@ export default {
mc: "",
secondary: "",
msg: {
CommentGrade: 5,
CommentGrade: 0,
GoodsId: 0,
Content: "",
OrderDetailId: 0,
CommentImgList: [],
CommentScore:5
},
submitStatus: false,
goodsName: "",
......@@ -102,9 +104,12 @@ export default {
let r = JSON.parse(data);
this.msg.CommentImgList.push(r.data);
},
change(val){
this.msg.CommentScore = val
},
submitForm() {
this.submitStatus = true;
if (this.msg.CommentGrade > 0) {
if (this.msg.CommentScore > 0) {
this.request2(
{
url: "/api/AppletOrder/SetGoodsCommentInfo",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment