You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
866 B
33 lines
866 B
import {FC} from "react";
|
|
import '../videoInfo.scss'
|
|
import {Image, View} from "@tarojs/components";
|
|
import playOk from "@/static/img/play-ok.png";
|
|
import play from "@/static/img/play.png";
|
|
import {formatMinute} from "@/utils/time";
|
|
|
|
interface Props {
|
|
id: number
|
|
index: number
|
|
title: string
|
|
duration: number
|
|
click: (id: number) => void
|
|
complete: (id: number) => boolean
|
|
}
|
|
|
|
const Hours: FC<Props> = (opt: Props) => {
|
|
return (
|
|
<>
|
|
<View className={'hor' + ` ${opt.complete(opt.id) ? 'complete' : null}`}
|
|
onClick={() => opt.click(opt.id)}
|
|
>
|
|
<Image src={opt.complete(opt.id) ? playOk : play} mode='aspectFit'/>
|
|
<View>
|
|
<View>{opt.index + 1}.{opt.title}</View>
|
|
<View className='font-26'>时长{formatMinute(opt.duration)}</View>
|
|
</View>
|
|
</View>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default Hours
|
|
|