- 开发无止境 -
Data: 2017-12-21 09:00:32Form: JournalClick: 8
编号 | 基础库版本 | 安卓版本 | 安卓用户占比 | iOS版本 | iOS用户占比 | 总体占比 |
---|---|---|---|---|---|---|
1 | 2.10.3 | 7.0.9 | 21.35% | 7.0.9 | 25.09% | 22.13% |
2 | 2.10.2 | - | 70.72% | - | 63.00% | 69.11% |
3 | 2.10.1 | - | 1.24% | - | 0.01% | 0.99% |
4 | 2.9.5 | 7.0.7 | 1.65% | 7.0.7 | 4.86% | 2.32% |
5 | 2.9.3 | - | 0.68% | - | 0.00% | 0.54% |
6 | 2.8.3 | 7.0.5 | 1.88% | 7.0.5 | 1.88% | 1.88% |
7 | 2.7.7 | 7.0.4 | 0.83% | 7.0.4 | 1.35% | 0.94% |
8 | 2.7.1 | - | 0.01% | - | 0.00% | 0.01% |
9 | 2.6.6 | 7.0.3 | 0.82% | 7.0.3 | 1.59% | 0.98% |
10 | 2.5.2 | 7.0.0 | 0.26% | 7.0.0 | 0.53% | 0.31% |
11 | 2.4.4 | 6.7.3 | 0.22% | 6.7.3 | 0.81% | 0.35% |
12 | 2.3.2 | 6.7.2 | 0.04% | 6.7.2 | 0.20% | 0.07% |
13 | 2.2.5 | 6.6.7 | 0.11% | 6.7.0 | 0.19% | 0.13% |
14 | 2.1.3 | - | - | 6.6.7 | 0.08% | 0.02% |
15 | 2.0.9 | 6.6.6 | 0.05% | 6.6.6 | 0.12% | 0.06% |
16 | 1.9.97 | 6.6.2 | 0.06% | 6.6.2 | 0.10% | 0.07% |
17 | 1.9.9 | 6.6.1 | 0.02% | 6.6.1 | 0.05% | 0.03% |
function compareVersion(v1, v2) {
v1 = v1.split('.');
v2 = v2.split('.');
const len = Math.max(v1.length, v2.length);
while (v1.length < len) {
v1.push('0');
}
while (v2.length < len) {
v2.push('0');
}
for (let i = 0; i < len; i++) {
const num1 = parseInt(v1[i]);
const num2 = parseInt(v2[i]);
if (num1 > num2) {
return 1;
} else if (num1 < num2) {
return -1;
}
}
return 0;
}
module.exports.compareVersion = compareVersion;
// 调用 wx.getSystemInfo 或者 wx.getSystemInfoSync 获取到当前小程序运行的基础库的版本号
var common = require('../../utils/common.js');
page({
onLoad(){
const version = wx.getSystemInfoSync().SDKVersion;
if (compareVersion(version, '1.1.0') >= 0) {
} else {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
}
})
if (wx.openBluetoothAdapter) {
wx.openBluetoothAdapter()
} else {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
wx.canIUse
wx.showModal({
success: function(res) {
if (wx.canIUse('showModal.success.cancel')) {
console.log(res.cancel);
}
}
})