Skip to content

Conversation

@AgxCOy
Copy link
Collaborator

@AgxCOy AgxCOy commented Nov 26, 2025

简而言之,移植blivechat的布局,并适配本项目的后端。

目前显然还没有完工。咕咕咕。

wbzd

@AgxCOy AgxCOy self-assigned this Nov 26, 2025
Copy link
Owner

@frg2089 frg2089 left a 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 不知道是哪里来的 最好处理掉

frg2089

This comment was marked as duplicate.

@AgxCOy
Copy link
Collaborator Author

AgxCOy commented Nov 30, 2025

整改(change as requested)完之后还是考虑先读懂岛风demo写的是怎么回事= =现在是莫得厮路。

AgxCOy and others added 3 commits December 2, 2025 22:28
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]>
TODO:
- 在 3115c4b 基础上重新实现布局所需 API(即 original ... logic 注释块)
- `EventClient.ts`标注的其余待办

Signed-off-by: SilverAg.L <[email protected]>
Copy link
Owner

@frg2089 frg2089 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对提交进行一个快速审查

Comment on lines +22 to +30
<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" />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该可以想办法合并一下

Suggested change
<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'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如无意外 应该由 AutoImport 插件自动处理 .vue 组件的导入

Comment on lines +9 to +16
/** 人气值 */
hot = ref(0)

/** 历史观看人数 */
viewed = ref(0)

/** 外显消息队列 */
messages = reactive<types.AnyDisplayMessage[]>([])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仔细想想 或许这里不该写 vue 响应式对象 改成用事件往外发更好些
响应式对象就让它在SFC里和pinia里好了

https://developer.mozilla.org/docs/Web/API/EventTarget

Comment on lines +47 to +55
const props = withDefaults(
defineProps<{
maxNumber: number
showGiftName?: boolean
}>(),
{
maxNumber: 60,
},
)
Copy link
Owner

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()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里似乎不在某个方法里 如果需要在组件可用时调用异步方法 把调用的部分放到 OnMounted 里

Comment on lines +20 to +27
const resRoom = await client.GET('/bili/live/infoByUid', {
params: {
query: {
userId: userId.value!,
},
},
})
roomId.value = resRoom.data?.roomid ?? undefined
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你猜怎么着?我有非空断言洁癖 我看到 ! 就不自在

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants