hookehuyr

feat(任务筛选): 添加弹窗显示状态监听并控制返回顶部按钮

添加对任务筛选组件弹窗显示状态的监听,当弹窗显示时隐藏返回顶部按钮,提升用户体验
......@@ -55,11 +55,16 @@ const props = defineProps({
}
})
const emit = defineEmits(['change'])
const emit = defineEmits(['change', 'popup-visible-change'])
// 状态
const showTaskPicker = ref(false)
const showSubtaskPicker = ref(false)
// 监听弹窗显示状态
watch([showTaskPicker, showSubtaskPicker], ([showTask, showSubtask]) => {
emit('popup-visible-change', showTask || showSubtask)
})
const taskList = ref([])
const subtaskList = ref([])
const selectedTaskId = ref('')
......
......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2025-06-19 17:12:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-15 13:08:35
* @LastEditTime: 2025-12-15 13:45:56
* @FilePath: /mlaj/src/views/teacher/studentPage.vue
* @Description: 学生详情页面
-->
......@@ -100,6 +100,7 @@
:key="currentGroupId"
:group-id="currentGroupId"
@change="handleTaskFilterChange"
@popup-visible-change="handlePopupVisibleChange"
/>
</div>
<van-tabs v-model:active="activeTab" color="#4caf50" animated swipeable @change="handleTabChange">
......@@ -321,7 +322,7 @@
</div>
</van-dialog>
<van-back-top right="5vw" bottom="25vh" offset="600" />
<van-back-top v-if="showBackTop" right="5vw" bottom="25vh" offset="600" />
</div>
</van-config-provider>
</template>
......@@ -392,6 +393,12 @@ const handleTaskFilterChange = ({ task_id, subtask_id }) => {
getStatList()
}
// 返回顶部按钮显示控制
const showBackTop = ref(true)
const handlePopupVisibleChange = (isVisible) => {
showBackTop.value = !isVisible
}
// 当前选中的标签页
const activeTab = ref('homework')
......