wangliang_wd

feat:优化人民号主页发布数处理

... ... @@ -16,7 +16,8 @@ export class NumberFormatterUtils {
// 处理 1万到1亿之间的数字,使用万作为单位,小数点后为0则不显示
const wanUnit = num / 10000;
const formattedWan = wanUnit.toFixed(1);
return formattedWan.endsWith('.0') ? `${Math.floor(wanUnit)}万` : `${formattedWan}万`;
const wanUnitW = wanUnit.toFixed(0)
return formattedWan.endsWith('.0') ? `${wanUnitW}万` : `${formattedWan}万`;
} else {
// 数字达到1亿及以上时,转换为亿并处理小数点后为0的情况
const yiUnit = num / 100000000;
... ...
... ... @@ -1114,11 +1114,7 @@ struct createImg {
if (picWidth && picHeight) {
let imageH = 305
let sizeH = this.compWidth * picHeight / picWidth
if (sizeH > imageH) {
return sizeH
}else {
return imageH
}
return Math.max(sizeH,imageH)
} else {
return 305; //普通图
}
... ...
... ... @@ -207,11 +207,7 @@ struct createImg {
if (picWidth && picHeight) {
let imageH = 305
let sizeH = this.compWidth * picHeight / picWidth
if (sizeH > imageH) {
return sizeH
}else {
return imageH
}
return Math.max(sizeH,imageH)
} else {
return 305; //普通图
}
... ...