Commit f6b14b04 by wjw

ww-儿童营地完成

parent d93318d3
...@@ -12,7 +12,7 @@ Page({ ...@@ -12,7 +12,7 @@ Page({
winSide: true, winSide: true,
sideHeight: 1250, sideHeight: 1250,
shareImage: App.globalData.appResourcesBase + 'share/share-1.png', shareImage: App.globalData.appResourcesBase + 'share/share-1.png',
swiperImage: [], childActivity: [],
bannerImage: App.globalData.appResourcesBase + 'campsite/campsite-header.png', bannerImage: App.globalData.appResourcesBase + 'campsite/campsite-header.png',
bottomImage: App.globalData.appResourcesBase + 'campsite/bottom.png', bottomImage: App.globalData.appResourcesBase + 'campsite/bottom.png',
detailImage: [], detailImage: [],
...@@ -30,6 +30,7 @@ Page({ ...@@ -30,6 +30,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.setSideHeight() this.setSideHeight()
this.queryDetail() this.queryDetail()
this.queryActivity()
}, },
setSideHeight: function () { setSideHeight: function () {
...@@ -45,13 +46,32 @@ Page({ ...@@ -45,13 +46,32 @@ Page({
success: function(res) { success: function(res) {
let funcData = res.list.filter(v => v.name === '儿童营地') let funcData = res.list.filter(v => v.name === '儿童营地')
that.setData({ that.setData({
swiperImage: funcData[0].rotationImg,
detailImageUrl: funcData[0].content 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 () { onBackTop: function () {
wx.pageScrollTo({ wx.pageScrollTo({
scrollTop: 0 scrollTop: 0
......
...@@ -76,14 +76,14 @@ ...@@ -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> </view>
<!-- 多张图片 --> <!-- 多张图片 -->
<swiper class="swiper" indicator-dots indicator-color="#F6DADA" indicator-active-color="#E57C99" autoplay circular wx:else> <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> <swiper-item>
<image mode="widthFix" src=""></image> <image mode="aspectFit" src="{{item.childImg}}"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
......
...@@ -160,7 +160,12 @@ ...@@ -160,7 +160,12 @@
.swiper { .swiper {
width: 750rpx; width: 750rpx;
height: 1160rpx; height: 1160rpx;
background-color: lightblue; background-color: #FCF8F0;
}
.swiper image {
width: 750rpx;
height: 1160rpx;
} }
.wx-swiper-dots{ .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