panhui преди 3 години
родител
ревизия
1638a3be76
променени са 2 файла, в които са добавени 13 реда и са изтрити 4 реда
  1. 11 4
      src/router/index.js
  2. 2 0
      src/styles/main.less

+ 11 - 4
src/router/index.js

@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from '@ionic/vue-router'
 import TabsPage from '../views/TabsPage.vue'
 import { Page } from './Page'
 import { useUserStore } from '../stores/user'
-import { Dialog } from 'vant'
+import { showConfirmDialog } from 'vant'
 
 const router = createRouter({
     history: createWebHistory(import.meta.env.BASE_URL),
@@ -66,12 +66,18 @@ const router = createRouter({
         {
             path: '/productList',
             name: 'productList',
-            component: () => import('@/views/ProductListPage.vue')
+            component: () => import('@/views/ProductListPage.vue'),
+            meta: {
+                pageType: Page.Every
+            }
         },
         {
             path: '/productDetail',
             name: 'productDetail',
-            component: () => import('@/views/ProductDetailPage.vue')
+            component: () => import('@/views/ProductDetailPage.vue'),
+            meta: {
+                pageType: Page.Every
+            }
         }
     ]
 })
@@ -86,7 +92,8 @@ router.beforeEach((to, from, next) => {
                     next()
                 })
                 .catch(() => {
-                    Dialog.confirm({
+                    console.log('37366')
+                    showConfirmDialog({
                         title: '提示',
                         message: '用户未登录,是否立即登录'
                     })

+ 2 - 0
src/styles/main.less

@@ -4,6 +4,8 @@
     --van-tabbar-item-font-size: 10px;
     --van-tabbar-item-icon-size: 28px;
     --van-tabbar-item-icon-margin-bottom: 2px;
+    --van-dialog-confirm-button-text-color: #ff0000;
+    --van-button-default-color: #aaacad;
     --van-gray-6: #c8c9cc;
     --yellow: #ffd563;
     --red: #ff0000;