一杯沧海 1 year ago
commit d44f3eb15c
  1. 4
      pnpm-lock.yaml
  2. 8
      src/api/home.ts
  3. 4
      src/components/video/video.tsx
  4. 5
      src/pages/business/videoInfo/components/catalogue.tsx
  5. 12
      src/pages/business/videoInfo/components/course.tsx
  6. 4
      src/pages/home/components/feature_recommended.tsx
  7. 6
      src/pages/home/home.tsx
  8. 2
      src/pages/manage/courseAdmin/components/search.tsx
  9. 10
      src/pages/manage/courseAdmin/courseAdmin.tsx
  10. BIN
      src/static/img/arrow-right.png

@ -1,4 +1,4 @@
lockfileVersion: '6.0' lockfileVersion: '6.1'
settings: settings:
autoInstallPeers: true autoInstallPeers: true
@ -12444,7 +12444,7 @@ packages:
dependencies: dependencies:
object-assign: 4.1.1 object-assign: 4.1.1
react: 18.0.0 react: 18.0.0
react-is: 16.13.1 react-is: 18.2.0
dev: false dev: false
/react@18.0.0: /react@18.0.0:

@ -33,8 +33,12 @@ export interface HomeData {
adverts: AdwareType[] adverts: AdwareType[]
skill: Kill[] skill: Kill[]
health: Health[] health: Health[]
brand: Brand[] brand: {
illness: Illness[] list: Brand[]
}
illness: {
list: Illness[]
}
} }
export const HomeApi = { export const HomeApi = {

@ -45,12 +45,10 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
opt.breakpoint.forEach(d => { opt.breakpoint.forEach(d => {
if (time < d + deviation && time > d - deviation) { if (time < d + deviation && time > d - deviation) {
video?.pause() video?.pause()
video?.seek(d - deviation)
if (process.env.TARO_ENV === 'h5') { if (process.env.TARO_ENV === 'h5') {
try { try {
document?.exitFullscreen().then() document?.exitFullscreen().then()
} catch (e) { } catch (e) {}
}
} }
video?.exitFullScreen() video?.exitFullScreen()
opt.onBreakpoint(d) opt.onBreakpoint(d)

@ -175,10 +175,9 @@ const Catalogue: FC<Props> = ({data, setHors, id, playId}) => {
<View className='Videobutton'> <View className='Videobutton'>
{ {
playing ? <MyButton style={{flex: '1'}} onClick={onPause}>{JSON.stringify(playing)}</MyButton> playing ? <MyButton style={{flex: '1'}} onClick={onPause}></MyButton>
: <MyButton style={{flex: '1'}} onClick={learning}>{JSON.stringify(playing)}</MyButton> : <MyButton style={{flex: '1'}} onClick={learning}></MyButton>
} }
<View className='px-3' onClick={() => setShow(true)}>...</View> <View className='px-3' onClick={() => setShow(true)}>...</View>
</View> </View>

@ -129,15 +129,13 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}) => {
setTime={videoSeek} setTime={videoSeek}
/> />
<CustomPageContainer <CustomPageContainer show={show} position='bottom'>
show={show}
position='bottom'
>
<View> <View>
<View className='text-center mt-2 text-muted'> <View className='text-center mt-2 text-muted'>
<Text className='mr-2'>{formatMinute(time)}</Text> <Text className='mr-2'>{formatMinute(time)}</Text>
</View> </View>
{examAll?.[time]?.slice(0, 1)?.map((d) => {
examAll?.[time]?.slice(0, 1)?.map((d) =>
<ScrollView style='height:60vh' scrollY key={d.id}> <ScrollView style='height:60vh' scrollY key={d.id}>
{d.question_type === 2 && {d.question_type === 2 &&
<Judge <Judge
@ -145,8 +143,8 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}) => {
validate={validate} validate={validate}
onAnswer={(isAnswer) => setRecord([isAnswer])} onAnswer={(isAnswer) => setRecord([isAnswer])}
/>} />}
</ScrollView> </ScrollView>)
)} }
<View> <View>
<View className='statistics'> <View className='statistics'>

@ -76,9 +76,7 @@ const FeatureRecommended: FC<Props> = (props) => {
description: d.graphic_introduction, description: d.graphic_introduction,
path: `?id=${d.id}`, path: `?id=${d.id}`,
})) }))
} catch (e) { } catch (e) {}
console.log(e)
}
return [] return []
} }

@ -1,7 +1,6 @@
import {FC, useEffect, useState} from "react"; import {FC, useEffect, useState} from "react";
import {View} from "@tarojs/components"; import {View} from "@tarojs/components";
import styles from "./home.module.scss"; import styles from "./home.module.scss";
// import {Search} from "@/pages/home/components/search";
import Adware from "@/pages/home/components/adware"; import Adware from "@/pages/home/components/adware";
import Feature from "@/pages/home/components/feature"; import Feature from "@/pages/home/components/feature";
import FeatureRecommended from "@/pages/home/components/feature_recommended"; import FeatureRecommended from "@/pages/home/components/feature_recommended";
@ -29,13 +28,12 @@ const Home: FC = () => {
return ( return (
<View className={styles.content}> <View className={styles.content}>
{/*<Search/>*/}
<Adware data={data?.adverts || []} only_flag='routine_home_top_banner' width={710}/> <Adware data={data?.adverts || []} only_flag='routine_home_top_banner' width={710}/>
<Feature/> <Feature/>
<FeatureRecommended <FeatureRecommended
illness={(data?.illness as any)?.list || []} illness={data?.illness.list || []}
health={data?.health || []} health={data?.health || []}
brand={((data?.brand as any)?.list) || []} brand={data?.brand.list || []}
skill={data?.skill || []} skill={data?.skill || []}
/> />
<Adware data={data?.adverts || []} only_flag='routine_home_recommend_banner' width={710}/> <Adware data={data?.adverts || []} only_flag='routine_home_recommend_banner' width={710}/>

@ -88,7 +88,7 @@ export const Search: FC<Props> = ({param, setParam}) => {
{deps.length ? {deps.length ?
<> <>
{ {
deps.map(dep => <View deps?.map(dep => <View
key={dep.id} key={dep.id}
className={styles.radioBox} className={styles.radioBox}
onClick={() => changeDepId(dep.id)}> onClick={() => changeDepId(dep.id)}>

@ -26,7 +26,7 @@ const CourseAdmin: FC = () => {
courseApi.getCourseAll({...param, page_size: param.page_size * (replace ? param.page : 1)}).then(res => { courseApi.getCourseAll({...param, page_size: param.page_size * (replace ? param.page : 1)}).then(res => {
setTotal(res.total) setTotal(res.total)
if (param.page === 1 || replace) { if (param.page === 1 || replace) {
setData(res.data) setData(res.data || [])
} else { } else {
setData([ setData([
...data, ...data,
@ -53,7 +53,7 @@ const CourseAdmin: FC = () => {
if (curs.length === data.length) { if (curs.length === data.length) {
setCurs([]) setCurs([])
} else { } else {
setCurs(data.map(d => d.id)) setCurs(data?.map(d => d.id))
} }
} }
@ -72,7 +72,7 @@ const CourseAdmin: FC = () => {
Taro.showModal({ Taro.showModal({
title: '删除警告', title: '删除警告',
content: "删除后所有部门不可查看", content: "删除后所有部门不可查看",
confirmText:'删除', confirmText: '删除',
async success({confirm}) { async success({confirm}) {
if (confirm) { if (confirm) {
try { try {
@ -108,7 +108,7 @@ const CourseAdmin: FC = () => {
* @param required [] * @param required []
*/ */
function batchChangDep(ids: number[], depList = [], required = []) { function batchChangDep(ids: number[], depList = [], required = []) {
if (!ids.length) { if (!ids?.length) {
Taro.showToast({title: '请选择课程', icon: 'none'}) Taro.showToast({title: '请选择课程', icon: 'none'})
return return
} }
@ -153,7 +153,7 @@ const CourseAdmin: FC = () => {
<View className={styles.curList}> <View className={styles.curList}>
{ {
data.map((d, index) => <View key={d.id} className={styles.curBox}> data?.map((d, index) => <View key={d.id} className={styles.curBox}>
<View className={styles.curTitle} onClick={() => addCurs(d.id)}> <View className={styles.curTitle} onClick={() => addCurs(d.id)}>
{batch && <Radio {batch && <Radio
checked={curs.includes(d.id)} checked={curs.includes(d.id)}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save