一杯沧海 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. 26
      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:
autoInstallPeers: true
@ -12444,7 +12444,7 @@ packages:
dependencies:
object-assign: 4.1.1
react: 18.0.0
react-is: 16.13.1
react-is: 18.2.0
dev: false
/react@18.0.0:

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

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

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

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

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

@ -1,7 +1,6 @@
import {FC, useEffect, useState} from "react";
import {View} from "@tarojs/components";
import styles from "./home.module.scss";
// import {Search} from "@/pages/home/components/search";
import Adware from "@/pages/home/components/adware";
import Feature from "@/pages/home/components/feature";
import FeatureRecommended from "@/pages/home/components/feature_recommended";
@ -29,13 +28,12 @@ const Home: FC = () => {
return (
<View className={styles.content}>
{/*<Search/>*/}
<Adware data={data?.adverts || []} only_flag='routine_home_top_banner' width={710}/>
<Feature/>
<FeatureRecommended
illness={(data?.illness as any)?.list || []}
illness={data?.illness.list || []}
health={data?.health || []}
brand={((data?.brand as any)?.list) || []}
brand={data?.brand.list || []}
skill={data?.skill || []}
/>
<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.map(dep => <View
deps?.map(dep => <View
key={dep.id}
className={styles.radioBox}
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 => {
setTotal(res.total)
if (param.page === 1 || replace) {
setData(res.data)
setData(res.data || [])
} else {
setData([
...data,
@ -53,7 +53,7 @@ const CourseAdmin: FC = () => {
if (curs.length === data.length) {
setCurs([])
} else {
setCurs(data.map(d => d.id))
setCurs(data?.map(d => d.id))
}
}
@ -72,7 +72,7 @@ const CourseAdmin: FC = () => {
Taro.showModal({
title: '删除警告',
content: "删除后所有部门不可查看",
confirmText:'删除',
confirmText: '删除',
async success({confirm}) {
if (confirm) {
try {
@ -108,7 +108,7 @@ const CourseAdmin: FC = () => {
* @param required []
*/
function batchChangDep(ids: number[], depList = [], required = []) {
if (!ids.length) {
if (!ids?.length) {
Taro.showToast({title: '请选择课程', icon: 'none'})
return
}
@ -153,7 +153,7 @@ const CourseAdmin: FC = () => {
<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)}>
{batch && <Radio
checked={curs.includes(d.id)}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save