gjy 3 anni fa
parent
commit
52b413120c
2 ha cambiato i file con 68 aggiunte e 44 eliminazioni
  1. 1 0
      main.js
  2. 67 44
      pages/business/business.vue

+ 1 - 0
main.js

@@ -174,6 +174,7 @@ const request = (_gp, _mt, data = {}, failCallback) => {
 // 现app调用方式
 
 const doRequest = (method, url, data)=> {
+	console.log(method,url,data)
 	// let baseUrl = config.def().baseUrl
 	let baseUrl = 'http://192.168.1.120:8090/'
         // 如果data为空

+ 67 - 44
pages/business/business.vue

@@ -73,6 +73,9 @@
 				isLoadMore: false, //是否加载中
 				showTran: true,
 				scrollTop: 0,
+				pageSize:1,
+				searchKeyWord:'',
+				currentPage:10,
 				categoryList: [{
 					title: '我要买粮',
 					id: '0'
@@ -93,13 +96,24 @@
 			uni.showTabBar()
 		},
 		onLoad(options) {
-			console.log("buy onload")
-			// #ifdef H5
-			this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
-			// #endif
-			this.cateId = options.tid ? options.tid : 0;
-			this.keywords = options.keywords ? options.keywords : ''
-			this.loadData();
+			// console.log("buy onload")
+			// // #ifdef H5
+			// this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
+			// // #endif
+			// this.cateId = options.tid ? options.tid : 0;
+			// this.keywords = options.keywords ? options.keywords : ''
+			// this.loadData();
+			this.$api.doRequest('get', '/procurementPlanInfo/selectProcurementPlanInfo',{pageSize:this.pageSize,
+			currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
+				console.log(res)
+							})
+							.catch(res => {
+								uni.showToast({
+									title: res.errmsg,
+									icon:'none',
+									duration: 2000
+								})
+							});
 		},
 		onPageScroll(e) {
 			this.scrollTop = e.scrollTop;
@@ -152,48 +166,57 @@
 					mask: true
 				})
 				var param1 = ''
-				var param2 = ''
 				if (that.TabCur == 0) {
-					param1 = 'integral'
-					param2 = 'getIndexData'
+					param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
 				} else {
 					param1 = 'buy'
-					param2 = 'getBuyListInfo'
 				}
-				console.log(param1, param2)
-				that.$api.request(param1, param2, {
-					page: 1,
-					limit: 10
-				}, failres => {
-					that.$api.msg(failres.errmsg)
-					that.isLoadMore = false
-					that.loadStatus = 'nomore'
-					if (that.pages > 1) {
-						that.pages -= 1
-					}
-					uni.hideLoading()
-				}).then(res => {
-					let data = null
-					if (that.TabCur == 0) {
-						data = res.data.saleInfo
-					} else {
-						data = res.data
-					}
-					uni.stopPullDownRefresh()
-
-					//采购信息
-					if (data.length > 0) {
-						that.buyInfo = data
-						that.isLoadMore = false
-					} else {
-						if (that.pages > 1) {
-							that.pages -= 1
-						}
-						that.isLoadMore = true
-						that.loadStatus = 'nomore'
-					}
-					uni.hideLoading()
+				
+				console.log(11111)
+				this.$api.doRequest('get', '/procurementPlanInfo/selectProcurementPlanInfo',{pageSize:this.pageSize,
+currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
+	console.log(res)
 				})
+				.catch(res => {
+					uni.showToast({
+						title: res.errmsg,
+						icon:'none',
+						duration: 2000
+					})
+				});
+				// that.$api.request(param1, param2, {
+				// 	page: 1,
+				// 	limit: 10
+				// }, failres => {
+				// 	that.$api.msg(failres.errmsg)
+				// 	that.isLoadMore = false
+				// 	that.loadStatus = 'nomore'
+				// 	if (that.pages > 1) {
+				// 		that.pages -= 1
+				// 	}
+				// 	uni.hideLoading()
+				// }).then(res => {
+				// 	let data = null
+				// 	if (that.TabCur == 0) {
+				// 		data = res.data.saleInfo
+				// 	} else {
+				// 		data = res.data
+				// 	}
+				// 	uni.stopPullDownRefresh()
+
+				// 	//采购信息
+				// 	if (data.length > 0) {
+				// 		that.buyInfo = data
+				// 		that.isLoadMore = false
+				// 	} else {
+				// 		if (that.pages > 1) {
+				// 			that.pages -= 1
+				// 		}
+				// 		that.isLoadMore = true
+				// 		that.loadStatus = 'nomore'
+				// 	}
+				// 	uni.hideLoading()
+				// })
 			},
 			//详情
 			navToDetailPage(item) {