Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
tingyuan committed Apr 13, 2024
1 parent 8ebf629 commit c54b007
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 133 deletions.
14 changes: 13 additions & 1 deletion src/api/play-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from 'vitest'

import request from './fetcher'
import { PlayUrlResponseSchema } from './play-url.schema'

// import fs from 'node:fs'
test('get-play-url', async () => {
const res = await request(
'/x/player/wbi/playurl?bvid=BV1Av421r7Ur&cid=1454646853&type=mp4&qn=64&fnval=1&platform=pc&high_quality=1',
Expand All @@ -23,3 +23,15 @@ test('get-play-url-html5', async () => {
)
PlayUrlResponseSchema.parse(res)
})

// test('aaa', async () => {
// const qn = [32, 64, 74, 80, 112, 116]
// const list = {}
// for (const q of qn) {
// const res = await request(
// `/x/player/wbi/playurl?bvid=BV1HH4y1h7eh&cid=1432196942&qn=${q}&fnval=16&platform=pc&high_quality=1`,
// )
// list[q] = res
// }
// fs.writeFileSync('listaaa3.json', JSON.stringify(list, null, 2))
// })
8 changes: 6 additions & 2 deletions src/components/CommentList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Icon, Skeleton, Text } from '@rneui/themed'
import { FlashList } from '@shopify/flash-list'
import clsx from 'clsx'
import React from 'react'
import { TouchableOpacity, View } from 'react-native'

Expand All @@ -8,7 +9,6 @@ import { colors } from '@/constants/colors.tw'
import { type CommentItemType, useComments } from '../api/comments'
import { Comment } from './Comment'
import ReplyList from './ReplyList'
import clsx from 'clsx'

function Loading() {
return (
Expand Down Expand Up @@ -72,7 +72,11 @@ export default function CommentList(
color={tw(colors.gray6.text).color}
/>
<Text className={`text-xs mr-3 px-1 ${colors.gray6.text}`}>
{allCount ? allCount + '条评论' : '暂无评论'}
{allCount
? allCount + '条评论'
: isLoading
? '加载中'
: '暂无评论'}
</Text>
</View>
<View className="ml-2 mr-1 flex-row gap-2 items-center">
Expand Down
8 changes: 5 additions & 3 deletions src/routes/About/Statement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ function Statement() {
</Card.Title>
<Card.Divider />
<View>
<Text className="text-base">感谢你使用这款应用 ❤</Text>
<Text className="text-base">感谢你使用这款应用(MiniBili)</Text>
<Text />
<Text className="text-base">
本应用完全开源并且所有数据均为B站官网公开,不涉及任何个人隐私数据,仅供学习交流!
本应用完全开源并且所有数据均为B站官网公开,不涉及任何个人隐私数据,
<Text className="font-bold">*仅供*</Text>
个人使用及学习交流!
</Text>
<Text className="text-base">
有问题欢迎使用意见反馈或者在
Expand All @@ -61,7 +63,7 @@ function Statement() {
中提出 😀
</Text>
<Text />
<Text>⚠️ 切勿频繁刷新数据!🙏</Text>
<Text className="text-base">⚠️ 切勿频繁刷新数据!🙏</Text>
<View className="items-end my-3">
<Button
size="sm"
Expand Down
29 changes: 15 additions & 14 deletions src/routes/Dynamic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,27 @@ function Dynamic({ route }: Props) {
error,
} = useDynamicItems(upId)
useErrToast('请求动态失败', error)
const headerTitle = React.useCallback(() => {
return (
<HeaderLeft
scrollTop={() => {
try {
dynamicListRef.current?.scrollToOffset({
offset: 0,
})
} catch (err) {}
}}
/>
)
}, [])

useUpdateNavigationOptions(
React.useMemo(() => {
const headerTitle = () => {
return (
<HeaderLeft
scrollTop={() => {
try {
dynamicListRef.current?.scrollToOffset({
offset: 0,
})
} catch (err) {}
}}
/>
)
}
return {
headerTitle,
headerRight,
}
}, [headerTitle]),
}, []),
)

const renderItem = ({ item }: { item: DynamicItemAllType }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/History/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function HistoryList() {
},
},
}
}, [headerTitle]),
}, [headerTitle, blackColor]),
)

const buttons = (video: CollectVideoInfo) => {
Expand Down
9 changes: 3 additions & 6 deletions src/routes/Play/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export function PlayHeaderTitle() {
'text-lg font-semibold',
isBlackUp && 'line-through',
followed && colors.secondary.text,
)}
onPress={() => {
//
}}>
)}>
{route.params?.name || vi?.name}
</Text>
<Text
Expand Down Expand Up @@ -167,14 +164,14 @@ export function PlayHeaderRight(props: { cid?: number; refresh: () => void }) {
}}>
省流
</MenuItem>
<MenuItem
{/* <MenuItem
textStyle={tw(' text-black dark:text-gray-300')}
pressColor={tw(colors.gray4.text).color}
onPress={() => {
showToast('暂未实现')
}}>
切换高清
</MenuItem>
</MenuItem> */}
{/* <MenuItem
textStyle={tw(' text-black dark:text-gray-300')}
pressColor={tw(colors.gray4.text).color}
Expand Down
Loading

0 comments on commit c54b007

Please sign in to comment.