💊 fix: 修复动态css

This commit is contained in:
wangsongsole 2023-06-29 18:02:33 +08:00
parent 304c1e23c8
commit ac12391328
1 changed files with 7 additions and 4 deletions

View File

@ -231,19 +231,22 @@
/* 动态font */
fonts () {
const { cash_amount_type, min_denomination, max_denomination } = this.goodsInfo.entity;
const defaultCss = {
b: '0.2rem',
a: '0.32rem'
};
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'
};
} else {
return {
b: '0.2rem'
};
return defaultCss;
}
} else {
return defaultCss;
}
}
},