omi-mp - rpx value of css supports decimal
This commit is contained in:
parent
bfb778d045
commit
6a38c1e026
|
@ -30,15 +30,11 @@ wx.getSystemInfoSync = function() {
|
|||
}
|
||||
}
|
||||
|
||||
wx.setNavigationBarTitle = function(option){
|
||||
document.title = option.title
|
||||
}
|
||||
|
||||
wx.getUserInfo = function() {}
|
||||
|
||||
//用户可以有个开关不转
|
||||
window.rpx2px = function(str) {
|
||||
return str.replace(/([0-9]*)rpx/g, (a, b) => {
|
||||
return str.replace(/([1-9]\d*|0)(\.\d*)*rpx/g, (a, b) => {
|
||||
return (window.innerWidth * Number(b)) / 750 + 'px'
|
||||
})
|
||||
}
|
||||
|
@ -65,6 +61,10 @@ function getUrlParam(name, url){
|
|||
return !match ? '' : match[1]
|
||||
}
|
||||
|
||||
wx.setNavigationBarTitle = function(option){
|
||||
document.title = option.title
|
||||
}
|
||||
|
||||
function getUrlParams(url) {
|
||||
url = url.replace(/#.*$/, '')
|
||||
var queryArray = url.split(/[?&]/).slice(1)
|
||||
|
|
|
@ -34,7 +34,7 @@ wx.getUserInfo = function() {}
|
|||
|
||||
//用户可以有个开关不转
|
||||
window.rpx2px = function(str) {
|
||||
return str.replace(/([0-9]*)rpx/g, (a, b) => {
|
||||
return str.replace(/([1-9]\d*|0)(\.\d*)*rpx/g, (a, b) => {
|
||||
return (window.innerWidth * Number(b)) / 750 + 'px'
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue