|
|
@@ -408,57 +408,57 @@
|
|
408
|
408
|
|
|
409
|
409
|
}, false);
|
|
410
|
410
|
})
|
|
411
|
|
- var Code_;
|
|
412
|
|
- var NewCode_;
|
|
413
|
|
- var server = huayi.config.callcenter_url + "ApplicationsRefresh/GetInfo?"; //获取升级描述文件服务器地址
|
|
414
|
|
- plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
|
|
415
|
|
- console.log("当前应用版本:"+wgtinfo.version+"---"+plus.runtime.version);
|
|
416
|
|
- localStorage.setItem("Code",wgtinfo.version)//缓存保存版本号;
|
|
417
|
|
- Code_= localStorage.getItem("Code");
|
|
418
|
|
- $('.update').text(Code_);
|
|
419
|
|
-
|
|
420
|
|
- });
|
|
421
|
|
- mui.ajax(server, {
|
|
422
|
|
- data: {
|
|
423
|
|
- isNew: true,
|
|
424
|
|
- token: token
|
|
425
|
|
- },
|
|
426
|
|
- dataType: 'json', //服务器返回json格式数据
|
|
427
|
|
- type: 'post', //HTTP请求类型
|
|
428
|
|
- timeout: 10000, //超时时间设置为10秒;
|
|
429
|
|
- headers: {
|
|
430
|
|
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
|
|
431
|
|
- },
|
|
432
|
|
- success: function(data) {
|
|
433
|
|
- if(data.state == "success") {
|
|
434
|
|
- NewCode_ = data.data.F_VersionCode;
|
|
435
|
|
- localStorage.setItem("Code",NewCode_); //缓存保存版本号;
|
|
436
|
|
-// alert(Code_);
|
|
437
|
|
-// alert(NewCode_);
|
|
438
|
|
- if(Code_!= NewCode_){
|
|
439
|
|
- var Codes=localStorage.setItem("Code",NewCode_);
|
|
440
|
|
- plus.nativeUI.confirm("1:引导页修改", function(event) {
|
|
441
|
|
- var tapIndex = event.index;
|
|
442
|
|
- if(tapIndex == 0) {
|
|
443
|
|
- console.log(data);
|
|
444
|
|
- plus.runtime.openURL(data.data.F_DownUrl);
|
|
445
|
|
- } else {
|
|
446
|
|
- mui.toast("取消更新");
|
|
447
|
|
- }
|
|
448
|
|
- }, "提示", ["立即更新", "取消", ])
|
|
449
|
|
- }
|
|
450
|
|
-
|
|
451
|
|
- } else {
|
|
452
|
|
- mui.toast(data.message);
|
|
453
|
|
-
|
|
454
|
|
- }
|
|
455
|
|
-
|
|
456
|
|
- },
|
|
457
|
|
- error: function(data) {
|
|
458
|
|
- //异常处理;
|
|
459
|
|
- console.log(data.message);
|
|
460
|
|
- }
|
|
461
|
|
- })
|
|
|
411
|
+// var Code_;
|
|
|
412
|
+// var NewCode_;
|
|
|
413
|
+// var server = huayi.config.callcenter_url + "ApplicationsRefresh/GetInfo?"; //获取升级描述文件服务器地址
|
|
|
414
|
+// plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
|
|
|
415
|
+// console.log("当前应用版本:"+wgtinfo.version+"---"+plus.runtime.version);
|
|
|
416
|
+// localStorage.setItem("Code",wgtinfo.version)//缓存保存版本号;
|
|
|
417
|
+// Code_= localStorage.getItem("Code");
|
|
|
418
|
+// $('.update').text(Code_);
|
|
|
419
|
+//
|
|
|
420
|
+// });
|
|
|
421
|
+// mui.ajax(server, {
|
|
|
422
|
+// data: {
|
|
|
423
|
+// isNew: true,
|
|
|
424
|
+// token: token
|
|
|
425
|
+// },
|
|
|
426
|
+// dataType: 'json', //服务器返回json格式数据
|
|
|
427
|
+// type: 'post', //HTTP请求类型
|
|
|
428
|
+// timeout: 10000, //超时时间设置为10秒;
|
|
|
429
|
+// headers: {
|
|
|
430
|
+// 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
|
|
|
431
|
+// },
|
|
|
432
|
+// success: function(data) {
|
|
|
433
|
+// if(data.state == "success") {
|
|
|
434
|
+// NewCode_ = data.data.F_VersionCode;
|
|
|
435
|
+// localStorage.setItem("Code",NewCode_); //缓存保存版本号;
|
|
|
436
|
+// // alert(Code_);
|
|
|
437
|
+// // alert(NewCode_);
|
|
|
438
|
+// if(Code_!= NewCode_){
|
|
|
439
|
+// var Codes=localStorage.setItem("Code",NewCode_);
|
|
|
440
|
+// plus.nativeUI.confirm("1:引导页修改", function(event) {
|
|
|
441
|
+// var tapIndex = event.index;
|
|
|
442
|
+// if(tapIndex == 0) {
|
|
|
443
|
+// console.log(data);
|
|
|
444
|
+// plus.runtime.openURL(data.data.F_DownUrl);
|
|
|
445
|
+// } else {
|
|
|
446
|
+// mui.toast("取消更新");
|
|
|
447
|
+// }
|
|
|
448
|
+// }, "提示", ["立即更新", "取消", ])
|
|
|
449
|
+// }
|
|
|
450
|
+//
|
|
|
451
|
+// } else {
|
|
|
452
|
+// mui.toast(data.message);
|
|
|
453
|
+//
|
|
|
454
|
+// }
|
|
|
455
|
+//
|
|
|
456
|
+// },
|
|
|
457
|
+// error: function(data) {
|
|
|
458
|
+// //异常处理;
|
|
|
459
|
+// console.log(data.message);
|
|
|
460
|
+// }
|
|
|
461
|
+// })
|
|
462
|
462
|
})
|
|
463
|
463
|
</script>
|
|
464
|
464
|
|