feat: 项目加载优化

This commit is contained in:
Gsh
2026-02-01 00:30:44 +08:00
parent 3b6887dc2e
commit 11cbb1b612
29 changed files with 1490 additions and 299 deletions

View File

@@ -1,9 +1,15 @@
<script setup lang="ts">
import { useRouter } from 'vue-router';
const emit = defineEmits(['close']);
const router = useRouter();
function goToActivation() {
emit('close');
window.location.href = '/console/activation';
// 使用 router 进行跳转,避免完整页面刷新
setTimeout(() => {
router.push('/console/activation');
}, 300); // 等待对话框关闭动画完成
}
</script>

View File

@@ -1,10 +1,13 @@
<script setup lang="ts">
import { ArrowRight, Box, CircleCheck, Loading, Right, Service } from '@element-plus/icons-vue';
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { promotionConfig } from '@/config/constants.ts';
import { useUserStore } from '@/stores';
import { showContactUs } from '@/utils/contact-us.ts';
const router = useRouter();
interface PackageItem {
id: number;
name: string;
@@ -66,7 +69,7 @@ function contactService() {
}
function goToModelLibrary() {
window.location.href = '/model-library';
router.push('/model-library');
}
const selectedPackage = computed(() => {

View File

@@ -2,6 +2,7 @@
import type { GoodsItem } from '@/api/pay';
import { ElMessage } from 'element-plus';
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { createOrder, getOrderStatus } from '@/api';
import { getGoodsList, GoodsCategoryType } from '@/api/pay';
import ProductPage from '@/pages/products/index.vue';
@@ -11,6 +12,7 @@ import NewbieGuide from './NewbieGuide.vue';
import PackageTab from './PackageTab.vue';
const emit = defineEmits(['close']);
const router = useRouter();
// 商品数据类型定义
interface PackageItem {
@@ -321,8 +323,10 @@ function onClose() {
function goToActivation() {
close();
// 使用 window.location 进行跳转,避免 router 注入问题
window.location.href = '/console/activation';
// 使用 router 进行跳转,避免完整页面刷新
setTimeout(() => {
router.push('/console/activation');
}, 300); // 等待对话框关闭动画完成
}
</script>