From 4f9b041b0f7a7ead5c723b2b6e958d3bc7be2437 Mon Sep 17 00:00:00 2001 From: Administrator <123456> Date: Tue, 22 Feb 2022 17:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=A6=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/course/list/index.tsx | 75 +++++++++++++++-------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/web/src/pages/course/list/index.tsx b/web/src/pages/course/list/index.tsx index bddb271..c595eca 100644 --- a/web/src/pages/course/list/index.tsx +++ b/web/src/pages/course/list/index.tsx @@ -10,22 +10,22 @@ import SubMenu from 'antd/lib/menu/SubMenu'; console.log('course/list') const { Paragraph } = Typography; import cookie from 'react-cookies'; -const getList = async (subject_id,chapter_id ) => { - // const hide = message.loading('正在配置'); - try { - const a=await listMyLearningChapterCourse({ - identity_id:cookie.load('identity_id'), - person_id:cookie.load('person_id'), - subject_id:subject_id, - chapter_id:chapter_id, - }); - // message.success('配置成功'); - return a; - } catch (error) { - // message.error('配置失败请重试!'); - return false; - } -}; +// const getList = async (subject_id,chapter_id ) => { +// // const hide = message.loading('正在配置'); +// try { +// const a=await listMyLearningChapterCourse({ +// identity_id:cookie.load('identity_id'), +// person_id:cookie.load('person_id'), +// subject_id:subject_id, +// chapter_id:chapter_id, +// }); +// // message.success('配置成功'); +// return a; +// } catch (error) { +// // message.error('配置失败请重试!'); +// return false; +// } +// }; const CardList = () => { const params=useParams(); @@ -40,11 +40,6 @@ const CardList = () => { subject_id:ids[2] }); - },{ - formatResult: (result) => { - - console.log('result',result); - } }); const list = data?.list||[]; @@ -52,8 +47,18 @@ const CardList = () => { const last_data=data?data.last_learning_course:[]; const chapter_list=data?data.chapter_list:[]; + const aa = useRequest(() => { + return listMyLearningChapterCourse({ + identity_id:cookie.load('identity_id'), + person_id:cookie.load('person_id'), + subject_id:2,//chapter_list[0].subject_id + chapter_id:2,//chapter_list[0].chapter_id + + }); + }); + useEffect(() => { - console.log('getList',getList) + // console.log('getList',getList) // const a=await listMyLearningChapterCourse({ // identity_id:cookie.load('identity_id'), // person_id:cookie.load('person_id'), @@ -62,19 +67,19 @@ const CardList = () => { // }); },[]); - if(chapter_list.length!==0){ - - // const msg = useRequest(() => { - // return listMyLearningChapterCourse({ - // identity_id:cookie.load('identity_id'), - // person_id:cookie.load('person_id'), - // subject_id:chapter_list?chapter_list[0].subject_id:'', - // chapter_id:chapter_list?chapter_list[0].chapter_id:'', - // - // }); - // }); - // console.log('msg',msg) - } + // if(chapter_list.length!==0){ + // + // // const msg = useRequest(() => { + // // return listMyLearningChapterCourse({ + // // identity_id:cookie.load('identity_id'), + // // person_id:cookie.load('person_id'), + // // subject_id:chapter_list?chapter_list[0].subject_id:'', + // // chapter_id:chapter_list?chapter_list[0].chapter_id:'', + // // + // // }); + // // }); + // // console.log('msg',msg) + // } // const msg = await listMyLearningChapterCourse({ // identity_id:cookie.load('identity_id'),