Commit f3a4fb50 by wjw

ww-儿童营地修改

parent e48bfde0
......@@ -8,6 +8,7 @@ let logicData = {
Page({
data: {
imageBase: App.globalData.appImageBase,
appResourcesBase: App.globalData.appResourcesBase,
showPopup: false,
winSide: true,
sideHeight: 1250,
......@@ -32,12 +33,35 @@ Page({
this.queryDetail()
this.queryActivity()
},
onShow: function () {
this.setShopInfo(3, 1)
},
setSideHeight: function () {
this.setData({
sideHeight: this.data.sideHeight * wx.getStorageSync('unitProportion')
})
},
// 缓存商店信息
setShopInfo: function (funcShopAppId, funcShopType) {
// 获取门店基本信息
let funcShopId = App.globalData.shopId
for (let i = 0, l = funcShopId.length; i < l; i++) {
if (funcShopAppId === funcShopId[i].appId) {
let funcShopInfo = {
'id': funcShopId[i].id,
'appId': funcShopId[i].appId,
'name': funcShopId[i].title[funcShopType],
'logo': funcShopId[i].logo,
'cover': funcShopId[i].cover,
'shopType': funcShopType,
'commodityLogo': funcShopId[i].commodityLogo
}
wx.setStorageSync('shopInfoBuffer', funcShopInfo)
break
}
}
},
// 获取后台信息
queryDetail: function () {
let that = this
......@@ -54,20 +78,21 @@ Page({
// 获取活动信息
queryActivity: function () {
let that = this
let shopInfo = wx.getStorageInfoSync('shopInfoBuffer')
App.wxRequest({
url: '/api/v1/activity/getList',
data: {
'listType': '1',
'pageSize': '5',
'pageNo': '1',
'tagId': '103'
'tagId': '103',
'officeId': shopInfo.id
},
success: function(res) {
let funcData = res.data.list
let childActivity = funcData.filter(v => v.childImg !== '')
console.log(childActivity)
console.log(funcData)
that.setData({
childActivity
childActivity: funcData
})
}
})
......@@ -100,7 +125,6 @@ Page({
this.setData({
winSide: false
})
wx.hideTabBar({animation: true})
}
let funcOpacity = (funcEvent.scrollTop - this.data.sideHeight) / 40
......@@ -114,7 +138,6 @@ Page({
winSide: true,
navigationAnimationShow: 0
})
wx.showTabBar({animation: true})
}
// 恢复滚动事件
......@@ -151,7 +174,7 @@ Page({
// 跳转到购买年卡/月卡/次卡界面
onBuyMembership: function (event) {
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let funcShopType = 1
let funcShopType = 3
let funcShopAppId = event.currentTarget.dataset.id
this.setShopInfo(funcShopAppId, funcShopType)
......@@ -160,15 +183,32 @@ Page({
})
},
// 跳转到购买饮品界面
onBuySnacks() {
onBuySnacks(event) {
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let funcShopType = 6
let funcShopAppId = event.currentTarget.dataset.id
this.setShopInfo(funcShopAppId, funcShopType)
wx.navigateTo({
url: '/pages/commodity/menu-snacks/menu-snacks',
url: '/pages/commodity/menu-food/menu-food',
})
},
// 跳转到购买文创界面
onBuyArt() {
onBuyArt(event) {
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let funcShopType = 1
let funcShopAppId = event.currentTarget.dataset.id
this.setShopInfo(funcShopAppId, funcShopType)
wx.navigateTo({
url: '/pages/commodity/menu-art/menu-art',
url: '/pages/commodity/menu-food/menu-food',
})
},
// 跳转到活动详情
onActivityDetail: function (event) {
let id = event.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + id,
})
},
// 点击分享图标
......@@ -199,4 +239,10 @@ Page({
url: '/pages/home/guide/guide?id=' + 10
})
},
// 点击全部活动
onAllActivity: function () {
wx.navigateTo({
url: '/pages/play/activity/activity',
})
},
})
\ No newline at end of file
......@@ -38,7 +38,7 @@
</view>
<!-- 入园购票 -->
<view class="buy-coupon" bindtap="onBuyMembership" data-id="{{3}}">
<view class="buy-coupon" bindtap="onBuyMembership" data-id="{{1}}">
<view class="buy-coupon-title row align-c">
<image src="./image/ruyuangoupiao.png"></image>
<image src="/image/more.png"></image>
......@@ -53,7 +53,7 @@
<!-- 饮品预订 文创周边-->
<view class="buy-other row con-b">
<!-- 饮品预订 -->
<view class="buy-snacks row" bindtap="onBuySnacks">
<view class="buy-snacks row" bindtap="onBuySnacks" data-id="{{5}}">
<view class="buy-left col con-c">
<image src="./image/yinpinyuding.png"></image>
</view>
......@@ -63,7 +63,7 @@
</view>
</view>
<!-- 文创周边 -->
<view class="buy-art row" bindtap="onBuyArt">
<view class="buy-art row" bindtap="onBuyArt" data-id="{{4}}">
<view class="buy-left col con-c">
<image src="./image/wenchuangzhoubian.png"></image>
</view>
......@@ -74,16 +74,21 @@
</view>
</view>
<!-- 全部活动 -->
<view class="activity" bindtap="onAllActivity">
<image src="{{appResourcesBase + 'campsite/title.png'}}"></image>
</view>
<!-- 滚动图片 -->
<!-- 单张图片 -->
<view class="swiper" wx:if="{{childActivity.length <= 1}}">
<image mode="aspectFit" src="{{childActivity[0].childImg}}"></image>
<image mode="scaleToFill" src="{{childActivity[0].childImg}}"></image>
</view>
<!-- 多张图片 -->
<swiper class="swiper" indicator-dots indicator-color="#F6DADA" indicator-active-color="#E57C99" autoplay circular wx:else>
<block wx:for="{{childActivity}}" wx:key="id">
<swiper-item>
<image mode="aspectFit" src="{{item.childImg}}"></image>
<image mode="scaleToFill" src="{{item.cover}}" bindtap="onActivityDetail" data-id="{{item.id}}"></image>
</swiper-item>
</block>
</swiper>
......
......@@ -89,7 +89,7 @@
width: 670rpx;
height: 312rpx;
padding: 40rpx 32rpx;
background: rgba(255, 255, 255, 0.65);
background: rgba(255, 255, 255, 0.85);
box-shadow: 8rpx 10rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
}
......@@ -143,7 +143,7 @@
.snacks-img {
position: absolute;
top: 28rpx;
top: 38rpx;
left: 42rpx;
width: 50rpx;
height: 76rpx;
......@@ -151,12 +151,22 @@
.art-img {
position: absolute;
top: 30rpx;
top: 42rpx;
left: 12rpx;
width: 86rpx;
height: 70rpx;
}
.activity {
position: absolute;
top: 1602rpx;
}
.activity image{
width: 160rpx;
height: 34rpx;
}
.swiper {
width: 750rpx;
height: 1160rpx;
......
......@@ -21,16 +21,16 @@
"checkSiteMap": false,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"packNpmManually": false,
"packNpmRelationList": [],
"enableEngineNative": false
......
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