diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8afdb16..2b130cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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: diff --git a/src/api/home.ts b/src/api/home.ts index aa884b5..70ee5e3 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -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 = { diff --git a/src/components/video/video.tsx b/src/components/video/video.tsx index 9924471..e324452 100644 --- a/src/components/video/video.tsx +++ b/src/components/video/video.tsx @@ -45,12 +45,10 @@ const HVideo: FC = (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) diff --git a/src/pages/business/videoInfo/components/catalogue.tsx b/src/pages/business/videoInfo/components/catalogue.tsx index 601d885..fd8df74 100644 --- a/src/pages/business/videoInfo/components/catalogue.tsx +++ b/src/pages/business/videoInfo/components/catalogue.tsx @@ -175,10 +175,9 @@ const Catalogue: FC = ({data, setHors, id, playId}) => { { - playing ? {JSON.stringify(playing)}暂停 - : {JSON.stringify(playing)}立即学习 + playing ? 暂停 + : 立即学习 } - setShow(true)}>... diff --git a/src/pages/business/videoInfo/components/course.tsx b/src/pages/business/videoInfo/components/course.tsx index b001118..b8df4c7 100644 --- a/src/pages/business/videoInfo/components/course.tsx +++ b/src/pages/business/videoInfo/components/course.tsx @@ -129,24 +129,22 @@ const Course: FC = ({id, courseId, preview, curEnd}) => { setTime={videoSeek} /> - + {formatMinute(time)}考题 - {examAll?.[time]?.slice(0, 1)?.map((d) => - - {d.question_type === 2 && - setRecord([isAnswer])} - />} - - )} + { + examAll?.[time]?.slice(0, 1)?.map((d) => + + {d.question_type === 2 && + setRecord([isAnswer])} + />} + ) + } diff --git a/src/pages/home/components/feature_recommended.tsx b/src/pages/home/components/feature_recommended.tsx index 3a16227..2cd2fc9 100644 --- a/src/pages/home/components/feature_recommended.tsx +++ b/src/pages/home/components/feature_recommended.tsx @@ -76,9 +76,7 @@ const FeatureRecommended: FC = (props) => { description: d.graphic_introduction, path: `?id=${d.id}`, })) - } catch (e) { - console.log(e) - } + } catch (e) {} return [] } diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index acc1adf..2cd8a6c 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -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 ( - {/**/} diff --git a/src/pages/manage/courseAdmin/components/search.tsx b/src/pages/manage/courseAdmin/components/search.tsx index 367a088..43f9fd7 100644 --- a/src/pages/manage/courseAdmin/components/search.tsx +++ b/src/pages/manage/courseAdmin/components/search.tsx @@ -88,7 +88,7 @@ export const Search: FC = ({param, setParam}) => { {deps.length ? <> { - deps.map(dep => changeDepId(dep.id)}> diff --git a/src/pages/manage/courseAdmin/courseAdmin.tsx b/src/pages/manage/courseAdmin/courseAdmin.tsx index 6eb09f5..6f9b245 100644 --- a/src/pages/manage/courseAdmin/courseAdmin.tsx +++ b/src/pages/manage/courseAdmin/courseAdmin.tsx @@ -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 = () => { { - data.map((d, index) => + data?.map((d, index) => addCurs(d.id)}> {batch &&