Uni-app whole package upgrade plan

Insert picture description here
The app has new updates,

  • 1. First, update the application version name and application version number in manifest.json
  • 2. Cloud packaging
  • 3. Upload the packaged .apk installation package to the background server, and upload the version number and version name
  • 4. The front end requests the interface to determine whether the online version number is greater than the current app version each time before entering the app, and if it is greater than the current app version, it prompts to upgrade
  • 5. There is also a check update button in the personal center. Clicking it will request the interface to determine whether there is a new version
getVersion(){
    
    
			// #ifdef APP-PLUS
			uni.showLoading({
    
    
				title:'正在获取最新版本信息...'
			})
			setTimeout(()=>{
    
    
				uni.hideLoading();
				// 如果线上版本大于本地版本
				let onLineVersion = 105;
				
				if(onLineVersion > plus.runtime.versionCode){
    
    
					uni.showModal({
    
    
						title:'发现新版本是否升级?',
						content:`
							1、新增个人信息模块
							2、新增版本信息模块
						`,
						success(res){
    
    
							if(res.confirm){
    
    
								 	plus.runtime.openURL('http://192.168.8.106:8081/xxxxxx.apk');
							}
						}
					})
				}else{
    
    
					uni.showToast({
    
    
						icon:'none',
						title:'当前已经是最新版本'
					})
				}
			},2000)
			// #endif
		}

Guess you like

Origin blog.csdn.net/weixin_35958891/article/details/108095818