-
Notifications
You must be signed in to change notification settings - Fork 1
弹幕姬 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/danmaku
Are you sure you want to change the base?
弹幕姬 #10
Conversation
frg2089
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
先进行一个代码的审
基本都是些小的格式问题
以及 那个 date-fns 3.6 不知道是哪里来的 最好处理掉
|
整改(change as requested)完之后还是考虑先读懂岛风demo写的是怎么回事= =现在是莫得厮路。 |
Co-authored-by: 舰队的偶像-岛风酱! <[email protected]> Signed-off-by: SilverAg.L <[email protected]>
- lazy to continue. im very vegetable. Co-authored-by: 舰队的偶像-岛风酱! <[email protected]> Signed-off-by: SilverAg.L <[email protected]>
- `DanmakuQueue.ts`不知放哪合适,暂不动 - 暂定将svg分离进`ModeratorIcon.vue`. Signed-off-by: SilverAg.L <[email protected]>
Signed-off-by: SilverAg.L <[email protected]>
TODO: - 在 3115c4b 基础上重新实现布局所需 API(即 original ... logic 注释块) - `EventClient.ts`标注的其余待办 Signed-off-by: SilverAg.L <[email protected]>
frg2089
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对提交进行一个快速审查
| <AuthorBadge | ||
| v-if="authorType === types.AuthorType.ADMIN" | ||
| class="style-scope yt-live-chat-author-chip" | ||
| is-admin | ||
| :privilege-type="0" /> | ||
| <AuthorBadge | ||
| v-if="privilegeType > 0" | ||
| class="style-scope yt-live-chat-author-chip" | ||
| :privilege-type="privilegeType" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该可以想办法合并一下
| <AuthorBadge | |
| v-if="authorType === types.AuthorType.ADMIN" | |
| class="style-scope yt-live-chat-author-chip" | |
| is-admin | |
| :privilege-type="0" /> | |
| <AuthorBadge | |
| v-if="privilegeType > 0" | |
| class="style-scope yt-live-chat-author-chip" | |
| :privilege-type="privilegeType" /> | |
| <AuthorBadge | |
| class="style-scope yt-live-chat-author-chip" | |
| :is-admin="authorType === types.AuthorType.ADMIN" | |
| :privilege-type="privilegeType" /> |
| </template> | ||
|
|
||
| <script lang="ts" setup> | ||
| import AuthorBadge from './AuthorBadge.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如无意外 应该由 AutoImport 插件自动处理 .vue 组件的导入
| /** 人气值 */ | ||
| hot = ref(0) | ||
|
|
||
| /** 历史观看人数 */ | ||
| viewed = ref(0) | ||
|
|
||
| /** 外显消息队列 */ | ||
| messages = reactive<types.AnyDisplayMessage[]>([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
仔细想想 或许这里不该写 vue 响应式对象 改成用事件往外发更好些
响应式对象就让它在SFC里和pinia里好了
| const props = withDefaults( | ||
| defineProps<{ | ||
| maxNumber: number | ||
| showGiftName?: boolean | ||
| }>(), | ||
| { | ||
| maxNumber: 60, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个组件是在 pages 目录下的 可能预期目的是作为一个页组件存在的
页组件被 RouterView 动态渲染,它通常不会传递属性 这里始终会保持默认
如果需要获取参数,应该从 ReturnType<typeof useRoute> 对象里取它的 Query 参数
或者你要实在想用 defineProps 也行 研究一下这两个东西
https://router.vuejs.org/guide/essentials/passing-props
https://uvr.esm.is/guide/extending-routes#definepage
| const hot = ref(0) | ||
| const data = reactive<Bili.Live.Danmaku.Event[]>([]) | ||
| const user = useUser() | ||
| await user.updateUserInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里似乎不在某个方法里 如果需要在组件可用时调用异步方法 把调用的部分放到 OnMounted 里
| const resRoom = await client.GET('/bili/live/infoByUid', { | ||
| params: { | ||
| query: { | ||
| userId: userId.value!, | ||
| }, | ||
| }, | ||
| }) | ||
| roomId.value = resRoom.data?.roomid ?? undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你猜怎么着?我有非空断言洁癖 我看到 ! 就不自在
| const resRoom = await client.GET('/bili/live/infoByUid', { | |
| params: { | |
| query: { | |
| userId: userId.value!, | |
| }, | |
| }, | |
| }) | |
| roomId.value = resRoom.data?.roomid ?? undefined | |
| if (!userId.value) return | |
| const resRoom = await client.GET('/bili/live/infoByUid', { | |
| params: { | |
| query: { | |
| userId: userId.value, | |
| }, | |
| }, | |
| }) | |
| roomId.value = resRoom.data?.roomid ?? undefined |
简而言之,移植
blivechat的布局,并适配本项目的后端。目前显然还没有完工。咕咕咕。