zhengjinyi 5 gadi atpakaļ
vecāks
revīzija
66a2961ae2

+ 3 - 0
common/config/caimeiApi.js

@@ -108,6 +108,9 @@ const caimeiApi = {
 				key: key,
 				success: function (res){
 					resolve(res.data);
+				},
+				fail: function(res){
+					reject(false)
 				}
 			})
 		});

+ 7 - 5
components/cm-module/listTemplate/commodityList.vue

@@ -95,7 +95,7 @@
 				showLoading: false,
 				loadingNow: true,
 				loadingText: '上拉加载更多',
-				pageSize: 10,
+				pageSize: 20,
 				pageNum: 1,
 				totalPage: 1,
 				pullFlag: true,
@@ -110,14 +110,14 @@
 				this.clubStatus = resolve.clubStatus
 				this.userID = resolve.userID ? resolve.userID : '';
 				this.userIdentity = resolve.userIdentity
-				if(this.userIdentity = 1){
+				if(this.userIdentity == 1){
 					this.identity = 1
 				}else{
 					this.identity = 2
 				}
 				this.getListFromServer();
 			}).catch(error =>{
-				console.log(error)
+				this.getListFromServer();
 			})
 		},
 		computed: {
@@ -125,7 +125,7 @@
 		},
 		methods:{
 			toLower() {
-				if(this.totalPage>this.pageNum && this.pullFlag) {
+				if(this.totalPage>this.listData.length && this.pullFlag) {
 					this.getListFromServer(true);
 				}
 			},
@@ -165,11 +165,12 @@
 							this.setProductPrice()
 							this.showSkeleton = false
 						}
+						console.log(this.listData)
 						// 防上拉暴滑
 						this.pullFlag = false;
 						setTimeout(()=>{ this.pullFlag = true; },500)
 						// 底部提示文案
-						if(this.totalPage>this.pageNum) {
+						if(this.totalPage>this.listData.length) {
 							this.loadingText = '上拉加载更多';
 						} else {
 							this.showLoading = true;
@@ -178,6 +179,7 @@
 					} else {
 						if(!loadMore) { this.showEmpty = true; }
 					}
+					
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})

+ 4 - 4
components/cm-module/listTemplate/immediatelyList.vue

@@ -169,7 +169,7 @@
 				showLoading: false,
 				loadingNow: true,
 				loadingText: '上拉加载更多',
-				pageSize: 10,
+				pageSize: 20,
 				zuhepageSize:5,
 				pageNum: 1,
 				totalPage:1,
@@ -192,7 +192,7 @@
 		created() {
 			this.setScrollHeight();		
 			this.$api.getComStorage('userInfo').then((resolve) =>{
-				if(resolve.userIdentity = 1){
+				if(resolve.userIdentity == 1){
 					this.identity = 1
 				}
 			}).catch(error =>{
@@ -209,7 +209,7 @@
 		methods:{
 			scrolltolower(tabIndex) {
 				if(tabIndex ==0){
-					if(this.totalPage>this.pageNum && this.pullFlag) {
+					if(this.totalPage>this.listData.length && this.pullFlag) {
 						this.getProductAgainInfo(true);
 					}
 				}else if(tabIndex==1){
@@ -250,7 +250,7 @@
 						this.pullFlag = false;
 						setTimeout(()=>{ this.pullFlag = true; },500)
 						// 底部提示文案
-						if(this.totalPage>this.pageNum) {
+						if(this.totalPage>this.listData.length) {
 							this.loadingText = '上拉加载更多';
 						} else {
 							this.showLoading = true;

+ 5 - 4
pages/search/search.vue

@@ -119,7 +119,7 @@
 				showLoading: false,
 				loadingNow: true,
 				loadingText: '上拉加载更多',
-				pageSize: 10,
+				pageSize: 20,
 				pageNum: 1,
 				hasNextPage: false,
 				totalPage: 1,
@@ -155,11 +155,11 @@
 				}else{
 					this.listData =[]
 					this.setSearchHistoryAdd()
-					this.getListFromServer(false)
+					this.getListFromServer()
 				}
 			},
 			scrolltolower() {
-				if(this.totalPage>this.pageNum && this.pullFlag) {
+				if(this.totalPage>this.listData.length && this.pullFlag) {
 					this.getListFromServer(true);
 				}
 			},
@@ -191,7 +191,8 @@
 						this.pullFlag = false;
 						setTimeout(()=>{ this.pullFlag = true; },500)
 						// 底部提示文案
-						if(this.totalPage>this.pageNum) {
+						if(this.totalPage>this.listData.length) {
+							console.log('1111111111')
 							this.loadingText = '上拉加载更多';
 						} else {
 							this.showLoading = true;