💊 fix: 动态金额
This commit is contained in:
parent
74e2fc29e7
commit
2fcd8c7c89
|
@ -1272,8 +1272,7 @@ ul {
|
|||
}
|
||||
|
||||
#redPacketsViews .tag {
|
||||
font-size: 0.2rem;
|
||||
margin-right: -0.05rem;
|
||||
margin-right: -0.08rem;
|
||||
display: inline;
|
||||
}
|
||||
#redPacketsViews .instruction-text {
|
||||
|
|
|
@ -54,8 +54,9 @@
|
|||
<span>红包有限期截止 {{goodsInfo.entity.end_time}}</span>
|
||||
</p>
|
||||
<p class='money'>
|
||||
<span class='tag'>¥</span>
|
||||
<span>{{goodsInfo.entity.cash_amount_type==='1'?parseFloat(goodsInfo.entity.denomination)
|
||||
<span class='tag' :style="{fontSize:this.fonts().b}">¥</span>
|
||||
<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>
|
||||
</p>
|
||||
<p class='type'>
|
||||
|
@ -226,6 +227,24 @@
|
|||
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>
|
||||
|
|
Loading…
Reference in New Issue