修复由于没有根节点导致的其他页面不显示
This commit is contained in:
parent
6186c68bc8
commit
95ebce0990
|
@ -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">
|
||||||
|
@ -73,7 +76,7 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div >
|
<div>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<div>注册的用户</div>
|
<div>注册的用户</div>
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue