Ver código fonte

代码更新 3/9

zhangyun 3 anos atrás
pai
commit
011ee5abaa

+ 7 - 7
MingGaoApp/pages/my/index.vue

@@ -15,7 +15,7 @@
 				</view>
 				<view class="item_info">
 					<view class="" v-if="index==3">
-						{{userinfo.current_version}}
+						{{ids}}
 					</view>
 					<view class="item_info_dian" v-if="index==3&&newversion">
 						
@@ -38,7 +38,8 @@
 					username:""
 				},
 				tablist: ["个人中心", "监测日志", "监督记录","版本信息"],
-				newversion:false
+				newversion:false,
+				ids:plus.runtime.version
 			}
 		},
 		methods: {
@@ -54,20 +55,19 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=app.my.get_app_history',
 					data:{
-						current_version:this.userinfo.current_version
+						current_version:this.ids
 					}
 				})
 				if(res.new_app.app_version){
-					console.log(res.new_app.app_version.match(/\d+/g).join(""))
+					console.log(this.ids.match(/\d+/g).join(""))
 					var news = res.new_app.app_version.match(/\d+/g).join("")
-					var old = this.userinfo.current_version.match(/\d+/g).join("")
+					var old = this.ids.match(/\d+/g).join("")
 					if(news > old){
 						this.newversion = true
 					}else{
 						this.newversion = false
 					}
 				}
-				// this.userinfo = res
 			},
 			myskip(index) {
 				if (index == 0) {
@@ -85,7 +85,7 @@
 					});
 				}else if(index == 3){
 					uni.navigateTo({
-						url: './version?id='+this.userinfo.current_version,
+						url: './version',
 					});
 				}
 			}

+ 7 - 5
MingGaoApp/pages/my/version.vue

@@ -28,12 +28,13 @@
 	export default {
 		data() {
 			return {
-				current_version: "",
+				current_version: plus.runtime.version,
 				newversion: false,
 				versionlist: [],
 				showA: false,
 				contentA: "",
 				percentNum: 0,
+				app_url:""
 			}
 		},
 		watch: {
@@ -78,7 +79,9 @@
 						current_version: this.current_version
 					}
 				})
+				// console.log(this.baseUrl)
 				if (res.new_app.app_version) {
+					this.app_url = res.new_app.app_url
 					var news = res.new_app.app_version.match(/\d+/g).join("")
 					var old = this.current_version.match(/\d+/g).join("")
 					if (news > old) {
@@ -117,7 +120,8 @@
 			upgrade() {
 				//标准版
 				// this.appName = "big_data"
-				var url = "http://hnyfwlw.com/app/big_data.apk"
+				
+				var url = this.baseUrl + this.app_url
 				console.log(url)
 				const downloadTask = uni.downloadFile({
 					url: url, //仅为示例,并非真实的资源
@@ -146,9 +150,7 @@
 				});
 			}
 		},
-		onLoad(option) {
-			console.log(option)
-			this.current_version = option.id
+		onLoad() {
 			this.getversions()
 		}
 	}

Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 10
MingGaoApp/unpackage/dist/dev/app-plus/app-service.js