caojunjie 4 lat temu
rodzic
commit
9f467b45a3

+ 18 - 3
pages/home/Scan-code-in/index.vue

@@ -93,6 +93,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			this.getDatalist()
 		},
 		methods: {
@@ -114,6 +127,7 @@
 							materialList: this.datalist
 						}
 					}).then(res => {
+						console.log(res)
 						this.dalist = res.data.data
 						for (let i = 0; i < this.dalist.length; i++) {
 							this.total += parseInt(this.dalist[i].rewardMoney)
@@ -122,6 +136,10 @@
 
 					}).catch(err => {
 						console.log(err)
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~'
+						})
 					}).finally(() => {
 						// Loading.close()
 					})
@@ -155,9 +173,6 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						// scanAddress: '青岛市市北区橡胶谷-B栋',		//地址
-						// longitude: 120.3898355082192,		//纬度
-						// latitude: 36.14788760436011,		//经度
 						scanAddress: this.address,		//地址
 						longitude: this.longitude,		//纬度
 						latitude: this.latitude,		//经度

+ 27 - 1
pages/home/scancode/index.vue

@@ -72,6 +72,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -146,7 +159,7 @@
 						console.log(this.lisi)
 					}).catch(err => {
 						this.$refs.repeat.show({
-							title: "网络连接失败",
+							title: "无网络,请连接网络后再试~",
 							type: 'default',
 							position: 'bottom'
 						})
@@ -158,6 +171,19 @@
 			},
 			//获取扫码控件
 			getScanCode(val) {
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				console.log(val)
 				this.number = val
 				this.number_s = val

+ 27 - 0
pages/home/scancode/scancodeout.vue

@@ -72,6 +72,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -152,6 +165,19 @@
 				console.log(val)
 				this.number = val
 				this.number_s = val
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				request({
 						url: '/storeScan/storeScanGetTyre',
 						method: 'Post',
@@ -161,6 +187,7 @@
 							tyreNum: this.number_s
 						}
 					}).then(res => {
+						console.log(res)
 						this.tips = "胎号"
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {