Quellcode durchsuchen

屏蔽右下角弹窗

chen vor 3 Jahren
Ursprung
Commit
39328b247b
2 geänderte Dateien mit 59 neuen und 23 gelöschten Zeilen
  1. 50 23
      src/App.vue
  2. 9 0
      src/api/App.js

+ 50 - 23
src/App.vue

@@ -1,4 +1,3 @@
-
 <template>
   <div id="app">
     <router-view />
@@ -6,32 +5,60 @@
 </template>
 
 <script>
+import { getRebateOrderMsg } from "@/api/App";
 export default {
   name: "App",
   data() {
     return {};
   },
-  watch: {
-    $route: {
-      handler: function (route) {
-        let id = setInterval(() => {
-          if (route.path !== "/login") {
-            this.$notify.info({
-              title: "自定义位置",
-              message: "右下角弹出的消息",
-              position: "bottom-right",
-              duration: 0,
-              // onClose: id(),
-            });
-            clearInterval(id);
-          } else {
-            // clearInterval(id);
-          }
-        }, 3000);
-      },
-      // immediate: true,
-    },
-  },
-  created() {},
+  // watch: {
+  //   $route(route) {
+  //     let that = this.$notify;
+
+  //     let aa = function () {
+  //       let intivalId2 = setInterval(() => {
+  //         that.info({
+  //           title: "自定义位置",
+  //           message: "右下角弹出的消息",
+  //           position: "bottom-right",
+  //           duration: 0,
+  //           onClose() {
+  //             console.log("关闭回调");
+  //             clearInterval(intivalId2);
+  //             aa();
+  //           },
+  //         });
+  //         clearInterval(intivalId2);
+  //       }, 3000);
+  //     };
+  //     if (route.path == "/dashboard") {
+  //       console.log(32312312312);
+  //       // let res = await getRebateOrderMsg();
+  //       // console.log(res);
+  //       // let intivalId = setInterval(() => {
+  //       //   this.$notify.info({
+  //       //     title: "自定义位置",
+  //       //     message: "右下角弹出的消息",
+  //       //     position: "bottom-right",
+  //       //     duration: 0,
+  //       //     onClose() {
+  //       //       console.log("关闭回调");
+  //       //       console.log(that);
+  //       //       clearInterval(intivalId);
+  //       //       aa();
+  //       //     },
+  //       //   });
+  //       //   clearInterval(intivalId);
+  //       // }, 3000);
+
+  //     } else {
+  //       // clearInterval(id);
+  //     }
+  //   },
+  //   // immediate: true,
+  // },
+
+  updated() {},
+  methods: {},
 };
 </script>

+ 9 - 0
src/api/App.js

@@ -0,0 +1,9 @@
+import request from "@/utils/request";
+
+//返利通知获取信息接口
+export function getRebateOrderMsg() {
+  return request({
+    url: "/rebate/order/msg",
+    method: "get",
+  });
+}