Commit 70e66e07 authored by tangfh's avatar tangfh

+

parent b18e59ab
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<swiper-item class="swiper-item" v-for="(tab,index) in tabList" :key="index"> <swiper-item class="swiper-item" v-for="(tab,index) in tabList" :key="index">
<scroll-view class="scroll-v" scroll-y :refresher-enabled="true" @refresherrefresh="onRefresh()" <scroll-view class="scroll-v" scroll-y :refresher-enabled="true" @refresherrefresh="onRefresh()"
:enable-back-to-top="true" :lower-threshold="75" :refresher-triggered="tab.refreshing" :enable-back-to-top="true" :lower-threshold="75" :refresher-triggered="tab.refreshing"
@scrolltolower="loadMore(index)" :style="{height: (swiperHeight) + 'px'}"> @scrolltolower="onLoadMore(index)" :style="{height: (swiperHeight) + 'px'}">
<view class="flex-column" v-if="tab.data.length > 0" :style="{'min-height': (svHeight + 'rpx')}"> <view class="flex-column" v-if="tab.data.length > 0" :style="{'min-height': (svHeight + 'rpx')}">
<view class="view-tmp1 active" v-for="(item2, index2) in tab.data" :index="index2" :key="index2" <view class="view-tmp1 active" v-for="(item2, index2) in tab.data" :index="index2" :key="index2"
:item="item2" @onItemClick="onItemClick"></view> :item="item2" @onItemClick="onItemClick"></view>
...@@ -131,13 +131,13 @@ ...@@ -131,13 +131,13 @@
tab.limit = 10; tab.limit = 10;
tab.loadStatus = constant.LOAD_STATUS.more; tab.loadStatus = constant.LOAD_STATUS.more;
tab.total_pages = 1; tab.total_pages = 1;
tab.data.push([{},{},{}]); // tab.data.push([{},{},{}]);
tab.channel = REPAIR_LIST_TYPE.wait_alloc.text tab.channel = REPAIR_LIST_TYPE.wait_alloc.text
} else if (tabBar.type == REPAIR_LIST_TYPE.alloced.type) { } else if (tabBar.type == REPAIR_LIST_TYPE.alloced.type) {
tab.limit = 5; tab.limit = 5;
tab.loadStatus = constant.LOAD_STATUS.more; tab.loadStatus = constant.LOAD_STATUS.more;
tab.total_pages = 1; tab.total_pages = 1;
tab.data.push([{},{},{},{},{},{}]); // tab.data.push([{},{},{},{},{},{}]);
tab.channel = REPAIR_LIST_TYPE.alloced.text tab.channel = REPAIR_LIST_TYPE.alloced.text
} }
if (tab.total_pages == 1) { if (tab.total_pages == 1) {
...@@ -177,7 +177,6 @@ ...@@ -177,7 +177,6 @@
} }
tab.loadStatus = constant.LOAD_STATUS.loading; tab.loadStatus = constant.LOAD_STATUS.loading;
tab.page++; tab.page++;
tab.loadStatus = tab.page > tab.total_pages ? constant.LOAD_STATUS.noMore : constant.LOAD_STATUS.more;
this.getList(this.tabIndex); this.getList(this.tabIndex);
}, },
getList(index) { getList(index) {
...@@ -226,15 +225,15 @@ ...@@ -226,15 +225,15 @@
// } // }
// }) // })
if (tab.refreshing || tab.data.length == 0) { if (tab.refreshing || tab.data.length == 0) {
tab.total_page = util.calTotalPage(data.total_list); tab.total_pages = util.calTotalPage(data.total_list);
this.clearTabData(this.tabIndex); this.clearTabData(this.tabIndex);
tab.data = list; tab.data = list;
tab.loadStatus = tab.total_page == 1 ? constant.LOAD_STATUS.noMore : constant.LOAD_STATUS.more; tab.loadStatus = tab.total_pages == 1 ? constant.LOAD_STATUS.noMore : constant.LOAD_STATUS.more;
} else if (tab.loadStatus == constant.LOAD_STATUS.loading) { } else if (tab.loadStatus == constant.LOAD_STATUS.loading) {
if (list.length > 0) { if (list.length > 0) {
tab.data = tab.data.concat(list); tab.data = tab.data.concat(list);
} }
tab.loadStatus = tab.page == tab.total_page ? constant.LOAD_STATUS.noMore : constant.LOAD_STATUS.more; tab.loadStatus = tab.page == tab.total_pages ? constant.LOAD_STATUS.noMore : constant.LOAD_STATUS.more;
} }
tab.contentStatus = tab.data.length == 0 ? constant.CONTENT_STATUS.EMPTY : {}; tab.contentStatus = tab.data.length == 0 ? constant.CONTENT_STATUS.EMPTY : {};
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment