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.
40 lines
1011 B
40 lines
1011 B
import {getCurrentInstance} from "@tarojs/runtime";
|
|
import {curriculum, RecordData} from "@/api";
|
|
import {useEffect, useState} from "react";
|
|
import {View, Progress, CustomWrapper} from "@tarojs/components";
|
|
import './student.scss'
|
|
import Taro from "@tarojs/taro";
|
|
import PageScript from "@/components/pageScript/pageScript";
|
|
|
|
const Student = () => {
|
|
const {id, name} = getCurrentInstance()?.router?.params as any
|
|
const [data, setData] = useState<RecordData[]>([])
|
|
|
|
const getData = () => {
|
|
curriculum.record(id!).then(res => {
|
|
setData(res)
|
|
})
|
|
}
|
|
|
|
useEffect(() => {
|
|
Taro.setNavigationBarTitle({title:name})
|
|
getData()
|
|
}, [])
|
|
|
|
return (
|
|
<CustomWrapper>
|
|
{
|
|
data.map(d => {
|
|
return (
|
|
<View className='college'>
|
|
<View>{d.key}</View>
|
|
<Progress percent={d.value} activeColor='red' active showInfo/>
|
|
</View>
|
|
)
|
|
})
|
|
}
|
|
<PageScript/>
|
|
</CustomWrapper>
|
|
)
|
|
}
|
|
export default Student
|
|
|