Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_wechat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_wechat
Commits
718b8cb1
Commit
718b8cb1
authored
Nov 18, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
细节优化
parent
fa7436f0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
764 additions
and
437 deletions
+764
-437
index.config.js
config/index.config.js
+8
-8
order.vue
pages/order/order.vue
+756
-429
No files found.
config/index.config.js
View file @
718b8cb1
...
...
@@ -2,8 +2,8 @@ const CONFIG = {
// 开发环境配置
development
:
{
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
//
assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath
:
'http://10.24.5.63:8211/static'
,
// 静态资源路径
assetsPath
:
'http://coujiao.pseer.com:8888/wechat_static'
,
// 静态资源路径
//
assetsPath: 'http://10.24.5.63:8211/static', // 静态资源路径
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
baseUrl
:
'https://coujiao.pseer.com/front-api'
,
// 后台接口请求地址
hostUrl
:
'http://coujiao.pseer.com:8888/prod-api'
,
// H5地址(前端运行地址)
...
...
@@ -15,12 +15,12 @@ const CONFIG = {
},
// 生产环境配置
production
:
{
//
assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath
:
'https://www.coujio.com/wechat_static'
,
// 静态资源路径
//
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
baseUrl
:
'https://www.coujio.com/front-api'
,
// 后台接口请求地址
//
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
hostUrl
:
'https://www.coujio.com/prod-api'
,
// H5地址(前端运行地址)
assetsPath
:
'http://coujiao.pseer.com:8888/wechat_static'
,
// 静态资源路径
//
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl
:
'https://coujiao.pseer.com/front-api'
,
// 后台接口请求地址
//
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl
:
'https://coujiao.pseer.com/prod-api'
,
// H5地址(前端运行地址)
//
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl
:
''
,
// websocket服务端地址
weixinAppId
:
''
,
// 微信公众号appid
codeHeadUrl
:
""
,
...
...
pages/order/order.vue
View file @
718b8cb1
...
...
@@ -63,7 +63,8 @@
:class=
"
{active:dateIndex === k}" @tap="onDateChange(k)">
<view
class=
"relative"
>
<text
class=
"text-title text-bold text-first "
>
{{
k
===
0
&&
item
.
readDate
===
toDayDate
?
'今天'
:
item
.
weekday
}}
</text>
<text
class=
"text-title text-bold text-first "
>
{{
k
===
0
&&
item
.
readDate
===
toDayDate
?
'今天'
:
item
.
weekday
}}
</text>
<view
v-if=
"dateIndex !== k && activityDate[item.readDate]"
class=
"absolute-right"
>
<image
:src=
"assetsPath+'/xx2.png'"
mode=
"widthFix"
></image>
</view>
...
...
@@ -91,11 +92,15 @@
<view
class=
"item"
:class=
"allDayUseStatus? 'gray': modeIndex===index?'active':''"
>
<text>
{{
item
.
labelName
}}
</text>
</view>
<view
v-if=
"item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))"
class=
"pre-icon"
>
<image
:src=
"
<view
v-if=
"item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))"
class=
"pre-icon"
>
<image
:src=
"
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId) && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(!item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)) ? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'"
mode=
"widthFix"
></image>
(!item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)) ? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'"
mode=
"widthFix"
></image>
</view>
</view>
</view>
...
...
@@ -106,7 +111,9 @@
<text>
{{
item
.
name
}}
</text>
</view>
<view
class=
"pre-icon"
>
<image
:src=
" activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.id)? assetsPath+'/pre_icon_2.png' : assetsPath+'/pre_icon.png'"
mode=
"widthFix"
></image>
<image
:src=
" activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.id)? assetsPath+'/pre_icon_2.png' : assetsPath+'/pre_icon.png'"
mode=
"widthFix"
></image>
</view>
</view>
</view>
...
...
@@ -213,63 +220,96 @@
<text>
/小时
</text>
</view>
</view>
<view
v-if=
"userInfo && (secondaryCardList.length || monthlyCardList.length)"
class=
"flex-col card-use"
>
<view
class=
"flex-between"
@
tap=
"onShowMorePayWay"
>
<text
class=
"text-black text-left"
>
钱包支付
</text>
<view
class=
"flex-row-center"
>
<text
class=
"cuIcon-right"
:class=
"showMorePayWay? 'show-more-pay-way':''"
></text>
<view
v-if=
"computePriceInfo.totalFeeNow"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
应付金额
</text>
<view
class=
"flex-row"
>
<!--
<text
class=
"text-pink text-sm text-bold"
style=
"margin-bottom: 3upx;"
>
{{
computePriceInfo
.
couponFee
>
0
?
'-'
:
''
}}
¥
</text>
-->
<text
class=
"text-pink"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
computePriceInfo
.
totalFeeNow
||
0
}}
</text>
</view>
</view>
<view
v-if=
"computePriceInfo.remainingBalance"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
支付策略
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink"
>
优先使用钱包余额
</text>
</view>
</view>
<view
class=
"radio-group-box"
:class=
"showMorePayWay? 'radio-group-box-height':''"
>
<radio-group
class=
"radio-group"
>
<!--
<label
v-if=
"Number(computePriceInfo.availableBalance)"
class=
"flex-between"
@
tap=
"onRadioChange('availableBalance')"
>
<view
class=
"flex-1 flex-between"
>
<view
v-if=
"computePriceInfo.discount > 0 && computePriceInfo.discount
<
100
"
class=
"flex-between price"
>
<view
class=
"flex-row-center"
>
<text>
余额:
<text
class=
"text-pink text-bold"
>
¥
{{
computePriceInfo
.
availableBalance
}}
</text>
可用
</text>
<text
class=
"text-black text-left"
>
会员折扣
</text>
<view
class=
"vip-tag-box"
>
<image
:src=
"assetsPath+'/huiyuan.png'"
mode=
"widthFix"
></image>
<text>
会员日
{{
computePriceInfo
.
discountText
||
computePriceInfo
.
discount
}}
折
</text>
</view>
<view
class=
"flex-row-center margin-right-sm"
>
<text>
{{
userInfo
.
memberConfig
.
levelName
}}
:
<text
class=
"text-pink text-bold"
>
{{
userInfo
.
memberConfig
.
discountRatio
}}
</text>
折
</text>
</view>
<view
class=
"flex-row-center"
>
<text
class=
"text-pink text-xl text-bold"
style=
"margin-right: 6upx;"
>
-
</text>
<text
class=
"text-pink text-bold"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
(
computePriceInfo
.
memberDiscount
).
toFixed
(
2
)
}}
</text>
</view>
<view
class=
"flex-row-center"
>
<radio
class=
'pink radio'
:class=
"radioChecked=='availableBalance'?'checked':''"
value=
"availableBalance"
:checked=
"radioChecked == 'availableBalance'?true:false"
style=
"transform:scale(0.7)"
/>
</view>
</label
>
-->
<view
class=
"flex-col card-use"
>
<view
class=
"flex-between"
@
tap=
"onShowMorePayWay"
>
<text
class=
"text-black text-left"
>
钱包支付
</text>
<view
class=
"flex-row-center"
>
<text
class=
"cuIcon-right"
:class=
"showMorePayWay? 'show-more-pay-way':''"
></text>
</view>
</view>
<view
class=
"radio-group-box"
:class=
"showMorePayWay? 'radio-group-box-height':''"
>
<radio-group
class=
"radio-group"
>
<label
v-if=
"monthlyCardList.length"
class=
"flex-between"
@
tap=
"onRadioChange('monthlyCard')"
>
<view
class=
"flex-row-center"
>
<text>
{{
monthlyCardList
[
0
].
confName
}}
:
</text>
<text
class=
"text-pink text-bold"
>
{{
monthlyCardList
[
0
].
freeDuration
}}
</text>
<text>
小时可用
</text>
</view>
<view
class=
"flex-row-center"
>
<!--
<text>
请选择
</text>
-->
<radio
class=
'pink radio'
:class=
"radioChecked=='monthlyCard'?'checked':''"
value=
"monthlyCard"
:checked=
"radioChecked == 'monthlyCard'?true:false"
style=
"transform:scale(0.7)"
/>
<view
class=
"flex-row-center"
>
<radio
class=
'pink radio'
:class=
"radioChecked=='monthlyCard'?'checked':''"
value=
"monthlyCard"
:checked=
"radioChecked == 'monthlyCard'?true:false"
style=
"transform:scale(0.7)"
/>
</view>
</label
>
</label
>
<label
v-if=
"secondaryCardList.length"
class=
"flex-between"
@
tap=
"onRadioChange('secondaryCard')"
>
<view
class=
"flex-row-center"
>
<text>
{{
secondaryCard
.
name
}}
:剩
<text
class=
"text-pink text-bold"
>
{{
secondaryCard
.
number
}}
</text>
次可用
</text>
<text>
{{
secondaryCard
.
name
}}
:剩
<text
class=
"text-pink text-bold"
>
{{
secondaryCard
.
number
}}
</text>
次可用
</text>
</view>
<view
class=
"flex-row-center"
>
<!--
<text>
请选择
</text>
-->
<radio
class=
'pink radio'
:class=
"radioChecked=='secondaryCard'?'checked':''"
value=
"secondaryCard"
:checked=
"radioChecked=='secondaryCard'?true:false"
style=
"transform:scale(0.7)"
/>
<view
class=
"flex-row-center"
>
<radio
class=
'pink radio'
:class=
"radioChecked=='secondaryCard'?'checked':''"
value=
"secondaryCard"
:checked=
"radioChecked=='secondaryCard'?true:false"
style=
"transform:scale(0.7)"
/>
</view>
</label
>
</label>
<!--
<label
v-if=
"computePriceInfo && computePriceInfo.availableDuration"
class=
"flex-between"
@
tap=
"onRadioChange('availableDuration')"
>
<label
class=
"flex-between"
>
<view
class=
"flex-1 flex-between"
>
<view
class=
"flex-row-center"
>
<text>
时长:
<text
class=
"text-pink text-bold"
>
{{
Number
(
computePriceInfo
.
availableDuration
).
toFixed
(
1
)
}}
</text>
小时可用
</text>
<text>
可用余额:
</text>
<text
class=
"text-pink text-bold"
>
¥
{{
computePriceInfo
.
availableBalance
}}
</text>
</view>
<view
class=
"flex-row-center margin-right-sm"
>
<!--
<text>
{{
userInfo
.
memberConfig
.
levelName
}}
:
<textclass
="
text-pink
text-bold
"
>
{{
userInfo
.
memberConfig
.
discountRatio
}}
</text>
折
</text>
-->
</view>
</view>
<view
class=
"flex-row-center"
>
<radio
class=
'pink radio'
:class=
"radioChecked=='availableDuration'?'checked':''"
value=
"availableDuration"
:checked=
"radioChecked == 'availableDuration'?true:false"
style=
"transform:scale(0.7)"
/>
<view
class=
"flex-row-center"
>
<text
v-if=
"computePriceInfo.availableBalance"
class=
"text-pink text-lg text-bold margin-right-sm"
>
{{
computePriceInfo
.
balance
||
0
}}
</text>
<button
v-else
class=
"cu-btn bg-pink sm"
@
tap=
"onNavToRecharge"
>
充值
</button>
</view>
</label
>
-->
</label>
<label
v-if=
"computePriceInfo && computePriceInfo.availableDuration"
class=
"flex-between"
>
<view
class=
"flex-1 flex-between"
>
<view
class=
"flex-row-center"
>
<text>
可用时长:
</text>
<text
class=
"text-pink text-bold"
>
{{
Number
(
computePriceInfo
.
availableDuration
).
toFixed
(
1
)
}}
小时
</text>
</view>
</view>
<view
class=
"flex-row-center"
>
<text
class=
"text-pink text-bold margin-right-sm"
>
{{
Number
(
computePriceInfo
.
duration
)?
'-'
+
Number
(
computePriceInfo
.
duration
).
toFixed
(
1
)
:
0
}}
</text>
</view>
</label>
</radio-group>
</view>
...
...
@@ -277,7 +317,8 @@
<view
class=
"flex-between price use-coupon-box"
>
<view
class=
"flex-row-center"
>
<text
class=
"text-black text-left"
>
{{
useCouponList
[
selectCouponIndex
].
couponType
==
2
?
'团购券'
:
'优惠券'
}}
</text>
<text
class=
"text-black text-left"
>
{{
useCouponList
[
selectCouponIndex
].
couponType
==
2
?
'团购券'
:
'优惠券'
}}
</text>
<text
v-if=
"couponExpireTip && selectCouponIndex
<
0
"
class=
"text-red"
>
(有即将过期券待使用)
</text>
</view>
...
...
@@ -287,62 +328,36 @@
<text
class=
"cuIcon-right "
:class=
"useCouponList.length?'text-pink':'text-gray'"
></text>
</view>
</view>
<view
v-if=
"userInfo && computePriceInfo.availableDuration"
class=
"flex-between price"
>
<
!--
<
view
v-if=
"userInfo && computePriceInfo.availableDuration"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
可用时长
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink text-lg text-bold"
>
{{
computePriceInfo
&&
computePriceInfo
.
availableDuration
?
Number
(
computePriceInfo
.
availableDuration
).
toFixed
(
1
)
:
0
}}
</text>
<text
class=
"text-pink"
>
小时
</text>
</view>
</view>
<view
v-if=
"userInfo && computePriceInfo.duration"
class=
"flex-between price"
>
</view>
-->
<
!--
<
view
v-if=
"userInfo && computePriceInfo.duration"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
时长抵扣
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink text-lg text-bold"
>
{{
Number
(
computePriceInfo
.
duration
).
toFixed
(
1
)
}}
</text>
<text>
小时
</text>
</view>
</view>
<view
v-if=
"computePriceInfo.remainingBalance"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
支付策略
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink"
>
优先使用钱包余额
</text>
</view>
</view>
<!--
<view
v-if=
"computePriceInfo.availableBalance"
class=
"flex-between price"
>
</view>
-->
<!--
<view
v-if=
"computePriceInfo.availableBalance"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
可用余额
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
computePriceInfo
.
availableBalance
}}
</text>
</view>
</view>
-->
<view
v-if=
"computePriceInfo.balance"
class=
"flex-between price"
>
<
!--
<
view
v-if=
"computePriceInfo.balance"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
余额抵扣
</text>
<view
class=
"flex-row"
>
<text
class=
"text-pink"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
computePriceInfo
.
balance
}}
</text>
</view>
</view>
<view
v-if=
"computePriceInfo.discount > 0 && computePriceInfo.discount
<
100
"
class=
"flex-between price"
>
<view
class=
"flex-row-center"
>
<text
class=
"text-black text-left"
>
会员折扣
</text>
<view
class=
"vip-tag-box"
>
<image
:src=
"assetsPath+'/huiyuan.png'"
mode=
"widthFix"
></image>
<text>
会员日
{{
computePriceInfo
.
discountText
||
computePriceInfo
.
discount
}}
折
</text>
</view>
</view>
<view
class=
"flex-row-center"
>
<text
class=
"text-pink text-xl text-bold"
style=
"margin-right: 6upx;"
>
-
</text>
<text
class=
"text-pink text-bold"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
(
computePriceInfo
.
memberDiscount
).
toFixed
(
2
)
}}
</text>
</view>
</view>
<view
v-if=
"computePriceInfo.totalFeeNow"
class=
"flex-between price"
>
<text
class=
"text-black text-left"
>
应付金额
</text>
<view
class=
"flex-row"
>
<!--
<text
class=
"text-pink text-sm text-bold"
style=
"margin-bottom: 3upx;"
>
{{
computePriceInfo
.
couponFee
>
0
?
'-'
:
''
}}
¥
</text>
-->
<text
class=
"text-pink"
>
¥
</text>
<text
class=
"text-pink text-lg text-bold"
>
{{
computePriceInfo
.
totalFeeNow
||
0
}}
</text>
</view>
</view>
</view>
-->
</view>
<view
class=
"pay-content-box"
>
...
...
@@ -402,7 +417,7 @@
</view>
</uni-popup>
<uni-popup
ref=
"popupActivite"
type=
"center"
isMaskClick=
"false"
>
<uni-popup
ref=
"popupActivite"
type=
"center"
:
isMaskClick=
"false"
>
<view
class=
"flex-col"
>
<view
class=
"activite-box"
>
<image
:src=
"assetsPath+'/activite_1.jpg'"
mode=
"widthFix"
></image>
...
...
@@ -413,6 +428,40 @@
</view>
</uni-popup>
<uni-popup
ref=
"popupRecharge"
type=
"center"
:isMaskClick=
"false"
>
<view
class=
"popup-recharge"
>
<view
class=
"recharge-content"
>
<view
class=
"close-btn"
@
click=
"onNavToCreateOrder"
>
<text
class=
"cuIcon-close text-gray text-bold"
>
</text>
</view>
<view
class=
"header-part"
>
<text
class=
"text-title text-black margin-top text-xl"
>
充值会员
</text>
<text
class=
"text-gray"
>
享受每次订房最低打95折,最高打88折
</text>
</view>
<view
class=
"content-part"
>
<view
v-for=
"(item,k) in rechargeConfList"
:key=
"k"
class=
"flex-row-center list-item"
>
<image
class=
"recharge-icon"
:src=
"assetsPath+'/recharge_icon.png'"
mode=
"widthFix"
></image>
<text
class=
"text-title"
>
{{
item
.
rechargeAmount
}}
元送
</text>
<text
class=
"text-pink"
>
{{
item
.
giveAmount
}}
</text>
<text
class=
"text-title"
>
元余额=
{{
Number
(
item
.
rechargeAmount
)
+
Number
(
item
.
giveAmount
)
}}
元
</text>
</view>
<view
class=
"text-des-box"
>
<text
class=
"text-des"
>
充值会员后,每一次消费的积分可自动 累计,用于升级订房折扣,最高打88折
</text>
</view>
<button
class=
"cu-btn"
@
tap=
"onNavToRecharge"
>
立即充值
</button>
</view>
</view>
</view>
</uni-popup>
<uni-popup
ref=
"confirmPop"
type=
"bottom"
:isMaskClick=
"false"
>
<view
class=
"confirm-pop"
>
<view
class=
"pop-content-box"
>
...
...
@@ -443,7 +492,8 @@
<view
class=
"info flex-row-center"
>
<text
class=
"text-black text-bold text-lg"
>
房间:
</text>
<text
class=
" margin-left text-lg "
>
{{
roomInfo
.
name
}}
(
{{
roomTypeEnum
[
roomInfo
.
roomType
]
}}
)
</text>
<text
class=
" margin-left text-lg "
>
{{
roomInfo
.
name
}}
(
{{
roomTypeEnum
[
roomInfo
.
roomType
]
}}
)
</text>
</view>
...
...
@@ -452,7 +502,8 @@
<text
class=
"margin-left text-lg"
>
¥
</text>
<text
class=
" text-xl"
>
{{
Number
(
computePriceInfo
.
balance
).
toFixed
(
2
)
}}
</text>
<text
class=
"text-lg margin-left-sm"
>
(余额账户: ¥
{{
Number
(
userInfo
.
consumerWallet
.
balance
).
toFixed
(
2
)
}}
)
</text>
<text
class=
"text-lg margin-left-sm"
>
(余额账户:
¥
{{
Number
(
userInfo
.
consumerWallet
.
balance
).
toFixed
(
2
)
}}
)
</text>
</view>
<view
class=
"info flex-row-center"
>
...
...
@@ -480,11 +531,14 @@
<uni-popup
ref=
"popupMessage"
type=
"dialog"
>
<uni-popup-dialog
type=
"warn"
mode=
"base"
title=
"提示"
:showClose=
"false"
:content=
"tipErrMsg|| tipContent"
:duration=
"2000"
:before-close=
"true"
@
close=
"onCancleTip"
@
confirm=
"onCancleTip"
></uni-popup-dialog>
<uni-popup-dialog
type=
"warn"
mode=
"base"
title=
"提示"
:showClose=
"false"
:content=
"tipErrMsg|| tipContent"
:duration=
"2000"
:before-close=
"true"
@
close=
"onCancleTip"
@
confirm=
"onCancleTip"
></uni-popup-dialog>
</uni-popup>
<uni-popup
ref=
"popupDialog"
type=
"dialog"
>
<uni-popup-dialog
type=
"warn"
mode=
"base"
title=
"提示"
:content=
" warnTip || packageMode[tempPackageIndex].name + '时长不足,是否接受预定?'"
:duration=
"2000"
:before-close=
"true"
@
close=
"onCancleTip"
@
confirm=
"onPackageCheck"
></uni-popup-dialog>
<uni-popup-dialog
type=
"warn"
mode=
"base"
title=
"提示"
:content=
" warnTip || packageMode[tempPackageIndex].name + '时长不足,是否接受预定?'"
:duration=
"2000"
:before-close=
"true"
@
close=
"onCancleTip"
@
confirm=
"onPackageCheck"
></uni-popup-dialog>
</uni-popup>
</view>
</
template
>
...
...
@@ -497,7 +551,8 @@
dictList
}
from
"@/api/index.js"
;
import
{
getDictItem
,
getSysConfigValue
getDictItem
,
getSysConfigValue
}
from
"@/utils/tools.js"
import
{
getStoreActivity
,
...
...
@@ -514,6 +569,9 @@
orderCancelPay
,
queryCardUse
}
from
"@/api/order"
import
{
rechargeConf
}
from
"@/api/recharge.js"
;
export
default
{
components
:
{
...
...
@@ -530,7 +588,7 @@
images
:
[],
status
:
0
},
userInfo
:
uni
.
getStorageSync
(
"userInfo"
)
||
''
,
userInfo
:
uni
.
getStorageSync
(
"userInfo"
)
||
''
,
startTime
:
moment
().
format
(
"HH:mm"
),
endTime
:
''
,
dateIndex
:
0
,
...
...
@@ -591,7 +649,7 @@
],
durationIndex2
:
[
0
],
hourList2
:
[
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
],
minuteList
:
[
'00'
,
"05"
,
"10"
,
"15"
,
"20"
,
"25"
,
'30'
,
"35"
,
"40"
,
"45"
,
"50"
,
"55"
],
minuteList
:
[
'00'
,
"05"
,
"10"
,
"15"
,
"20"
,
"25"
,
'30'
,
"35"
,
"40"
,
"45"
,
"50"
,
"55"
],
orderTypeEnum
:
{
1
:
"预定"
,
2
:
"续费"
,
...
...
@@ -628,41 +686,43 @@
0
:
"待保洁"
,
1
:
"保洁中"
},
formatAllData
:{
list
:[]
formatAllData
:
{
list
:
[]
},
orderInfo
:{},
tempPackageIndex
:
0
,
orderInfo
:
{},
tempPackageIndex
:
0
,
// 临时存放开始时间 结束时间 时长
tempDateObj
:{},
orderDateDes
:
""
,
orderWeekDes
:
""
,
orderWeeEnum
:{
1
:
"周一"
,
2
:
"周二"
,
3
:
"周三"
,
4
:
"周四"
,
5
:
"周五"
,
6
:
"周六"
,
0
:
"周日"
,
tempDateObj
:
{},
orderDateDes
:
""
,
orderWeekDes
:
""
,
orderWeeEnum
:
{
1
:
"周一"
,
2
:
"周二"
,
3
:
"周三"
,
4
:
"周四"
,
5
:
"周五"
,
6
:
"周六"
,
0
:
"周日"
,
},
allDayUseStatus
:
false
,
// 当日无可预约时段,true 无法预约,false 可预约
tipContent
:
"当前条件下无可预约的时段,请手动选择合适的空闲时段"
,
tipErrMsg
:
''
,
warnTip
:
''
,
activityDate
:{},
storeCleanDuration
:
getSysConfigValue
(
'StoreCleanDuration'
)?
Number
(
getSysConfigValue
(
'StoreCleanDuration'
)):
30
,
radioChecked
:
''
,
monthlyCardList
:[],
secondaryCardList
:[],
secondaryCard
:{
warnTip
:
''
,
activityDate
:
{},
storeCleanDuration
:
getSysConfigValue
(
'StoreCleanDuration'
)
?
Number
(
getSysConfigValue
(
'StoreCleanDuration'
))
:
30
,
radioChecked
:
''
,
monthlyCardList
:
[],
secondaryCardList
:
[],
secondaryCard
:
{
status
:
0
,
number
:
0
,
name
:
'次卡'
name
:
'次卡'
},
submitBtnStatus
:
false
,
submitBtnStatus
:
false
,
showMorePayWay
:
true
,
couponExpireTip
:
false
,
//是否进行优惠券过期提醒
couponExpireTip
:
false
,
//是否进行优惠券过期提醒
rechargeConfList
:
[],
};
},
filters
:
{
...
...
@@ -685,7 +745,7 @@
}
},
onLoad
(
option
)
{
if
(
!
uni
.
getStorageSync
(
'activite'
))
{
if
(
!
uni
.
getStorageSync
(
'activite'
))
{
this
.
$refs
.
popupActivite
.
open
()
}
uni
.
showLoading
({
...
...
@@ -696,7 +756,7 @@
this
.
onGetDicts
();
this
.
id
=
option
.
roomId
;
if
(
option
.
orderNo
)
{
if
(
option
.
modeIndex
)
{
if
(
option
.
modeIndex
)
{
this
.
modeIndex
=
Number
(
option
.
modeIndex
);
}
this
.
orderType
=
2
;
...
...
@@ -710,22 +770,43 @@
this
.
onLoading
()
this
.
distanceIndex
=
0
}
this
.
onGetRechargeConf
();
},
onShow
()
{
if
(
this
.
rechargeConfList
.
length
){
this
.
userInfo
=
uni
.
getStorageSync
(
"userInfo"
)
||
''
;
this
.
onComputePrice
();
}
},
methods
:
{
onShowMorePayWay
(){
onGetRechargeConf
()
{
rechargeConf
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
rows
)
{
this
.
rechargeConfList
=
res
.
data
.
rows
}
})
},
onNavToRecharge
(){
uni
.
switchTab
({
url
:
'/pages/vipCreate/vipCreate'
})
},
onShowMorePayWay
()
{
this
.
showMorePayWay
=
!
this
.
showMorePayWay
},
onActiviteClose
(){
onActiviteClose
()
{
this
.
$refs
.
popupActivite
.
close
();
uni
.
setStorageSync
(
'activite'
,
true
)
uni
.
setStorageSync
(
'activite'
,
true
)
},
onRadioChange
(
e
){
if
(
this
.
radioChecked
===
e
)
{
onRadioChange
(
e
)
{
if
(
this
.
radioChecked
===
e
)
{
this
.
radioChecked
=
''
if
(
this
.
useCouponList
&&
this
.
useCouponList
.
length
)
{
if
(
this
.
useCouponList
&&
this
.
useCouponList
.
length
)
{
this
.
selectCouponIndex
=
0
;
}
}
else
{
}
else
{
this
.
radioChecked
=
e
this
.
selectCouponIndex
=
-
1
;
}
...
...
@@ -733,9 +814,9 @@
},
// 日期切换
onDateChange
(
k
)
{
if
(
this
.
dateIndex
===
k
||
this
.
orderType
==
2
)
return
;
if
(
this
.
dateIndex
===
k
||
this
.
orderType
==
2
)
return
;
this
.
dateIndex
=
k
;
if
(
this
.
modeIndex
<
0
)
{
if
(
this
.
modeIndex
<
0
)
{
this
.
modeIndex
=
0
;
this
.
modeIndex2
=
-
1
;
}
...
...
@@ -743,13 +824,13 @@
this
.
onGetSortDistance
()
},
// 小时标签切换
onChangePackage
(
index
){
if
(
this
.
modeIndex
==
index
||
this
.
allDayUseStatus
)
return
;
onChangePackage
(
index
)
{
if
(
this
.
modeIndex
==
index
||
this
.
allDayUseStatus
)
return
;
let
startDateTime
=
''
if
(
this
.
orderType
==
2
)
{
if
(
this
.
orderType
==
2
)
{
startDateTime
=
this
.
orderInfo
.
endDate
if
(
this
.
orderInfo
.
status
==
2
)
{
if
(
this
.
orderInfo
.
status
==
2
)
{
startDateTime
=
moment
().
format
(
"YYYY-MM-DD HH:mm:00"
)
}
}
...
...
@@ -762,7 +843,7 @@
duration
:
this
.
roomLabelList
[
this
.
modeIndex
].
labelDuration
,
});
},
onPackageCheck
(){
onPackageCheck
()
{
this
.
onCancleTip
();
this
.
modeIndex
=
-
1
this
.
modeIndex2
=
this
.
tempPackageIndex
...
...
@@ -771,29 +852,31 @@
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
this
.
tempDateObj
.
startDate
,
duration
:
this
.
tempDateObj
.
duration
,
durationType
:
this
.
tempDateObj
.
durationType
durationType
:
this
.
tempDateObj
.
durationType
});
},
// 套餐校验,检查当前套餐是否可用
onCheckPackageUse
(
valData
){
onCheckPackageUse
(
valData
)
{
let
useStatus
=
true
;
let
startStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
valData
.
packaStartPeriod
)
>=
10
?
valData
.
packaStartPeriod
:
'0'
+
valData
.
packaStartPeriod
}
:00:00`
let
startStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
valData
.
packaStartPeriod
)
>=
10
?
valData
.
packaStartPeriod
:
'0'
+
valData
.
packaStartPeriod
}
:00:00`
let
startDate
=
moment
(
moment
().
format
(
startStr
)).
format
(
"YYYY-MM-DD HH:00:00"
);
let
endStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
valData
.
packaEndPeriod
)
>=
10
?
valData
.
packaEndPeriod
:
'0'
+
valData
.
packaEndPeriod
}
:00:00`
let
endStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
valData
.
packaEndPeriod
)
>=
10
?
valData
.
packaEndPeriod
:
'0'
+
valData
.
packaEndPeriod
}
:00:00`
let
endDate
=
moment
(
moment
().
format
(
endStr
)).
format
(
"YYYY-MM-DD HH:00:00"
);
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let
pointDateForm
=
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
format
(
"YYYY-MM-DD 11:00:00"
);
let
dateTimeObj
=
{};
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
())
{
if
(
this
.
orderType
==
2
)
{
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
())
{
if
(
this
.
orderType
==
2
)
{
// 1.确定续套餐的结束时间
let
orderEndDate
=
''
if
(
this
.
orderInfo
.
status
==
1
)
{
if
(
this
.
orderInfo
.
status
==
1
)
{
orderEndDate
=
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
}
else
{
}
else
{
orderEndDate
=
moment
().
valueOf
()
}
startDate
=
moment
(
orderEndDate
).
format
(
`YYYY-MM-DD 0
${
valData
.
packaStartPeriod
}
:00:00`
);
...
...
@@ -801,54 +884,60 @@
// 续夜宵套餐时的开始时间必须在设定的开始和结束时间内
let
b1
=
orderEndDate
>=
moment
(
startDate
).
valueOf
()
&&
orderEndDate
<=
moment
(
endDate
).
valueOf
();
// 续夜宵套餐的开始时间必须在设定的开始时间和开始时间四个小时内
let
b2
=
orderEndDate
>=
moment
(
startDate
).
valueOf
()
&&
orderEndDate
<=
moment
(
startDate
).
valueOf
()
+
4
*
60
*
60
*
1000
;
let
b2
=
orderEndDate
>=
moment
(
startDate
).
valueOf
()
&&
orderEndDate
<=
moment
(
startDate
)
.
valueOf
()
+
4
*
60
*
60
*
1000
;
if
(
!
(
b1
&&
b2
)
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
if
(
!
(
b1
&&
b2
)
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
useStatus
=
false
;
}
}
else
{
}
else
{
//通宵套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 实际时长小于原时长的60%则选择明天的时间
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
()
// 实际时间
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
)){
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
// 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if
(
this
.
dateIndex
!=
0
)
{
if
(
this
.
dateIndex
!=
0
)
{
useStatus
=
false
;
return
}
startDate
=
moment
(
startDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
endDate
=
moment
(
endDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
)
startDate
=
moment
(
startDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
endDate
=
moment
(
endDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
)
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 实际时间
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
)){
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
useStatus
=
false
;
return
}
}
}
}
else
{
if
(
this
.
orderType
==
2
){
if
(
!
(
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
>=
moment
(
startDate
).
valueOf
()
&&
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
<=
moment
(
endDate
).
valueOf
())){
if
(
this
.
orderType
==
2
)
{
if
(
!
(
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
>=
moment
(
startDate
).
valueOf
()
&&
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
<=
moment
(
endDate
).
valueOf
()))
{
useStatus
=
false
;
}
return
}
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
// 闲时套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
()
// 实际时间
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
*
0.6
||
this
.
onCheckPackUse
(
startDate
,
endDate
)){
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
if
(
actualTime
<
originTime
*
0.6
||
this
.
onCheckPackUse
(
startDate
,
endDate
))
{
useStatus
=
false
;
return
}
...
...
@@ -856,219 +945,241 @@
return
useStatus
},
// 套餐切换
onChangePackage2
(
index
,
val
)
{
onChangePackage2
(
index
,
val
)
{
if
(
this
.
modeIndex2
==
index
||
!
val
.
show
)
return
;
if
(
this
.
modeIndex2
==
index
||
!
val
.
show
)
return
;
this
.
tempPackageIndex
=
index
;
let
hStartStr
=
this
.
packageMode
[
this
.
tempPackageIndex
].
packaStartPeriod
let
startStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
hStartStr
)
>=
10
?
hStartStr
:
'0'
+
hStartStr
}
:00:00`
let
startStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
hStartStr
)
>=
10
?
hStartStr
:
'0'
+
hStartStr
}
:00:00`
let
startDate
=
moment
(
moment
().
format
(
startStr
)).
format
(
"YYYY-MM-DD HH:00:00"
);
let
hEndtStr
=
this
.
packageMode
[
this
.
tempPackageIndex
].
packaEndPeriod
let
endStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
hEndtStr
)
>=
10
?
hEndtStr
:
'0'
+
hEndtStr
}
:00:00`
let
endStr
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
Number
(
hEndtStr
)
>=
10
?
hEndtStr
:
'0'
+
hEndtStr
}
:00:00`
let
endDate
=
moment
(
moment
().
format
(
endStr
)).
format
(
"YYYY-MM-DD HH:00:00"
);
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let
pointDateForm
=
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
format
(
"YYYY-MM-DD 11:00:00"
);
let
dateTimeObj
=
{};
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
())
{
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
())
{
// 如果是续单
if
(
this
.
orderType
==
2
)
{
if
(
this
.
orderType
==
2
)
{
let
orderEndDate
=
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
)
if
(
this
.
orderInfo
.
status
==
1
)
{
if
(
this
.
orderInfo
.
status
==
1
)
{
orderEndDate
=
this
.
orderInfo
.
endDate
}
startDate
=
moment
(
orderEndDate
).
format
(
`YYYY-MM-DD 0
${
this
.
packageMode
[
this
.
tempPackageIndex
].
packaStartPeriod
}
:00:00`
);
endDate
=
moment
(
orderEndDate
).
format
(
`YYYY-MM-DD 0
${
this
.
packageMode
[
this
.
tempPackageIndex
].
packaEndPeriod
}
:00:00`
);
startDate
=
moment
(
orderEndDate
).
format
(
`YYYY-MM-DD 0
${
this
.
packageMode
[
this
.
tempPackageIndex
].
packaStartPeriod
}
:00:00`
);
endDate
=
moment
(
orderEndDate
).
format
(
`YYYY-MM-DD 0
${
this
.
packageMode
[
this
.
tempPackageIndex
].
packaEndPeriod
}
:00:00`
);
// 续夜宵套餐时的开始时间必须在设定的开始和结束时间内
let
b1
=
moment
(
orderEndDate
).
valueOf
()
>=
moment
(
startDate
).
valueOf
()
&&
moment
(
orderEndDate
).
valueOf
()
<=
moment
(
endDate
).
valueOf
();
let
b1
=
moment
(
orderEndDate
).
valueOf
()
>=
moment
(
startDate
).
valueOf
()
&&
moment
(
orderEndDate
)
.
valueOf
()
<=
moment
(
endDate
).
valueOf
();
if
(
b1
)
{
if
(
b1
)
{
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
>=
3
*
60
*
60
*
1000
&&
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
<
4
*
60
*
60
*
1000
){
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
>=
3
*
60
*
60
*
1000
&&
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
<
4
*
60
*
60
*
1000
)
{
this
.
tempDateObj
=
{
startDate
:
orderEndDate
,
endDate
:
endDate
,
duration
:
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
())
/
60000
,
durationType
:
2
duration
:
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
())
/
60000
,
durationType
:
2
}
this
.
warnTip
=
'通宵套餐,不足4小时,是否预定?'
this
.
$refs
.
popupDialog
.
open
();
return
}
else
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
>
4
*
60
*
60
*
1000
)
{
}
else
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
()
>
4
*
60
*
60
*
1000
)
{
this
.
modeIndex
=
-
1
this
.
modeIndex2
=
index
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
this
.
formatAllData
=
this
.
onTransiteForDate
({
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
orderEndDate
,
endDateTime
:
endDate
,
duration
:
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
())
/
60000
,
durationType
:
2
duration
:
(
moment
(
endDate
).
valueOf
()
-
moment
(
orderEndDate
).
valueOf
())
/
60000
,
durationType
:
2
});
}
else
{
}
else
{
}
}
}
else
{
}
else
{
//否则是订单
// 通宵套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
()
// 实际时间
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
// 原时长是9个小时,减去4个小时, 低于5个小时,则时长不足
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
// 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if
(
this
.
dateIndex
!=
0
)
{
if
(
this
.
dateIndex
!=
0
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
})
}
else
{
startDate
=
moment
(
startDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
endDate
=
moment
(
endDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
}
else
{
startDate
=
moment
(
startDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
endDate
=
moment
(
endDate
).
add
(
1
,
"d"
).
format
(
"YYYY-MM-DD HH:00:00"
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 实际时间
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
)){
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
))
{
uni
.
showToast
({
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
})
return
}
else
if
(
actualTime
<
originTime
-
3
*
60
*
60
*
1000
&&
actualTime
>=
originTime
-
4
*
60
*
60
*
1000
){
}
else
if
(
actualTime
<
originTime
-
3
*
60
*
60
*
1000
&&
actualTime
>=
originTime
-
4
*
60
*
60
*
1000
)
{
this
.
tempDateObj
=
{
startDate
:
dateTimeObj
.
tempStartDate
,
endDate
:
dateTimeObj
.
tempEndDate
,
duration
:
actualTime
/
60000
,
durationType
:
2
duration
:
actualTime
/
60000
,
durationType
:
2
}
this
.
warnTip
=
'通宵套餐,不足4小时,是否预定?'
this
.
$refs
.
popupDialog
.
open
();
return
}
else
{
}
else
{
this
.
modeIndex
=
-
1
this
.
modeIndex2
=
index
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
this
.
formatAllData
=
this
.
onTransiteForDate
({
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
dateTimeObj
.
tempStartDate
,
endDateTime
:
dateTimeObj
.
tempEndDate
,
duration
,
durationType
:
2
durationType
:
2
});
}
}
}
else
if
(
actualTime
<
originTime
-
3
*
60
*
60
*
1000
&&
actualTime
>=
originTime
-
4
*
60
*
60
*
1000
){
}
else
if
(
actualTime
<
originTime
-
3
*
60
*
60
*
1000
&&
actualTime
>=
originTime
-
4
*
60
*
60
*
1000
)
{
this
.
tempDateObj
=
{
startDate
:
dateTimeObj
.
tempStartDate
,
endDate
:
dateTimeObj
.
tempEndDate
,
duration
:
actualTime
/
60000
,
durationType
:
2
duration
:
actualTime
/
60000
,
durationType
:
2
}
this
.
warnTip
=
'通宵套餐,不足4小时,是否预定?'
this
.
$refs
.
popupDialog
.
open
();
return
}
else
{
}
else
{
this
.
modeIndex
=
-
1
this
.
modeIndex2
=
index
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
())
/
1000
/
60
;
this
.
formatAllData
=
this
.
onTransiteForDate
({
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
dateTimeObj
.
tempStartDate
,
endDateTime
:
dateTimeObj
.
tempEndDate
,
duration
,
durationType
:
2
durationType
:
2
});
}
}
}
else
{
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
()
// 实际时间
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
*
0.6
||
this
.
onCheckPackUse
(
startDate
,
endDate
)){
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
()
if
(
actualTime
<
originTime
*
0.6
||
this
.
onCheckPackUse
(
startDate
,
endDate
))
{
uni
.
showToast
({
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
icon
:
"none"
,
title
:
'可使用时长不足,请选择其他日期'
})
return
}
else
if
(
actualTime
<
originTime
*
0.8
&&
actualTime
>=
originTime
*
0.6
)
{
}
else
if
(
actualTime
<
originTime
*
0.8
&&
actualTime
>=
originTime
*
0.6
)
{
this
.
tempDateObj
=
{
startDate
:
dateTimeObj
.
tempStartDate
,
endDate
:
dateTimeObj
.
tempEndDate
,
duration
:
actualTime
/
60000
,
durationType
:
2
duration
:
actualTime
/
60000
,
durationType
:
2
}
this
.
warnTip
=
'闲时套餐,不足4小时,是否预定?'
this
.
$refs
.
popupDialog
.
open
();
return
}
else
{
}
else
{
this
.
modeIndex
=
-
1
this
.
modeIndex2
=
index
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
())
/
1000
/
60
;
let
duration
=
(
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
)
.
valueOf
())
/
1000
/
60
;
this
.
formatAllData
=
this
.
onTransiteForDate
({
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
dateTimeObj
.
tempStartDate
,
endDateTime
:
dateTimeObj
.
tempEndDate
,
duration
,
durationType
:
2
durationType
:
2
});
}
}
},
// 通过指定时间在当前时间段内查询合适的时间段
onComputeStartDateAndEndDate
(
startDate
,
endDate
)
{
onComputeStartDateAndEndDate
(
startDate
,
endDate
)
{
//重新设置开始时间和结束时间
let
tempStartDate
=
''
;
let
tempEndDate
=
''
;
let
startNeedChange
=
true
;
let
endNeedChange
=
true
;
this
.
dateIntervalList
.
forEach
(
item
=>
{
this
.
dateIntervalList
.
forEach
(
item
=>
{
// 检查时段在开始时间和结束时间内
let
start
=
moment
(
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)).
valueOf
()
let
end
=
moment
(
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:59:59"
)).
valueOf
()
if
(
start
<
moment
(
endDate
).
valueOf
()
&&
start
>=
moment
(
startDate
).
valueOf
())
{
if
(
start
<
moment
(
endDate
).
valueOf
()
&&
start
>=
moment
(
startDate
).
valueOf
())
{
if
(
tempStartDate
&&
!
startNeedChange
)
{
if
(
item
.
status
==
0
&&
endNeedChange
)
{
if
(
tempStartDate
&&
!
startNeedChange
)
{
if
(
item
.
status
==
0
&&
endNeedChange
)
{
endNeedChange
=
true
;
tempEndDate
=
moment
(
item
.
timeHour
+
':59:00'
).
add
(
1
,
"m"
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
item
.
status
==
1
&&
endNeedChange
){
tempEndDate
=
moment
(
item
.
timeHour
+
':59:00'
).
add
(
1
,
"m"
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
item
.
status
==
1
&&
endNeedChange
)
{
endNeedChange
=
false
;
tempEndDate
=
moment
(
item
.
startHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
}
else
{
if
(
item
.
status
==
0
&&
startNeedChange
)
{
}
else
{
if
(
item
.
status
==
0
&&
startNeedChange
)
{
tempStartDate
=
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)
startNeedChange
=
false
;
}
else
if
(
item
.
status
==
1
&&
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)
&&
startNeedChange
){
}
else
if
(
item
.
status
==
1
&&
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)
&&
startNeedChange
)
{
startNeedChange
=
true
;
tempStartDate
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)).
format
(
"YYYY-MM-DD HH:mm:00"
)
tempEndDate
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
item
.
status
==
1
&&
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)
&&
startNeedChange
){
tempStartDate
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
))
.
format
(
"YYYY-MM-DD HH:mm:00"
)
tempEndDate
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
item
.
status
==
1
&&
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)
&&
startNeedChange
)
{
startNeedChange
=
false
;
let
tempStart
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)).
format
(
"YYYY-MM-DD HH:mm:00"
)
tempStartDate
=
this
.
orderType
==
1
?
moment
(
tempStart
).
add
(
1
,
'm'
)
:
tempStart
let
tempStart
=
moment
(
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
))
.
format
(
"YYYY-MM-DD HH:mm:00"
)
tempStartDate
=
this
.
orderType
==
1
?
moment
(
tempStart
).
add
(
1
,
'm'
)
:
tempStart
}
}
}
...
...
@@ -1080,67 +1191,71 @@
}
},
// 通过指定时长在当前时间段内查询合适的时间段
onComputeByDuration
(
duration
,
durationType
=
1
)
{
onComputeByDuration
(
duration
,
durationType
=
1
)
{
//重新设置开始时间和结束时间
let
m
=
Number
(
duration
)
*
60
;
let
m
=
Number
(
duration
)
*
60
;
if
(
durationType
===
2
)
{
m
=
Number
(
duration
)
}
// 把时长计算成毫秒数
let
timeStampLong
=
m
*
60
*
1000
;
let
timeStampLong
=
m
*
60
*
1000
;
let
tempStartDate
=
''
;
let
tempEndDate
=
''
;
let
startNeedChange
=
true
;
let
endNeedChange
=
true
;
this
.
dateIntervalList
.
forEach
((
item
,
k
)
=>
{
this
.
dateIntervalList
.
forEach
((
item
,
k
)
=>
{
if
(
k
<
24
){
if
(
item
.
status
==
1
&&
startNeedChange
&&
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)){
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
if
(
k
<
24
)
{
if
(
item
.
status
==
1
&&
startNeedChange
&&
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
startNeedChange
=
true
endNeedChange
=
true
;
}
if
(
item
.
status
==
1
&&
startNeedChange
&&
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)){
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
if
(
item
.
status
==
1
&&
startNeedChange
&&
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
startNeedChange
=
false
endNeedChange
=
true
;
}
if
(
item
.
status
==
0
&&
startNeedChange
)
{
if
(
item
.
status
==
0
&&
startNeedChange
)
{
tempStartDate
=
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)
startNeedChange
=
false
endNeedChange
=
true
;
}
}
if
(
item
.
status
==
1
&&
endNeedChange
&&
tempStartDate
)
{
if
(
item
.
status
==
1
&&
endNeedChange
&&
tempStartDate
)
{
let
endDate
=
moment
(
item
.
startHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)
if
(
moment
(
endDate
).
valueOf
()
>=
moment
(
tempStartDate
).
valueOf
())
{
if
(
moment
(
endDate
).
valueOf
()
>=
moment
(
tempStartDate
).
valueOf
())
{
tempEndDate
=
endDate
if
(
moment
(
tempEndDate
).
valueOf
()
-
moment
(
tempStartDate
).
valueOf
()
>=
timeStampLong
)
{
if
(
moment
(
tempEndDate
).
valueOf
()
-
moment
(
tempStartDate
).
valueOf
()
>=
timeStampLong
)
{
startNeedChange
=
false
;
endNeedChange
=
false
;
}
else
{
if
(
k
<
24
){
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
{
if
(
k
<
24
)
{
tempStartDate
=
moment
(
item
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
startNeedChange
=
true
;
}
else
{
}
else
{
startNeedChange
=
false
;
}
endNeedChange
=
false
;
}
}
}
else
if
(
item
.
status
==
0
&&
endNeedChange
&&
tempStartDate
)
{
}
else
if
(
item
.
status
==
0
&&
endNeedChange
&&
tempStartDate
)
{
let
endDate
=
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:59:00"
)
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
tempStartDate
).
valueOf
()
>=
timeStampLong
)
{
if
(
moment
(
endDate
).
valueOf
()
-
moment
(
tempStartDate
).
valueOf
()
>=
timeStampLong
)
{
endNeedChange
=
false
;
tempEndDate
=
moment
(
moment
(
tempStartDate
).
valueOf
()
+
timeStampLong
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
{
tempEndDate
=
moment
(
moment
(
tempStartDate
).
valueOf
()
+
timeStampLong
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
{
endNeedChange
=
true
;
}
}
...
...
@@ -1148,12 +1263,12 @@
let
params
=
{
startDateTime
:
tempStartDate
,
startDateTime
:
tempStartDate
,
endDateTime
:
tempEndDate
,
useStatus
:
moment
(
tempEndDate
).
valueOf
()
-
moment
(
tempStartDate
).
valueOf
()
<
timeStampLong
}
if
(
this
.
modeIndex
==
0
&&
params
.
useStatus
)
{
if
(
this
.
modeIndex
==
0
&&
params
.
useStatus
)
{
// 当前日期,全天可用状态 true 不可用,false 还有可用时段;
this
.
allDayUseStatus
=
true
;
this
.
tipErrMsg
=
"当前日期,空闲时间不足,请选择其他日期"
...
...
@@ -1225,21 +1340,21 @@
}
})
},
onGetStoreActivity
(){
onGetStoreActivity
()
{
getStoreActivity
({
storeId
:
this
.
id
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
let
obj
=
res
.
data
.
data
||
{}
for
(
let
key
in
obj
)
{
for
(
let
key
in
obj
)
{
let
key2
=
moment
(
key
).
format
(
"YYYY-MM-DD"
)
if
(
obj
[
key
]
&&
obj
[
key
].
length
)
{
if
(
obj
[
key
]
&&
obj
[
key
].
length
)
{
this
.
activityDate
[
key2
]
=
{
labelIds
:
obj
[
key
].
filter
(
item
=>
item
.
labelId
).
map
(
val
=>
val
.
labelId
),
packIds
:
obj
[
key
].
filter
(
item
=>
item
.
packId
).
map
(
val
=>
val
.
packId
),
labelIds
:
obj
[
key
].
filter
(
item
=>
item
.
labelId
).
map
(
val
=>
val
.
labelId
),
packIds
:
obj
[
key
].
filter
(
item
=>
item
.
packId
).
map
(
val
=>
val
.
packId
),
}
}
else
{
}
else
{
this
.
activityDate
[
key2
]
=
false
}
...
...
@@ -1285,13 +1400,13 @@
roomId
:
this
.
roomInfo
.
id
,
day
:
this
.
dateList
[
this
.
dateIndex
].
readDate
,
orderType
:
this
.
orderType
,
orderId
:
this
.
orderType
==
2
?
this
.
orderInfo
.
id
:
""
orderId
:
this
.
orderType
==
2
?
this
.
orderInfo
.
id
:
""
}).
then
(
res
=>
{
uni
.
hideLoading
()
this
.
dateIntervalList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
status
=
item
.
status
;
if
(
status
==
1
)
{
if
(
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
if
(
status
==
1
)
{
if
(
!
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
status
=
0
}
}
...
...
@@ -1302,7 +1417,7 @@
}
})
this
.
packageMode
=
this
.
packList
.
map
(
item
=>
{
this
.
packageMode
=
this
.
packList
.
map
(
item
=>
{
return
{
...
item
,
show
:
this
.
onCheckPackageUse
(
item
)
...
...
@@ -1310,9 +1425,9 @@
})
let
startDateTime
=
''
if
(
this
.
orderType
==
2
)
{
if
(
this
.
orderType
==
2
)
{
startDateTime
=
this
.
orderInfo
.
endDate
if
(
this
.
orderInfo
.
status
==
2
)
{
if
(
this
.
orderInfo
.
status
==
2
)
{
startDateTime
=
moment
().
format
(
"YYYY-MM-DD HH:mm:00"
)
}
}
...
...
@@ -1331,26 +1446,30 @@
preStartDate
:
p
!=
null
?
p
.
startDateTime
:
this
.
formatAllData
.
startDateTime
,
preEndDate
:
p
!=
null
?
p
.
endDateTime
:
this
.
formatAllData
.
endDateTime
,
orderType
:
this
.
orderType
,
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)?
1
:
0
,
packageId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)
?
1
:
0
,
packageId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
}).
then
(
res
=>
{
this
.
couponExpireTip
=
false
;
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
data
.
length
)
{
this
.
useCouponList
=
res
.
data
.
data
;
this
.
useCouponList
=
res
.
data
.
data
;
let
i
=
this
.
useCouponList
.
findIndex
(
item
=>
{
if
(
item
.
isAvailable
===
0
){
if
(
moment
(
item
.
endDate
).
valueOf
()
-
moment
().
valueOf
()
<
7
*
24
*
3600
*
1000
){
if
(
item
.
isAvailable
===
0
)
{
if
(
moment
(
item
.
endDate
).
valueOf
()
-
moment
().
valueOf
()
<
7
*
24
*
3600
*
1000
)
{
this
.
couponExpireTip
=
true
}
}
return
item
.
isAvailable
===
0
return
item
.
isAvailable
===
0
})
this
.
selectCouponIndex
=
i
>=
0
?
i
:
-
1
;
}
else
{
this
.
selectCouponIndex
=
i
>=
0
?
i
:
-
1
;
}
else
{
this
.
selectCouponIndex
=
-
1
;
}
this
.
onQueryCardUse
();
...
...
@@ -1367,7 +1486,8 @@
events
:
{
getSelectData
(
data
)
{
if
(
data
.
couponId
&&
that
.
useCouponList
.
length
)
{
that
.
selectCouponIndex
=
that
.
useCouponList
.
findIndex
(
item
=>
item
.
id
===
data
.
couponId
);
that
.
selectCouponIndex
=
that
.
useCouponList
.
findIndex
(
item
=>
item
.
id
===
data
.
couponId
);
that
.
radioChecked
=
''
}
else
{
that
.
selectCouponIndex
=
-
1
...
...
@@ -1380,71 +1500,85 @@
orderType
:
that
.
orderType
,
storeId
:
that
.
roomInfo
.
storeId
,
roomId
:
that
.
roomInfo
.
id
,
orderMode
:
that
.
modeIndex2
>=
0
||
(
that
.
modeIndex
>=
0
&&
that
.
roomLabelList
.
length
&&
that
.
roomLabelList
[
that
.
modeIndex
].
openPack
==
1
)?
1
:
0
,
orderMode
:
that
.
modeIndex2
>=
0
||
(
that
.
modeIndex
>=
0
&&
that
.
roomLabelList
.
length
&&
that
.
roomLabelList
[
that
.
modeIndex
]
.
openPack
==
1
)
?
1
:
0
,
preStartDate
:
that
.
formatAllData
.
startDateTime
,
preEndDate
:
that
.
formatAllData
.
endDateTime
,
packageId
:
that
.
modeIndex2
>=
0
?
that
.
packageMode
[
that
.
modeIndex2
].
id
:
that
.
modeIndex
>=
0
&&
that
.
roomLabelList
.
length
&&
that
.
roomLabelList
[
that
.
modeIndex
].
openPack
==
1
?
that
.
roomLabelList
[
that
.
modeIndex
].
packId
:
''
,
roomLabelId
:
that
.
modeIndex
>=
0
?
that
.
roomLabelList
[
that
.
modeIndex
].
id
:
''
,
selectId
:
that
.
selectCouponIndex
>=
0
&&
that
.
useCouponList
.
length
?
that
.
useCouponList
[
that
.
selectCouponIndex
].
id
:
''
packageId
:
that
.
modeIndex2
>=
0
?
that
.
packageMode
[
that
.
modeIndex2
].
id
:
that
.
modeIndex
>=
0
&&
that
.
roomLabelList
.
length
&&
that
.
roomLabelList
[
that
.
modeIndex
].
openPack
==
1
?
that
.
roomLabelList
[
that
.
modeIndex
]
.
packId
:
''
,
roomLabelId
:
that
.
modeIndex
>=
0
?
that
.
roomLabelList
[
that
.
modeIndex
].
id
:
''
,
selectId
:
that
.
selectCouponIndex
>=
0
&&
that
.
useCouponList
.
length
?
that
.
useCouponList
[
that
.
selectCouponIndex
].
id
:
''
})
}
})
}
},
onQueryCardUse
(){
if
(
this
.
userInfo
&&
(
this
.
userInfo
.
monthlyCardList
||
this
.
userInfo
.
secondaryCardList
))
{
onQueryCardUse
()
{
if
(
this
.
userInfo
&&
(
this
.
userInfo
.
monthlyCardList
||
this
.
userInfo
.
secondaryCardList
))
{
let
params
=
{
storeId
:
this
.
roomInfo
.
storeId
,
roomId
:
this
.
roomInfo
.
id
,
orderType
:
this
.
orderType
,
preStartDate
:
this
.
formatAllData
.
startDateTime
,
preEndDate
:
this
.
formatAllData
.
endDateTime
,
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)?
1
:
0
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
,
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)
?
1
:
0
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
,
}
queryCardUse
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerMonthlyCard
&&
res
.
data
.
data
.
consumerMonthlyCard
.
length
){
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerMonthlyCard
&&
res
.
data
.
data
.
consumerMonthlyCard
.
length
)
{
this
.
radioChecked
=
"monthlyCard"
;
this
.
selectCouponIndex
=
-
1
;
}
else
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerSecondaryCard
&&
res
.
data
.
data
.
consumerSecondaryCard
.
length
){
}
else
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerSecondaryCard
&&
res
.
data
.
data
.
consumerSecondaryCard
.
length
)
{
this
.
radioChecked
=
"secondaryCard"
;
this
.
selectCouponIndex
=
-
1
;
}
else
{
}
else
{
this
.
radioChecked
=
""
}
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerMonthlyCard
&&
res
.
data
.
data
.
consumerMonthlyCard
.
length
){
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
consumerMonthlyCard
&&
res
.
data
.
data
.
consumerMonthlyCard
.
length
)
{
this
.
monthlyCardList
=
res
.
data
.
data
.
consumerMonthlyCard
}
else
{
}
else
{
this
.
monthlyCardList
=
[];
}
if
(
this
.
userInfo
.
secondaryCardList
&&
res
.
data
.
data
&&
res
.
data
.
data
.
consumerSecondaryCard
&&
res
.
data
.
data
.
consumerSecondaryCard
.
length
){
if
(
this
.
userInfo
.
secondaryCardList
&&
res
.
data
.
data
&&
res
.
data
.
data
.
consumerSecondaryCard
&&
res
.
data
.
data
.
consumerSecondaryCard
.
length
)
{
this
.
secondaryCardList
=
res
.
data
.
data
.
consumerSecondaryCard
if
(
this
.
secondaryCardList
&&
this
.
secondaryCardList
.
length
)
{
if
(
this
.
secondaryCardList
&&
this
.
secondaryCardList
.
length
)
{
this
.
secondaryCard
.
status
=
1
;
let
num
=
0
;
this
.
secondaryCardList
.
forEach
(
val
=>
{
num
+=
val
.
number
;
num
+=
val
.
number
;
this
.
secondaryCard
.
name
=
val
.
confName
;
})
this
.
secondaryCard
.
number
=
num
;
}
}
else
{
}
else
{
this
.
secondaryCardList
=
[];
}
this
.
onComputePrice
();
}
})
}
else
{
}
else
{
this
.
onComputePrice
();
}
},
...
...
@@ -1454,18 +1588,22 @@
storeId
:
this
.
roomInfo
.
storeId
,
roomId
:
this
.
roomInfo
.
id
,
buyType
:
this
.
orderTypeList
[
this
.
index
].
type
,
couponId
:
this
.
useCouponList
.
length
&&
this
.
selectCouponIndex
>=
0
&&
!
this
.
radioChecked
?
this
.
useCouponList
[
this
.
selectCouponIndex
].
id
:
''
,
couponId
:
this
.
useCouponList
.
length
&&
this
.
selectCouponIndex
>=
0
&&
!
this
.
radioChecked
?
this
.
useCouponList
[
this
.
selectCouponIndex
].
id
:
''
,
orderType
:
this
.
orderType
,
preStartDate
:
this
.
formatAllData
.
startDateTime
,
preStartDate
:
this
.
formatAllData
.
startDateTime
,
preEndDate
:
this
.
formatAllData
.
endDateTime
,
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)?
1
:
0
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
orderMode
:
this
.
modeIndex2
>=
0
||
(
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
)
?
1
:
0
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
}
if
(
this
.
radioChecked
==
"secondaryCard"
&&
this
.
secondaryCardList
.
length
)
{
if
(
this
.
radioChecked
==
"secondaryCard"
&&
this
.
secondaryCardList
.
length
)
{
params
.
secondaryCardId
=
this
.
secondaryCardList
[
0
].
id
}
else
if
(
this
.
radioChecked
==
"monthlyCard"
&&
this
.
monthlyCardList
.
length
)
{
}
else
if
(
this
.
radioChecked
==
"monthlyCard"
&&
this
.
monthlyCardList
.
length
)
{
params
.
monthlyCardId
=
this
.
monthlyCardList
[
0
].
id
}
...
...
@@ -1475,9 +1613,9 @@
let
obj
=
res
.
data
.
data
let
discountText
=
obj
.
discount
;
if
(
obj
.
discount
>
0
&&
obj
.
discount
<
100
)
{
if
(
obj
.
discount
>
0
&&
obj
.
discount
<
100
)
{
discountText
=
Number
(
obj
.
discount
.
toString
().
split
(
''
).
reverse
().
join
(
''
)).
toString
();
if
(
discountText
.
length
==
2
)
{
if
(
discountText
.
length
==
2
)
{
discountText
=
obj
.
discount
;
}
}
...
...
@@ -1506,7 +1644,7 @@
},
// 开始选择时间
onSelectDate
()
{
if
(
this
.
orderType
==
1
&&
this
.
modeIndex
>=
0
&&
!
this
.
allDayUseStatus
)
{
if
(
this
.
orderType
==
1
&&
this
.
modeIndex
>=
0
&&
!
this
.
allDayUseStatus
)
{
this
.
hourList
=
[
"00"
,
"01"
,
...
...
@@ -1539,11 +1677,11 @@
this
.
hourList
=
this
.
hourList
.
filter
(
item
=>
Number
(
item
)
>=
Number
(
h
));
}
this
.
checkedDateList
=
this
.
formatAllData
.
startTime
.
split
(
":"
).
map
((
item
,
index
)
=>
{
this
.
checkedDateList
=
this
.
formatAllData
.
startTime
.
split
(
":"
).
map
((
item
,
index
)
=>
{
let
n
=
0
if
(
index
==
0
)
{
if
(
index
==
0
)
{
n
=
this
.
hourList
.
findIndex
(
val
=>
Number
(
val
)
==
Number
(
item
))
}
else
if
(
index
==
1
&&
Number
(
item
)
%
5
==
0
)
{
}
else
if
(
index
==
1
&&
Number
(
item
)
%
5
==
0
)
{
n
=
this
.
minuteList
.
findIndex
(
val
=>
Number
(
val
)
==
Number
(
item
))
}
return
n
...
...
@@ -1565,7 +1703,7 @@
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
,
duration
:
this
.
roomLabelList
[
this
.
modeIndex
].
labelDuration
},
false
);
},
false
);
this
.
$forceUpdate
();
this
.
onHideModal
();
},
...
...
@@ -1598,18 +1736,39 @@
this
.
submitBtnStatus
=
false
},
onOrderConfirmBefore
()
{
if
(
this
.
formatAllData
.
useStatus
)
{
if
(
this
.
formatAllData
.
useStatus
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"所选时段有被占用,请选择其他空闲时段"
icon
:
"none"
,
title
:
"所选时段有被占用,请选择其他空闲时段"
})
return
;
}
if
(
this
.
submitBtnStatus
)
return
if
(
this
.
submitBtnStatus
)
return
this
.
submitBtnStatus
=
true
;
if
(
this
.
orderType
===
1
&&
!
uni
.
getStorageSync
(
'rechargeTip'
))
{
this
.
$refs
.
popupRecharge
.
open
();
return
}
wx
.
requestSubscribeMessage
({
tmplIds
:
[
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg'
,
],
success
:
(
res
)
=>
{
},
complete
:
(
res
)
=>
{
this
.
onOrderConfirm
();
}
})
},
onNavToCreateOrder
(){
this
.
$refs
.
popupRecharge
.
close
();
uni
.
setStorageSync
(
'rechargeTip'
,
true
)
wx
.
requestSubscribeMessage
({
tmplIds
:
[
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg'
,
...
...
@@ -1641,7 +1800,7 @@
let
nowDate
=
moment
().
valueOf
();
let
setDate
=
moment
(
this
.
formatAllData
.
startDateTime
).
valueOf
();
// 如果当前时间大于开始时间,则不允许下单
if
(
this
.
orderType
==
1
&&
nowDate
>
setDate
)
{
if
(
this
.
orderType
==
1
&&
nowDate
>
setDate
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"当前时间晚于预约开始时间,请重新选择预约时间"
...
...
@@ -1690,18 +1849,23 @@
orderType
:
this
.
orderType
,
buyType
:
this
.
orderTypeList
[
this
.
index
].
type
,
payType
:
1
,
couponId
:
this
.
useCouponList
.
length
&&
this
.
selectCouponIndex
>=
0
?
this
.
useCouponList
[
this
.
selectCouponIndex
].
id
:
''
,
couponId
:
this
.
useCouponList
.
length
&&
this
.
selectCouponIndex
>=
0
?
this
.
useCouponList
[
this
.
selectCouponIndex
].
id
:
''
,
preStartDate
:
this
.
formatAllData
.
startDateTime
,
preEndDate
:
this
.
formatAllData
.
endDateTime
,
totalFee
:
this
.
computePriceInfo
.
totalFee
||
0
,
payFee
:
this
.
computePriceInfo
.
payFee
||
0
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
packId
:
this
.
modeIndex2
>=
0
?
this
.
packageMode
[
this
.
modeIndex2
].
id
:
this
.
modeIndex
>=
0
&&
this
.
roomLabelList
.
length
&&
this
.
roomLabelList
[
this
.
modeIndex
].
openPack
==
1
?
this
.
roomLabelList
[
this
.
modeIndex
].
packId
:
''
,
roomLabelId
:
this
.
modeIndex
>=
0
?
this
.
roomLabelList
[
this
.
modeIndex
].
id
:
''
,
discountRatio
:
this
.
computePriceInfo
.
discountRatio
,
balance
:
this
.
computePriceInfo
.
balance
,
duration
:
this
.
computePriceInfo
.
duration
,
secondaryCardId
:
this
.
userInfo
&&
this
.
userInfo
.
secondaryCardList
&&
this
.
secondaryCardList
.
length
&&
this
.
radioChecked
===
'secondaryCard'
?
this
.
secondaryCardList
[
0
].
id
:
''
,
monthlyCardId
:
this
.
userInfo
&&
this
.
userInfo
.
monthlyCardList
&&
this
.
monthlyCardList
.
length
&&
this
.
radioChecked
===
'monthlyCard'
?
this
.
monthlyCardList
[
0
].
id
:
''
secondaryCardId
:
this
.
userInfo
&&
this
.
userInfo
.
secondaryCardList
&&
this
.
secondaryCardList
.
length
&&
this
.
radioChecked
===
'secondaryCard'
?
this
.
secondaryCardList
[
0
].
id
:
''
,
monthlyCardId
:
this
.
userInfo
&&
this
.
userInfo
.
monthlyCardList
&&
this
.
monthlyCardList
.
length
&&
this
.
radioChecked
===
'monthlyCard'
?
this
.
monthlyCardList
[
0
].
id
:
''
}
if
(
this
.
orderType
===
2
&&
this
.
preOrderNo
)
{
params
.
preOrderNo
=
this
.
preOrderNo
...
...
@@ -1801,7 +1965,7 @@
})
},
onSelectDatePoint
(
val
,
i
)
{
if
(
this
.
orderType
==
2
||
this
.
modeIndex2
>=
0
||
this
.
allDayUseStatus
)
return
;
if
(
this
.
orderType
==
2
||
this
.
modeIndex2
>=
0
||
this
.
allDayUseStatus
)
return
;
if
(
i
>=
24
)
{
uni
.
showToast
({
icon
:
"none"
,
...
...
@@ -1810,10 +1974,10 @@
return
}
let
startDate
=
""
;
if
(
val
.
endHoldTime
&&
this
.
onCheckHourUse
(
val
.
startHoldTime
,
val
.
endHoldTime
))
{
if
(
val
.
endHoldTime
&&
this
.
onCheckHourUse
(
val
.
startHoldTime
,
val
.
endHoldTime
))
{
startDate
=
moment
(
val
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
val
.
endHoldTime
&&
!
this
.
onCheckHourUse
(
val
.
startHoldTime
,
val
.
endHoldTime
))
{
startDate
=
moment
(
val
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
if
(
val
.
endHoldTime
&&
!
this
.
onCheckHourUse
(
val
.
startHoldTime
,
val
.
endHoldTime
))
{
startDate
=
moment
(
val
.
endHoldTime
).
add
(
1
,
'm'
).
format
(
"YYYY-MM-DD HH:mm:00"
)
}
else
{
startDate
=
moment
(
val
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)
}
...
...
@@ -1821,59 +1985,65 @@
this
.
formatAllData
=
this
.
onTransiteForDate
({
list
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
)),
startDateTime
:
startDate
,
duration
:
this
.
formatAllData
.
duration
,
durationType
:
2
},
false
);
duration
:
this
.
formatAllData
.
duration
,
durationType
:
2
},
false
);
this
.
$forceUpdate
();
},
// 通过开始时间和时长计算时段有无占用
onUseByStartAndDuration
(
startDate
,
duration
,
durationType
=
1
)
{
onUseByStartAndDuration
(
startDate
,
duration
,
durationType
=
1
)
{
let
useStatus
=
false
;
let
m
=
Number
(
duration
)
*
60
;
let
m
=
Number
(
duration
)
*
60
;
if
(
durationType
===
2
)
{
m
=
Number
(
duration
)
}
let
stempLong
=
m
*
60000
;
let
stempLong
=
m
*
60000
;
let
startStemp
=
moment
(
startDate
).
valueOf
();
let
endStemp
=
startStemp
+
stempLong
;
if
(
this
.
orderType
==
2
)
{
endStemp
=
endStemp
+
this
.
storeCleanDuration
*
60
*
1000
if
(
this
.
orderType
==
2
)
{
endStemp
=
endStemp
+
this
.
storeCleanDuration
*
60
*
1000
}
let
nextStatus
=
false
;
this
.
dateIntervalList
.
forEach
((
item
,
k
)
=>
{
if
(
nextStatus
)
return
;
let
start
=
moment
(
item
.
timeHour
+
':00:00'
).
valueOf
();
let
end
=
moment
(
item
.
timeHour
+
':59:59'
).
valueOf
();
if
(
end
>
startStemp
&&
start
<
endStemp
)
{
if
(
item
.
status
==
1
)
{
if
(
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
this
.
dateIntervalList
.
forEach
((
item
,
k
)
=>
{
if
(
nextStatus
)
return
;
let
start
=
moment
(
item
.
timeHour
+
':00:00'
).
valueOf
();
let
end
=
moment
(
item
.
timeHour
+
':59:59'
).
valueOf
();
if
(
end
>
startStemp
&&
start
<
endStemp
)
{
if
(
item
.
status
==
1
)
{
if
(
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
))
{
useStatus
=
true
;
nextStatus
=
true
;
}
else
{
if
(
this
.
orderType
==
1
){
if
(
startStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
}
else
{
if
(
this
.
orderType
==
1
)
{
if
(
startStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
}
else
if
(
endStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
}
else
if
(
endStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
}
else
if
(
startStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()){
}
else
if
(
startStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
}
}
else
if
(
this
.
orderType
==
2
){
if
(
startStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
}
else
if
(
this
.
orderType
==
2
)
{
if
(
startStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
}
else
if
(
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()){
}
else
if
(
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
}
else
if
(
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
}
else
if
(
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
())
{
useStatus
=
true
;
nextStatus
=
true
;
...
...
@@ -1899,32 +2069,32 @@
//startTime(HH:mm): 开始时间,显示使用
//endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟
onTransiteForDate
(
params
,
dayChange
=
true
)
{
onTransiteForDate
(
params
,
dayChange
=
true
)
{
// 计算出时长,使用分钟计算
if
(
!
params
.
duration
)
{
if
(
!
params
.
duration
)
{
return
{
errMsg
:
"选择时长错误"
errMsg
:
"选择时长错误"
}
}
let
m
=
Number
(
params
.
duration
)
*
60
;
let
m
=
Number
(
params
.
duration
)
*
60
;
if
(
params
.
durationType
===
2
)
{
m
=
Number
(
params
.
duration
)
}
let
startStamp
=
moment
().
valueOf
();
let
endStamp
=
moment
().
valueOf
()
+
m
*
60000
;
let
endStamp
=
moment
().
valueOf
()
+
m
*
60000
;
let
dateObj
=
{
useStatus
:
false
};
this
.
tipErrMsg
=
""
;
if
(
params
.
startDateTime
)
{
if
(
params
.
startDateTime
)
{
// 开始和结束时间的毫秒数
startStamp
=
moment
(
params
.
startDateTime
).
valueOf
();
endStamp
=
startStamp
+
m
*
60000
;
dateObj
.
useStatus
=
this
.
onUseByStartAndDuration
(
params
.
startDateTime
,
m
,
2
)
endStamp
=
startStamp
+
m
*
60000
;
dateObj
.
useStatus
=
this
.
onUseByStartAndDuration
(
params
.
startDateTime
,
m
,
2
)
}
else
if
(
params
.
duration
)
{
dateObj
=
this
.
onComputeByDuration
(
m
,
2
);
}
else
if
(
params
.
duration
)
{
dateObj
=
this
.
onComputeByDuration
(
m
,
2
);
startStamp
=
moment
(
dateObj
.
startDateTime
).
valueOf
();
endStamp
=
moment
(
dateObj
.
endDateTime
).
valueOf
();
}
...
...
@@ -1934,11 +2104,11 @@
let
startH
=
moment
(
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)).
valueOf
();
let
endH
=
moment
(
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:59:59"
)).
valueOf
();
if
(
endH
>=
startStamp
&&
endH
<
endStamp
)
{
if
(
endH
>=
startStamp
&&
endH
<
endStamp
)
{
item
.
status
=
2
}
if
(
this
.
orderType
==
2
&&
startStamp
>=
startH
&&
endStamp
<=
endH
)
{
if
(
this
.
orderType
==
2
&&
startStamp
>=
startH
&&
endStamp
<=
endH
)
{
item
.
status
=
2
}
...
...
@@ -1946,59 +2116,59 @@
return
item
})
if
(
dateObj
.
useStatus
)
{
if
(
dateObj
.
useStatus
)
{
this
.
$refs
.
popupMessage
.
open
();
}
let
paramsData
=
{
list
:
dateObj
.
useStatus
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
))
:
list
,
list
:
dateObj
.
useStatus
?
JSON
.
parse
(
JSON
.
stringify
(
this
.
dateIntervalList
))
:
list
,
startDateTime
:
moment
(
startStamp
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
startTime
:
moment
(
startStamp
).
format
(
"HH:mm"
),
endDateTime
:
moment
(
endStamp
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
endTime
:
moment
(
endStamp
).
format
(
"HH:mm"
),
duration
:
m
,
useStatus
:
dateObj
.
useStatus
,
useStatus
:
dateObj
.
useStatus
,
durationType
:
2
,
}
if
(
dayChange
)
{
if
(
dayChange
)
{
// 获取用户可用优化券
this
.
onGetUseCoupon
(
paramsData
)
}
return
paramsData
},
onCancleTip
(){
onCancleTip
()
{
this
.
$refs
.
popupMessage
.
close
();
this
.
$refs
.
popupDialog
.
close
();
},
// 检查当前小时段是否被全部占用 true 完全占用 false 部分占用
onCheckHourUse
(
startDate
,
endDate
)
{
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
onCheckHourUse
(
startDate
,
endDate
)
{
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
return
timeStamp
>=
3599000
},
//检查套餐后半段60%的时间内是否有被占用,有被占用,则无法预定,d为小时
onCheckPackUse
(
startDate
,
endDate
,
d
=
0
)
{
onCheckPackUse
(
startDate
,
endDate
,
d
=
0
)
{
let
useStatus
=
false
;
let
startStemp
=
moment
(
startDate
).
valueOf
();
let
endStemp
=
moment
(
endDate
).
valueOf
();
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
if
(
d
)
{
startStemp
=
startStemp
+
d
*
3600
*
1000
;
}
else
{
startStemp
=
startStemp
+
timeStamp
*
0.4
;
if
(
d
)
{
startStemp
=
startStemp
+
d
*
3600
*
1000
;
}
else
{
startStemp
=
startStemp
+
timeStamp
*
0.4
;
}
this
.
dateIntervalList
.
forEach
(
item
=>
{
this
.
dateIntervalList
.
forEach
(
item
=>
{
let
start
=
moment
(
item
.
timeHour
+
':00:00'
).
valueOf
();
let
end
=
moment
(
item
.
timeHour
+
':59:59'
).
valueOf
();
let
start
=
moment
(
item
.
timeHour
+
':00:00'
).
valueOf
();
let
end
=
moment
(
item
.
timeHour
+
':59:59'
).
valueOf
();
if
(
end
>
startStemp
&&
start
<
endStemp
)
{
if
(
item
.
status
==
1
)
{
if
(
end
>
startStemp
&&
start
<
endStemp
)
{
if
(
item
.
status
==
1
)
{
useStatus
=
true
;
}
}
...
...
@@ -2197,22 +2367,26 @@
.text-first
{
letter-spacing
:
4
upx
;
}
.relative
{
.absolute-right{
.relative
{
.absolute-right
{
position
:
absolute
;
top
:
-12
upx
;
right
:
-16
upx
;
image{
image
{
width
:
32
upx
;
max-height
:
30
upx
;
}
}
}
.absolute-right
{
.absolute-right
{
position
:
absolute
;
top
:
-8
upx
;
right
:
-4
upx
;
image{
image
{
width
:
38
upx
;
max-height
:
34
upx
;
}
...
...
@@ -2256,7 +2430,7 @@
.package-box
{
.room-label-list{
.room-label-list
{
display
:
flex
;
flex-wrap
:
wrap
;
width
:
60%
;
...
...
@@ -2264,35 +2438,41 @@
margin-left
:
20
upx
;
border-radius
:
12
upx
;
padding
:
10
upx
6
upx
;
.room-label-box{
.room-label-box
{
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
33.33%
;
padding
:
10
upx
6
upx
;
.item
{
padding
:
8
upx
20
upx
;
}
.gray
{
.gray
{
background
:
#c3c3c3
;
color
:
#f5f5f5
;
}
.pre-icon
{
.pre-icon
{
position
:
absolute
;
top
:
-8
upx
;
right
:
-10
upx
;
display
:
flex
;
width
:
64
upx
;
z-index
:
6
;
image{
image
{
width
:
100%
;
max-height
:
64
upx
;
}
}
}
}
.package-list
{
.package-list
{
display
:
flex
;
flex-direction
:
column
;
height
:
100%
;
...
...
@@ -2300,30 +2480,36 @@
border-radius
:
12
upx
;
margin-left
:
20
upx
;
padding
:
10
upx
6
upx
;
.package-list-box{
.package-list-box
{
position
:
relative
;
padding
:
10
upx
6
upx
;
.item{
.item
{
padding
:
8
rpx
20
rpx
;
}
.gray
{
.gray
{
background
:
#c3c3c3
;
color
:
#f5f5f5
;
}
.pre-icon
{
.pre-icon
{
position
:
absolute
;
top
:
-8
upx
;
right
:
-10
upx
;
display
:
flex
;
width
:
64
upx
;
z-index
:
6
;
image{
image
{
width
:
100%
;
max-height
:
64
upx
;
}
}
}
}
.item
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -2333,10 +2519,11 @@
border-radius
:
12
upx
;
border
:
1px
solid
#CCD1DB
;
}
.active
{
.active
{
border
:
1px
solid
#e1419b
;
color
:
#FFFFFF
;
background
:
linear-gradient
(
to
right
,
#e03997
,
#ff375d
);
background
:
linear-gradient
(
to
right
,
#e03997
,
#ff375d
);
box-shadow
:
0
0
8
upx
#ffffff
inset
;
}
}
...
...
@@ -2405,13 +2592,16 @@
.line-black
::after
{
border-color
:
transparent
;
}
.line-gray
{
.line-gray
{
border
:
2px
solid
#c5c5c5
;
color
:
#c5c5c5
;
}
.line-gray
::after
{
border-color
:
transparent
;
}
.line-pink
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -2505,21 +2695,25 @@
text-align
:
center
;
}
}
.relative
{
.relative
{
position
:
relative
;
.absolute{
.absolute
{
position
:
absolute
;
top
:
-1
upx
;
left
:
0
upx
;
height
:
100%
;
.flex-col{
.flex-col
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
height
:
150%
;
display
:
flex
;
flex-direction
:
column
;
.saojiao{
.saojiao
{
position
:
absolute
;
top
:
-10px
;
left
:
-15
upx
;
...
...
@@ -2532,7 +2726,8 @@
border-left-color
:
transparent
;
border-right-color
:
transparent
;
}
.line
{
.line
{
position
:
absolute
;
top
:
0
;
left
:
0
;
...
...
@@ -2540,12 +2735,14 @@
height
:
100%
;
background
:
linear-gradient
(
180deg
,
#EFD12C
,
#DDC01E
);
}
.text-sm
{
.text-sm
{
position
:
absolute
;
top
:
-4px
;
left
:
10px
;
width
:
46
upx
;
text{
text
{
font-size
:
20
upx
;
color
:
#DFC224
;
}
...
...
@@ -2566,7 +2763,8 @@
padding
:
0
0
15
upx
;
overflow
:
hidden
;
align-items
:
center
;
.logo-box{
.logo-box
{
position
:
absolute
;
top
:
0
;
left
:
0
;
...
...
@@ -2576,15 +2774,18 @@
justify-content
:
center
;
align-items
:
center
;
z-index
:
0
;
image{
image
{
width
:
402
upx
;
height
:
322
upx
;
}
}
.flex-between
{
.flex-between
{
position
:
relative
;
z-index
:
3
;
}
.text-left
{
width
:
120
upx
;
text-align-last
:
justify
;
...
...
@@ -2611,18 +2812,20 @@
.flex-row
{
align-items
:
center
;
}
.vip-tag-box
{
.vip-tag-box
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
background
:
linear-gradient
(
to
right
,
rgba
(
255
,
255
,
255
,
0.2
),
rgba
(
157
,
18
,
196
,
0.3
));
background
:
linear-gradient
(
to
right
,
rgba
(
255
,
255
,
255
,
0.2
),
rgba
(
157
,
18
,
196
,
0.3
));
color
:
#9D1260
;
font-size
:
16
upx
;
height
:
34
upx
;
border-radius
:
18
upx
;
padding
:
0
12
upx
;
margin-left
:
6
upx
;
image{
image
{
width
:
22
upx
;
max-height
:
22
upx
;
margin-right
:
4
upx
;
...
...
@@ -2671,7 +2874,8 @@
flex-direction
:
row
;
align-items
:
center
;
color
:
#000000
;
.amount{
.amount
{
color
:
#e03997
;
}
}
...
...
@@ -2706,13 +2910,15 @@
}
}
.select-datetime-box
{
.select-datetime-box
{
display
:
flex
;
flex-direction
:
column
;
.bg-white{
.bg-white
{
border-bottom
:
1px
solid
#e5e5e5
;
}
}
}
.select-box
{
height
:
420
upx
;
background-color
:
#f1f1f1
;
...
...
@@ -2735,13 +2941,14 @@
.confirm-pop
{
width
:
100vw
;
.pop-content-box
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
//
height
:
700
upx
;
background
:
#FFFFFF
;
box-shadow
:
0
2
upx
38
upx
0
rgba
(
0
,
0
,
0
,
0.27
);
box-shadow
:
0
2
upx
38
upx
0
rgba
(
0
,
0
,
0
,
0.27
);
border-radius
:
16
upx
16
upx
0
rpx
0
rpx
;
.info-box
{
...
...
@@ -2755,7 +2962,8 @@
background
:
#FFFFFF
;
border-radius
:
16
rpx
;
border
:
2px
solid
#8C8C8C
;
.info-store{
.info-store
{
margin-top
:
-30
upx
;
width
:
308
upx
;
height
:
60
upx
;
...
...
@@ -2764,33 +2972,38 @@
align-items
:
center
;
z-index
:
44
;
background
:
#FFFFFF
;
.text-title{
.text-title
{
font-weight
:
600
;
font-size
:
36
rpx
;
//
color
:
#E03997
;
color
:
#333333
;
}
}
.time-box
{
.time-box
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
width
:
100%
;
align-items
:
center
;
margin
:
30
upx
0
;
.part-1{
.part-1
{
position
:
relative
;
display
:
flex
;
flex
:
1
;
margin
:
0
24
upx
;
height
:
90
upx
;
image{
image
{
width
:
100%
;
height
:
100%
;
}
.absolute
{
.absolute
{
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
...
...
@@ -2799,7 +3012,8 @@
align-items
:
center
;
border
:
6
upx
solid
#E03997
;
border-radius
:
47
upx
;
text{
text
{
font-weight
:
600
;
font-size
:
60
upx
;
//
color
:
#333333
;
...
...
@@ -2807,17 +3021,20 @@
}
}
}
text
{
text
{
font-weight
:
600
;
font-size
:
30
rpx
;
color
:
#333333
;
}
}
.info
{
width
:
100%
;
padding
:
12
upx
30
upx
;
font-size
:
20
upx
;
text{
text
{
//
font-weight
:
600
;
//
font-size
:
32
rpx
;
//
color
:
#333333
;
...
...
@@ -2831,7 +3048,8 @@
align-items
:
center
;
width
:
100%
;
padding
:
32
upx
28
upx
;
text{
text
{
font-weight
:
600
;
font-size
:
36
upx
;
color
:
#333333
;
...
...
@@ -2867,12 +3085,13 @@
width
:
100%
;
padding
:
0
5%
;
margin
:
40
upx
0
;
.btn-close{
.btn-close
{
width
:
240
upx
;
height
:
64
upx
;
border
:
2
upx
solid
;
background
:
#F5F5F5
;
box-shadow
:
0
5
upx
9
upx
0
rgba
(
54
,
4
,
9
,
0.42
);
box-shadow
:
0
5
upx
9
upx
0
rgba
(
54
,
4
,
9
,
0.42
);
border-image
:
linear-gradient
(
0deg
,
#9D9C9C
,
#DEDCDC
)
2
2
;
margin
:
0
12
upx
;
font-weight
:
600
;
...
...
@@ -2881,11 +3100,12 @@
border-radius
:
6
upx
;
opacity
:
0.95
;
}
.btn-confirm
{
.btn-confirm
{
width
:
240
upx
;
height
:
64
upx
;
background
:
linear-gradient
(
97deg
,
#E5268B
,
#FD5661
);
box-shadow
:
0
5
upx
9
upx
0
rgba
(
54
,
4
,
9
,
0.42
);
box-shadow
:
0
5
upx
9
upx
0
rgba
(
54
,
4
,
9
,
0.42
);
border-radius
:
6
upx
;
opacity
:
0.95
;
margin
:
0
12
upx
;
...
...
@@ -2947,12 +3167,14 @@
}
}
}
.card-use
{
.card-use
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
padding
:
15
upx
30
upx
;
.radio-group-box{
.radio-group-box
{
width
:
100%
;
height
:
0
;
margin-top
:
15
upx
;
...
...
@@ -2963,40 +3185,144 @@
box-shadow
:
0
0
12
upx
transparent
inset
;
transition
:
all
0.5s
;
overflow
:
hidden
;
.radio-group{
.radio-group
{
width
:
100%
;
margin
:
20
upx
0
;
label{
height
:
32px
;
}
.margin-right-sm
{
margin-right
:
14
upx
;
}
.radio-group-box-height
{
}
}
.radio-group-box-height
{
height
:
auto
;
border-color
:
rgba
(
255
,
170
,
255
,
0.8
)
;
border-color
:
rgba
(
255
,
170
,
255
,
0.8
);
box-shadow
:
0
0
12
upx
rgba
(
255
,
170
,
255
,
0.8
)
inset
;
}
.cuIcon-right
{
.cuIcon-right
{
transition
:
all
0.5s
;
}
}
.activite-box
{
.activite-box
{
width
:
92vw
;
border-radius
:
20
upx
;
overflow
:
hidden
;
image{
image
{
display
:
block
;
width
:
100%
;
min-height
:
960
upx
;
}
}
.close-btn
{
.close-btn
{
display
:
flex
;
justify-content
:
center
;
margin-top
:
24
upx
;
.text-pink{
.text-pink
{
font-size
:
80
upx
;
}
}
.show-more-pay-way
{
.show-more-pay-way
{
transform-origin
:
center
center
;
transform
:
rotate
(
90deg
);
}
.popup-recharge
{
width
:
540
upx
;
//
height
:
700
upx
;
background-color
:
#ffffff
;
border-radius
:
36
upx
;
overflow
:
hidden
;
.recharge-content{
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
width
:
100%
;
//
height
:
100%
;
background
:
linear-gradient
(
0deg
,
rgba
(
255
,
255
,
255
,
0.65
),
rgba
(
255
,
214
,
241
,
0.43
));
.close-btn{
position
:
absolute
;
top
:
0
;
right
:
0
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
42px
;
height
:
42px
;
z-index
:
10
;
margin
:
0
;
.cuIcon-close{
font-size
:
36
upx
;
}
}
.header-part
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
padding-bottom
:
32
upx
;
width
:
470
upx
;
border-bottom
:
1px
dashed
#C9CACA
;
.text-title{
margin-top
:
50
upx
;
font-size
:
40
upx
;
}
.text-gray
{
margin-top
:
16
upx
;
font-size
:
24
upx
;
}
}
.content-part
{
display
:
flex
;
flex-direction
:
column
;
padding
:
30
upx
0
0
;
width
:
470
upx
;
.list-item{
margin
:
14
upx
0
14
upx
18
upx
;
.recharge-icon{
display
:
block
;
width
:
44
upx
;
max-height
:
46
upx
;
margin-right
:
12
upx
;
}
.text-title
{
color
:
#000000
;
font-size
:
30
upx
;
}
.text-pink
{
color
:
#E40583
;
font-size
:
30
upx
;
}
}
.text-des-box
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
423
rpx
;
font-size
:
26
upx
;
color
:
#666666
;
margin
:
52
upx
auto
52
upx
;
}
.cu-btn
{
width
:
470
upx
;
height
:
88
upx
;
background
:
#E40583
;
border-radius
:
44
upx
;
font-size
:
38
upx
;
color
:
#FFFFFF
;
font-weight
:
bold
;
margin-bottom
:
36
upx
;
}
}
}
}
</
style
>
\ 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