mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
add tobecontinue
This commit is contained in:
@@ -10,19 +10,17 @@ const { width } = useWindowSize()
|
||||
|
||||
const weekdays = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
function getDateFromWeek(year: number, week: number, dayOfWeek: number): Date {
|
||||
// week starts from 1-52, dayOfWeek starts from 0-6 where 0 is Monday
|
||||
var simple = new Date(year, 0, 1 + (week - 1) * 7);
|
||||
var dow = simple.getDay();
|
||||
var ISOweekStart = simple;
|
||||
if (dow <= 4)
|
||||
ISOweekStart.setDate(simple.getDate() - simple.getDay() + 1);
|
||||
else
|
||||
ISOweekStart.setDate(simple.getDate() + 8 - simple.getDay());
|
||||
return new Date(ISOweekStart.getFullYear(), ISOweekStart.getMonth(), ISOweekStart.getDate() + dayOfWeek);
|
||||
// week starts from 1-52, dayOfWeek starts from 0-6 where 0 is Monday
|
||||
var simple = new Date(year, 0, 1 + (week - 1) * 7)
|
||||
var dow = simple.getDay()
|
||||
var ISOweekStart = simple
|
||||
if (dow <= 4) ISOweekStart.setDate(simple.getDate() - simple.getDay() + 1)
|
||||
else ISOweekStart.setDate(simple.getDate() + 8 - simple.getDay())
|
||||
return new Date(ISOweekStart.getFullYear(), ISOweekStart.getMonth(), ISOweekStart.getDate() + dayOfWeek)
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
schedules: ScheduleWeekInfo[],
|
||||
schedules: ScheduleWeekInfo[]
|
||||
isSelf: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{
|
||||
@@ -34,7 +32,7 @@ const emit = defineEmits<{
|
||||
|
||||
<template>
|
||||
<NEmpty v-if="(schedules?.length ?? 0) == 0" />
|
||||
<NList style="padding: 0;" bordered >
|
||||
<NList v-else style="padding: 0" bordered>
|
||||
<NListItem v-for="item in schedules" v-bind:key="item.year + ' ' + item.week" style="padding: 0">
|
||||
<NCard size="small" :bordered="false">
|
||||
<template #header>
|
||||
@@ -64,7 +62,7 @@ const emit = defineEmits<{
|
||||
<template #header-extra>
|
||||
<template v-if="day.tag">
|
||||
<NSpace :size="5">
|
||||
<NBadge v-if="day.tagColor" dot :color="day.tagColor"/>
|
||||
<NBadge v-if="day.tagColor" dot :color="day.tagColor" />
|
||||
<NEllipsis>
|
||||
<NText :style="{ color: day.tagColor }">
|
||||
{{ day.tag }}
|
||||
|
||||
@@ -98,6 +98,11 @@ const routes: Array<RouteRecordRaw> = [
|
||||
name: 'manage-schedule',
|
||||
component: () => import('@/views/manage/ScheduleManageView.vue'),
|
||||
},
|
||||
{
|
||||
path: 'event',
|
||||
name: 'manage-event',
|
||||
component: () => import('@/views/manage/EventView.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
} from 'naive-ui'
|
||||
import { h, onMounted, ref } from 'vue'
|
||||
import { BrowsersOutline, Chatbox, Moon, MusicalNote, Sunny, AnalyticsSharp } from '@vicons/ionicons5'
|
||||
import { CalendarClock24Filled, Lottery24Filled } from '@vicons/fluent'
|
||||
import { CalendarClock24Filled, Lottery24Filled, VehicleShip24Filled } from '@vicons/fluent'
|
||||
import { isLoadingAccount, useAccount } from '@/api/account'
|
||||
import RegisterAndLogin from '@/components/RegisterAndLogin.vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
@@ -63,6 +63,21 @@ const menuOptions = [
|
||||
key: 'manage-history',
|
||||
icon: renderIcon(AnalyticsSharp),
|
||||
},
|
||||
{
|
||||
label: () =>
|
||||
h(
|
||||
RouterLink,
|
||||
{
|
||||
to: {
|
||||
name: 'manage-event',
|
||||
},
|
||||
disabled: accountInfo.value?.isBiliVerified != true,
|
||||
},
|
||||
{ default: () => '舰长和SC' }
|
||||
),
|
||||
key: 'manage-event',
|
||||
icon: renderIcon(VehicleShip24Filled),
|
||||
},
|
||||
{
|
||||
label: () =>
|
||||
h(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- eslint-disable vue/component-name-in-template-casing -->
|
||||
<script setup lang="ts">
|
||||
import { NAvatar, NIcon, NLayout, NLayoutHeader, NLayoutSider, NMenu, NSpace, NText, NButton, NResult, NPageHeader, NSwitch, NModal, NEllipsis, MenuOption, NSpin } from 'naive-ui'
|
||||
import { NAvatar, NIcon, NLayout, NLayoutHeader, NLayoutSider, NMenu, NSpace, NText, NButton, NResult, NPageHeader, NSwitch, NModal, NEllipsis, MenuOption, NSpin, NLayoutContent } from 'naive-ui'
|
||||
import { computed, h, onMounted, ref } from 'vue'
|
||||
import { BookOutline as BookIcon, Chatbox, Home, Moon, MusicalNote, PersonOutline as PersonIcon, Sunny, WineOutline as WineIcon } from '@vicons/ionicons5'
|
||||
import { GetInfo, useUser, useUserWithUId } from '@/api/user'
|
||||
@@ -23,6 +23,8 @@ const userInfo = ref<UserInfo>()
|
||||
const biliUserInfo = ref()
|
||||
const accountInfo = useAccount()
|
||||
|
||||
const notfount = ref(false)
|
||||
|
||||
const registerAndLoginModalVisiable = ref(false)
|
||||
const sider = ref()
|
||||
const { width } = useElementSize(sider)
|
||||
@@ -47,7 +49,13 @@ async function RequestBiliUserData() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
userInfo.value = await useUser()
|
||||
const result = await GetInfo(id.value?.toString())
|
||||
if (result.code == 200) {
|
||||
userInfo.value = result.data
|
||||
} else {
|
||||
notfount.value = true
|
||||
}
|
||||
|
||||
menuOptions.value = [
|
||||
{
|
||||
label: () =>
|
||||
@@ -114,8 +122,12 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NResult v-if="!id" status="error" title="输入的uId无效" description="再检查检查" />
|
||||
<NResult v-else-if="false" status="error" title="未找到指定 uId 的用户" description="或者是没有进行认证" />
|
||||
<NLayoutContent v-if="!id" style="height: 100vh;">
|
||||
<NResult status="error" title="输入的uId无效" description="再检查检查" />
|
||||
</NLayoutContent>
|
||||
<NLayoutContent v-else-if="notfount" style="height: 100vh;">
|
||||
<NResult status="error" title="未找到指定 uId 的用户" description="或者是没有进行认证" />
|
||||
</NLayoutContent>
|
||||
<NLayout v-else style="height: 100vh">
|
||||
<NLayoutHeader style="height: 50px; padding: 5px 15px 5px 15px">
|
||||
<NPageHeader :subtitle="($route.meta.title as string) ?? ''">
|
||||
|
||||
3
src/views/manage/EventView.vue
Normal file
3
src/views/manage/EventView.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
编写中...
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { UserInfo } from '@/api/api-models'
|
||||
import { NAvatar, NButton, NDivider, NSpace, NText } from 'naive-ui'
|
||||
import { NAvatar, NButton, NDivider, NImage, NSpace, NText } from 'naive-ui'
|
||||
|
||||
const width = window.innerWidth
|
||||
|
||||
|
||||
Reference in New Issue
Block a user