|
|
|
@ -9,7 +9,14 @@ |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="banner"> |
|
|
|
|
<image class="pic" src="https://occupationlab.com/images/preschoolEdu/index-banner.jpg" mode="widthFix"></image> |
|
|
|
|
<uni-swiper-dot class="swiper" v-if="banners.length" :current="curBanner" :info="banners" field="id" mode="round" :dotsStyles="dotsStyles"> |
|
|
|
|
<swiper class="swiper-box" autoplay> |
|
|
|
|
<swiper-item v-for="(item, i) in banners" :key="i"> |
|
|
|
|
<image class="pic" :src="item.coverUrl"></image> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
</uni-swiper-dot> |
|
|
|
|
<image v-else class="pic" src="https://occupationlab.com/images/preschoolEdu/index-banner.jpg"></image> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -18,7 +25,14 @@ |
|
|
|
|
<view class="title">爆款推荐</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<image class="hot" src="https://occupationlab.com/images/preschoolEdu/index-hot.jpg"></image> |
|
|
|
|
<uni-swiper-dot class="swiper" v-if="hots.length" :current="curBanner" :info="hots" field="id" mode="round" :dotsStyles="dotsStyles"> |
|
|
|
|
<swiper class="swiper-box" autoplay> |
|
|
|
|
<swiper-item v-for="(item, i) in hots" :key="i"> |
|
|
|
|
<image class="hot" :src="item.coverUrl"></image> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
</uni-swiper-dot> |
|
|
|
|
<image v-else class="hot" src="https://occupationlab.com/images/preschoolEdu/index-hot.jpg"></image> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="module"> |
|
|
|
@ -58,13 +72,23 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { postLoginActivity, individualEventRegistration, cancelRegistration, categoryList } from '@/apis/modules/activity.js' |
|
|
|
|
import { postLoginActivity, individualEventRegistration, cancelRegistration, categoryList, explosiveList } from '@/apis/modules/activity.js' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
per: true, // 是否有权限 |
|
|
|
|
teamId: uni.getStorageSync('teamId') || '', |
|
|
|
|
curBanner: 0, |
|
|
|
|
dotsStyles: { |
|
|
|
|
backgroundColor: 'rgba(83, 200, 249,0.3)', |
|
|
|
|
border: '1px rgba(83, 200, 249,0.3) solid', |
|
|
|
|
color: '#fff', |
|
|
|
|
selectedBackgroundColor: 'rgba(83, 200, 249,0.9)', |
|
|
|
|
selectedBorder: '1px rgba(83, 200, 249,0.9) solid' |
|
|
|
|
}, |
|
|
|
|
banners: [], |
|
|
|
|
hots: [], |
|
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
|
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore |
|
|
|
|
keyword: '', |
|
|
|
@ -103,6 +127,7 @@ |
|
|
|
|
this.keyword = '' |
|
|
|
|
this.curTab = '' |
|
|
|
|
this.per = true |
|
|
|
|
this.getBanner() |
|
|
|
|
this.getCategory() |
|
|
|
|
this.initList() |
|
|
|
|
}, |
|
|
|
@ -166,6 +191,31 @@ |
|
|
|
|
const { page } = await categoryList() |
|
|
|
|
this.tabs = page |
|
|
|
|
}, |
|
|
|
|
// 获取banner及爆款 |
|
|
|
|
getBanner() { |
|
|
|
|
// banner |
|
|
|
|
explosiveList({ |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 5, |
|
|
|
|
enabledState: 0, |
|
|
|
|
type: 1 |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.banners = data.records |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
|
|
|
|
|
// 爆款 |
|
|
|
|
explosiveList({ |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 5, |
|
|
|
|
enabledState: 0, |
|
|
|
|
type: 0 |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
data.records.forEach(e => { |
|
|
|
|
if (e.coverUrl.includes(',')) e.coverUrl = e.coverUrl.split(',')[0] |
|
|
|
|
}) |
|
|
|
|
this.hots = data.records |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// keyword清除回调 |
|
|
|
|
clearKeyword() { |
|
|
|
|
this.keyword = '' |
|
|
|
@ -243,6 +293,10 @@ |
|
|
|
|
position: relative; |
|
|
|
|
.pic { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 420rpx; |
|
|
|
|
} |
|
|
|
|
swiper { |
|
|
|
|
height: 420rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.tab-wrap { |
|
|
|
|