调整学习页面

v2
king 1 year ago
parent e437e131cd
commit c99493e9de
  1. 4
      .env
  2. 40
      src/pages/index/components/videoList.tsx
  3. 2
      src/pages/my/components/header/header.tsx
  4. 6
      src/pages/my/components/header/time.tsx

@ -1,5 +1,5 @@
TARO_APP_API=https://yjx.dev.yaojiankang.top #TARO_APP_API=https://yjx.dev.yaojiankang.top
#TARO_APP_API=https://mooc.yaojiankang.top TARO_APP_API=https://mooc.yaojiankang.top
#TARO_APP_API=https://shopfix.yaojiankang.top #TARO_APP_API=https://shopfix.yaojiankang.top
#TARO_APP_API=https://playedu.yaojiankang.top #TARO_APP_API=https://playedu.yaojiankang.top
TARO_APP_LGOIN=true TARO_APP_LGOIN=true

@ -77,14 +77,14 @@ export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => {
} }
// eventsIndex.on(({id}) => { // eventsIndex.on(({id}) => {
// if (id == null) return; // if (id == null) return;
// for (const [index, notFinished] of data.is_not_finished.entries()) { // for (const [index, notFinished] of data.is_not_finished.entries()) {
// if (notFinished.id === id) { // if (notFinished.id === id) {
// data.is_finished.push(notFinished) // data.is_finished.push(notFinished)
// data.is_not_finished.splice(index, 1) // data.is_not_finished.splice(index, 1)
// return // return
// } // }
// } // }
// }) // })
useDidShow(() => { useDidShow(() => {
@ -123,17 +123,19 @@ export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => {
&& key === 'is_required' && key === 'is_required'
? <LoginView/> : value?.length ? ? <LoginView/> : value?.length ?
<> <>
{value?.map(c => {
<VideoCover value?.map(c =>
thumb={c.thumb} <VideoCover
title={c.title} thumb={c.thumb}
id={c.id} title={c.title}
depId={c.id} id={c.id}
key={c.id} depId={c.id}
time={formatMinute(c.course_duration)} key={c.id}
content={rateOfLearning(c.id, c.class_hour)} time={formatMinute(c.course_duration)}
/>)} content={rateOfLearning(c.id, c.class_hour)}
<View className='text-center text-muted'></View> />)
}
<View className='text-center text-muted flex-1'></View>
</> </>
: <Empty name='暂无课程'/> : <Empty name='暂无课程'/>
} }

@ -29,7 +29,7 @@ const Header = ({showCompany}:{showCompany:()=> void}) => {
<View className='flex-1'> <View className='flex-1'>
<View className='font-32 mt-2' onClick={()=>{ <View className='font-32 mt-2' onClick={()=>{
empty() empty()
}}>/</View> }}></View>
</View> </View>
} }

@ -47,6 +47,10 @@ const Time: FC = () => {
}) })
function jump(type?: number) { function jump(type?: number) {
if (!token) {
Taro.navigateTo({url: '/pages/login/login'})
return;
}
if (!type) return; if (!type) return;
Taro.navigateTo({url: "/pages/business/courType/courType?type=" + type}) Taro.navigateTo({url: "/pages/business/courType/courType?type=" + type})
} }
@ -61,7 +65,7 @@ const Time: FC = () => {
<View className={styles.timeBoxFlex}> <View className={styles.timeBoxFlex}>
<View> <View>
<View className='mb-2'>{d.title}</View> <View className='mb-2'>{d.title}</View>
{ token && <View className='text-muted font-26'>{d.time}</View>} {token && <View className='text-muted font-26'>{d.time}</View>}
</View> </View>
<Image src={d.src} mode='aspectFit' className={styles.timeImag}/> <Image src={d.src} mode='aspectFit' className={styles.timeImag}/>
</View> </View>

Loading…
Cancel
Save