diff --git a/src/routes/About/BlackTags.tsx b/src/routes/About/BlackTags.tsx index f760070..58f0cbc 100644 --- a/src/routes/About/BlackTags.tsx +++ b/src/routes/About/BlackTags.tsx @@ -25,7 +25,7 @@ function BlackTags() { setExpanded(!expanded) }}> + containerStyle={tw('flex-wrap p-0 flex-row px-1 pb-4 bg-transparent')}> {Object.values($blackTags).map((tag) => { return ( 暂无收藏 + + {$collectedVideos.length === 0 ? ( + + 暂无收藏{'\n\n'}在视频播放页点击⭐收藏按钮 + + ) : ( + 无搜索结果 + )} + } ListFooterComponent={ - $collectedVideos.length ? ( + collectVideos.length ? ( 暂无更多 diff --git a/src/routes/History/index.tsx b/src/routes/History/index.tsx index 6ebb018..7b9ff8a 100644 --- a/src/routes/History/index.tsx +++ b/src/routes/History/index.tsx @@ -1,7 +1,7 @@ import { Text } from '@rneui/themed' import { FlashList } from '@shopify/flash-list' import React from 'react' -import { Linking } from 'react-native' +import { Linking, View } from 'react-native' import VideoListItem from '@/components/VideoItem' import { colors } from '@/constants/colors.tw' @@ -11,7 +11,8 @@ import type { CollectVideoInfo, HistoryVideoInfo } from '@/types' function HistoryList() { const { $watchedVideos } = useStore() - const headerTitle = `⏰ 观看历史(${Object.keys($watchedVideos).length})` + const count = Object.keys($watchedVideos).length + const headerTitle = `⏰ 观看历史(${count})` const blackColor = tw(colors.black.text).color const [searchKeyWord, setSearchKeyWord] = React.useState('') useUpdateNavigationOptions( @@ -73,12 +74,18 @@ function HistoryList() { persistentScrollbar estimatedItemSize={100} ListEmptyComponent={ - 暂无记录 + + {count === 0 ? ( + 暂无观看记录 + ) : ( + 无搜索结果 + )} + } ListFooterComponent={ list.length ? ( - 暂无更多(最近约400条) + 暂无更多(保存最近约420条) ) : null } diff --git a/src/routes/Music/index.tsx b/src/routes/Music/index.tsx index d3bdae2..e21a5b7 100644 --- a/src/routes/Music/index.tsx +++ b/src/routes/Music/index.tsx @@ -217,12 +217,13 @@ function MusicList() { // ListHeaderComponent={} ListEmptyComponent={ - 暂无歌曲 {list.length === 0 ? ( - 你可以在视频播放页面右上角添加 + 暂无歌曲{'\n\n'}在视频播放页面右上角菜单添加 - ) : null} + ) : ( + 无搜索结果 + )} } ListFooterComponent={ diff --git a/src/routes/Play/inject-play.js b/src/routes/Play/inject-play.js index df4bab9..b84dea1 100644 --- a/src/routes/Play/inject-play.js +++ b/src/routes/Play/inject-play.js @@ -74,6 +74,9 @@ function __$hack() { if (node.src !== newVideoUrl) { node.src = newVideoUrl node.play() + setTimeout(() => { + window.reportPlayTime() + }, 3000) } setTimeout(() => { if (node.src !== newVideoUrl) { @@ -157,6 +160,7 @@ function __$hack() { }) video.addEventListener('ended', () => { + window.reportPlayTime() const rateBtn = document.getElementById('play-rate-button') rateBtn.dataset.rate = `1${xx}` rateBtn.textContent = 1 + xx @@ -188,9 +192,6 @@ function __$hack() { lastTime = video.currentTime }) - video.addEventListener('ended', () => { - window.reportPlayTime() - }) window.reportPlayTime = () => { window.ReactNativeWebView.postMessage( JSON.stringify({ diff --git a/src/routes/VideoList/Test.tsx b/src/routes/VideoList/Test.tsx index 860d0d1..eabddce 100644 --- a/src/routes/VideoList/Test.tsx +++ b/src/routes/VideoList/Test.tsx @@ -10,7 +10,6 @@ export default function Test() { const [count, setCount] = React.useState(0) const [time, setTime] = React.useState(getTime) const state = useAppState() - console.log(99, state) // useBackgroundTask( // 'test', // useMemoizedFn(() => { diff --git a/src/routes/WebPage/index.tsx b/src/routes/WebPage/index.tsx index d008865..3b71a6d 100644 --- a/src/routes/WebPage/index.tsx +++ b/src/routes/WebPage/index.tsx @@ -1,6 +1,6 @@ -import { useRefresh } from '@react-native-community/hooks' +import { useBackHandler, useRefresh } from '@react-native-community/hooks' import type { NativeStackScreenProps } from '@react-navigation/native-stack' -import { Button, Text } from '@rneui/themed' +import { Text } from '@rneui/themed' import { ResizeMode, Video } from 'expo-av' import React from 'react' import { @@ -81,36 +81,52 @@ function WebPage({ route }: Props) { : '' const liveUrls = useLiveUrl(enableBackgroundPlay ? roomId : '') const videoRef = React.useRef