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