feat: 优化
This commit is contained in:
@@ -3,38 +3,22 @@
|
||||
<view class="eval-header">
|
||||
<view class="title">商品评价 ({{ totalCount }})</view>
|
||||
<view class="more" @click="goMore">
|
||||
<view class="rate"
|
||||
>查看全部
|
||||
<up-image
|
||||
src="/static/common/right.png"
|
||||
width="14"
|
||||
height="14"
|
||||
bgColor="#f1f6ff00"
|
||||
class="arrow"
|
||||
></up-image
|
||||
></view>
|
||||
<view class="rate">查看全部
|
||||
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00" class="arrow"></up-image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="eval-list">
|
||||
<view class="eval-item" v-for="(item, index) in list" :key="index">
|
||||
<view class="user-info">
|
||||
<view class="user-left">
|
||||
<image
|
||||
class="avatar"
|
||||
:src="item.userImage"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<image class="avatar" :src="item.userImage" mode="aspectFill"></image>
|
||||
<text class="username">{{ item.userName }}</text>
|
||||
</view>
|
||||
<view class="user-right">
|
||||
<view class="stars">
|
||||
<text
|
||||
v-for="s in item.rating"
|
||||
:key="s"
|
||||
class="star-icon"
|
||||
:style="{ color: s <= item.rating ? '#7934F6' : '#e5e5e5' }"
|
||||
>★</text
|
||||
>
|
||||
<text v-for="s in item.rating" :key="s" class="star-icon"
|
||||
:style="{ color: s <= item.rating ? '#7934F6' : '#e5e5e5' }">★</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -109,6 +93,7 @@ export default {
|
||||
/* 自适应父级宽度,可根据页面情况调整 margin */
|
||||
margin: 20rpx auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
|
||||
/* 头部样式 */
|
||||
@@ -133,10 +118,12 @@ export default {
|
||||
|
||||
.rate {
|
||||
color: #999999;
|
||||
margin-right: 4rpx;
|
||||
display: flex;
|
||||
|
||||
.arrow {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,6 +172,7 @@ export default {
|
||||
.user-right {
|
||||
.stars {
|
||||
display: flex;
|
||||
|
||||
.star-icon {
|
||||
font-size: 26rpx;
|
||||
margin-left: 6rpx;
|
||||
@@ -196,6 +184,7 @@ export default {
|
||||
/* 评价文字 */
|
||||
.eval-content {
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.text-desc {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
下单送{{ orderInfo.contribution }}贡献值
|
||||
</view>
|
||||
<!-- 销量还需要改 -->
|
||||
<view>销量{{ limit999(orderInfo.sales) }}件</view>
|
||||
<view>全网销量{{ limit999(orderInfo.sales) }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -497,7 +497,11 @@ export default {
|
||||
methods: {
|
||||
assembleAddress,
|
||||
limit999(n) {
|
||||
return n > 999 ? '999+' : String(n);
|
||||
const num = Number(n);
|
||||
if (isNaN(num) || num < 10000) {
|
||||
return n != null && n !== '' ? String(n) : '0';
|
||||
}
|
||||
return `${Math.floor(num / 10000)}万+`;
|
||||
},
|
||||
|
||||
onOpenApp() {
|
||||
|
||||
Reference in New Issue
Block a user