diff --git a/homepage2_0.css b/homepage2_0.css index e062390..148b2a2 100644 --- a/homepage2_0.css +++ b/homepage2_0.css @@ -1272,8 +1272,7 @@ ul { } #redPacketsViews .tag { - font-size: 0.2rem; - margin-right: -0.05rem; + margin-right: -0.08rem; display: inline; } #redPacketsViews .instruction-text { diff --git a/redPackets.html b/redPackets.html index f179dce..3197c3e 100644 --- a/redPackets.html +++ b/redPackets.html @@ -54,8 +54,9 @@ 红包有限期截止 {{goodsInfo.entity.end_time}}
- ¥ - {{goodsInfo.entity.cash_amount_type==='1'?parseFloat(goodsInfo.entity.denomination) + ¥ + {{goodsInfo.entity.cash_amount_type==='1'?parseFloat(goodsInfo.entity.denomination) :`${parseFloat(goodsInfo.entity.min_denomination)}~${parseFloat(goodsInfo.entity.max_denomination)}`}}
@@ -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 ' + }; + } + } }, })