自定义ui视频组件调试

v2
一杯沧海 11 months ago
parent 0c7d7bc52b
commit bae5ece6d7
  1. 4
      .env
  2. 2
      src/components/videoList/videoList.tsx
  3. 2
      src/pages/preview/brand/info/info.tsx
  4. 10
      src/pages/preview/health/health.tsx

@ -1,6 +1,6 @@
#TARO_APP_API=https://yjx.dev.yaojiankang.top #TARO_APP_API=https://yjx.dev.yaojiankang.top
#TARO_APP_API=https://mooc.yaojiankang.top #TARO_APP_API=https://mooc.yaojiankang.top
TARO_APP_API=https://xingui.yaojiankang.top #TARO_APP_API=https://xingui.yaojiankang.top
#TARO_APP_API=https://shopfix.yaojiankang.top #TARO_APP_API=https://shopfix.yaojiankang.top
#TARO_APP_API=https://playedu.yaojiankang.top TARO_APP_API=https://playedu.yaojiankang.top
TARO_APP_LGOIN=true TARO_APP_LGOIN=true

@ -42,7 +42,7 @@ const VideoList: FC<Props> = (props) => {
<View className={styles.health}> <View className={styles.health}>
<View key={data.id} onClick={jump} className="bg-white"> <View key={data.id} onClick={jump} className="bg-white">
<Img src={data.url_path} mode='widthFix' errorType={props.errorType} height={346}/> <Img src={data.url_path} errorType={props.errorType} height={346}/>
<View className='p-2 relative'> <View className='p-2 relative'>
<View className='text-ellipsis-1 font-28 text-dark'>{data.title}</View> <View className='text-ellipsis-1 font-28 text-dark'>{data.title}</View>
<View className='text-ellipsis-2 mt-2 font-24 text-secondary'>{data.introduction}</View> <View className='text-ellipsis-2 mt-2 font-24 text-secondary'>{data.introduction}</View>

@ -103,7 +103,7 @@ const BrandInfo: FC = () => {
onChange={onChange} onChange={onChange}
> >
{brandInfo?.introductory_video_resource?.url && <SwiperItem> {brandInfo?.introductory_video_resource?.url && <SwiperItem>
<VideoPro onRef={VideoRef} src={"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"}></VideoPro> <VideoPro onRef={VideoRef} src={brandInfo.introductory_video_resource.url}></VideoPro>
</SwiperItem>} </SwiperItem>}
{ {
(brandInfo?.brand_album?.length || 0) > 0 (brandInfo?.brand_album?.length || 0) > 0

@ -13,6 +13,7 @@ const Health: FC = () => {
const [data, setData] = useState<VideList[]>([]) const [data, setData] = useState<VideList[]>([])
const [total, setTotal] = useState(0) const [total, setTotal] = useState(0)
const [enable, setEnable] = useState(true) const [enable, setEnable] = useState(true)
const [statusText,setStatusText] = useState("正在加载~")
async function getData(page: number) { async function getData(page: number) {
try { try {
@ -28,7 +29,12 @@ const Health: FC = () => {
} }
useReachBottom(() => { useReachBottom(() => {
data.length < total && setPage(page + 1) if(data.length < total ) {
setPage(page + 1)
setStatusText("加载中...")
return
}
setStatusText("没有更多了")
}) })
useEffect(() => { useEffect(() => {
@ -45,7 +51,7 @@ const Health: FC = () => {
<View className={styles.container}> <View className={styles.container}>
{data.map(d => <VideoList key={d.id} data={d} errorType='health'/>)} {data.map(d => <VideoList key={d.id} data={d} errorType='health'/>)}
</View> </View>
<PageScript/> <PageScript text={statusText} />
</> </>
: <Empty showBack onRefresh={() => getData(1)} name='暂无数据'/> : <Empty showBack onRefresh={() => getData(1)} name='暂无数据'/>
} }

Loading…
Cancel
Save