修复由于没有根节点导致的其他页面不显示

This commit is contained in:
lingling 2025-02-26 21:12:23 +08:00
parent 6186c68bc8
commit 95ebce0990
1 changed files with 91 additions and 90 deletions

View File

@ -1,4 +1,7 @@
<template>
<div>
<div class="container">
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('menu.promotion.Table') + invite_code">
@ -116,6 +119,7 @@
</a-row>
</div>
</div>
</template>
@ -130,8 +134,8 @@ import dayjs from 'dayjs';
import { useRoute } from 'vue-router';
const route = useRoute()
const invite_code = ref(route.params.invite_code)
import router from '@/router';
const invite_code = ref("")
// const data = reactive({
// register: 0,
@ -143,13 +147,13 @@ const data = ref({
register_user: [], //
binding_user: [] //
});
const queryParams = ref([dayjs().subtract(1, 'day').format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")])
onMounted(async () => {
//
const startDate = dayjs().format("YYYY-MM-DD");
const endDate = startDate; //
try {
if (route.params.invite_code) {
invite_code.value = route.params.invite_code
} else {
router.go(-1)
}
const res = await detailed(invite_code.value, queryParams.value[0], queryParams.value[1]); //
//
@ -157,10 +161,7 @@ onMounted(async () => {
data.value.binding = res.data.binding;
data.value.register_user = res.data.register_user;
data.value.binding_user = res.data.binding_user;
} catch (error) {
console.error("Error fetching data:", error);
//
}
});
const reset = () => { }
const search = async () => {
@ -172,7 +173,7 @@ const search = async () => {
data.value.register_user = res.data.register_user;
data.value.binding_user = res.data.binding_user;
}
const queryParams = ref([dayjs().subtract(1, 'day').format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")])
</script>