feat(voucher): 优化兑换券整数去除.00展示并支持计划点击穿透明细
这个提交包含在:
@@ -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({
|
||||
|
||||
在新工单中引用
屏蔽一个用户