NGToolsCSharp/NGTools/Scripts/MUI/js/update.js
2024-09-13 16:44:30 +08:00

35 lines
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 参考文档http://ask.dcloud.net.cn/article/431
* 升级文件为JSON格式数据如下
*
* 需升级
{
"status":1,
"version": "2.6.0",
"title": "Hello MUI版本更新",
"note": "修复“选项卡+下拉刷新”示例中某个选项卡滚动到底时会触发所有选项卡上拉加载事件的bug\n修复Android4.4.4版本部分手机上软键盘弹出时影响图片轮播组件导致自动轮播停止的bug",
"url": "http://www.dcloud.io/hellomui/HelloMUI.apk"
}
*
* 无需升级
{"status":0}
*/
var server = "http://www.dcloud.io/check/update"; //获取升级描述文件服务器地址
function update() {
mui.getJSON(server, {
"appid": plus.runtime.appid,
"version": plus.runtime.version,
"imei": plus.device.imei
}, function(data) {
if (data.status) {
plus.nativeUI.confirm(data.note, function(event) {
if (0 == event.index) {
plus.runtime.openURL(data.url);
}
}, data.title, ["立即更新", "取  消"]);
}
});
}
mui.os.plus && !mui.os.stream && mui.plusReady(update);