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

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