|
@@ -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) {
|