商品评价

This commit is contained in:
gongfuxiang 2019-07-11 23:20:59 +08:00
parent ec54625802
commit 3b6ffca2f6
2 changed files with 4 additions and 4 deletions

View File

@ -586,7 +586,7 @@ class GoodsCommentsService
if($rating > 0 && $rating <= 5)
{
$rating_list[$rating]['count'] = $count;
$rating_list[$rating]['portion'] = round($count/$sum, 2)*100;
$rating_list[$rating]['portion'] = round(($count/$sum)*100);
}
}
}

View File

@ -5,8 +5,8 @@
<view class="value">{{goods_score.avg || '0.0'}}</view>
</view>
<view class="progress fr tc">
<block a:for="{{goods_score.rating}}" for-key="key">
<view class="progress-bar {{progress_class[key]}}" style="width: {{item.portion}}%;">{item.name}}({{item.portion}}%)</view>
<block wx:for="{{goods_score.rating}}" wx:key="key">
<view class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
</block>
</view>
</view>
@ -26,7 +26,7 @@
<view class="content cr-666">{{item.content}}</view>
<view wx:if="{{(item.msg || null) != null}}" class="spec">{{item.msg}}</view>
<view wx:if="{{item.is_reply == 1 && (item.reply || null) != null}}" class="reply br-t-dashed">
<text class="cr-666">管理员回复:</text>
<text class="cr-888">管理员回复:</text>
<text class="reply-desc">{{item.reply}}</text>
</view>
</view>