소스 검색

fix: 优化

chenjj 1 주 전
부모
커밋
cb7aab3edf
1개의 변경된 파일2개의 추가작업 그리고 17개의 파일을 삭제
  1. 2 17
      pages/index.vue

+ 2 - 17
pages/index.vue

@@ -169,7 +169,6 @@ const getList = async () => {
 		if (!res || !res.rows) {
 			return;
 		}
-<<<<<<< HEAD
 		console.log('判断是否已经到了最后一页',pages.value.current >= Math.ceil(res.total / pages.value.pageSize));
 		
 		// 如果是第一页,先清空
@@ -182,28 +181,14 @@ const getList = async () => {
 		res.rows.forEach((item, index) => {
 			index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item);
 		});
-
-		if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
-=======
-		res.rows.forEach((item, index) => {
-			index % 2 !== 0 ? rightList.value.push(item) : leftList.value.push(item);
-		});
 		pages.value.total = res.total;
-		console.log('判断是否已经到了最后一页',pages.value.current, res.total,pages.value.pageSize);
-		const isBottom = pages.value.current >= Math.ceil(res.total / pages.value.pageSize)
-		// 判断是否已经到了最后一页
-		if (isBottom) {
->>>>>>> 9cb1dc3 (fix: 优化)
+		if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
 			loadmoreInfo.value.status = 'nomore';
 		} else {
 			loadmoreInfo.value.status = 'loadmore';
 		}
-<<<<<<< HEAD
 
-		pages.value.total = res.total;
-=======
-		
->>>>>>> 9cb1dc3 (fix: 优化)
+	
 	} catch (error) {
 		leftList.value = [];
 		rightList.value = [];