1. 程式人生 > >小程式--獲取手機型號

小程式--獲取手機型號

手機型號:{{mobileModel}}手機畫素比:{{mobileePixelRatio}}視窗寬度:{{windowWidth}}視窗高度:{{windowHeight}}微信設定的語言:{{language}}微信版本號:{{version}}

 

var app = getApp()
Page({
data: {
mobileModel:'',
mobileePixelRatio:'',
windowWidth:'',
windowHeight:'',
language:'',
version:''
},
onLoad: function () {
var that=this;
wx.getSystemInfo({
success: function(res) {
that.setData({
mobileModel:res.model,
mobileePixelRatio:res.pixelRatio,
windowWidth:res.windowWidth,
windowHeight:res.windowHeight,
language:res.language,
version:res.version
})
}
})
}
})