mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-14 05:06:37 +08:00
feat: 项目加载优化
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user