默认提交
Showing
2 changed files
with
27 additions
and
19 deletions
| ... | @@ -15,6 +15,7 @@ Page({ | ... | @@ -15,6 +15,7 @@ Page({ |
| 15 | curTab: {}, | 15 | curTab: {}, |
| 16 | queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数 | 16 | queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数 |
| 17 | active: 0, | 17 | active: 0, |
| 18 | curBanner: {} | ||
| 18 | }, | 19 | }, |
| 19 | onShareAppMessage() {}, | 20 | onShareAppMessage() {}, |
| 20 | showAuth() { | 21 | showAuth() { |
| ... | @@ -72,6 +73,26 @@ Page({ | ... | @@ -72,6 +73,26 @@ Page({ |
| 72 | this.queryVideoList(); | 73 | this.queryVideoList(); |
| 73 | } | 74 | } |
| 74 | }, | 75 | }, |
| 76 | |||
| 77 | /** | ||
| 78 | * banner切换 | ||
| 79 | */ | ||
| 80 | onBannerChangeHandler(e) { | ||
| 81 | console.log("e:", e); | ||
| 82 | let index = e.detail.current; | ||
| 83 | this.setBannerIndex(index); | ||
| 84 | }, | ||
| 85 | |||
| 86 | setBannerIndex(idx) { | ||
| 87 | let bannerList = this.data.bannerList; | ||
| 88 | if (bannerList && bannerList.length > 0) { | ||
| 89 | let curBanner = bannerList[idx] || {} | ||
| 90 | this.setData({ | ||
| 91 | curBanner: curBanner | ||
| 92 | }) | ||
| 93 | } | ||
| 94 | }, | ||
| 95 | |||
| 75 | onDetailHandler(evt) { | 96 | onDetailHandler(evt) { |
| 76 | let curItem = getBindtapData(evt); | 97 | let curItem = getBindtapData(evt); |
| 77 | app.router.push({ | 98 | app.router.push({ |
| ... | @@ -131,6 +152,7 @@ Page({ | ... | @@ -131,6 +152,7 @@ Page({ |
| 131 | this.setData({ | 152 | this.setData({ |
| 132 | bannerList: result | 153 | bannerList: result |
| 133 | }) | 154 | }) |
| 155 | this.setBannerIndex(0); | ||
| 134 | resolve(result); | 156 | resolve(result); |
| 135 | }).catch((err) => { | 157 | }).catch((err) => { |
| 136 | reject(err) | 158 | reject(err) | ... | ... |
| ... | @@ -11,14 +11,17 @@ | ... | @@ -11,14 +11,17 @@ |
| 11 | </van-sticky> | 11 | </van-sticky> |
| 12 | <view class="content"> | 12 | <view class="content"> |
| 13 | <view class="banner" wx:if="{{bannerList && bannerList.length>0}}"> | 13 | <view class="banner" wx:if="{{bannerList && bannerList.length>0}}"> |
| 14 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | 14 | <swiper bindchange="onBannerChangeHandler" class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> |
| 15 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> | 15 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> |
| 16 | <swiper-item> | 16 | <swiper-item> |
| 17 | <image class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" /> | 17 | <image class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" /> |
| 18 | </swiper-item> | 18 | </swiper-item> |
| 19 | </block> | 19 | </block> |
| 20 | </swiper> | 20 | </swiper> |
| 21 | <view class="tit">banner名字</view> | 21 | <view wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit"> |
| 22 | {{curBanner && curBanner.bannerTitle || ""}} | ||
| 23 | </view> | ||
| 24 | <!-- <view class="tit">名字</view> --> | ||
| 22 | </view> | 25 | </view> |
| 23 | <view class="list"> | 26 | <view class="list"> |
| 24 | <view wx:for="{{dataList}}" wx:key="index" class="list-item"> | 27 | <view wx:for="{{dataList}}" wx:key="index" class="list-item"> |
| ... | @@ -39,27 +42,10 @@ | ... | @@ -39,27 +42,10 @@ |
| 39 | </button> | 42 | </button> |
| 40 | </view> | 43 | </view> |
| 41 | </view> | 44 | </view> |
| 42 | <!-- <view bindtap="onDetailHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item"> | ||
| 43 | <view class="list-item-video"> | ||
| 44 | <video objectFit="cover" class="vid" poster="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> | ||
| 45 | <view class="tit">这是一个视频</view> | ||
| 46 | </view> | ||
| 47 | <view class="list-item-func"> | ||
| 48 | <view class="user"> | ||
| 49 | <image class="portrait" mode="aspectFill" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" /> | ||
| 50 | <text class="name">我爱我家</text> | ||
| 51 | </view> | ||
| 52 | <button class="share"> | ||
| 53 | <span class="t1 iconfont iconwechat"></span> | ||
| 54 | <span class="t1">分享</span> | ||
| 55 | </button> | ||
| 56 | </view> | ||
| 57 | </view> --> | ||
| 58 | </view> | 45 | </view> |
| 59 | </view> | 46 | </view> |
| 60 | </view> | 47 | </view> |
| 61 | </view> | 48 | </view> |
| 62 | |||
| 63 | <van-popup show="{{ authorizeVisible }}"> | 49 | <van-popup show="{{ authorizeVisible }}"> |
| 64 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | 50 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> |
| 65 | </van-popup> | 51 | </van-popup> | ... | ... |
-
Please register or sign in to post a comment