Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
home-with-kids-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
d32de68d
authored
2019-11-26 20:27:09 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
712025c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
src/pages/index/index.js
src/pages/index/index.wxml
src/pages/index/index.js
View file @
d32de68
...
...
@@ -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
)
...
...
src/pages/index/index.wxml
View file @
d32de68
...
...
@@ -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>
...
...
Please
register
or
sign in
to post a comment