瀏覽代碼

[dev]加个触底的触发点

Neo 1 年之前
父節點
當前提交
6eb31fb7d4
共有 1 個文件被更改,包括 19 次插入3 次删除
  1. 19 3
      pages/index/index.vue

+ 19 - 3
pages/index/index.vue

@@ -87,14 +87,15 @@
 								@emit-select="emitSelect"
 							/>
 						</template>
+						<view v-if="isBottom" class="order-bottom">
+							<view class="text">-- 没有更多数据 --</view>
+						</view>
 					</scroll-view>
 					<view v-else class="text">
 						<image class="zwsj" aspectFill :src="'/static/zwsj.png'" />
 					</view>
 				</view>
-				<view v-if="isBottom" class="order-bottom">
-					<view class="text">-- 没有更多数据 --</view>
-				</view>
+				
 			</view>
 		</view>
 	</view>
@@ -204,6 +205,9 @@ onLoad(async () => {
 	if (res.code === 200) {
 		total.value = res.total
 		orderList.value = res.rows
+		if(orderList.value.length < pageSize.value){
+			isBottom.value = true
+		}
 		if(tabActive.value ==0){
 			tabList.value[0].leng = orderList.value.length
 		}
@@ -261,6 +265,9 @@ const handleSearch = async()=>{
 		if (res.code === 200) {
 			total.value = res.total
 			orderList.value = res.rows
+			if(orderList.value.length < pageSize.value){
+				isBottom.value = true
+			}
 		}
 	}
 	if(tabActive.value==1){
@@ -286,6 +293,9 @@ const handleSearch = async()=>{
 		if (res.code === 200) {
 			total.value = res.total
 			orderList.value = res.rows
+			if(orderList.value.length < pageSize.value){
+				isBottom.value = true
+			}
 			if(tabActive.value ==0){
 				tabList.value[0].leng = orderList.value.length
 			}
@@ -511,6 +521,9 @@ const checkIndex = async(index) => {
 	if (res.code === 200) {
 		total.value = res.total
 		orderList.value = res.rows
+		if(orderList.value.length < pageSize.value){
+			isBottom.value = true
+		}
 		if(tabActive.value ==0){
 			tabList.value[0].leng = orderList.value.length
 		}
@@ -591,6 +604,9 @@ const loadPreList = async()=>{
 	if (res.code === 200) {
 		total.value = res.total
 		orderList.value = res.rows
+		if(orderList.value.length < pageSize.value){
+			isBottom.value = true
+		}
 		if(tabActive ==0){
 			tabList.value[0].leng = orderList.value.length
 		}