فهرست منبع

优化:兼容未登录用户首次进入订单页

萤火科技 3 سال پیش
والد
کامیت
11ac5e3e51
3فایلهای تغییر یافته به همراه7 افزوده شده و 7 حذف شده
  1. 3 3
      pages/login/components/main.vue
  2. 2 2
      pages/order/detail.vue
  3. 2 2
      pages/order/index.vue

+ 3 - 3
pages/login/components/main.vue

@@ -230,10 +230,10 @@
           .then(result => {
             // 显示登录成功
             app.$toast(result.message)
+            // 相应全局事件订阅: 刷新上级页面数据
+            uni.$emit('syncRefresh', true)
             // 跳转回原页面
-            setTimeout(() => {
-              app.onNavigateBack(1)
-            }, 2000)
+            setTimeout(() => app.onNavigateBack(1), 2000)
           })
           .catch(err => {
             // 跳转回原页面

+ 2 - 2
pages/order/detail.vue

@@ -292,7 +292,7 @@
       // 获取当前订单信息
       this.getOrderDetail()
       // 注册全局事件订阅: 是否刷新当前订单数据
-      uni.$on('syncRefreshOrder', (val, isCur) => {
+      uni.$on('syncRefresh', (val, isCur) => {
         if (!isCur) {
           this.canReset = val
         }
@@ -320,7 +320,7 @@
             app.isLoading = false
           })
         // 相应全局事件订阅: 刷新上级页面数据
-        canReset && uni.$emit('syncRefreshOrder', true, true)
+        canReset && uni.$emit('syncRefresh', true, true)
       },
 
       // 复制指定内容

+ 2 - 2
pages/order/index.vue

@@ -208,7 +208,7 @@
       // 初始化当前选中的标签
       this.initCurTab(options)
       // 注册全局事件订阅: 是否刷新订单列表
-      uni.$on('syncRefreshOrder', canReset => {
+      uni.$on('syncRefresh', canReset => {
         this.canReset = canReset
       })
     },
@@ -226,7 +226,7 @@
      */
     onUnload() {
       // 卸载全局事件订阅
-      uni.$off('syncRefreshOrder')
+      uni.$off('syncRefresh')
     },
 
     methods: {