Răsfoiți Sursa

新增手工停止充电标识,优化手工停止后仍然显示充电中的问题

zuypeng 10 luni în urmă
părinte
comite
b90afa7713
3 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 1 0
      src/App.vue
  2. 2 0
      src/pages-charge/ordering/ordering.vue
  3. 8 0
      src/pages/map/map.vue

+ 1 - 0
src/App.vue

@@ -6,6 +6,7 @@ export default <any>{
     lastData: {},
     stations: [],
     normalCode: "",
+    manualStop:false,//手工停止充电标识
   },
   onLaunch() {
     uni.getSystemInfo({

+ 2 - 0
src/pages-charge/ordering/ordering.vue

@@ -184,6 +184,8 @@ const cancel = () => {
                   title: "已停止充电",
                   icon: "none",
                 });
+                //设置手工停止充电标识
+                getApp<any>().globalData.manualStop =true;
                 setTimeout(() => {
                   uni.navigateBack();
                 }, 2000);

+ 8 - 0
src/pages/map/map.vue

@@ -619,6 +619,14 @@ onShow(() => {
 });
 
 const fetchCharging = () => {
+  //手工停止充电后,因为有10s延迟,暂时不查询充电状态
+  if (getApp<any>().globalData.manualStop) {
+    setTimeout(()=>{
+      //10s后重置该标识,防止再次启动充电后不显示充电中快捷角标
+      getApp<any>().globalData.manualStop = false;
+    },10000)
+    return;
+  }
   fetchChargeStatus().then((res) => {
     if (res && [0, 1, 2, 3].includes(res.chargeStatus)) {
       charging.value = res;