console.log('onLaunch');  
              const updateManager = uni.getUpdateManager();  
              updateManager.onCheckForUpdate(function(res) {  
                console.log(res.hasUpdate)  
                if (res.hasUpdate) {  
                  updateManager.onUpdateReady(function() {  
                    uni.showModal({  
                      title: "更新提示",  
                      content: "新版本已经准备好,是否重启应用?",  
                      success(res) {  
                        if (res.confirm) {  
                          // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启  
                          updateManager.applyUpdate();  
                        }  
                      }  
                    });  
                  });  
                  updateManager.onUpdateFailed(function() {  
                    // 新的版本下载失败  
                    uni.showModal({  
                      title: "已经有新版本了哟~",  
                      content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~"  
                    });  
                  });  
                }  
              });  
            updateManager.onUpdateFailed(function (res) {  
              // 新的版本下载失败  
            });                                
                                        乔军                                                                                
                                        
                                - 发布:2019-09-05 09:19
 - 更新:2019-12-17 13:48
 - 阅读:2350
 
微信小程序端版本更新不运行
                                分类:uni-app
                            
                            
                            
                            
            
            
            
            
1 个回复
1***@qq.com - 前端小白
兄弟 解决了吗 我的是有一些机型不生效