|
|
|
@ -4,9 +4,8 @@ |
|
|
|
<view v-if="tab_list.length"> |
|
|
|
<u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="title_current" @change="titletabChange"></u-tabs> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="title_current==0"> |
|
|
|
<view class="lf-p-30 lf-flex" v-for="i of 8"> |
|
|
|
<view class="lf-p-30 lf-flex" v-for="(item,index) of tab_list[title_current].list" :key="index"> |
|
|
|
<image class="collect-img" src="https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png" mode="aspectFill"></image> |
|
|
|
<view class="lf-flex-column lf-m-l-20" style="width: 480rpx;min-height: 160rpx;justify-content: space-between;"> |
|
|
|
<view class="lf-font-36 lf-color-black lf-line-1">luckin coffee 瑞幸瑞幸咖啡瑞幸咖啡瑞幸咖啡瑞幸咖啡咖啡</view> |
|
|
|
@ -18,12 +17,15 @@ |
|
|
|
</view> |
|
|
|
<view class="lf-iconfont icon-shoucang lf-font-38" style="color: #FF9D9D;"></view> |
|
|
|
</view> |
|
|
|
<view class="loading-more"> |
|
|
|
<text :class="{'loading-more-text': tab_list[title_current].loadingClass}" v-if="tab_list[title_current].list.length">{{ tab_list[title_current].loadingText }}</text> |
|
|
|
<lf-nocontent v-else></lf-nocontent> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-p-b-30 lf-m-t-30" v-else> |
|
|
|
<lf-waterfall :list="tab_list[0].list" :ifsale="false" ref="uWaterfall"></lf-waterfall> |
|
|
|
<!-- <u-loadmore v-if="recomm_list.length" status="已加载全部数据~" @loadmore="addRandomData"></u-loadmore> --> |
|
|
|
<lf-waterfall :list="tab_list[title_current].list" :ifsale="false" ref="uWaterfall"></lf-waterfall> |
|
|
|
<view class="loading-more"> |
|
|
|
<text :class="{'loading-more-text': loading_class}" v-if="list.length">{{ loading_text }}</text> |
|
|
|
<text :class="{'loading-more-text': tab_list[title_current].loadingClass}" v-if="tab_list[title_current].list.length">{{ tab_list[title_current].loadingText }}</text> |
|
|
|
<lf-nocontent v-else></lf-nocontent> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -104,16 +106,23 @@ |
|
|
|
isRefresher: true |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
autoHeight(){ |
|
|
|
return `calc(${this.scrollH}px - ${this.nav_height}px - 86rpx)`; |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
lfWaterfall |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.windowHeight = getApp().globalData.windowHeight; |
|
|
|
let info = uni.getSystemInfoSync(); |
|
|
|
this.scrollH = info.screenHeight; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
titletabChange(index){ |
|
|
|
this.title_current = index; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
getData(options = {}) { |
|
|
|
let tab_item = this.tab_list[this.title_current]; |
|
|
|
@ -121,7 +130,7 @@ |
|
|
|
.get({ |
|
|
|
api: 'api/collect', |
|
|
|
data: { |
|
|
|
type: 'jc_goods' |
|
|
|
type: tab_item.type |
|
|
|
}, |
|
|
|
header: { |
|
|
|
Authorization: this.$cookieStorage.get('user_token') |
|
|
|
@ -139,6 +148,7 @@ |
|
|
|
if(options.type == 'pageRefresh') { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}else if(options.type == 'scrollRefresh') { |
|
|
|
console.log('进入了') |
|
|
|
this.isRefresher = false; |
|
|
|
} |
|
|
|
if(tab_item.page == 1) { |
|
|
|
@ -161,12 +171,13 @@ |
|
|
|
}, |
|
|
|
// 滑块下标值变化 |
|
|
|
swiperChange(event){ |
|
|
|
this.current = event.detail.current; |
|
|
|
this.title_current = event.detail.current; |
|
|
|
if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
// 页面触底,加载下一页 |
|
|
|
onScrolltolower(){ |
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
let tab_item = this.tab_list[this.title_current]; |
|
|
|
if(tab_item.isPage){ |
|
|
|
tab_item.page = tab_item.page + 1; |
|
|
|
this.getData(); |
|
|
|
@ -175,20 +186,19 @@ |
|
|
|
// scroll-view 下拉刷新 |
|
|
|
onRefresherrefresh(){ |
|
|
|
this.$u.throttle(() => { |
|
|
|
this.clearTabItem(); |
|
|
|
this.getData(); |
|
|
|
this.clearTabItem({type: 'scrollRefresh'}); |
|
|
|
}, 200); |
|
|
|
}, |
|
|
|
clearTabItem(){ |
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
clearTabItem(options){ |
|
|
|
let tab_item = this.tab_list[this.title_current]; |
|
|
|
tab_item.page = 1; |
|
|
|
tab_item.isPage = true; |
|
|
|
tab_item.isRefresher = true; |
|
|
|
tab_item.loadingClass = true; |
|
|
|
tab_item.loadingText = '正在加载中'; |
|
|
|
tab_item.list = []; |
|
|
|
this.$set(this.tab_list, this.current, tab_item); |
|
|
|
// this.$refs.uWaterfallFather[this.current].clear(); |
|
|
|
this.getData(options); |
|
|
|
// this.$refs.uWaterfallFather[this.title_current].clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|