|
|
@ -2,7 +2,7 @@ import {Image, View} from "@tarojs/components"; |
|
|
|
import styles from '../../my.module.scss' |
|
|
|
import styles from '../../my.module.scss' |
|
|
|
import Taro from "@tarojs/taro"; |
|
|
|
import Taro from "@tarojs/taro"; |
|
|
|
import {curriculum} from "@/api"; |
|
|
|
import {curriculum} from "@/api"; |
|
|
|
import {FC, useState} from "react"; |
|
|
|
import {FC, useEffect, useState} from "react"; |
|
|
|
import {formatMinute} from "@/utils/time"; |
|
|
|
import {formatMinute} from "@/utils/time"; |
|
|
|
import time1 from "@/static/img/time1.png"; |
|
|
|
import time1 from "@/static/img/time1.png"; |
|
|
|
import time2 from "@/static/img/time2.png"; |
|
|
|
import time2 from "@/static/img/time2.png"; |
|
|
@ -28,20 +28,17 @@ const Time: FC = () => { |
|
|
|
// {title: '未完成(必修)', time: '0', src: incomplete, type: 4},
|
|
|
|
// {title: '未完成(必修)', time: '0', src: incomplete, type: 4},
|
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
Taro.useDidShow(async () => { |
|
|
|
curriculum.course().then(res => { |
|
|
|
try { |
|
|
|
|
|
|
|
const res = await curriculum.course() |
|
|
|
|
|
|
|
const oldList: List[] = JSON.parse(JSON.stringify(list)) |
|
|
|
const oldList: List[] = JSON.parse(JSON.stringify(list)) |
|
|
|
oldList[0].time = formatMinute(res.today_learn_time) |
|
|
|
oldList[0].time = formatMinute(res.today_learn_time) |
|
|
|
oldList[1].time = formatMinute(res.total_learn_time) |
|
|
|
oldList[1].time = formatMinute(res.total_learn_time) |
|
|
|
// oldList[2].time = res.required_count
|
|
|
|
// oldList[2].time = res.required_count
|
|
|
|
// oldList[3].time = res.not_required_count
|
|
|
|
// oldList[3].time = res.not_required_count
|
|
|
|
oldList[2].time = res.finished_count |
|
|
|
// oldList[2].time = res.finished_count
|
|
|
|
oldList[3].time = res.not_finished_count |
|
|
|
// oldList[3].time = res.not_finished_count
|
|
|
|
setList(oldList) |
|
|
|
setList(oldList) |
|
|
|
} catch (e) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
function jump(type?: number) { |
|
|
|
function jump(type?: number) { |
|
|
|