|
@@ -6,12 +6,12 @@
|
|
|
</view>
|
|
|
<view class="container">
|
|
|
<view class="tabs">
|
|
|
- <view class="tab" :class="active === i.id ? 'active' : ''" v-for="i in activeTabs" :key="i.id" @click="handlerTabs(i)">
|
|
|
+ <view class="tab" :class="params.type === i.id ? 'active' : ''" v-for="i in activeTabs" :key="i.id" @click="handlerTabs(i)">
|
|
|
{{ i.title }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="growth-module-list">
|
|
|
- <active-team-com v-for="i in dataList" :key="i.id" :module="i" :active="active" @playVideo="playVideo"/>
|
|
|
+ <active-team-com v-for="i in dataList" :key="i.id" :module="i" :active="params.type" @playVideo="playVideo"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<cm-video :show="showVideo" @closeClick="closeVideo" :videoObj="videoObj" />
|
|
@@ -64,24 +64,36 @@ export default {
|
|
|
isActive: 6,
|
|
|
activeTabs: [
|
|
|
{
|
|
|
- id: 1,
|
|
|
+ id: 2,
|
|
|
title: '美业企谈'
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
+ id: 3,
|
|
|
title: '干货知识'
|
|
|
}
|
|
|
],
|
|
|
- active: 1,
|
|
|
dataList: [],
|
|
|
showVideo: false,
|
|
|
- videoObj: {}
|
|
|
+ videoObj: {},
|
|
|
+ params: {
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ type: 2,
|
|
|
+ source: 2
|
|
|
+ },
|
|
|
+ hasNextPage: false
|
|
|
}
|
|
|
},
|
|
|
onLoad (option) {
|
|
|
this.handlerInit()
|
|
|
- this.active = Number(option.active)
|
|
|
- this.getSupplierLanding(this.active)
|
|
|
+ this.params.type = Number(option.active)
|
|
|
+ this.getSupplierLanding(this.params.type)
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ if (this.hasNextPage) {
|
|
|
+ this.getSupplierLanding(this.params.type)
|
|
|
+ }
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
},
|
|
|
methods: {
|
|
|
// 滚动事件
|
|
@@ -96,13 +108,15 @@ export default {
|
|
|
this.$refs['login-menu'].isActive = 6
|
|
|
},
|
|
|
handlerTabs ($event) {
|
|
|
- this.active = $event.id
|
|
|
- this.getSupplierLanding(this.active)
|
|
|
+ this.params.type = $event.id
|
|
|
+ this.params.pageNum = 1
|
|
|
+ this.dataList = []
|
|
|
+ this.getSupplierLanding(this.params.type)
|
|
|
},
|
|
|
async getSupplierLanding(active) {
|
|
|
try {
|
|
|
- const { data } = await this.UserService.supplierLoading({ source: 2 })
|
|
|
- this.dataList = active === 1 ? data.landing.filter(e => e.type == '2') : data.landing.filter(e => e.type == '3')
|
|
|
+ const { data } = await this.UserService.supplierMoreList(this.params)
|
|
|
+ this.dataList = [...this.dataList, ...data.list]
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
}
|