Explorar o código

feat(message): 下拉刷新

wangpx hai 1 ano
pai
achega
8857edc940
Modificáronse 1 ficheiros con 9 adicións e 48 borrados
  1. 9 48
      pages/message/index.vue

+ 9 - 48
pages/message/index.vue

@@ -28,20 +28,13 @@
 					<uni-section title="待办消息" type="line" titleFontSize="20px"></uni-section>
 				</template>
 				<view class="process_container">
-					<view class="process_list" v-if="processes">
+					<view class="process_list">
 						<process-list :processes="processes"></process-list>
 					</view>
-					<view class="no_process" v-else>
-						<uni-section title="无待办消息"></uni-section>
-					</view>
 				</view>
 			</uni-collapse-item>
 		</uni-collapse>
 
-
-
-
-
 		<uni-collapse>
 			<uni-collapse-item title-border="show" :border="true" :show-animation="true" :open="false">
 				<template v-slot:title>
@@ -156,7 +149,7 @@
 
 <script setup lang="ts">
 	import { onMounted, reactive, ref } from 'vue';
-	import { onLoad } from '@dcloudio/uni-app'
+	import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
 	import $tab from '@/plugins/tab.js';
 	import $modal from '@/plugins/modal.js';
 	import processList from '@/components/ygoa/processList.vue'
@@ -170,6 +163,12 @@
 			$tab.navigateTo('/pages/mine/clockIn/clockIn')
 		})
 	}
+	onPullDownRefresh(() => {
+		console.log('onPullDownRefresh');
+		onClickItem({ currentIndex: 0 })
+		onClickItem2({ currentIndex: 0 })
+    uni.stopPullDownRefresh();
+	})
 	onMounted(() => {
 		onClickItem({ currentIndex: 0 })
 		onClickItem2({ currentIndex: 0 })
@@ -186,44 +185,7 @@
 	//公告列表
 	let notices = ref([]);
 	// 待办列表
-	let processes = reactive([
-		{
-			id: 1,
-			title: '账户1 的请假申请',
-			user: '账户1',
-			createTime: '2024/10/10',
-			startTime: '2024/10/10',
-			endTime: '2024/10/12',
-			totalTime: '2',
-			description: '请假说明请假说明请假说明请假说明请假说明',
-			type: 'icon-apply-leave',
-			step: 0
-		},
-		{
-			id: 1,
-			title: '账户2 的请假申请',
-			user: '账户2',
-			createTime: '2024/10/10',
-			startTime: '2024/10/10',
-			endTime: '2024/10/12',
-			totalTime: '2',
-			description: '请假说明请假说明',
-			type: 'icon-apply-leave',
-			step: 0
-		},
-		{
-			id: 2,
-			title: '账户2 的加班申请',
-			user: '账户2',
-			createTime: '2024/10/10',
-			startTime: '2024/10/10 17/30/00',
-			endTime: '2024/10/10 18/30/00',
-			totalTime: '1',
-			description: '加班说明加班说明',
-			type: 'icon-apply-overtime',
-			step: 0
-		},
-	])
+	let processes = reactive([])
 
 
 	// 点击消息分段器
@@ -274,7 +236,6 @@
 	// 点击公告分段器
 	function onClickItem2({ currentIndex }) {
 		current2.value = currentIndex;
-		console.log(currentIndex);
 		switch (currentIndex) {
 			case 0:
 				const params1 = {