|
@@ -71,7 +71,8 @@ export default {
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
list: [],
|
|
list: [],
|
|
- total: 0
|
|
|
|
|
|
+ total: 0,
|
|
|
|
+ action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -93,11 +94,11 @@ export default {
|
|
// tabs通知swiper切换
|
|
// tabs通知swiper切换
|
|
tabsChange(index) {
|
|
tabsChange(index) {
|
|
this.swiperCurrent = index;
|
|
this.swiperCurrent = index;
|
|
- this.resetPage();
|
|
|
|
},
|
|
},
|
|
- swiperChange(event) {
|
|
|
|
- this.list = [];
|
|
|
|
|
|
+ swiperChange(e) {
|
|
|
|
+ this.action = 'swiperChange'
|
|
this.status = 'loading';
|
|
this.status = 'loading';
|
|
|
|
+ this.typeId = this.tabList[e.detail.current].code
|
|
},
|
|
},
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
transition(e) {
|
|
transition(e) {
|
|
@@ -111,21 +112,30 @@ export default {
|
|
this.$refs.uTabs.setFinishCurrent(current);
|
|
this.$refs.uTabs.setFinishCurrent(current);
|
|
this.swiperCurrent = current;
|
|
this.swiperCurrent = current;
|
|
this.current = current;
|
|
this.current = current;
|
|
- this.resetPage();
|
|
|
|
|
|
+ if(this.status!="nomore"){
|
|
|
|
+ this.resetPage();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// scroll-view到底部加载更多
|
|
// scroll-view到底部加载更多
|
|
onreachBottom() {
|
|
onreachBottom() {
|
|
|
|
+ this.action = 'onreachBottom'
|
|
if (this.list.length < this.total) {
|
|
if (this.list.length < this.total) {
|
|
this.pageNo += 1;
|
|
this.pageNo += 1;
|
|
- this.getRow();
|
|
|
|
} else {
|
|
} else {
|
|
this.status = 'nomore';
|
|
this.status = 'nomore';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
resetPage(){
|
|
resetPage(){
|
|
this.status = 'loading';
|
|
this.status = 'loading';
|
|
- this.list = [];
|
|
|
|
- this.getRow(1);
|
|
|
|
|
|
+ // 上划分页
|
|
|
|
+ if(this.action == 'onreachBottom'){
|
|
|
|
+ this.getRow();
|
|
|
|
+ }
|
|
|
|
+ // 左右切换tab
|
|
|
|
+ if(this.action == 'swiperChange'){
|
|
|
|
+ this.list = [];
|
|
|
|
+ this.getRow(1);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 查询列表
|
|
// 查询列表
|
|
getRow(pageNo) {
|
|
getRow(pageNo) {
|
|
@@ -133,7 +143,6 @@ export default {
|
|
if (pageNo) {
|
|
if (pageNo) {
|
|
this.pageNo = pageNo;
|
|
this.pageNo = pageNo;
|
|
}
|
|
}
|
|
- this.typeId = this.tabList[this.swiperCurrent].code
|
|
|
|
let params = {
|
|
let params = {
|
|
pageNo: this.pageNo,
|
|
pageNo: this.pageNo,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|