d32de68d by simon

默认提交

1 parent 712025c6
......@@ -15,6 +15,7 @@ Page({
curTab: {},
queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数
active: 0,
curBanner: {}
},
onShareAppMessage() {},
showAuth() {
......@@ -72,6 +73,26 @@ Page({
this.queryVideoList();
}
},
/**
* banner切换
*/
onBannerChangeHandler(e) {
console.log("e:", e);
let index = e.detail.current;
this.setBannerIndex(index);
},
setBannerIndex(idx) {
let bannerList = this.data.bannerList;
if (bannerList && bannerList.length > 0) {
let curBanner = bannerList[idx] || {}
this.setData({
curBanner: curBanner
})
}
},
onDetailHandler(evt) {
let curItem = getBindtapData(evt);
app.router.push({
......@@ -131,6 +152,7 @@ Page({
this.setData({
bannerList: result
})
this.setBannerIndex(0);
resolve(result);
}).catch((err) => {
reject(err)
......
......@@ -11,14 +11,17 @@
</van-sticky>
<view class="content">
<view class="banner" wx:if="{{bannerList && bannerList.length>0}}">
<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}}">
<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}}">
<block wx:for="{{bannerList}}" wx:key="{{index}}">
<swiper-item>
<image class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
<view class="tit">banner名字</view>
<view wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit">
{{curBanner && curBanner.bannerTitle || ""}}
</view>
<!-- <view class="tit">名字</view> -->
</view>
<view class="list">
<view wx:for="{{dataList}}" wx:key="index" class="list-item">
......@@ -39,27 +42,10 @@
</button>
</view>
</view>
<!-- <view bindtap="onDetailHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item">
<view class="list-item-video">
<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" />
<view class="tit">这是一个视频</view>
</view>
<view class="list-item-func">
<view class="user">
<image class="portrait" mode="aspectFill" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" />
<text class="name">我爱我家</text>
</view>
<button class="share">
<span class="t1 iconfont iconwechat"></span>
<span class="t1">分享</span>
</button>
</view>
</view> -->
</view>
</view>
</view>
</view>
<van-popup show="{{ authorizeVisible }}">
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
......