瀏覽代碼

优化订单在查询时用户退出的情况

Zhengxiaowei 5 年之前
父節點
當前提交
c19c95f858
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      src/views/Pay/index.ux

+ 22 - 0
src/views/Pay/index.ux

@@ -205,6 +205,28 @@ export default {
   },
   onHide() {
     this.$app.$def.createShortcut(true);
+  },
+  async onBackPress() {
+    // 查询订单的过程如果用户返回
+    if (this.showLoading) {
+      let ret = await prompt.showDialog({
+        title: "警告",
+        message: "订单正在查询中,是否确认退出?",
+        buttons: [
+          {
+            text: "退出",
+            color: "#EF5952"
+          },
+          {
+            text: "取消",
+            color: "#999"
+          }
+        ]
+      });
+      if (ret.data.index === 1) return true;
+      else router.back();
+    }
+    else router.back();
   }
 }
 </script>