|
|
|
@ -67,7 +67,8 @@ |
|
|
|
..._public |
|
|
|
}], |
|
|
|
page_size: 10, |
|
|
|
windowHeight: 0 |
|
|
|
windowHeight: 0, |
|
|
|
stateText: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -91,18 +92,30 @@ |
|
|
|
methods: { |
|
|
|
// 获取数据 TODO 目前接口还没有数据 |
|
|
|
getData(options){ |
|
|
|
if(this.current == 1) { |
|
|
|
this.stateText = '待确认' |
|
|
|
}else if(this.current == 2) { |
|
|
|
this.stateText = '已出库' |
|
|
|
}else { |
|
|
|
this.stateText = '' |
|
|
|
} |
|
|
|
let item = this.tab_list[this.current]; |
|
|
|
this.$http(this.API.API_CANTEEN_WAREHOUSEOUTLIST).then(res => { |
|
|
|
this.$http(this.API.API_CANTEEN_WAREHOUSEOUTLIST,{ |
|
|
|
page: item.page, |
|
|
|
pagesize: 10, |
|
|
|
state: this.stateText |
|
|
|
}).then(res => { |
|
|
|
console.log("getData", res); |
|
|
|
this.tab_list[this.current].list = res.data.list || []; |
|
|
|
|
|
|
|
let list = res.data.list || []; |
|
|
|
// let isPage res.data.isPage; |
|
|
|
// if(!isPage){ |
|
|
|
// item.loading_class = false; |
|
|
|
// item.loading_text = '已加载全部数据~'; |
|
|
|
// } |
|
|
|
// item.isPage = isPage; |
|
|
|
let isPage = res.data.hasmore; |
|
|
|
if(!isPage){ |
|
|
|
item.loading_class = false; |
|
|
|
item.loading_text = '已加载全部数据~'; |
|
|
|
} |
|
|
|
item.isPage = isPage; |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
|
|
|
|
if(options && options.refresh){ |
|
|
|
item.isRefresher = false; |
|
|
|
@ -118,7 +131,7 @@ |
|
|
|
tabsChange(current){ |
|
|
|
this.current = current; |
|
|
|
if(this.tab_list[this.current].list.length <= 0){ |
|
|
|
this.getData(); |
|
|
|
this.getData({type: this.current}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// swiper页面切换 |
|
|
|
@ -126,7 +139,7 @@ |
|
|
|
this.current = event.detail.current; |
|
|
|
if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 |
|
|
|
if(this.tab_list[this.current].list.length <= 0){ |
|
|
|
this.getData(); |
|
|
|
this.getData({type: this.current}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 页面触底 |
|
|
|
@ -134,7 +147,7 @@ |
|
|
|
let item = this.tab_list[this.current]; |
|
|
|
if(item.isPage){ |
|
|
|
item.page++; |
|
|
|
this.getData(); |
|
|
|
this.getData({type: this.current}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 下拉刷新 |
|
|
|
@ -147,7 +160,7 @@ |
|
|
|
item.loading_class = true; |
|
|
|
item.loading_text = '正在加载中...'; |
|
|
|
item.list = []; |
|
|
|
this.getData({refresh: true}); |
|
|
|
this.getData({refresh: true,type: this.current}); |
|
|
|
}, 200); |
|
|
|
} |
|
|
|
} |
|
|
|
|