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