Jelajahi Sumber

检测网络超时

李天标 5 tahun lalu
induk
melakukan
d8057a2025
3 mengubah file dengan 36 tambahan dan 2 penghapusan
  1. 2 1
      common/lang/en.js
  2. 2 1
      common/lang/zh.js
  3. 32 0
      pages/User/equipmentStatusList.vue

+ 2 - 1
common/lang/en.js

@@ -2,7 +2,7 @@ export default {
 	lang: 'en',
 	login: {
 		title: 'backstage management',
-		username:'please enter a user name',
+		username:'please enter a user name/phone',
 		password:'please enter your password',
 		login:'login'
 	},
@@ -84,6 +84,7 @@ export default {
 		error:'Abnormal operation',
 		guanjierror:'Equipment has been shut down.',
 		kaijierror:'Equipment has been started.',
+		network:'Bad machine network,operation failure'
 	},
 	equipmentStatics:{
 		title:'Machine Sales Ranking',

+ 2 - 1
common/lang/zh.js

@@ -2,7 +2,7 @@ export default {
 	lang: 'zh',
 	login: {
 		title: '管理后台',
-		username:'请输入用户名',
+		username:'请输入用户名/手机号',
 		password:'请输入密码',
 		login:'登录'
 	},
@@ -82,6 +82,7 @@ export default {
 		error:'操作异常',
 		guanjierror:'设备已关机',
 		kaijierror:'设备已开机',
+		network:'机器网络不好,操作失败'
 	},
 	equipmentStatics:{
 		title:'机器销售排行',

+ 32 - 0
pages/User/equipmentStatusList.vue

@@ -210,6 +210,7 @@
 					url: '../Login/Login',
 				});
 			}
+
 		},
 		methods: {
 			...mapActions('chart', ['getEquipmentListByUser']),
@@ -306,6 +307,9 @@
 												content: that.$t('equipmentStatusList.tishi'),
 												success: function(res) {
 													that.getEquipmentListData();
+													setTimeout(function () {
+													    that.network(id);
+													}, 7000);
 												}
 											})
 										} else {
@@ -356,6 +360,9 @@
 									content: that.$t('equipmentStatusList.tishi'),
 									success: function(res) {
 										that.getEquipmentListData();
+										setTimeout(function () {
+										    that.network(id);
+										}, 7000);
 									}
 								})
 							} else {
@@ -373,6 +380,31 @@
 					});
 				}
 			},
+			network(id){
+				var token = uni.getStorageSync("token");
+				var equipmentId = id;
+				uni.request({
+					url: this.serverurl + '/TEquipment/checkStatus',
+					data: {
+						"equipmentId": id
+					},
+					method: "POST",
+					header:{
+						'token':token
+					},
+					success: (res) => {
+						var data = res.data.data;
+						if(data=='fail'){
+							uni.showToast({
+							    title: this.$t('equipmentStatusList.network'),
+								icon:'none',
+							    duration: 3000
+							});
+							this.getEquipmentListData();
+						}
+					}
+				});
+			},
 			openDoor(id) {
 				var token = uni.getStorageSync("token");
 				uni.request({