Commit d9e75931 by wjw

ww-儿童营地,活动修改bug

parent ddff6ecb
...@@ -26,6 +26,21 @@ Page({ ...@@ -26,6 +26,21 @@ Page({
App.globalData.appResourcesBase + 'campsite/campsite-6.png', App.globalData.appResourcesBase + 'campsite/campsite-6.png',
], ],
detailIndex: 0, detailIndex: 0,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(246, 218, 218, 1)'
},
scroll: '100rpx',
},
navigationScroll: 0,
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -85,7 +100,6 @@ Page({ ...@@ -85,7 +100,6 @@ Page({
'listType': '1', 'listType': '1',
'pageSize': '5', 'pageSize': '5',
'pageNo': '1', 'pageNo': '1',
'tagId': '103',
'officeId': shopInfo.id 'officeId': shopInfo.id
}, },
success: function(res) { success: function(res) {
...@@ -123,7 +137,7 @@ Page({ ...@@ -123,7 +137,7 @@ Page({
if (funcEvent.scrollTop >= this.data.sideHeight) { if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) { if (this.data.winSide) {
this.setData({ this.setData({
winSide: false winSide: false,
}) })
} }
...@@ -139,6 +153,9 @@ Page({ ...@@ -139,6 +153,9 @@ Page({
navigationAnimationShow: 0 navigationAnimationShow: 0
}) })
} }
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件 // 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () { logicData.pageScrollTimer = setTimeout(function () {
......
<!-- 此页面是为了让其他页面进行跳转的镜像页面 --> <!-- 此页面是为了让其他页面进行跳转的镜像页面 -->
<!-- 如果直接跳转 tabbar 的营地页面会导致路由错乱问题 --> <!-- 如果直接跳转 tabbar 的营地页面会导致路由错乱问题 -->
<navigation class="navigation" titleText="儿童营地" backIcon="/image/back.png"></navigation> <navigation class="navigation" titleText="儿童营地" backIcon="/image/back.png" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container"> <view class="container">
<!-- <view class="appointment"> <!-- <view class="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button> <l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
<!-- 入园购票 --> <!-- 入园购票 -->
<view class="buy-coupon" bindtap="onBuyMembership" data-id="{{3}}"> <view class="buy-coupon" bindtap="onBuyMembership" data-id="{{3}}">
<view class="buy-coupon-title row align-c"> <view class="buy-coupon-title row align-c">
<image src="./image/ruyuangoupiao.png"></image> <image src="../home/image/ruyuangoupiao.png"></image>
<image src="/image/more.png"></image> <image src="/image/more.png"></image>
</view> </view>
<view class="buy-coupon-type row con-b"> <view class="buy-coupon-type row con-b">
<image src="./image/single.png"></image> <image src="../home/image/single.png"></image>
<image src="./image/month.png"></image> <image src="../home/image/month.png"></image>
<image src="./image/year.png"></image> <image src="../home/image/year.png"></image>
</view> </view>
</view> </view>
...@@ -58,21 +58,21 @@ ...@@ -58,21 +58,21 @@
<!-- 饮品预订 --> <!-- 饮品预订 -->
<view class="buy-snacks row" bindtap="onBuySnacks" data-id="{{3}}"> <view class="buy-snacks row" bindtap="onBuySnacks" data-id="{{3}}">
<view class="buy-left col con-c"> <view class="buy-left col con-c">
<image src="./image/yinpinyuding.png"></image> <image src="../home/image/yinpinyuding.png"></image>
</view> </view>
<view class="buy-right col con-c"> <view class="buy-right col con-c">
<image src="./image/icon-bg.png"></image> <image src="../home/image/icon-bg.png"></image>
<image class="snacks-img" src="./image/yinpin.png"></image> <image class="snacks-img" src="../home/image/yinpin.png"></image>
</view> </view>
</view> </view>
<!-- 文创周边 --> <!-- 文创周边 -->
<view class="buy-art row" bindtap="onBuyArt" data-id="{{3}}"> <view class="buy-art row" bindtap="onBuyArt" data-id="{{3}}">
<view class="buy-left col con-c"> <view class="buy-left col con-c">
<image src="./image/wenchuangzhoubian.png"></image> <image src="../home/image/wenchuangzhoubian.png"></image>
</view> </view>
<view class="buy-right col con-c"> <view class="buy-right col con-c">
<image src="./image/icon-bg.png"></image> <image src="../home/image/icon-bg.png"></image>
<image class="art-img" src="./image/shanzi.png"></image> <image class="art-img" src="../home/image/shanzi.png"></image>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -78,19 +78,17 @@ Page({ ...@@ -78,19 +78,17 @@ Page({
// 获取活动信息 // 获取活动信息
queryActivity: function () { queryActivity: function () {
let that = this let that = this
let shopInfo = wx.getStorageInfoSync('shopInfoBuffer') let shopInfo = wx.getStorageSync('shopInfoBuffer')
App.wxRequest({ App.wxRequest({
url: '/api/v1/activity/getList', url: '/api/v1/activity/getList',
data: { data: {
'listType': '1', 'listType': '1',
'pageSize': '5', 'pageSize': '5',
'pageNo': '1', 'pageNo': '1',
'tagId': '103',
'officeId': shopInfo.id 'officeId': shopInfo.id
}, },
success: function(res) { success: function(res) {
let funcData = res.data.list let funcData = res.data.list
console.log(funcData)
that.setData({ that.setData({
childActivity: funcData childActivity: funcData
}) })
......
...@@ -80,12 +80,18 @@ ...@@ -80,12 +80,18 @@
</view> </view>
<!-- 滚动图片 --> <!-- 滚动图片 -->
<!-- 单张图片 --> <!-- 无活动 -->
<view class="swiper" wx:if="{{childActivity.length <= 1}}"> <view class="activity-empty" wx:if="{{childActivity.length === 0}}">
<block>
<image src="{{appResourcesBase + 'campsite/empty.png'}}"></image>
</block>
</view>
<!-- 单活动 -->
<view class="swiper" wx:if="{{childActivity.length === 1}}">
<image mode="scaleToFill" src="{{childActivity[0].childImg}}"></image> <image mode="scaleToFill" 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:if="{{childActivity.length > 1}}">
<block wx:for="{{childActivity}}" wx:key="id"> <block wx:for="{{childActivity}}" wx:key="id">
<swiper-item> <swiper-item>
<image mode="scaleToFill" src="{{item.cover}}" bindtap="onActivityDetail" data-id="{{item.id}}"></image> <image mode="scaleToFill" src="{{item.cover}}" bindtap="onActivityDetail" data-id="{{item.id}}"></image>
......
...@@ -166,6 +166,14 @@ ...@@ -166,6 +166,14 @@
width: 160rpx; width: 160rpx;
height: 34rpx; height: 34rpx;
} }
.activity-empty {
width: 750rpx;
height: 544rpx;
}
.activity-empty image {
width: 750rpx;
height: 544rpx;
}
.swiper { .swiper {
width: 750rpx; width: 750rpx;
......
...@@ -114,8 +114,8 @@ Page({ ...@@ -114,8 +114,8 @@ Page({
} }
}) })
}, },
// 活动报名
onContact: function () { onReport: function () {
if (this.data.activeState == 1) { if (this.data.activeState == 1) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=6' url: '/pages/pay/order-input/order-input?type=6'
......
...@@ -84,6 +84,6 @@ ...@@ -84,6 +84,6 @@
<text>/人</text> <text>/人</text>
</view> </view>
</view> </view>
<button class="{{isSubmit ? 'button' : 'button-disable'}} row con-c align-c" size="long" bindtap="onContact">{{stateText}}</button> <button class="{{isSubmit ? 'button' : 'button-disable'}} row con-c align-c" size="long" bindtap="onReport">{{stateText}}</button>
</view> </view>
</view> </view>
\ No newline at end of file
const App = getApp() const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
statusTop: '',
statusFixed: false,
statusActive: 0, statusActive: 0,
statusList: [ statusList: [
{ {
...@@ -15,6 +22,7 @@ Page({ ...@@ -15,6 +22,7 @@ Page({
activity: [], activity: [],
selectedActivity: [], selectedActivity: [],
other: [], other: [],
selectedOther: [],
shopInfo: {}, shopInfo: {},
options: {} options: {}
}, },
...@@ -28,11 +36,35 @@ Page({ ...@@ -28,11 +36,35 @@ Page({
shopInfo: shopInfo shopInfo: shopInfo
}) })
} }
this.getActivityList(1) this.getActivityList(1)
this.getActivityList(0) this.getActivityList(0)
this.setData({
statusTop: wx.getStorageSync('navigationStatusHeight') + wx.getStorageSync('navigationCapsuleHeight') - 40 + 'rpx'
})
}, },
onPageScroll: function (funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
if (funcEvent.scrollTop > 10) {
this.setData({
statusFixed: true,
statusTop: wx.getStorageSync('navigationStatusHeight') + wx.getStorageSync('navigationCapsuleHeight') + 'px'
})
} else {
this.setData({
statusFixed: false,
statusTop: wx.getStorageSync('navigationStatusHeight') + wx.getStorageSync('navigationCapsuleHeight') - 40 + 'rpx'
})
}
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
onActivityDetail: function (event) { onActivityDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + event.currentTarget.dataset.id url: '/pages/play/activity-detail/activity-detail?id=' + event.currentTarget.dataset.id
...@@ -57,6 +89,7 @@ Page({ ...@@ -57,6 +89,7 @@ Page({
success: function (res) { success: function (res) {
let tmpArr = []; let tmpArr = [];
let funcData = res.data.list let funcData = res.data.list
console.log(funcData)
funcData.forEach(item => { funcData.forEach(item => {
let tmpItem = { let tmpItem = {
id: item.id, id: item.id,
...@@ -97,7 +130,8 @@ Page({ ...@@ -97,7 +130,8 @@ Page({
}) })
} else { } else {
that.setData({ that.setData({
other: tmpArr other: tmpArr,
selectedOther: tmpArr
}) })
} }
} }
...@@ -131,16 +165,31 @@ Page({ ...@@ -131,16 +165,31 @@ Page({
let index = event.currentTarget.dataset.index let index = event.currentTarget.dataset.index
let statusList = this.data.statusList let statusList = this.data.statusList
let selectedActivity = this.data.activity let selectedActivity = this.data.activity
console.log(selectedActivity) let selectedOther = this.data.other
if (index !== 0) { if (index !== 0) {
selectedActivity = selectedActivity.filter(item => { selectedActivity = selectedActivity.filter(item => {
item.tagNames = [].concat(statusList[index].name) item.tagNames = [].concat(statusList[index].name)
return item.tagIds.includes(statusList[index].id) return item.tagIds.includes(statusList[index].id)
}) })
selectedOther = selectedOther.filter(item => {
return item.tagIds.includes(statusList[index].id)
})
} }
this.setData({ this.setData({
selectedActivity, selectedActivity,
selectedOther,
statusActive: index statusActive: index
}) })
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
}, },
// 活动报名
onReport: function () {
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=6'
})
}
}) })
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="container con-s"> <view class="container con-s">
<!-- 活动类别 --> <!-- 活动类别 -->
<view class="status row align-c" wx:if="{{!options.fromPage}}"> <view class="status row align-c {{statusFixed ? 'status-fixed' : ''}}" style="{{statusFixed ? 'top: ' + (statusTop) : 'margin-top: ' + (statusTop)}}" wx:if="{{!options.fromPage}}">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="status-item row con-c align-c" data-index="{{index}}" bindtap="onSelectionStatus"> <view class="status-item row con-c align-c" data-index="{{index}}" bindtap="onSelectionStatus">
<view class="row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}"> <view class="row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}">
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
</view> </view>
<view class="row align-c" wx:if="{{item.priceType === 2}}"> <view class="row align-c" wx:if="{{item.priceType === 2}}">
<text>业主价</text> <text>业主价</text>
<text class="price-symbol"></text> <text class="price-symbol">{{item.priceSpecial == '0' ? '': '¥'}}</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text> <text>{{item.priceSpecial == '0' ? '免费' : item.priceSpecialText}}</text>
<text>{{item.priceText}}</text> <text>{{item.priceText}}</text>
</view> </view>
<view class="row align-c" wx:if="{{item.priceType === 3}}"> <view class="row align-c" wx:if="{{item.priceType === 3}}">
<text style="display: none"></text> <text style="display: none"></text>
<text class="price-symbol"></text> <text class="price-symbol">{{item.price == '0' ? '': '¥'}}</text>
<text>{{item.priceText == '0' ? '免费' : item.priceText}}</text> <text>{{item.price == '0' ? '免费' : item.priceText}}</text>
</view> </view>
<view> <view>
<button class="row con-c align-c" catchtap="onReport" data-id="{{item.id}}">报名</button> <button class="row con-c align-c" catchtap="onReport" data-id="{{item.id}}">报名</button>
......
...@@ -14,15 +14,19 @@ ...@@ -14,15 +14,19 @@
/* 状态筛选菜单 */ /* 状态筛选菜单 */
.status { .status {
width: 750rpx; width: 750rpx;
height: 76rpx;
margin-top: 80rpx;
padding: 0 40rpx; padding: 0 40rpx;
border-bottom: 1px #E2E7EF solid; border-bottom: 1px #E2E7EF solid;
overflow: scroll; overflow-x: scroll;
flex-wrap: nowrap; flex-wrap: nowrap;
background-color: #fff;
}
.status-fixed {
z-index: 999;
position: fixed;
left: 0;
} }
.status-item { .status-item {
height: 76rpx; height: 94rpx;
margin-right: 80rpx; margin-right: 80rpx;
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
...@@ -36,13 +40,13 @@ ...@@ -36,13 +40,13 @@
padding-right: 40rpx; padding-right: 40rpx;
} }
.status-item-active { .status-item-active {
height: 76rpx; height: 94rpx;
color: #15191F; color: #15191F;
font-weight: 600; font-weight: 600;
border-bottom: 4rpx #15191F solid; border-bottom: 4rpx #15191F solid;
} }
.status::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
color: transparent; color: transparent;
...@@ -106,7 +110,7 @@ ...@@ -106,7 +110,7 @@
text-align: center; text-align: center;
font-size: 18rpx; font-size: 18rpx;
font-weight: 500; font-weight: 500;
line-height: 24rpx; line-height: 32rpx;
color: #86C5E1; color: #86C5E1;
} }
......
...@@ -112,7 +112,6 @@ page { ...@@ -112,7 +112,6 @@ page {
/* 状态筛选菜单 */ /* 状态筛选菜单 */
.status { .status {
width: 750rpx; width: 750rpx;
height: 76rpx;
margin-top: 48rpx; margin-top: 48rpx;
padding: 0 40rpx; padding: 0 40rpx;
border-bottom: 1px #3A3A40 solid; border-bottom: 1px #3A3A40 solid;
......
...@@ -31,3 +31,5 @@ button::after { ...@@ -31,3 +31,5 @@ button::after {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
} }
/* 去除滚动条 */
::-webkit-scrollbar{display: none;}
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