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 41 top: {
42 42 value: 0
43 43 },
44   - onLine: navigator.onLine,
  44 + onLine: {
  45 + value: navigator.onLine // 网络状态,true:正常;false:异常
  46 + },
45 47 helper: null,
46 48 appShareParams: null,
47 49 schemeParams: null,
... ... @@ -1069,10 +1071,10 @@
1069 1071  
1070 1072 // 修改onLine的值
1071 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 1078 Toast("网络连接恢复");
1077 1079 } else {
1078 1080 Toast("网络异常,请检查网络");
... ...