|
关于autoUpdate设置为false还是会出现原来的更新界面的问题
[复制链接]
本帖最后由 Sir-Ma 于 2018-9-28 22:55 编辑
我使用自定义loader的时候是没有问题的,生成正式之后就出现了这个问题!
关于autoUpdate设置为false还是会出现原来的更新界面的问题
具体情况如下图:
- /*检测更新*/
- function CheckUpdate()
- {
- var mam = api.require('mam');
- mam.checkUpdate(function(ret, err) {
- if(ret){
- var result = ret.result;
- if(result.update == true && result.closed == false){
- var Body = $api.byId('Body');
- $api.append(Body, '<div class="me-update-fixed"><div class="me-update-box"><div class="me-update-title-box"><div class="me-update-title">新版本发布了!!!</div></div><div class="me-update-content" id="UpContent"></div><div class="me-update-button"><div class="me-update-button-title" onclick="UpdateDown()">立即更新</div></div></div></div>');
- var UpContent = $api.byId('UpContent');
- $api.html(UpContent, '更新内容:' + result.updateTip);
- UpdateSource = result.source;
- }
- }
- });
- }
- /*更新下载*/
- function UpdateDown()
- {
- if(UpdateSource!=''){
- api.download({
- url : UpdateSource,
- report : true
- }, function(ret, err) {
- if (ret && 0 == ret.state) {/* 下载进度 */
- api.toast({
- msg : "已经下载" + ret.percent + "%",
- duration : 1000
- });
- }
- if (ret && 1 == ret.state) {/* 下载完成 */
- var savePath = ret.savePath;
- api.installApp({
- appUri : savePath
- });
- }
- });
- }
- }
复制代码
|
|