feat: 优化

This commit is contained in:
2026-07-23 13:59:35 +08:00
parent 268207b01b
commit 3f335074ea
13 changed files with 614 additions and 580 deletions
+8 -1
View File
@@ -16,7 +16,7 @@
<!-- 无优惠券 -->
<view class="flex-r-lr price-line" v-else>
<text class="text-28 text-zi text-bold">¥{{ obj.price }}</text>
<text class="text-24 sold">已售{{ obj.sales }}件</text>
<text class="text-24 sold">全网销量{{ limit999(obj.sales) }}件</text>
</view>
</view>
</view>
@@ -32,6 +32,13 @@ export default {
}
},
methods: {
limit999(n) {
const num = Number(n);
if (isNaN(num) || num < 10000) {
return n != null && n !== '' ? String(n) : '0';
}
return `${Math.floor(num / 10000)}万+`;
},
onClick() {
this.$emit('ok', this.obj.id);
}