2
0

fix:home界面组件更新联动

This commit is contained in:
zhongzm
2024-12-25 18:51:47 +08:00
parent 8edc1e19c7
commit 1c81fa2ec0
5 changed files with 24 additions and 3 deletions

View File

@@ -1,10 +1,12 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { ref, onMounted } from 'vue';
import { ref, onMounted, inject } from 'vue';
import { fetchPackageList, submitOrder } from '@/service/api/auth';
import { message } from 'ant-design-vue';
const { t } = useI18n();
// 注入更新仪表盘的方法
const updateDashboard = inject('updateDashboard') as () => Promise<void>;
interface PackageOption {
id: string;
@@ -127,6 +129,8 @@ const handleSubmitOrder = async () => {
packageId: selectedPackage.value.id
});
message.success('套餐办理成功!');
// 更新仪表盘数据
await updateDashboard();
} catch (error) {
message.error('套餐办理失败,请重试!');
console.error('Failed to submit order:', error);