feat(voucher): 优化兑换券整数去除.00展示并支持计划点击穿透明细

这个提交包含在:
chen
2026-09-19 15:41:19 +08:00
父节点 f06538ddf6
当前提交 efab61498d
共有 10 个文件被更改,包括 823 次插入 和 50 次删除

查看文件

@@ -48,7 +48,7 @@
class="ss-flex-1 ss-flex-col ss-col-center metric-item"
@tap="sheep.$router.go('/pages/commission/madow')"
>
<view class="item-title">马豆价值(元)</view>
<view class="item-title">dmepa价值(元)</view>
<view class="item-detail">
{{
state.showMoney
@@ -65,7 +65,7 @@
<view class="item-detail">
{{
state.showMoney
? agentInfo?.voucher_available || userInfo?.voucher_available || '0.00'
? formatVoucher(agentInfo?.voucher_available || userInfo?.voucher_available)
: '***'
}}
</view>
@@ -86,6 +86,13 @@
const state = reactive({
showMoney: false,
});
function formatVoucher(val) {
if (val === '' || val === null || val === undefined || val === '--') return '0';
const num = Number(val);
if (isNaN(num)) return '0';
return num % 1 === 0 ? String(Math.round(num)) : String(Number(num.toFixed(2)));
}
</script>
<style lang="scss" scoped>