omi-mp - rpx value of css supports decimal

This commit is contained in:
dntzhang 2018-11-11 19:49:59 +08:00
parent bfb778d045
commit 6a38c1e026
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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'
})
}