| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view v-if="list.length"> |
| | | <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more> |
| | | </view> |
| | | </view> |
| | | <view v-else> |
| | | <view class="list-item"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'; |
| | | import HTabs from "@/components/liuyuno-tabs/liuyuno-tabs.vue"; |
| | | export default { |
| | | components: { |
| | | HTabs |
| | | HTabs, |
| | | uniLoadMore |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | isShowFilter:false, |
| | | storeList: [], |
| | | shopId: '',//门店id |
| | | list: [] |
| | | list: [], |
| | | loadStatus: 'more', |
| | | pageNum: 1 |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | |
| | | this.loadShopList();; |
| | | } |
| | | }, |
| | | onPullDownRefresh(){ |
| | | this.reloadData(); |
| | | let timer = setTimeout(function () { |
| | | uni.startPullDownRefresh(); |
| | | clearTimeout(timer); |
| | | timer = null; |
| | | }, 800); |
| | | }, |
| | | onReachBottom(){ |
| | | this.loadList() |
| | | }, |
| | | onNavigationBarButtonTap(e){ |
| | | if(e.index==0){ |
| | | uni.navigateTo({ |
| | |
| | | this.hideFilter() |
| | | }, |
| | | methods:{ |
| | | reloadData(){ |
| | | this.list = []; |
| | | this.pageNum = 1; |
| | | this.loadStatus = 'more'; |
| | | this.loadList(); |
| | | }, |
| | | tabChange(index){ |
| | | let val = index + 1; |
| | | if(val == this.tabIndex){ |
| | |
| | | } |
| | | this.tabIndex = val; |
| | | if(val != 3){ |
| | | this.loadList() |
| | | this.reloadData() |
| | | } |
| | | }, |
| | | hideFilter(){ |
| | |
| | | uni.setNavigationBarTitle({ |
| | | title: item.shopShortName + '经营报表' |
| | | }); |
| | | this.loadList(); |
| | | this.reloadData(); |
| | | }, |
| | | loadShopList(){ |
| | | this.$httpUtils.request('/api/shop/findAllShopList').then((res) => { |
| | |
| | | }) |
| | | }, |
| | | loadList(){ |
| | | if(this.loadStatus!=='more'){ |
| | | return; |
| | | } |
| | | this.$httpUtils.request('/api/statistics/findShopBusinessesData', { |
| | | "pageNum": 1, |
| | | "pageSize": 100, |
| | | "pageNum": this.pageNum, |
| | | "pageSize": 10, |
| | | "shopId": this.shopId, |
| | | "type": this.tabIndex |
| | | }, 'POST').then((res) => { |
| | | if(res.status == 200){ |
| | | this.list = res.rows; |
| | | let result = res.rows; |
| | | if(result.length < 10){ |
| | | this.loadStatus = 'noMore'; |
| | | } else { |
| | | this.pageNum ++ ; |
| | | this.loadStatus = 'more'; |
| | | } |
| | | this.list = this.list.concat(result); |
| | | } |
| | | }) |
| | | } |