var server = localStorage.getItem('deviceurl') + "PosSellSearch!update_app.do";
// 获取本地应用资源版本号
var wgtVer=null;
function plusReady(){ // 获取本地应用资源版本号
plus.runtime.getProperty(plus.runtime.appid,function(inf){
wgtVer=inf.version;
alert(wgtVer);
});
}
var ver;
mui.plusReady(function(){
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
ver = inf.version;
var client;
var ua = navigator.userAgent.toLowerCase();
$.ajax({
type:"get",
dataType:'jsonp',
url:server,//获取当前上架APPStore版本信息
success:function(data){
var ver_new = (data.version).replace(/\./g,'');
var ver_used = ver.replace(/\./g,'');
if (ver_new > ver_used) {
alert('发现新版本'+ data.version + "是否更新");
plus.runtime.openURL(data.url);
}
},
error: function(xhr, type, errerThrown) {
mui.toast('网络异常,请稍候再试');
}
});
})
})
网友评论