king 1 year ago
parent af5acef018
commit da52fe659c
  1. 7
      src/app.config.ts
  2. 3
      src/pages/business/sort/sort.config.ts
  3. 21
      src/pages/business/sort/sort.tsx
  4. 6
      src/pages/home/components/feature_recommended.tsx
  5. 2
      src/pages/home/home.module.scss
  6. 16
      src/pages/index/components/videoList.tsx
  7. 2
      src/pages/preview/illness/list/list.tsx
  8. 13
      src/pages/preview/videoFull/videoFull.tsx

@ -45,6 +45,10 @@ export default defineAppConfig({
'pages/my/my': { 'pages/my/my': {
network: 'all', network: 'all',
packages: ['pages/manage'] packages: ['pages/manage']
},
'pages/home/home': {
network: 'all',
packages: ['pages/preview']
} }
}, },
subpackages: [ subpackages: [
@ -57,8 +61,7 @@ export default defineAppConfig({
'history/history', 'history/history',
'curHistory/curHistory', 'curHistory/curHistory',
'hourHistory/hourHistory', 'hourHistory/hourHistory',
'courType/courType', 'courType/courType'
'sort/sort', // 公共二级分类
] ]
}, },
{ {

@ -1,3 +0,0 @@
export default definePageConfig({
navigationBarTitleText: '分类'
})

@ -1,21 +0,0 @@
import {FC} from "react";
import {View} from "@tarojs/components";
import {useRouter} from "@tarojs/taro";
type SortType = ''
interface Params {
id: number
type: SortType
jumpUrl: (data:Record<string, any>) => void
}
const Sort: FC = () => {
const params = useRouter().params as unknown as Params
return (
<View>ds</View>
)
}
export default Sort

@ -80,7 +80,7 @@ const FeatureRecommended: FC = () => {
title: d.title, title: d.title,
imageUrl: d.url_path, imageUrl: d.url_path,
description: d.introduction, description: d.introduction,
path: `?url=${d.resource?.url}&poster=${d.url_path}&title=${d.resource?.name}` path: `?url=${d.resource?.url}&poster=${d.url_path}&title=${d.title}`
})) }))
} catch (e) { } catch (e) {
} }
@ -95,8 +95,8 @@ const FeatureRecommended: FC = () => {
id: d.id, id: d.id,
imageUrl: d.url_path, imageUrl: d.url_path,
description: d.introduction, description: d.introduction,
title: d.resource?.name, title: d.title,
path: `?url=${d.resource?.url}&poster=${d.url_path}&title=${d.resource?.name}` path: `?url=${d.resource?.url}&poster=${d.url_path}&title=${d.title}`
})) }))
} catch (e) { } catch (e) {
} }

@ -75,7 +75,7 @@
} }
.featureTitle { .featureTitle {
height: 50rpx; height: 42rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }

@ -1,4 +1,4 @@
import {FC, useEffect, useState} from "react"; import {FC, useEffect, useMemo, useState} from "react";
import {useDidShow} from "@tarojs/taro"; import {useDidShow} from "@tarojs/taro";
import {ScrollView, Swiper, SwiperItem, View} from "@tarojs/components"; import {ScrollView, Swiper, SwiperItem, View} from "@tarojs/components";
import {Courses, CoursesKey, publicApi} from "@/api/public"; import {Courses, CoursesKey, publicApi} from "@/api/public";
@ -16,9 +16,9 @@ interface Props {
export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => { export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => {
const [data, setData] = useState<Courses>({ const [data, setData] = useState<Courses>({
is_finished: [],
is_not_required: [],
is_required: [], is_required: [],
is_not_required: [],
is_finished: [],
is_not_finished: [], is_not_finished: [],
}) })
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
@ -105,9 +105,15 @@ export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => {
setCategoryKey(categoryKeys[index]) setCategoryKey(categoryKeys[index])
} }
const categoryIndex = useMemo(() => {
const index = Object.keys(data).findIndex(d => d === categoryKey)
return index < 0 ? 0 : index
}, [data, categoryKey])
return ( return (
<Swiper className={styles.swiper} onChange={changeSwiper} <Swiper className={styles.swiper}
current={Object.keys(data).findIndex(d => d === categoryKey)}> onChange={changeSwiper}
current={categoryIndex}>
{ {
Object.values(data).map((value) => <SwiperItem> Object.values(data).map((value) => <SwiperItem>
<ScrollView scrollY className={styles.swiper} onScrollToLower={() => setPage(page + 1)}> <ScrollView scrollY className={styles.swiper} onScrollToLower={() => setPage(page + 1)}>

@ -41,7 +41,7 @@ const BrandList: FC = () => {
return ( return (
<View style={{display: fetchDone ? 'block' : 'none'}} className='px-2 pt-2 bg-white'> <View style={{display: fetchDone ? 'block' : 'none'}} className='px-2 mt-2 bg-white'>
{ {
brands.length > 0 ? brands.length > 0 ?
brands.map((d, index) => <View key={d.id} className={styles.brands} onClick={() => jump(d.id)}> brands.map((d, index) => <View key={d.id} className={styles.brands} onClick={() => jump(d.id)}>

@ -34,10 +34,22 @@ const VideoFull: FC = () => {
} }
} }
function onError() {
Taro.showModal({
title: '视频播放错误',
confirmText: '退出',
showCancel: true,
success() {
Taro.navigateBack()
}
})
}
return ( return (
<> <>
{params.title && <View className={styles.title}>{params.title}</View>} {params.title && <View className={styles.title}>{params.title}</View>}
<Video <Video
posterSize='cover'
id={'myVideo'} id={'myVideo'}
onClick={click} onClick={click}
className={styles.video} className={styles.video}
@ -53,6 +65,7 @@ const VideoFull: FC = () => {
enableProgressGesture={false} enableProgressGesture={false}
onPlay={() => setpalying(true)} onPlay={() => setpalying(true)}
onPause={() => setpalying(false)} onPause={() => setpalying(false)}
onError={onError}
/> />
</> </>
) )

Loading…
Cancel
Save