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
175638ba
authored
Sep 23, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww--ui调整
parent
879a0a9d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
438 additions
and
28 deletions
image/icon/food.png
pages/campsite/home-mirror/home-mirror.js
pages/campsite/home-mirror/home-mirror.wxml
pages/campsite/home-mirror/home-mirror.wxss
pages/play/activity-detail/activity-detail.js
pages/play/activity-detail/activity-detail.wxml
pages/play/activity-detail/activity-detail.wxss
pages/play/activity/activity.js
pages/play/service-detail/service-detail.js
pages/play/service-detail/service-detail.wxml
pages/play/service-detail/service-detail.wxss
image/icon/food.png
0 → 100644
View file @
175638ba
1.37 KB
pages/campsite/home-mirror/home-mirror.js
View file @
175638ba
...
...
@@ -8,10 +8,14 @@ let logicData = {
Page
({
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
appResourcesBase
:
App
.
globalData
.
appResourcesBase
,
showPopup
:
false
,
winSide
:
true
,
sideHeight
:
1250
,
shareImage
:
App
.
globalData
.
appResourcesBase
+
'share/share-1.png'
,
childActivity
:
[],
bannerImage
:
App
.
globalData
.
appResourcesBase
+
'campsite/campsite-header.png'
,
bottomImage
:
App
.
globalData
.
appResourcesBase
+
'campsite/bottom.png'
,
detailImage
:
[],
detailImageUrl
:
[
App
.
globalData
.
appResourcesBase
+
'campsite/campsite-1.png'
,
...
...
@@ -26,7 +30,11 @@ Page({
onLoad
:
function
(
options
)
{
this
.
setSideHeight
()
},
onShow
:
function
()
{
this
.
setShopInfo
(
3
,
1
)
this
.
queryDetail
()
this
.
queryActivity
()
},
setSideHeight
:
function
()
{
...
...
@@ -34,11 +42,61 @@ Page({
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
App
.
wxRequest
({
url
:
'/api/v1/park/getList'
,
success
:
function
(
res
)
{
let
funcData
=
res
.
list
.
filter
(
v
=>
v
.
name
===
'儿童营地'
)
that
.
setData
({
detailImageUrl
:
funcData
[
0
].
content
})
}
})
},
// 获取活动信息
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'
,
'officeId'
:
shopInfo
.
id
},
success
:
function
(
res
)
{
let
funcData
=
res
.
data
.
list
console
.
log
(
funcData
)
that
.
setData
({
childActivity
:
funcData
})
}
})
},
onBackTop
:
function
()
{
wx
.
pageScrollTo
({
scrollTop
:
0
...
...
@@ -88,4 +146,103 @@ Page({
clearTimeout
(
logicData
.
pageScrollTimer
)
},
40
)
},
/**
* 缓存用户信息
* @function
* @param {object} - event
* @returns
*/
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
}
}
},
// 跳转到购买年卡/月卡/次卡界面
onBuyMembership
:
function
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
1
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
url
:
'/pages/commodity/project-detail/project-detail'
})
},
// 跳转到购买饮品界面
onBuySnacks
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
5
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food'
,
})
},
// 跳转到购买文创界面
onBuyArt
(
event
)
{
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let
funcShopType
=
4
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
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
,
})
},
// 点击分享图标
onShare
:
function
()
{
this
.
setData
({
showPopup
:
true
})
},
// 点击取消
onCancel
:
function
()
{
this
.
setData
({
showPopup
:
false
})
},
// 点击下载图片
onDownload
:
function
()
{
wx
.
showToast
({
title
:
'已保存到相册'
,
icon
:
'success'
})
this
.
setData
({
showPopup
:
false
})
},
// 点击位置图标
onLocation
:
function
()
{
wx
.
navigateTo
({
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-mirror/home-mirror.wxml
View file @
175638ba
<!-- 此页面是为了让其他页面进行跳转的镜像页面 -->
<!-- 如果直接跳转 tabbar 的营地页面会导致路由错乱问题 -->
<navigation class="navigation" titleText="儿童营地" backIcon="/image/back.png"></navigation>
<view class="container">
<view class="appointment">
<
!-- <
view class="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
</view>
</view>
-->
<view class="appointment-side col con-b align-c" hidden="{{winSide}}">
<button class="appointment-side-top" bindtap="onBackTop">
<image src="{{imageBase + 'top.png'}}"></image>
</button>
<button class="appointment-side-phone" bind:tap="onServic">
<
!-- <
button class="appointment-side-phone" bind:tap="onServic">
<image src="{{imageBase + 'phone.png'}}"></image>
</button>
</button> -->
</view>
<!-- 头部背景图 -->
<image class="banner" src="{{bannerImage}}"></image>
<!-- 分享按钮 -->
<view class="share col con-c align-c" bindtap="onShare">
<image class="icon-share" src="/image/icon/share-3.png"></image>
</view>
<!-- 分享弹出图片 -->
<l-popup show="{{showPopup}}" animation="{{false}}">
<view class="popupImage">
<image src="{{shareImage}}"></image>
</view>
<view class="row con-b">
<view class="cancel" bindtap="onCancel">
<text>取消</text>
</view>
<view class="download" bindtap="onDownload">
<text>下载图片</text>
</view>
</view>
</l-popup>
<!-- 位置按钮 -->
<view class="location col con-c align-c" bindtap="onLocation">
<image class="icon-location" src="/image/icon/location-3.png"></image>
</view>
<!-- 入园购票 -->
<view class="buy-coupon" bindtap="onBuyMembership" data-id="{{3}}">
<view class="buy-coupon-title row align-c">
<image src="./image/ruyuangoupiao.png"></image>
<image src="/image/more.png"></image>
</view>
<view class="buy-coupon-type row con-b">
<image src="./image/single.png"></image>
<image src="./image/month.png"></image>
<image src="./image/year.png"></image>
</view>
</view>
<!-- 饮品预订 文创周边-->
<view class="buy-other row con-b">
<!-- 饮品预订 -->
<view class="buy-snacks row" bindtap="onBuySnacks" data-id="{{3}}">
<view class="buy-left col con-c">
<image src="./image/yinpinyuding.png"></image>
</view>
<view class="buy-right col con-c">
<image src="./image/icon-bg.png"></image>
<image class="snacks-img" src="./image/yinpin.png"></image>
</view>
</view>
<!-- 文创周边 -->
<view class="buy-art row" bindtap="onBuyArt" data-id="{{3}}">
<view class="buy-left col con-c">
<image src="./image/wenchuangzhoubian.png"></image>
</view>
<view class="buy-right col con-c">
<image src="./image/icon-bg.png"></image>
<image class="art-img" src="./image/shanzi.png"></image>
</view>
</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="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="scaleToFill" src="{{item.cover}}" bindtap="onActivityDetail" data-id="{{item.id}}"></image>
</swiper-item>
</block>
</swiper>
<block wx:for="{{detailImageUrl}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block>
<image mode="widthFix" src="{{bottomImage}}"></image>
</view>
\ No newline at end of file
pages/campsite/home-mirror/home-mirror.wxss
View file @
175638ba
...
...
@@ -14,9 +14,9 @@
.appointment-side {
position: fixed;
right: 40rpx;
bottom:
74
rpx;
width:
112
rpx;
height:
224
rpx;
bottom:
180
rpx;
width:
80
rpx;
height:
80
rpx;
}
.appointment-side-top {
...
...
@@ -49,4 +49,164 @@
.container > image {
width: 750rpx;
}
.banner {
width: 750rpx;
height: 1676rpx;
}
.share {
position: absolute;
top: 710rpx;
right: 136rpx;
width: 64rpx;
height: 64rpx;
background: #F28FA2;
box-shadow: 8rpx 8rpx 20rpx 0rpx rgba(242,143,162,0.3);
border-radius: 50%;
}
.location {
position: absolute;
top: 710rpx;
right: 40rpx;
width: 64rpx;
height: 64rpx;
background: #F28FA2;
box-shadow: 8rpx 8rpx 20rpx 0rpx rgba(242,143,162,0.3);
border-radius: 50%;
}
.icon-share, .icon-location {
width: 40rpx;
height: 40rpx;
}
.buy-coupon {
position: absolute;
top: 804rpx;
width: 670rpx;
height: 312rpx;
padding: 40rpx 32rpx;
background: rgba(255, 255, 255, 0.85);
box-shadow: 8rpx 10rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
}
.buy-coupon-title image:nth-child(1) {
width: 120rpx;
height: 34rpx;
}
.buy-coupon-title image:nth-child(2) {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
}
.buy-coupon-type {
margin-top: 32rpx;
}
.buy-coupon-type image {
width: 170rpx;
height: 166rpx;
}
.buy-other {
position: absolute;
top: 1140rpx;
width: 670rpx;
}
.buy-snacks, .buy-art {
width: 322rpx;
height: 154rpx;
background: rgba(255, 255, 255, 0.65);
box-shadow: 8rpx 8rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
}
.buy-left, .buy-right {
position: relative;
margin-left: 32rpx;
}
.buy-left image{
width: 120rpx;
height: 34rpx;
}
.buy-right image:first-child {
width: 132rpx;
height: 136rpx;
}
.snacks-img {
position: absolute;
top: 38rpx;
left: 42rpx;
width: 50rpx;
height: 76rpx;
}
.art-img {
position: absolute;
top: 42rpx;
left: 12rpx;
width: 86rpx;
height: 70rpx;
}
.activity {
position: absolute;
top: 1602rpx;
}
.activity image{
width: 160rpx;
height: 34rpx;
}
.swiper {
width: 750rpx;
height: 1160rpx;
background-color: #FCF8F0;
}
.swiper image {
width: 750rpx;
height: 1160rpx;
}
.wx-swiper-dots{
position:relative;
left: 0;
right: 0;
}
.wx-swiper-dots.wx-swiper-dots-horizontal{
margin-bottom: 64rpx;
}
/* 分享弹窗 */
.popupImage image {
width: 606rpx;
height: 977rpx;
margin-bottom: 64rpx;
}
.cancel, .download {
width: 288rpx;
height: 96rpx;
text-align: center;
line-height: 96rpx;
border-radius: 4rpx;
}
.cancel {
color: #15191F;
background-color: #fff;
}
.download {
color: #fff;
background-color: #15191F;
}
\ No newline at end of file
pages/play/activity-detail/activity-detail.js
View file @
175638ba
...
...
@@ -93,6 +93,7 @@ Page({
funcItem
.
priceType
=
3
}
}
funcItem
.
priceType
=
3
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcItem
])
this
.
setData
({
...
...
pages/play/activity-detail/activity-detail.wxml
View file @
175638ba
...
...
@@ -78,6 +78,7 @@
<!-- 普通价样式 -->
<view class="row" wx:if="{{info.priceType === 3}}">
<view class="item-price row align-c">
<text></text>
<text>¥</text>
<text>{{info.priceText}}</text>
<text>/人</text>
...
...
pages/play/activity-detail/activity-detail.wxss
View file @
175638ba
...
...
@@ -190,7 +190,9 @@
line-height: 42rpx;
}
.contact .button-disable {
width: 670rpx;
position: absolute;
right: 40rpx;
width: 200rpx;
height: 96rpx;
margin-bottom: 40rpx;
background: #C8E1EC;
...
...
pages/play/activity/activity.js
View file @
175638ba
...
...
@@ -57,7 +57,7 @@ Page({
success
:
function
(
res
)
{
let
tmpArr
=
[];
let
funcData
=
res
.
data
.
list
res
.
data
.
list
.
forEach
(
item
=>
{
funcData
.
forEach
(
item
=>
{
let
tmpItem
=
{
id
:
item
.
id
,
cover
:
item
.
cover
,
...
...
pages/play/service-detail/service-detail.js
View file @
175638ba
...
...
@@ -722,13 +722,18 @@ Page({
break
}
},
// 跳转到服务详情
onContact
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/commodity/project-detail/project-detail'
})
},
// 跳转到餐品购物车
onBuyFood
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food'
})
},
onPageScroll
:
function
(
funcEvent
)
{
// 优化滚动事件触发频率
if
(
logicData
.
pageScrollLock
)
return
...
...
pages/play/service-detail/service-detail.wxml
View file @
175638ba
...
...
@@ -151,7 +151,7 @@
<view class="commodity-menu col" wx:if="{{winCommodityMenu}}" bindtap="onBuySnacks" data-id="{{5}}">
<image class="commodity-menu-bg" src="{{resourcesBase + 'play/service/service-flower.png'}}"></image>
<view>
<image class="commodity-menu-icon"></image>
<image class="commodity-menu-icon"
src="{{imageBase + 'icon/food.png'}}"
></image>
</view>
<view>
<text>能量补给站</text>
...
...
@@ -258,7 +258,7 @@
<button class="button row con-c align-c" bindtap="onContact">购买门票</button>
</view>
<view class="operation" wx:if="{{option.id === '4' || option.id === '6'}}">
<button class="button row con-c align-c" bindtap="on
Contact
">立即点餐</button>
<button class="button row con-c align-c" bindtap="on
BuyFood
">立即点餐</button>
</view>
<!-- 侧边返回顶部 -->
...
...
pages/play/service-detail/service-detail.wxss
View file @
175638ba
...
...
@@ -375,18 +375,13 @@
}
.commodity-menu-icon {
}
.commodity-menu-icon {
margin: 56rpx 0 0 54rpx;
width: 52rpx;
height: 37rpx;
background: #15191F;
margin: 48rpx 0 0 54rpx;
width: 56rpx;
height: 56rpx;
}
.commodity-menu view:nth-child(3) {
margin:
2
6rpx 0 0 50rpx;
margin:
1
6rpx 0 0 50rpx;
font-size: 30rpx;
color: #FFFFFF;
line-height: 42rpx;
...
...
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