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
028b08b9
authored
Sep 21, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 服务模块问题修复
parent
6bfb7ddf
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
455 additions
and
130 deletions
pages/commodity/home/home.js
pages/commodity/home/home.wxml
pages/commodity/menu-food/menu-food.js
pages/commodity/project-detail/project-detail.js
pages/commodity/project-detail/project-detail.wxml
pages/commodity/project-detail/project-detail.wxss
pages/commodity/project/project.js
pages/commodity/project/project.wxml
pages/commodity/shopping-cart/shopping-cart.js
pages/pay/order-input/order-input.js
pages/pay/order-input/order-input.wxml
pages/play/activity-detail/activity-detail.js
pages/play/activity/activity.js
pages/play/service-detail/service-detail.js
pages/play/service-sell/service-sell.js
pages/play/service-sell/service-sell.wxml
pages/play/service-sell/service-sell.wxss
pages/commodity/home/home.js
View file @
028b08b9
...
...
@@ -17,23 +17,58 @@ Page({
shopRecommendB
:
[],
// 顶部第二商店推荐
shopRecommendC
:
[],
// 底部第一商店推荐
shopRecommendD
:
[],
// 底部第二商店推荐
banner
:
[],
},
onLoad
:
function
(
option
)
{
// formPage=order&shopAppId=1&commodityType=5
this
.
setData
({
option
:
option
,
userInfo
:
wx
.
getStorageSync
(
'userInfo'
)
})
this
.
setGreetingMessage
()
// formPage=order&shopAppId=1&commodityType=5
this
.
queryShopCover
()
},
onShow
:
function
()
{
this
.
queryRecommend
()
},
queryShopCover
:
function
()
{
function
shopCover
(
funcType
,
funcIndex
)
{
App
.
wxRequest
({
url
:
'/api/v1/banner/getOfficeByBanner'
,
data
:
{
'smColumnId'
:
funcType
,
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcBanner
=
This
.
data
.
banner
if
(
funcResponse
.
length
)
{
funcBanner
[
funcIndex
]
=
funcResponse
[
0
].
img
}
else
{
funcBanner
[
funcIndex
]
=
''
}
This
.
setData
({
banner
:
funcBanner
})
}
})
}
let
This
=
this
// 0 首页,1 所有服务,2 儿童营地,3 海错图,4 元养水韵,5 儿童营地接待,6 拾光花坊, 7 商品
let
funcShopList
=
[
2
,
3
,
4
,
5
,
6
]
for
(
let
i
=
0
,
l
=
funcShopList
.
length
;
i
<
l
;
i
++
)
{
shopCover
(
funcShopList
[
i
],
i
)
}
},
/**
* 问候消息
* @function
...
...
@@ -282,7 +317,6 @@ Page({
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
let
funcCommodityItem
=
event
.
currentTarget
.
dataset
.
item
console
.
log
(
funcCommodityItem
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food?commodityId='
+
funcCommodityItem
.
id
+
'&sideBarId='
+
funcCommodityItem
.
sideBarId
...
...
@@ -398,7 +432,6 @@ Page({
let
funcShopAppId
=
event
.
currentTarget
.
dataset
.
id
let
funcCommodityItem
=
event
.
currentTarget
.
dataset
.
item
console
.
log
(
funcCommodityItem
)
this
.
setShopInfo
(
funcShopAppId
,
funcShopType
)
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food?commodityId='
+
funcCommodityItem
.
id
+
'&sideBarId='
+
funcCommodityItem
.
sideBarId
...
...
pages/commodity/home/home.wxml
View file @
028b08b9
...
...
@@ -62,15 +62,15 @@
<view class="services-list col align-c">
<!-- 精灵鸟理想国 -->
<view class="services-list-item col align-c" data-id="{{3}}" bindtap="onBuyMembership">
<image src="{{
resourcesBase + 'commodity/home/services-1.png'
}}"></image>
<image src="{{
banner[0]
}}"></image>
</view>
<!-- 故宫海洋世界 -->
<view class="services-list-item col align-c" data-id="{{1}}" bindtap="onBuyPassCheck">
<image src="{{
resourcesBase + 'commodity/home/services-2.png'
}}"></image>
<image src="{{
banner[1]
}}"></image>
</view>
<!-- 元养水韵 -->
<view class="services-list-item col align-c" data-id="{{7}}" bindtap="onBuyService">
<image src="{{
resourcesBase + 'commodity/home/services-3.png'
}}"></image>
<image src="{{
banner[2]
}}"></image>
</view>
</view>
</view>
...
...
@@ -86,11 +86,11 @@
</view>
<view class="reception-list col align-c">
<view class="reception-list-item col align-c" data-id="{{3}}" bindtap="onBuySupply">
<image src="{{
resourcesBase + 'commodity/home/reception-1.png'
}}"></image>
<image src="{{
banner[3]
}}"></image>
<text>儿童营地接待区</text>
</view>
<view class="reception-list-item col align-c" data-id="{{5}}" bindtap="onBuySupply">
<image src="{{
resourcesBase + 'commodity/home/reception-2.png'
}}"></image>
<image src="{{
banner[4]
}}"></image>
<text>拾光花坊</text>
</view>
</view>
...
...
pages/commodity/menu-food/menu-food.js
View file @
028b08b9
...
...
@@ -219,6 +219,7 @@ Page({
'id'
:
funcResponse
[
i
].
id
,
// 商品标识
'typeId'
:
funcResponse
[
i
].
genre
,
// 商品分类标识
'inventoriesId'
:
funcResponse
[
i
].
inventoriesId
,
// 仓库标识
'sideBarId'
:
''
,
'name'
:
funcResponse
[
i
].
name
,
'cover'
:
funcResponse
[
i
].
coverImg
,
// 商品封面
'price'
:
funcResponse
[
i
].
sightseerPrice
,
// 普通价
...
...
@@ -231,6 +232,7 @@ Page({
'describe'
:
funcResponse
[
i
].
synopsis
,
'describeDetail'
:
''
,
// 商品描述详情,在点击详情时获得数据
'tags'
:
funcResponse
[
i
].
tags
,
'tagsText'
:
''
,
'notificationId'
:
funcResponse
[
i
].
notificationId
,
// 下单须知
'quantityMin'
:
1
,
...
...
@@ -254,6 +256,11 @@ Page({
funcItem
.
priceType
=
3
}
}
// 标签文本匹配
switch
(
funcItem
)
{
}
funcCommodityList
.
push
(
funcItem
)
}
...
...
pages/commodity/project-detail/project-detail.js
View file @
028b08b9
...
...
@@ -166,8 +166,6 @@ Page({
winLoading
:
false
,
commodityList
:
this
.
data
.
commodityList
.
concat
(
funcCommodityList
),
})
console
.
log
(
'1111'
,
this
.
data
.
commodityList
)
},
})
},
...
...
@@ -277,13 +275,17 @@ Page({
winLoading
:
false
,
commodityList
:
this
.
data
.
commodityList
.
concat
(
funcCommodityList
),
})
console
.
log
(
'2222'
,
this
.
data
.
commodityList
)
},
})
},
onBuy
:
function
(
event
)
{
/**
* 前往商品详情
* @function
* @param
* @returns
*/
onCommodityDetail
:
function
(
event
)
{
let
funcCommodityInfo
=
event
.
currentTarget
.
dataset
.
item
// 补充必要参数
...
...
@@ -293,18 +295,29 @@ Page({
funcCommodityInfo
.
isActive
=
true
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcCommodityInfo
])
wx
.
navigateTo
({
url
:
'/pages/play/service-sell/service-sell'
})
},
switch
(
wx
.
getStorageSync
(
'shopInfoBuffer'
).
appId
)
{
case
7
:
wx
.
navigateTo
({
url
:
'/pages/play/service-sell/service-sell'
})
break
/**
* 前往购买
* @function
* @param
* @returns
*/
onBuy
:
function
(
event
)
{
let
funcCommodityInfo
=
event
.
currentTarget
.
dataset
.
item
default
:
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type='
+
funcCommodityInfo
.
typeId
})
}
// 补充必要参数
funcCommodityInfo
.
quantity
=
1
funcCommodityInfo
.
quantityMin
=
1
funcCommodityInfo
.
quantityMax
=
1
funcCommodityInfo
.
isActive
=
true
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcCommodityInfo
])
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type='
+
funcCommodityInfo
.
typeId
})
},
})
\ No newline at end of file
pages/commodity/project-detail/project-detail.wxml
View file @
028b08b9
...
...
@@ -6,7 +6,7 @@
</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="project-wrapper col">
<view class="project-wrapper col"
data-item="{{item}}" bindtap="onCommodityDetail"
>
<view class="project-cover">
<image src="{{item.cover}}"></image>
</view>
...
...
@@ -64,7 +64,7 @@
</view>
</view>
<view class="project-btn" data-item="{{item}}"
bind
tap="onBuy">
<view class="project-btn" data-item="{{item}}"
catch
tap="onBuy">
<text>{{buyText}}</text>
</view>
</view>
...
...
pages/commodity/project-detail/project-detail.wxss
View file @
028b08b9
...
...
@@ -27,6 +27,11 @@
}
.project-name {
width: 606rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #15191F;
font-size: 34rpx;
font-weight: 600;
...
...
pages/commodity/project/project.js
View file @
028b08b9
...
...
@@ -28,10 +28,51 @@ Page({
onLoad
:
function
(
options
)
{
for
(
let
i
=
0
,
l
=
this
.
data
.
shopAppId
.
length
;
i
<
l
;
i
++
)
{
this
.
queryBanner
(
this
.
data
.
shopAppId
[
i
].
appId
,
i
)
this
.
queryPassCheck
(
this
.
data
.
shopAppId
[
i
].
appId
,
this
.
data
.
shopAppId
[
i
].
commodityType
,
i
)
}
},
queryBanner
:
function
(
funcShopAppId
,
funcIndex
)
{
let
funcType
=
''
switch
(
funcShopAppId
)
{
case
1
:
funcType
=
3
break
case
3
:
funcType
=
2
if
(
funcIndex
===
3
)
funcIndex
=
2
break
case
7
:
funcType
=
4
break
}
App
.
wxRequest
({
url
:
'/api/v1/banner/getOfficeByBanner'
,
data
:
{
'smColumnId'
:
funcType
,
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcBanner
=
this
.
data
.
banner
if
(
funcResponse
.
length
)
{
funcBanner
[
funcIndex
]
=
funcResponse
[
0
].
img
}
else
{
funcBanner
[
funcIndex
]
=
''
}
this
.
setData
({
banner
:
funcBanner
})
console
.
log
(
funcBanner
)
}
})
},
queryPassCheck
:
function
(
funcShopAppId
,
funcCommodityType
,
funcIndex
)
{
let
funcShopId
=
''
for
(
let
i
=
0
,
l
=
App
.
globalData
.
shopId
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -143,6 +184,35 @@ Page({
this
.
setData
({
shopCommodityData
:
funcShopCommodityData
,
})
// 水养韵苑服务数据暂时固定
if
(
funcShopAppId
===
7
)
{
let
funcCommodityItem
=
funcCommodityList
[
0
]
funcCommodityItem
.
cover
=
this
.
data
.
resourcesBase
+
'shop/cover-7.png'
funcCommodityItem
.
name
=
'SPA套餐'
funcCommodityItem
.
describe
=
''
funcCommodityList
=
[
funcCommodityItem
]
App
.
wxRequest
({
url
:
'/api/v1/commodity/getSpaPriceRange'
,
data
:
{
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
funcCommodityItem
.
priceMin
=
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
sightseerPriceMin
)
funcCommodityItem
.
priceMax
=
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
sightseerPriceMax
)
funcCommodityItem
.
priceSpecialMin
=
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
ownerPriceMin
)
funcCommodityItem
.
priceSpecialMax
=
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
ownerPriceMax
)
let
funcShopCommodityData
=
this
.
data
.
shopCommodityData
funcShopCommodityData
[
funcIndex
]
=
funcCommodityList
this
.
setData
({
shopCommodityData
:
funcShopCommodityData
,
})
}
})
}
},
})
},
...
...
@@ -170,6 +240,18 @@ Page({
},
/**
* 服务套餐
* @function
* @param {object} - event
* @returns
*/
onBuyService
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/commodity/project-detail/project-detail'
})
},
/**
* banner 切换图片同步自定义标识组件
* @function
* @param {object} - funcEvent
...
...
pages/commodity/project/project.wxml
View file @
028b08b9
...
...
@@ -5,8 +5,7 @@
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
{{item.id}}
<image class="banner-swiper-image" src="{{item.img}}"></image>
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
...
...
@@ -105,12 +104,20 @@
<block wx:if="{{item.priceType === 1}}">
<view >
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceDiscountText}}</text>
<text class="commodity-price-value">{{item.priceSpecialMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text>{{item.priceMin}}</text>
<text>-</text>
<text>¥</text>
<text>{{item.priceMax}}</text>
<text>/人</text>
</view>
</block>
...
...
@@ -118,12 +125,20 @@
<block wx:if="{{item.priceType === 2}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialText}}</text>
<text class="commodity-price-value">{{item.priceSpecialMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceSpecialMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text class="commodity-price-special">业主价</text>
</view>
<view class="commodity-price-through row con-e align-c">
<text>¥</text>
<text>{{item.priceText}}</text>
<text>{{item.priceMin}}</text>
<text>-</text>
<text>¥</text>
<text>{{item.priceMax}}</text>
<text>/人</text>
</view>
</block>
...
...
@@ -131,7 +146,11 @@
<block wx:if="{{item.priceType === 3}}">
<view>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceText}}</text>
<text class="commodity-price-value">{{item.priceMin}}</text>
<text class="commodity-price-value">-</text>
<text class="commodity-price-symbol">¥</text>
<text class="commodity-price-value">{{item.priceMax}}</text>
<text class="commodity-price-symbol">/人</text>
<text></text>
</view>
<view class="commodity-price-through row con-e align-c">
...
...
@@ -141,7 +160,7 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuy">查看服务</button>
<button class="row con-c align-c" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuy
Service
">查看服务</button>
</view>
</view>
</view>
...
...
pages/commodity/shopping-cart/shopping-cart.js
View file @
028b08b9
...
...
@@ -160,7 +160,7 @@ Page({
let
funcShoppingCart
=
this
.
data
.
shoppingCart
if
(
funcShoppingCart
[
funcIndex
].
quantityMax
<=
funcShoppingCart
[
funcIndex
].
quantity
)
return
funcShoppingCart
[
funcIndex
].
quantity
=
funcShoppingCart
[
funcIndex
].
quantity
+
1
000
funcShoppingCart
[
funcIndex
].
quantity
=
funcShoppingCart
[
funcIndex
].
quantity
+
1
this
.
setData
({
shoppingCart
:
funcShoppingCart
})
...
...
pages/pay/order-input/order-input.js
View file @
028b08b9
...
...
@@ -85,6 +85,7 @@ Page({
stockList
:
[],
winStockTip
:
false
,
},
onLoad
:
function
(
options
)
{
if
(
options
.
type
)
options
.
type
=
Number
(
options
.
type
)
logicData
.
option
=
options
...
...
@@ -240,6 +241,7 @@ Page({
winButtonAppointment
:
false
,
// 确认预约
})
this
.
setStock
()
this
.
setEntryTime
()
break
case
7
:
...
...
@@ -377,6 +379,38 @@ Page({
})
},
setEntryTime
:
function
()
{
App
.
wxRequest
({
url
:
'/api/v1/activity/getEnrollView'
,
data
:
{
id
:
this
.
data
.
shoppingCartList
[
0
].
id
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
if
(
funcResponse
.
activityTimes
.
length
>
0
)
{
var
activityTimes
=
[]
var
pickerList
=
[]
funcResponse
.
activityTimes
.
forEach
(
item
=>
{
var
obj
=
item
obj
.
date
=
item
.
beginTime
+
' - '
+
item
.
endTime
activityTimes
.
push
(
obj
)
pickerList
.
push
(
obj
.
date
)
})
this
.
setData
({
activityTimes
:
activityTimes
,
listData
:
[
pickerList
],
})
}
console
.
log
(
activityTimes
)
this
.
setData
({
buyContentTitle
:
funcResponse
.
name
,
})
}
})
},
/**
* 同步库存信息
* @function
...
...
@@ -490,8 +524,6 @@ Page({
clearTimeout
(
funcTimer
)
},
100
)
console
.
log
(
this
.
data
.
shoppingCartList
)
App
.
wxRequest
({
url
:
'/api/v1/commodity/getNotification'
,
data
:
{
...
...
@@ -698,7 +730,7 @@ Page({
url
:
'/api/v1/order/doOrder'
,
data
:
{
'isPayment'
:
2
,
'totalMoney'
:
Number
(
this
.
data
.
payAmount
),
'totalMoney'
:
Number
(
this
.
data
.
payAmount
)
+
100
,
'office'
:
{
'id'
:
this
.
data
.
shopInfo
.
id
},
'smOrderDetails'
:
funcCommodity
,
'smPersonalDetails'
:
funcUserInfo
,
...
...
@@ -707,6 +739,10 @@ Page({
'goodType'
:
this
.
data
.
shopInfo
.
shopType
,
},
success
:
(
response
)
=>
{
console
.
log
(
'------------------'
)
console
.
log
(
response
)
if
(
/价格不一致/
.
test
(
response
.
data
.
msg
))
{
wx
.
lin
.
showToast
({
title
:
'价格已变更,请重新下单。'
,
...
...
@@ -755,6 +791,11 @@ Page({
orderId
:
pagePayId
})
// 支付金额为零,默认支付成功
if
(
Number
(
this
.
data
.
payAmount
)
===
0
)
{
this
.
payStatus
(
true
)
return
}
wx
.
requestPayment
({
'timeStamp'
:
funcResponse
.
timeStamp
,
'nonceStr'
:
funcResponse
.
nonceStr
,
...
...
@@ -781,6 +822,11 @@ Page({
// 开启支付状态轮询
// wx.showLoading({ title: '正在获取数据', mask: true })
this
.
queryPayStatus
(
pagePayId
)
},
fail
:
(
error
)
=>
{
this
.
setData
({
isPaySubmit
:
true
,
})
}
})
},
...
...
pages/pay/order-input/order-input.wxml
View file @
028b08b9
...
...
@@ -312,7 +312,7 @@
<view class="stock-tip row con-c align-c">
<text>{{'抱歉,您本单商品有' + stockList.length + '件库存不足'}}</text>
</view>
<view class="stock-info col
con-c
align-c">
<view class="stock-info col align-c">
<block wx:for="{{stockList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="stock-item row align-c">
<image src="{{item.cover}}"></image>
...
...
pages/play/activity-detail/activity-detail.js
View file @
028b08b9
...
...
@@ -41,10 +41,70 @@ Page({
this
.
setData
({
id
:
options
.
id
})
var
that
=
this
App
.
login
({
success
:
function
()
{
that
.
getActivityDetail
()
this
.
queryActivityDetail
()
},
//主题活动详情
queryActivityDetail
:
function
()
{
App
.
wxRequest
({
url
:
'/api/v1/activity/getDetail'
,
data
:
{
id
:
this
.
data
.
id
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcItem
=
{
'id'
:
funcResponse
.
id
,
// 商品标识
'typeId'
:
''
,
// 商品分类标识
'inventoriesId'
:
''
,
// 仓库标识
'dateValid'
:
''
,
// 有效时间
'dateInvalid'
:
''
,
// 失效时间
'name'
:
funcResponse
.
name
,
'cover'
:
funcResponse
.
banners
,
// 商品封面
'price'
:
funcResponse
.
visitorPrice
,
// 普通价
'priceText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
visitorPrice
),
// 普通价文本格式
'priceSpecial'
:
funcResponse
.
ownerPrice
,
// 业主价
'priceSpecialText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
ownerPrice
),
// 业主价文本格式
'priceDiscount'
:
funcResponse
.
price
,
// 活动价
'priceDiscountText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
price
),
// 活动价文本格式
'priceType'
:
1
,
'describe'
:
funcResponse
.
summary
,
'tags'
:
''
,
'notificationId'
:
''
,
// 下单须知
// 补充必要参数
'quantity'
:
1
,
'quantityMin'
:
1
,
'quantityMax'
:
1
,
'isActive'
:
true
,
}
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
funcItem
.
priceDiscount
)
{
funcItem
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
funcItem
.
price
!==
funcItem
.
priceSpecial
&&
funcUserType
)
{
funcItem
.
priceType
=
2
}
else
{
funcItem
.
priceType
=
3
}
}
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
funcItem
])
this
.
setData
({
banner
:
funcResponse
.
banners
,
info
:
{
title
:
funcResponse
.
name
,
date
:
funcResponse
.
activeDate
+
' '
+
funcResponse
.
activeTime
,
address
:
funcResponse
.
address
,
quota
:
funcResponse
.
enrollNum
,
describe
:
funcResponse
.
content
,
// contact: response.contact,
}
})
this
.
configActiveState
(
funcResponse
.
activeState
*
1
)
}
})
},
...
...
@@ -69,30 +129,6 @@ Page({
})
},
//主题活动详情
getActivityDetail
()
{
var
that
=
this
App
.
wxRequest
({
url
:
'/api/v1/activity/getDetail'
,
data
:
{
id
:
that
.
data
.
id
},
success
:
function
(
res
)
{
var
response
=
res
.
data
that
.
setData
({
banner
:
response
.
banners
,
info
:
{
title
:
response
.
name
,
date
:
response
.
activeDate
+
' '
+
response
.
activeTime
,
address
:
response
.
address
,
quota
:
response
.
enrollNum
,
describe
:
response
.
content
,
// contact: response.contact,
}
})
that
.
configActiveState
(
response
.
activeState
*
1
)
}
})
},
configActiveState
(
state
)
{
var
text
=
this
.
data
.
stateText
switch
(
state
)
{
...
...
pages/play/activity/activity.js
View file @
028b08b9
...
...
@@ -10,7 +10,6 @@ Page({
},
onLoad
:
function
(
options
)
{
console
.
log
(
options
.
fromPage
)
if
(
options
.
fromPage
===
'serviceDetail'
)
this
.
setData
({
shopInfo
:
wx
.
getStorageSync
(
'shopInfoBuffer'
)})
this
.
getActivityList
(
1
)
...
...
@@ -18,7 +17,6 @@ Page({
},
onActivityDetail
:
function
(
funcItem
)
{
console
.
log
(
'onActivityDetail'
)
wx
.
navigateTo
({
url
:
'/pages/play/activity-detail/activity-detail?id='
+
funcItem
.
currentTarget
.
dataset
.
id
})
...
...
pages/play/service-detail/service-detail.js
View file @
028b08b9
...
...
@@ -80,7 +80,6 @@ Page({
this
.
setData
({
option
:
options
,
})
console
.
log
(
'shopId'
,
Number
(
options
.
id
))
this
.
queryDetail
(
Number
(
options
.
id
))
...
...
@@ -390,7 +389,6 @@ Page({
'officeId'
:
this
.
data
.
shopInfo
.
id
,
},
success
:
(
response
)
=>
{
console
.
log
(
JSON
.
stringify
(
response
))
this
.
setData
({
winActivity
:
true
})
...
...
@@ -418,7 +416,8 @@ Page({
for
(
let
i
=
0
,
l
=
funcResponse
.
length
;
i
<
l
;
i
++
)
{
let
funcItem
=
{
'id'
:
funcResponse
[
i
].
id
,
// 商品标识
'typeId'
:
funcResponse
[
i
].
genre
,
// 商品分类标识
'typeId'
:
funcResponse
[
i
].
genre
,
// 商品类别标识
'sidebarId'
:
funcResponse
[
i
].
classifyId
,
// 商品分类标识
'name'
:
funcResponse
[
i
].
name
,
'cover'
:
funcResponse
[
i
].
coverImg
,
// 商品封面
'price'
:
funcResponse
[
i
].
sightseerPrice
,
// 普通价
...
...
pages/play/service-sell/service-sell.js
View file @
028b08b9
...
...
@@ -4,32 +4,13 @@ Page({
data
:
{
bannerIndex
:
0
,
bannerStyle
:
1
,
banner
:
[
{
id
:
0
,
img
:
''
},
{
id
:
1
,
img
:
''
},
{
id
:
2
,
img
:
''
}
],
serviceInfo
:
{
name
:
'竹子热油放松SPA'
,
time
:
'90 mins'
,
address
:
'元养水韵SPA'
,
content
:
'适合肌肉酸痛,容易疲乏、忧郁症、运动型等人群。竹子是生命能量的一种象征,此疗程是结合ADS舒压芳香精油特殊的气体对人体进行一种温暖放松的理疗,通过竹子在人体肌肉上的滚动,压按,深层反射肌肉,舒缓神经,有效改善睡眠,提高健康质量。'
,
priceSpecial
:
'880'
,
price
:
'890'
,
}
banner
:
[],
serviceInfo
:
{}
},
onLoad
:
function
(
options
)
{
this
.
queryCommodityDetail
()
},
/**
* banner 切换图片同步自定义标识组件
* @function
...
...
@@ -41,7 +22,8 @@ Page({
bannerIndex
:
funcEvent
.
detail
.
current
})
},
/**
/**
* 点击地址
* @function
* @param
...
...
@@ -63,8 +45,50 @@ Page({
'genre'
:
funcCommodity
.
typeId
,
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcItem
=
{
'name'
:
funcResponse
.
name
,
'time'
:
funcResponse
.
spaMins
,
'address'
:
'元养水韵SPA'
,
'content'
:
funcResponse
.
particulars
,
'price'
:
funcResponse
.
sightseerPrice
,
// 普通价
'priceText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
sightseerPrice
),
// 普通价文本格式
'priceSpecial'
:
funcResponse
.
ownerPrice
,
// 业主价
'priceSpecialText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
ownerPrice
),
// 业主价文本格式
'priceDiscount'
:
funcResponse
.
price
,
// 活动价
'priceDiscountText'
:
App
.
modular
.
utils
.
formatAmount
(
funcResponse
.
price
),
// 活动价文本格式
'priceType'
:
1
,
}
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
funcItem
.
priceDiscount
)
{
funcItem
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
funcItem
.
price
!==
funcItem
.
priceSpecial
&&
funcUserType
)
{
funcItem
.
priceType
=
2
}
else
{
funcItem
.
priceType
=
3
}
}
this
.
setData
({
banner
:
funcResponse
.
imgs
.
replace
(
/
\|
$/
,
''
).
split
(
'|'
),
serviceInfo
:
funcItem
})
}
})
},
onBuy
:
function
()
{
let
funcShopInfo
=
wx
.
getStorageSync
(
'shopInfoBuffer'
)
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[
this
.
data
.
serviceInfo
])
wx
.
navigateTo
({
url
:
'/pages/pay/order-input/order-input?type='
+
funcShopInfo
.
shopType
})
},
})
\ No newline at end of file
pages/play/service-sell/service-sell.wxml
View file @
028b08b9
...
...
@@ -5,8 +5,7 @@
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
{{item.id}}
<image class="banner-swiper-image" src="{{item.img}}"></image>
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
...
...
@@ -52,21 +51,55 @@
<text>{{serviceInfo.content}}</text>
</view>
<view class="footer-wrapper row align-c">
<view class="special-msg">
<text>业主价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceSpecial}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.price}}</text>
<text class="price-old-unit">/人 </text>
</view>
<view class="footer-btn">
<!-- 活动价样式 -->
<block wx:if="{{serviceInfo.priceType === 1}}">
<view class="special-msg">
<text>活动价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceDiscountText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.priceText}}</text>
<text class="price-old-unit">/人 </text>
</view>
</block>
<!-- 业主价样式 -->
<block wx:if="{{serviceInfo.priceType === 2}}">
<view class="special-msg">
<text>业主价</text>
</view>
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceSpecialText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
<view class="price-old">
<text>{{'¥' + serviceInfo.priceText}}</text>
<text class="price-old-unit">/人 </text>
</view>
</block>
<!-- 普通价样式 -->
<block wx:if="{{serviceInfo.priceType === 3}}">
<view class="price-special">
<text class="price-special-symbol">¥</text>
<text>{{serviceInfo.priceText}}</text>
</view>
<view class="price-special-unit">
<text>/人</text>
</view>
</block>
<view class="footer-btn" bindtap="onBuy">
<text>立即购买</text>
</view>
</view>
...
...
pages/play/service-sell/service-sell.wxss
View file @
028b08b9
...
...
@@ -14,20 +14,20 @@
background-color: #ccc;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
.banner-swiper, .banner-swiper-item, .banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 750rpx;
height: 800rpx;
}
.banner-swiper-point {
position: relative;
top: 702rpx;
left: 0;
}
.banner-wave {
position: absolute;
top: 754rpx;
...
...
@@ -40,39 +40,46 @@
width: 670rpx;
margin-top: 50rpx;
padding-bottom: 36rpx;
border-bottom: 1px solid #
E2E7EF
;
border-bottom: 1px solid #
e2e7ef
;
}
.service-name {
height: 120rpx;
color: #15191
F
;
color: #15191
f
;
font-size: 54rpx;
font-weight: 600;
}
.time-address-wrapper {
height: 82rpx;
font-size: 30rpx;
}
.time-address-title {
margin-left: 8rpx;
color: #959
DA
9;
color: #959
da
9;
}
.time-address {
flex: 1;
margin-left: 25rpx;
color: #000
000
;
color: #000;
}
.service-icon {
width: 40rpx;
height: 40rpx;
}
.service-content {
width: 670rpx;
margin: 56rpx 0;
color: #15191
F
;
color: #15191
f
;
font-size: 30rpx;
line-height: 50rpx;
font-weight: 300;
}
.footer-wrapper {
position: fixed;
left: 0;
...
...
@@ -81,40 +88,62 @@
height: 196rpx;
padding: 32rpx 40rpx 68rpx;
background-color: #fff;
border-top: 1px solid #E2E7EF;
border-top: 1px solid #e2e7ef;
}
/* 价格样式 */
.price-discount {
width: 78rpx;
height: 36rpx;
margin-right: 12rpx;
color: #EF4E4E;
font-size: 18rpx;
line-height: 36rpx;
text-align: center;
background: #FAEDEA;
border-radius: 4rpx;
}
.special-msg {
width: 78rpx;
height: 36rpx;
margin-right: 12rpx;
color: #
E8D0AF
;
color: #
e8d0af
;
font-size: 18rpx;
line-height: 36rpx;
text-align: center;
background: linear-gradient(180deg, #3
F
4357 0%, #252532 100%);
background: linear-gradient(180deg, #3
f
4357 0%, #252532 100%);
border-radius: 4rpx;
}
.price-special {
color: #15191
F
;
color: #15191
f
;
font-size: 38rpx;
}
.price-special-symbol {
font-size: 26rpx;
}
.price-special-unit {
margin-left: 4rpx;
color: #15191
F
;
color: #15191
f
;
font-size: 26rpx;
}
.price-old {
margin-left: 16rpx;
color: #
C2C7CF
;
color: #
c2c7cf
;
font-size: 30rpx;
text-decoration: line-through;
}
.price-old-unit {
font-size: 26rpx;
}
.footer-btn {
position: absolute;
right: 40rpx;
...
...
@@ -124,11 +153,11 @@
font-size: 30rpx;
line-height: 96rpx;
text-align: center;
background-color: #86
C5E
1;
background-color: #86
c5e
1;
border-radius: 4rpx;
}
image {
width: 100%;
height: 100%;
}
\ No newline at end of file
}
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