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

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

查看文件

@@ -54,8 +54,16 @@
const userInfo = computed(() => sheep.$store('user').userInfo || {});
const agentInfo = computed(() => sheep.$store('user').agentInfo || {});
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)));
}
const userVoucherAvailable = computed(() => {
return agentInfo.value?.voucher_available || userInfo.value?.voucher_available || '0.00';
return formatVoucher(agentInfo.value?.voucher_available || userInfo.value?.voucher_available);
});
const state = reactive({