Explorar el Código

修改显示内容

wangxy hace 10 meses
padre
commit
0447575351

+ 23 - 3
components/custom-scroll-list/custom-scroll-list.vue

@@ -9,10 +9,13 @@
 	</view>
 	<!-- 无限滚动区域 -->
 	<scroll-view class="scroll-container" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="triggered"
-		:refresher-threshold="100" refresher-background="lightgreen" @refresherrefresh="onRefresh"
+		:refresher-threshold="100" refresher-background="#F3F3F4" @refresherrefresh="onRefresh"
 		@scrolltolower="onReachBottom" @refresherrestore="onRestore">
 		<slot :list="list"></slot>
-		<view style="width: 100%;text-align: center;font-size: 14px;color:#ccc;" key="a333" v-if="isComplete">没有更多啦~</view>
+		<uni-load-more :status="status" :contentText="contentText"></uni-load-more>
+
+		<!-- 		<view style="width: 100%;text-align: center;font-size: 14px;color:#ccc;" key="a333" v-if="isComplete">没有更多啦~
+		</view> -->
 	</scroll-view>
 </template>
 
@@ -20,7 +23,7 @@
 	import {
 		ref,
 		onMounted,
-		computed
+		computed,
 	} from "vue";
 
 	import {
@@ -84,6 +87,12 @@
 	const name = ref(''); // 查询名
 	const activeTab = ref(props.defaultTab);
 
+	const status = ref('more');
+	const contentText = {
+		contentdown: '查看更多',
+		contentrefresh: '加载中',
+		contentnomore: '没有更多'
+	}
 	/**
 	 * 是否已完全加载
 	 */
@@ -91,6 +100,7 @@
 		if (total.value === 0) {
 			return false;
 		}
+
 		return total.value === list.value.length
 	})
 
@@ -101,6 +111,7 @@
 		triggered.value = false;
 		freshing.value = false;
 		total.value = 0;
+		status.value = 'more';
 	}
 
 	// 切换tab
@@ -139,9 +150,17 @@
 			action === "do-search" && (list.value = res.data.data); // 查询更新
 			action === "pull-down-refresh" && (list.value = res.data.data); // 下拉更新数据
 			action === "reach-buttom" && (list.value = [...list.value, ...res.data.data]); // 无限滚动更新数据
+
+
+
 		}).finally(() => {
 			triggered.value = false;
 			freshing.value = false;
+			if (total.value !== list.value.length) {
+				status.value = 'more';
+			} else {
+				status.value = 'noMore';
+			}
 		})
 	}
 
@@ -155,6 +174,7 @@
 	// 下拉刷新触发
 	function onRefresh() {
 		if (freshing.value) return;
+		status.value = 'loading';
 		freshing.value = true;
 		triggered.value = true;
 		page.value = 1;

+ 2 - 1
components/scroll-list-card/scroll-list-card.vue

@@ -3,7 +3,7 @@
 		<!--   title     -->
 		<text class="mobile-card-title">{{data.ksName === null ? '':data.ksName}}</text>
 		<!--   content   -->
-		<view class="mobile-card-row">
+		<view class="mobile-card-row" style="font-size: 28rpx;">
 			时间:{{data.ksStartTime === null ? '':data.ksStartTime}}-{{data.ksEndTime === null ? '':data.ksEndTime}}
 		</view>
 		<view class="mobile-card-row">
@@ -101,6 +101,7 @@
 		box-sizing: border-box;
 		margin: 0 30rpx 10rpx;
 		border-bottom: 2rpx solid #f2f1f2;
+		padding-bottom: 30rpx;
 	}
 
 	.mobile-card-title {