|
@@ -2,7 +2,7 @@
|
|
<view class="myShopTour-wrap">
|
|
<view class="myShopTour-wrap">
|
|
<!-- 内容 -->
|
|
<!-- 内容 -->
|
|
<view class="myShopTour-con">
|
|
<view class="myShopTour-con">
|
|
- <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
|
|
|
|
|
|
+ <view class="uTabs"><u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper></view>
|
|
<swiper class="data-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
<swiper class="data-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
<scroll-view scroll-y class="scroll-con" @scrolltolower="onreachBottom">
|
|
<scroll-view scroll-y class="scroll-con" @scrolltolower="onreachBottom">
|
|
@@ -77,7 +77,7 @@
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
pageNo: 1, // 当前页码
|
|
pageNo: 1, // 当前页码
|
|
- pageSize: 15, // 一页多少条
|
|
|
|
|
|
+ pageSize: 5, // 一页多少条
|
|
total: 0, // 总条数
|
|
total: 0, // 总条数
|
|
status: 'loading', // 加载状态
|
|
status: 'loading', // 加载状态
|
|
noDataText: '暂无数据', // 列表数据为空时提示文字
|
|
noDataText: '暂无数据', // 列表数据为空时提示文字
|
|
@@ -90,7 +90,7 @@
|
|
storeName: '' // 门店名称
|
|
storeName: '' // 门店名称
|
|
},
|
|
},
|
|
typeId: '', // 记录状态
|
|
typeId: '', // 记录状态
|
|
- action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
|
|
|
|
+ // action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
}
|
|
}
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -143,18 +143,11 @@
|
|
this.tabList.unshift({dispName: '全部', code: ''})
|
|
this.tabList.unshift({dispName: '全部', code: ''})
|
|
this.searchForm.beginDate = this.get7day(-6)
|
|
this.searchForm.beginDate = this.get7day(-6)
|
|
this.searchForm.endDate = this.get7day(0)
|
|
this.searchForm.endDate = this.get7day(0)
|
|
- this.resetPage()
|
|
|
|
- uni.$on("updatePointTaskList",()=>{
|
|
|
|
- this.resetPage()
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- onUnload() {
|
|
|
|
- uni.$off("updatePointTaskList")
|
|
|
|
|
|
+ this.pageInit(1)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 获取查询参数 刷新列表
|
|
// 获取查询参数 刷新列表
|
|
refresh(params){
|
|
refresh(params){
|
|
- // console.log(params,'1111111111')
|
|
|
|
this.searchForm = params
|
|
this.searchForm = params
|
|
this.pageInit(1)
|
|
this.pageInit(1)
|
|
},
|
|
},
|
|
@@ -187,7 +180,6 @@
|
|
this.noDataText = res.message || '暂无数据'
|
|
this.noDataText = res.message || '暂无数据'
|
|
}
|
|
}
|
|
this.status = 'loadmore'
|
|
this.status = 'loadmore'
|
|
-
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 查看详情
|
|
// 查看详情
|
|
@@ -204,11 +196,15 @@
|
|
},
|
|
},
|
|
// tabs通知swiper切换
|
|
// tabs通知swiper切换
|
|
tabsChange(index) {
|
|
tabsChange(index) {
|
|
|
|
+ this.pageNo = 1
|
|
this.swiperCurrent = index
|
|
this.swiperCurrent = index
|
|
|
|
+ this.list = []
|
|
|
|
+ this.status = "loading"
|
|
},
|
|
},
|
|
swiperChange(e) {
|
|
swiperChange(e) {
|
|
- this.action = 'swiperChange'
|
|
|
|
- this.status = 'loading'
|
|
|
|
|
|
+ this.pageNo = 1
|
|
|
|
+ this.list = []
|
|
|
|
+ this.status = "loading"
|
|
this.typeId = this.tabList[e.detail.current].code
|
|
this.typeId = this.tabList[e.detail.current].code
|
|
},
|
|
},
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
@@ -219,44 +215,27 @@
|
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
animationfinish(e) {
|
|
animationfinish(e) {
|
|
- let current = e.detail.current
|
|
|
|
- let isCurtab = this.current == current
|
|
|
|
- if(this.status!="nomore"){
|
|
|
|
- let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab
|
|
|
|
- if(loadData){
|
|
|
|
- this.$refs.uTabs.setFinishCurrent(current)
|
|
|
|
- this.swiperCurrent = current
|
|
|
|
- this.current = current
|
|
|
|
- this.resetPage()
|
|
|
|
- }
|
|
|
|
|
|
+ let current = e.detail.current;
|
|
|
|
+ if(current != this.current){
|
|
|
|
+ this.$refs.uTabs.setFinishCurrent(current)
|
|
|
|
+ this.swiperCurrent = current
|
|
|
|
+ this.current = current
|
|
|
|
+ this.pageInit()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 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
|
|
- } else {
|
|
|
|
- this.status = 'nomore'
|
|
|
|
|
|
+ this.pageInit()
|
|
|
|
+ }else{
|
|
|
|
+ this.status = "nomore"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 打开筛选条件
|
|
// 打开筛选条件
|
|
onNavigationBarButtonTap(e) {
|
|
onNavigationBarButtonTap(e) {
|
|
this.openScreen = true
|
|
this.openScreen = true
|
|
},
|
|
},
|
|
- // 初始化数据
|
|
|
|
- resetPage(){
|
|
|
|
- this.status = 'loading'
|
|
|
|
- // 上划分页
|
|
|
|
- if(this.action == 'onreachBottom'){
|
|
|
|
- this.pageInit()
|
|
|
|
- }
|
|
|
|
- // 左右切换tab
|
|
|
|
- if(this.action == 'swiperChange'){
|
|
|
|
- this.list = []
|
|
|
|
- this.pageInit(1)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 获取近几天的数据
|
|
// 获取近几天的数据
|
|
get7day(day){
|
|
get7day(day){
|
|
let today = new Date()
|
|
let today = new Date()
|