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
f3a4fb50
authored
Sep 22, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww-儿童营地修改
parent
e48bfde0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
22 deletions
pages/campsite/home/home.js
pages/campsite/home/home.wxml
pages/campsite/home/home.wxss
project.config.json
pages/campsite/home/home.js
View file @
f3a4fb50
...
@@ -8,6 +8,7 @@ let logicData = {
...
@@ -8,6 +8,7 @@ let logicData = {
Page
({
Page
({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
appResourcesBase
:
App
.
globalData
.
appResourcesBase
,
showPopup
:
false
,
showPopup
:
false
,
winSide
:
true
,
winSide
:
true
,
sideHeight
:
1250
,
sideHeight
:
1250
,
...
@@ -32,12 +33,35 @@ Page({
...
@@ -32,12 +33,35 @@ Page({
this
.
queryDetail
()
this
.
queryDetail
()
this
.
queryActivity
()
this
.
queryActivity
()
},
},
onShow
:
function
()
{
this
.
setShopInfo
(
3
,
1
)
},
setSideHeight
:
function
()
{
setSideHeight
:
function
()
{
this
.
setData
({
this
.
setData
({
sideHeight
:
this
.
data
.
sideHeight
*
wx
.
getStorageSync
(
'unitProportion'
)
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
()
{
queryDetail
:
function
()
{
let
that
=
this
let
that
=
this
...
@@ -54,20 +78,21 @@ Page({
...
@@ -54,20 +78,21 @@ Page({
// 获取活动信息
// 获取活动信息
queryActivity
:
function
()
{
queryActivity
:
function
()
{
let
that
=
this
let
that
=
this
let
shopInfo
=
wx
.
getStorageInfoSync
(
'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'
'tagId'
:
'103'
,
'officeId'
:
shopInfo
.
id
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
let
funcData
=
res
.
data
.
list
let
funcData
=
res
.
data
.
list
let
childActivity
=
funcData
.
filter
(
v
=>
v
.
childImg
!==
''
)
console
.
log
(
funcData
)
console
.
log
(
childActivity
)
that
.
setData
({
that
.
setData
({
childActivity
childActivity
:
funcData
})
})
}
}
})
})
...
@@ -100,7 +125,6 @@ Page({
...
@@ -100,7 +125,6 @@ Page({
this
.
setData
({
this
.
setData
({
winSide
:
false
winSide
:
false
})
})
wx
.
hideTabBar
({
animation
:
true
})
}
}
let
funcOpacity
=
(
funcEvent
.
scrollTop
-
this
.
data
.
sideHeight
)
/
40
let
funcOpacity
=
(
funcEvent
.
scrollTop
-
this
.
data
.
sideHeight
)
/
40
...
@@ -114,7 +138,6 @@ Page({
...
@@ -114,7 +138,6 @@ Page({
winSide
:
true
,
winSide
:
true
,
navigationAnimationShow
:
0
navigationAnimationShow
:
0
})
})
wx
.
showTabBar
({
animation
:
true
})
}
}
// 恢复滚动事件
// 恢复滚动事件
...
@@ -151,7 +174,7 @@ Page({
...
@@ -151,7 +174,7 @@ Page({
// 跳转到购买年卡/月卡/次卡界面
// 跳转到购买年卡/月卡/次卡界面
onBuyMembership
:
function
(
event
)
{
onBuyMembership
:
function
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
1
let
funcShopType
=
3
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
...
@@ -160,15 +183,32 @@ Page({
...
@@ -160,15 +183,32 @@ Page({
})
})
},
},
// 跳转到购买饮品界面
// 跳转到购买饮品界面
onBuySnacks
()
{
onBuySnacks
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
6
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
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
({
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({
...
@@ -199,4 +239,10 @@ Page({
url
:
'/pages/home/guide/guide?id='
+
10
url
:
'/pages/home/guide/guide?id='
+
10
})
})
},
},
// 点击全部活动
onAllActivity
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/play/activity/activity'
,
})
},
})
})
\ No newline at end of file
pages/campsite/home/home.wxml
View file @
f3a4fb50
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
</view>
</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">
<view class="buy-coupon-title row align-c">
<image src="./image/ruyuangoupiao.png"></image>
<image src="./image/ruyuangoupiao.png"></image>
<image src="/image/more.png"></image>
<image src="/image/more.png"></image>
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<!-- 饮品预订 文创周边-->
<!-- 饮品预订 文创周边-->
<view class="buy-other row con-b">
<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">
<view class="buy-left col con-c">
<image src="./image/yinpinyuding.png"></image>
<image src="./image/yinpinyuding.png"></image>
</view>
</view>
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
</view>
</view>
</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">
<view class="buy-left col con-c">
<image src="./image/wenchuangzhoubian.png"></image>
<image src="./image/wenchuangzhoubian.png"></image>
</view>
</view>
...
@@ -74,16 +74,21 @@
...
@@ -74,16 +74,21 @@
</view>
</view>
</view>
</view>
<!-- 全部活动 -->
<view class="activity" bindtap="onAllActivity">
<image src="{{appResourcesBase + 'campsite/title.png'}}"></image>
</view>
<!-- 滚动图片 -->
<!-- 滚动图片 -->
<!-- 单张图片 -->
<!-- 单张图片 -->
<view class="swiper" wx:if="{{childActivity.length <= 1}}">
<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>
</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 wx:for="{{childActivity}}" wx:key="id">
<block wx:for="{{childActivity}}" wx:key="id">
<swiper-item>
<swiper-item>
<image mode="
aspectFit" src="{{item.childImg
}}"></image>
<image mode="
scaleToFill" src="{{item.cover}}" bindtap="onActivityDetail" data-id="{{item.id
}}"></image>
</swiper-item>
</swiper-item>
</block>
</block>
</swiper>
</swiper>
...
...
pages/campsite/home/home.wxss
View file @
f3a4fb50
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
width: 670rpx;
width: 670rpx;
height: 312rpx;
height: 312rpx;
padding: 40rpx 32rpx;
padding: 40rpx 32rpx;
background: rgba(255, 255, 255, 0.
6
5);
background: rgba(255, 255, 255, 0.
8
5);
box-shadow: 8rpx 10rpx 52rpx 0rpx rgba(238,211,153,0.3);
box-shadow: 8rpx 10rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
border-radius: 4rpx;
}
}
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
.snacks-img {
.snacks-img {
position: absolute;
position: absolute;
top:
2
8rpx;
top:
3
8rpx;
left: 42rpx;
left: 42rpx;
width: 50rpx;
width: 50rpx;
height: 76rpx;
height: 76rpx;
...
@@ -151,12 +151,22 @@
...
@@ -151,12 +151,22 @@
.art-img {
.art-img {
position: absolute;
position: absolute;
top:
30
rpx;
top:
42
rpx;
left: 12rpx;
left: 12rpx;
width: 86rpx;
width: 86rpx;
height: 70rpx;
height: 70rpx;
}
}
.activity {
position: absolute;
top: 1602rpx;
}
.activity image{
width: 160rpx;
height: 34rpx;
}
.swiper {
.swiper {
width: 750rpx;
width: 750rpx;
height: 1160rpx;
height: 1160rpx;
...
...
project.config.json
View file @
f3a4fb50
...
@@ -21,16 +21,16 @@
...
@@ -21,16 +21,16 @@
"checkSiteMap"
:
false
,
"checkSiteMap"
:
false
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"compileHotReLoad"
:
false
,
"compileHotReLoad"
:
false
,
"useMultiFrameRuntime"
:
false
,
"useApiHook"
:
true
,
"babelSetting"
:
{
"babelSetting"
:
{
"ignore"
:
[],
"ignore"
:
[],
"disablePlugins"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
"outputPath"
:
""
},
},
"useIsolateContext"
:
true
,
"useIsolateContext"
:
true
,
"useCompilerModule"
:
fals
e
,
"useCompilerModule"
:
tru
e
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"useMultiFrameRuntime"
:
true
,
"useApiHook"
:
true
,
"packNpmManually"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"packNpmRelationList"
:
[],
"enableEngineNative"
:
false
"enableEngineNative"
:
false
...
...
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