评论商品接口有问题

This commit is contained in:
bobobobo
2026-01-16 00:12:33 +08:00
parent d2ba0df2b5
commit 5cd2732562
164 changed files with 14318 additions and 197 deletions

View File

@@ -90,7 +90,7 @@
.discover-box {
padding: 32rpx 24rpx;
.card-box {
padding: 20rpx 32rpx;
padding: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;

View File

@@ -161,6 +161,22 @@
getData()
}
const formatNumberWithWan = num => {
if (num < 10000) {
return num.toString()
}
// 保留小数:根据需求可调整 toFixed 的位数
let wan = num / 10000
// 如果是整数万,不显示小数;否则保留两位小数(或你想要的位数)
if (wan % 1 === 0) {
return wan + '万'
} else {
return wan.toFixed(2).replace(/\.?0+$/, '') + '万' // 去掉不必要的尾随零
}
}
onLoad(() => {
const now = new Date()
currentYear.value = now.getFullYear()
@@ -184,7 +200,7 @@
<view class="public-header—box">
<view class="integral-box">
<text>我的积分</text>
<text>{{ userInfo.totalPoints }}</text>
<text>{{ formatNumberWithWan(userInfo.totalPoints) }}</text>
</view>
<image
src="/static/images/discover/calendar.png"