修改rpx和px的转换显示

master
于肖磊 2025-02-28 11:49:06 +08:00
parent ea9fc0e184
commit fb7cba06c1
2 changed files with 9 additions and 1 deletions

View File

@ -1914,7 +1914,11 @@
},
// pxrpx
px_to_rpx(value) {
return (value || 0) == 0 ? 0 : (parseInt(value) * 750) / parseInt(this.get_system_info('windowWidth', 0));
const new_value = value * 2 || 0;
// 200 100px 100 使
var rpx = new_value / (uni.upx2px(value) / value);
// rpx
return uni.upx2px(rpx);
},
//

View File

@ -173,6 +173,10 @@
swiper_bg_style: this.get_swiper_bg_style(new_content, 0),
swiper_bg_img_style: this.get_swiper_bg_img_style(new_content, 0),
});
console.log(
app.globalData.px_to_rpx(100)
);
},
// tab
tabs_click_event(tabs_id, is_micro_page) {