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, Image } from 'vant' import OFullRefresh from '@/components/o-full-refresh' import DetailItem from './modals/detail-item' import { defineComponent, onMounted, reactive, ref, onDeactivated, nextTick } from 'vue' import { useRoute, useRouter } from 'vue-router' import styles from './exercis-detail.module.less' import request from '@/helpers/request' import questIcon from '@/school/images/quest-icon.png' import defaultIcon from '@/school/images/default-icon.png' import iconStudent from '@common/images/icon_student.png' import { state as globalState } from '@/state' import { useRect } from '@vant/use' export default defineComponent({ name: 'exercis-detail', setup() { const router = useRouter() const route = useRoute() const platformApi = ref(globalState.platformApi) 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, heightV: 0 as number, scrollTop: 0 as number, isClick: false }) 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(10, 'year').format('YYYY-MM-DD'))) const maxDate = ref(new Date(dayjs().add(10, '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 () => { if (state.isClick) { return } state.isClick = true if (refreshing.value) { list.value = [] forms.page = 1 refreshing.value = false } try { const res = await request.post(`${platformApi.value}/musicPracticeRecord/page`, { data: { ...forms, feature: 'EVALUATION' } }) if (list.value.length > 0 && res.data.current === 1) { return } list.value = list.value.concat(res.data.rows || []) forms.page = res.data.current + 1 showContact.value = list.value.length > 0 loading.value = false console.log(res.data, res.data.current >= res.data.pages) 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 } state.isClick = false } 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) } } const topWrap = ref() const topWrapHeight = ref(0) onMounted(async () => { await getList() await getDetail() window.addEventListener('scroll', handleScroll) nextTick(() => { const { height } = useRect(topWrap.value) topWrapHeight.value = height }) }) onDeactivated(() => { window.removeEventListener('scroll', handleScroll) }) const handleScroll = () => { const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 state.scrollTop = scrollTop } const getHeight = (dataHeight: number) => { state.heightV = dataHeight console.log(dataHeight, 'dataHeight') } 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() } const onBack = () => { router.go(-1) } return () => ( <>
state.scrollTop ? 'transparent' : '#fff'} > {{ right: () => ( { showTip.value = true }} /> ) }}

{infoDetail.value.nickname}

{infoDetail.value.subjectNames ? infoDetail.value.subjectNames : '暂无声部'}

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

练习天数

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

练习时长

{ state.showPopoverTime = true }} > {forms.practiceMonthName}
{/*
*/} {/*
{ 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: () => (

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

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

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

) }} >
) } })