Commit f6b14b04 by wjw

ww-儿童营地完成

parent d93318d3
......@@ -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
......
......@@ -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>
......
......@@ -160,7 +160,12 @@
.swiper {
width: 750rpx;
height: 1160rpx;
background-color: lightblue;
background-color: #FCF8F0;
}
.swiper image {
width: 750rpx;
height: 1160rpx;
}
.wx-swiper-dots{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment