fix avatar
This commit is contained in:
parent
2c6cd8c6f5
commit
6d33e04688
|
@ -3,7 +3,7 @@ import indexCss from './index.wxss'
|
|||
import { h, WeElement } from 'omi'
|
||||
|
||||
function css() {
|
||||
return appCss + indexCss
|
||||
return rpx2px(appCss + indexCss)
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
@ -45,7 +45,7 @@ const app = getApp()
|
|||
const mpOption = Page({
|
||||
data: {
|
||||
motto: 'Hello omi-mp',
|
||||
userInfo: { nickName: 'dntzhang' },
|
||||
userInfo: { nickName: 'dntzhang', avatarUrl: 'https://github.com/Tencent/omi/raw/master/assets/omi-logo.svg?sanitize=true' },
|
||||
hasUserInfo: false,
|
||||
canIUse: wx.canIUse('button.open-type.getUserInfo')
|
||||
},
|
||||
|
|
|
@ -25,18 +25,10 @@ wx.getSystemInfoSync = function () {
|
|||
}
|
||||
}
|
||||
|
||||
`width: 128rpx;
|
||||
height: 54rpx;`.replace(/([0-9]*)(rpx)/g,function(a,b,c){
|
||||
console.log(a,b,c)
|
||||
|
||||
|
||||
return Number(b)
|
||||
})
|
||||
|
||||
//用户可以有个开关不转
|
||||
window.rpx2px = function(str){
|
||||
return str.replace(/([0-9]*)rpx/g,function(a,b,c){
|
||||
console.log(a,b,c)
|
||||
window.rpx2px = function (str) {
|
||||
return str.replace(/([0-9]*)rpx/g, function (a, b) {
|
||||
return window.innerWidth * Number(b) / 750 + 'px'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue