|
@@ -16,7 +16,7 @@ import {
|
|
} from 'vant'
|
|
} from 'vant'
|
|
import OFullRefresh from '@/components/o-full-refresh'
|
|
import OFullRefresh from '@/components/o-full-refresh'
|
|
import DetailItem from './modals/detail-item'
|
|
import DetailItem from './modals/detail-item'
|
|
-import { defineComponent, onMounted, reactive, ref, onDeactivated, computed } from 'vue'
|
|
|
|
|
|
+import { defineComponent, onMounted, reactive, ref, onDeactivated, nextTick } from 'vue'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import styles from './exercis-detail.module.less'
|
|
import styles from './exercis-detail.module.less'
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
@@ -24,6 +24,7 @@ import questIcon from '@/school/images/quest-icon.png'
|
|
import defaultIcon from '@/school/images/default-icon.png'
|
|
import defaultIcon from '@/school/images/default-icon.png'
|
|
import iconStudent from '@common/images/icon_student.png'
|
|
import iconStudent from '@common/images/icon_student.png'
|
|
import { state as globalState } from '@/state'
|
|
import { state as globalState } from '@/state'
|
|
|
|
+import { useRect } from '@vant/use'
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'exercis-detail',
|
|
name: 'exercis-detail',
|
|
@@ -111,10 +112,17 @@ export default defineComponent({
|
|
showToast(message)
|
|
showToast(message)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- onMounted(() => {
|
|
|
|
- getList()
|
|
|
|
- getDetail()
|
|
|
|
|
|
+ const topWrap = ref()
|
|
|
|
+ const topWrapHeight = ref(0)
|
|
|
|
+ onMounted(async () => {
|
|
|
|
+ await getList()
|
|
|
|
+ await getDetail()
|
|
window.addEventListener('scroll', handleScroll)
|
|
window.addEventListener('scroll', handleScroll)
|
|
|
|
+
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ const { height } = useRect(topWrap.value)
|
|
|
|
+ topWrapHeight.value = height
|
|
|
|
+ })
|
|
})
|
|
})
|
|
onDeactivated(() => {
|
|
onDeactivated(() => {
|
|
window.removeEventListener('scroll', handleScroll)
|
|
window.removeEventListener('scroll', handleScroll)
|
|
@@ -147,10 +155,11 @@ export default defineComponent({
|
|
const onBack = () => {
|
|
const onBack = () => {
|
|
router.go(-1)
|
|
router.go(-1)
|
|
}
|
|
}
|
|
|
|
+
|
|
return () => (
|
|
return () => (
|
|
<>
|
|
<>
|
|
- <div class={styles.exercisContainer}>
|
|
|
|
- <div class={styles.topWrap}>
|
|
|
|
|
|
+ <div class={[styles.exercisContainer, !showContact.value && 'emptyRootContainer']}>
|
|
|
|
+ <div class={styles.topWrap} ref={topWrap}>
|
|
<OSticky position="top" background="#F8F8F8" onGetHeight={getHeight}>
|
|
<OSticky position="top" background="#F8F8F8" onGetHeight={getHeight}>
|
|
<OHeader
|
|
<OHeader
|
|
border={false}
|
|
border={false}
|