|
|
@ -1,10 +1,11 @@ |
|
|
|
import {Image, Text, View} from "@tarojs/components"; |
|
|
|
import {Text, View} from "@tarojs/components"; |
|
|
|
import styles from './history.module.scss' |
|
|
|
import styles from './history.module.scss' |
|
|
|
import Taro from "@tarojs/taro"; |
|
|
|
import Taro from "@tarojs/taro"; |
|
|
|
import {useEffect, useState} from "react"; |
|
|
|
import {useEffect, useState} from "react"; |
|
|
|
import {formatMinute} from "@/utils/time"; |
|
|
|
import {formatMinute} from "@/utils/time"; |
|
|
|
import Empty from "@/components/empty/empty"; |
|
|
|
import Empty from "@/components/empty/empty"; |
|
|
|
import {userApi} from "@/api"; |
|
|
|
import {userApi} from "@/api"; |
|
|
|
|
|
|
|
import Img from "@/components/image/image"; |
|
|
|
|
|
|
|
|
|
|
|
const History = () => { |
|
|
|
const History = () => { |
|
|
|
const [data, setData] = useState<HourHistory[]>([]) |
|
|
|
const [data, setData] = useState<HourHistory[]>([]) |
|
|
@ -25,12 +26,11 @@ const History = () => { |
|
|
|
}, []) |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View> |
|
|
|
|
|
|
|
<View className='mt-3'> |
|
|
|
<View className='mt-3'> |
|
|
|
{data.length ? data.map((d, index) => |
|
|
|
{data.length ? data.map((d, index) => |
|
|
|
<View key={index} className={styles.category} onClick={() => jump(d.userCourseRecord.course_id)}> |
|
|
|
<View key={index} className={styles.category} onClick={() => jump(d.userCourseRecord.course_id)}> |
|
|
|
<View className={styles.thumb}> |
|
|
|
<View className={styles.thumb}> |
|
|
|
<Image src={d.thumb} className={styles.image}/> |
|
|
|
<Img src={d.thumb} className={styles.image} width={300} height={188}/> |
|
|
|
<View |
|
|
|
<View |
|
|
|
className={styles.count}>共{d.userCourseRecord.hour_count}节/已学{d.userCourseRecord.finished_count}节</View> |
|
|
|
className={styles.count}>共{d.userCourseRecord.hour_count}节/已学{d.userCourseRecord.finished_count}节</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
@ -43,7 +43,6 @@ const History = () => { |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View>) : <Empty name='无观看记录'/>} |
|
|
|
</View>) : <Empty name='无观看记录'/>} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|