Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f6b14b04
authored
Sep 18, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww-儿童营地完成
parent
d93318d3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
pages/campsite/home/home.js
pages/campsite/home/home.wxml
pages/campsite/home/home.wxss
pages/campsite/home/home.js
View file @
f6b14b04
...
...
@@ -12,7 +12,7 @@ Page({
winSide
:
true
,
sideHeight
:
1250
,
shareImage
:
App
.
globalData
.
appResourcesBase
+
'share/share-1.png'
,
swiperImage
:
[],
childActivity
:
[],
bannerImage
:
App
.
globalData
.
appResourcesBase
+
'campsite/campsite-header.png'
,
bottomImage
:
App
.
globalData
.
appResourcesBase
+
'campsite/bottom.png'
,
detailImage
:
[],
...
...
@@ -30,6 +30,7 @@ Page({
onLoad
:
function
(
options
)
{
this
.
setSideHeight
()
this
.
queryDetail
()
this
.
queryActivity
()
},
setSideHeight
:
function
()
{
...
...
@@ -45,13 +46,32 @@ Page({
success
:
function
(
res
)
{
let
funcData
=
res
.
list
.
filter
(
v
=>
v
.
name
===
'儿童营地'
)
that
.
setData
({
swiperImage
:
funcData
[
0
].
rotationImg
,
detailImageUrl
:
funcData
[
0
].
content
})
}
})
},
// 获取活动信息
queryActivity
:
function
()
{
let
that
=
this
App
.
wxRequest
({
url
:
'/api/v1/activity/getList'
,
data
:
{
'listType'
:
'1'
,
'pageSize'
:
'5'
,
'pageNo'
:
'1'
,
'tagId'
:
'103'
},
success
:
function
(
res
)
{
let
funcData
=
res
.
data
.
list
let
childActivity
=
funcData
.
filter
(
v
=>
v
.
childImg
!==
''
)
console
.
log
(
childActivity
)
that
.
setData
({
childActivity
})
}
})
},
onBackTop
:
function
()
{
wx
.
pageScrollTo
({
scrollTop
:
0
...
...
pages/campsite/home/home.wxml
View file @
f6b14b04
...
...
@@ -76,14 +76,14 @@
<!-- 滚动图片 -->
<!-- 单张图片 -->
<view class="swiper" wx:if="{{
swiperImage
.length <= 1}}">
<view class="swiper" wx:if="{{
childActivity
.length <= 1}}">
<image mode="aspectFit" src="{{childActivity[0].childImg}}"></image>
</view>
<!-- 多张图片 -->
<swiper class="swiper" indicator-dots indicator-color="#F6DADA" indicator-active-color="#E57C99" autoplay circular wx:else>
<block>
<block
wx:for="{{childActivity}}" wx:key="id"
>
<swiper-item>
<image mode="
widthFix" src="
"></image>
<image mode="
aspectFit" src="{{item.childImg}}
"></image>
</swiper-item>
</block>
</swiper>
...
...
pages/campsite/home/home.wxss
View file @
f6b14b04
...
...
@@ -160,7 +160,12 @@
.swiper {
width: 750rpx;
height: 1160rpx;
background-color: lightblue;
background-color: #FCF8F0;
}
.swiper image {
width: 750rpx;
height: 1160rpx;
}
.wx-swiper-dots{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment