Commit 69a964972fab66fe26ce28adaf2f04204333baf2

Authored by 王强
1 parent e1e62eaa

购好物,调整网络异常处理~

Showing 1 changed file with 5 additions and 3 deletions
src/pages/common/common.vue
@@ -41,7 +41,9 @@ @@ -41,7 +41,9 @@
41 top: { 41 top: {
42 value: 0 42 value: 0
43 }, 43 },
44 - onLine: navigator.onLine, 44 + onLine: {
  45 + value: navigator.onLine // 网络状态,true:正常;false:异常
  46 + },
45 helper: null, 47 helper: null,
46 appShareParams: null, 48 appShareParams: null,
47 schemeParams: null, 49 schemeParams: null,
@@ -1069,10 +1071,10 @@ @@ -1069,10 +1071,10 @@
1069 1071
1070 // 修改onLine的值 1072 // 修改onLine的值
1071 const { type } = e; 1073 const { type } = e;
1072 - this.$set(this, "onLine", (type === "online")); 1074 + this.$set(this.onLine, 'value', (type === "online"));
1073 1075
1074 // 判断在线状态,给出提示 1076 // 判断在线状态,给出提示
1075 - if (this.onLine) { 1077 + if (this.onLine.value) {
1076 Toast("网络连接恢复"); 1078 Toast("网络连接恢复");
1077 } else { 1079 } else {
1078 Toast("网络异常,请检查网络"); 1080 Toast("网络异常,请检查网络");