修改rpx和px的转换显示
parent
ea9fc0e184
commit
fb7cba06c1
6
App.vue
6
App.vue
|
|
@ -1914,7 +1914,11 @@
|
|||
},
|
||||
// px转rpx
|
||||
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);
|
||||
},
|
||||
|
||||
// 终端类型
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue