Просмотр исходного кода

improve: 首页网络判断优化;

From-wh 2 лет назад
Родитель
Сommit
c4037672f4

+ 1 - 8
template/uni-app/pages/index/diy/index.vue

@@ -715,14 +715,7 @@
 								icon: 'none',
 								duration: 2000
 							})
-						}
-						setTimeout(e => {
-							this.diyData();
-							this.getIndexData();
-							getShare().then(res => {
-								this.shareInfo = res.data;
-							});
-						}, 2000)
+						}
 						this.errorNetwork = true
 						this.showSkeleton = false;
 					}

+ 14 - 4
template/uni-app/pages/index/index.vue

@@ -26,9 +26,9 @@
 		},
 		onLoad() {
 			uni.hideTabBar()
-			uni.$on('is_diy', (data) => {
-				this.isDiy = data
-			})
+			// uni.$on('is_diy', (data) => {
+			// 	this.isDiy = data
+			// })
 			this.setOpenShare();
 		},
 		onShow() {
@@ -41,6 +41,7 @@
 			getVersion(name) {
 				uni.$emit('uploadFooter')
 				getVersion(name).then(res => {
+					console.log(res, '11')
 					this.version = res.data.version
 					this.isDiy = res.data.is_diy
 					this.loading = true
@@ -58,7 +59,16 @@
 						uni.setStorageSync('DIY_VERSION', res.data.version)
 					} else {}
 				}).catch(err => {
-					this.loading = true
+					// #ifdef APP-PLUS
+					setTimeout(e => {
+						this.getVersion(0);
+					}, 1500)
+					// #endif
+					// #ifndef APP-PLUS
+					this.$util.Tips({
+						title: err
+					});
+					// #endiff
 				})
 			},
 			// 微信分享;

+ 1 - 7
template/uni-app/pages/index/visualization/index.vue

@@ -502,6 +502,7 @@
 			diyData() {
 				let that = this;
 				getDiy().then((res) => {
+					console.log('222', res)
 					let data = res.data;
 					that.headerSerch = data.headerSerch;
 					that.swiperBg = data.swiperBg;
@@ -534,13 +535,6 @@
 							icon: 'none',
 							duration: 2000
 						})
-						setTimeout(e => {
-							this.diyData();
-							this.getIndexData();
-							getShare().then(res => {
-								this.shareInfo = res.data;
-							});
-						}, 2000)
 					}
 					// #endif
 				});