import OHeader from '@/components/o-header' import OSticky from '@/components/o-sticky' import OEmpty from '@/components/o-empty' import dayjs from 'dayjs' import { Icon, Popover, DatePicker, DatePickerColumnType, Popup, List, PullRefresh, showToast, Dialog } from 'vant' import DetailItem from './modals/detail-item' import { defineComponent, onMounted, reactive, ref } from 'vue' import { useRoute, useRouter } from 'vue-router' import styles from './exercis-detail.module.less' import request from '@/helpers/request' import questIcon from '../images/quest-icon.png' import defaultIcon from '@/school/images/default-icon.jpg' export default defineComponent({ name: 'exercis-detail', setup() { const router = useRouter() const route = useRoute() const state = reactive({ showPopoverTime: false, showPopoverOrchestra: false, currentDate: [dayjs().format('YYYY'), dayjs().format('MM')], actions: [ { text: '全部乐团', color: 'var(--van-primary-color)' }, { text: '交付团' }, { text: '晋升团' } ], id: route.query.id }) console.log(route.query) const forms = reactive({ practiceMonth: route.query.practiceMonth ? route.query.practiceMonth : state.currentDate[0] + '' + state.currentDate[1], practiceMonthName: route.query.practiceMonthName ? route.query.practiceMonthName : state.currentDate[0] + '年' + state.currentDate[1] + '月', orchestraId: '', orchestraName: '', page: 1, rows: 20, userId: route.query.id, clientType: 'STUDENT' }) const showTip = ref(false) const minDate = ref(new Date(dayjs().subtract(5, 'year').format('YYYY-MM-DD'))) const maxDate = ref(new Date(dayjs().add(5, 'year').format('YYYY-MM-DD'))) const columnsType = ref(['year', 'month']) const refreshing = ref(false) const loading = ref(false) const finished = ref(false) const showContact = ref(false) const infoDetail = ref({} as any) const list = ref([]) const getList = async () => { loading.value = true if (refreshing.value) { list.value = [] forms.page = 1 refreshing.value = false } try { const res = await request.post('/api-school/musicPracticeRecord/page', { data: { ...forms } }) if (list.value.length > 0 && res.data.pageNo === 1) { return } forms.page = res.data.current + 1 list.value = list.value.concat(res.data.rows || []) showContact.value = list.value.length > 0 loading.value = false finished.value = res.data.current >= res.data.pages } catch (e: any) { // console.log(e, 'e') const message = e.message showToast(message) showContact.value = false finished.value = true } } const getDetail = async () => { try { const res = await request.get(`/api-backend/student/detail/${state.id}`) console.log(res) infoDetail.value = { ...res.data } } catch (e: any) { // console.log(e, 'e') const message = e.message showToast(message) } } onMounted(() => { getList() getDetail() }) const onBack = () => { console.log('返回') router.push('/exercise-record') } const checkTimer = (val: any) => { forms.practiceMonth = val.selectedValues[0] + val.selectedValues[1] forms.practiceMonthName = val.selectedValues[0] + '年' + val.selectedValues[1] + '月' state.showPopoverTime = false refreshing.value = true getList() } const onRefresh = () => { finished.value = false // 重新加载数据 // 将 loading 设置为 true,表示处于加载状态 loading.value = true getList() } return () => ( <>
{{ right: () => ( { showTip.value = true }} /> ) }}

{infoDetail.value.nickname}

{infoDetail.value.subjectNames}

{infoDetail.value.practiceDays ? infoDetail.value.practiceDays : 0}{' '}

练习天数

{infoDetail.value.practiceTimes ? infoDetail.value.practiceTimes : 0}{' '} 分钟

练习时长

{ state.showPopoverTime = true }} > {forms.practiceMonthName}
{/*
{{ reference: () => (
全部乐团
) }}
*/}
{showContact.value ? ( {list.value.map((item: any) => ( ))} ) : ( )} { state.showPopoverTime = false }} onConfirm={checkTimer} v-model={state.currentDate} title="选择年月" minDate={minDate.value} maxDate={maxDate.value} columnsType={columnsType.value} /> (

什么是练习数据

), default: () => (

练习数据是学生通过云教练自主练习的数据统计,可根据时间段查询学生的练习天数和练习时长{' '}

练习天数:当天有曲目播放或测评记录即算练习

练习时长:曲目播放和曲目测评的时长总和

) }} >
) } })