💊 fix: 动态金额

This commit is contained in:
wangsongsole 2023-06-29 16:51:20 +08:00
parent 74e2fc29e7
commit 2fcd8c7c89
2 changed files with 22 additions and 4 deletions

View File

@ -1272,8 +1272,7 @@ ul {
} }
#redPacketsViews .tag { #redPacketsViews .tag {
font-size: 0.2rem; margin-right: -0.08rem;
margin-right: -0.05rem;
display: inline; display: inline;
} }
#redPacketsViews .instruction-text { #redPacketsViews .instruction-text {

View File

@ -54,8 +54,9 @@
<span>红包有限期截止 {{goodsInfo.entity.end_time}}</span> <span>红包有限期截止 {{goodsInfo.entity.end_time}}</span>
</p> </p>
<p class='money'> <p class='money'>
<span class='tag'></span> <span class='tag' :style="{fontSize:this.fonts().b}"></span>
<span>{{goodsInfo.entity.cash_amount_type==='1'?parseFloat(goodsInfo.entity.denomination) <span
:style="{fontSize:this.fonts().a}">{{goodsInfo.entity.cash_amount_type==='1'?parseFloat(goodsInfo.entity.denomination)
:`${parseFloat(goodsInfo.entity.min_denomination)}~${parseFloat(goodsInfo.entity.max_denomination)}`}}</span> :`${parseFloat(goodsInfo.entity.min_denomination)}~${parseFloat(goodsInfo.entity.max_denomination)}`}}</span>
</p> </p>
<p class='type'> <p class='type'>
@ -226,6 +227,24 @@
history.go(-2); history.go(-2);
} }
}, },
/* 动态font */
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
if (cash_amount_type === '2') {
const count = String(parseFloat(min_denomination)).length + String(parseFloat(max_denomination)).length + 1;
if (count > 6) {
return {
a: 0.32 - ((count - 6) / 100 * 1.5) + 'rem',
b: 0.2 - ((count - 6) / 100) + 'rem'
};
}
return {
b: '0.2rem '
};
}
}
}, },
}) })
</script> </script>