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
d4a02383
Commit
d4a02383
authored
Aug 26, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除console.log
parent
0a2b8eb2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
38 deletions
+7
-38
order.vue
pages/order/order.vue
+7
-38
No files found.
pages/order/order.vue
View file @
d4a02383
...
...
@@ -584,7 +584,6 @@
}
},
onLoad
(
option
)
{
console
.
log
(
option
,
"option"
)
uni
.
showLoading
({
title
:
"加载中"
})
...
...
@@ -661,7 +660,6 @@
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
endDate
=
moment
(
moment
().
format
(
endStr
)).
format
(
"YYYY-MM-DD HH:00:00"
);
console
.
log
(
startStr
,
endStr
,
6666
)
// 如果是续单,则订单的结束时间必须在套餐的开始时间和结束时间内,否则无法续对应的套餐
// if(this.orderType == 2){
// if(!(moment(this.orderInfo.endDate).valueOf() >= moment(startDate).valueOf() && moment(this.orderInfo.endDate).valueOf()
<=
moment
(
endDate
).
valueOf
())){
...
...
@@ -675,24 +673,15 @@
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
()){
if
(
this
.
orderType
==
2
){
console
.
log
(
startDate
,
endDate
,
this
.
orderInfo
.
endDate
,
"22222"
)
let
orderEndDate
=
moment
(
this
.
orderInfo
.
endDate
).
valueOf
()
console
.
log
(
moment
(
startDate
).
add
(
1
,
'd'
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
orderEndDate
,
"224444"
)
let
b1
=
orderEndDate
>=
moment
(
startDate
).
valueOf
()
&&
orderEndDate
<=
moment
(
endDate
).
valueOf
();
let
b2
=
orderEndDate
>=
moment
(
moment
(
startDate
).
add
(
1
,
'd'
)).
valueOf
()
&&
orderEndDate
<=
moment
(
moment
(
endDate
).
add
(
1
,
"d"
)).
valueOf
();
console
.
log
(
b1
,
b2
,
"b1b2"
)
if
(
!
(
b1
||
b2
)){
useStatus
=
false
;
console
.
log
(
useStatus
,
"useStatus1"
)
return
;
}
}
// console.log("通宵套餐")
//通宵套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 实际时长小于原时长的60%则选择明天的时间
...
...
@@ -701,11 +690,10 @@
// 实际时间
let
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
)){
//
console.log("实际时长小于原时长的60%则选择明天的时间");
//
实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if
(
this
.
dateIndex
!=
0
){
useStatus
=
false
;
console
.
log
(
useStatus
,
"useStatus2"
)
return
}
...
...
@@ -717,7 +705,6 @@
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
if
(
actualTime
<
originTime
-
4
*
60
*
60
*
1000
||
this
.
onCheckPackUse
(
startDate
,
endDate
,
4
)){
useStatus
=
false
;
console
.
log
(
useStatus
,
"useStatus3"
)
return
}
}
...
...
@@ -729,9 +716,8 @@
}
}
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
//
console.log("闲时套餐")
//
闲时套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
console
.
log
(
dateTimeObj
,
"dateTimeObj"
)
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
()
// 实际时间
...
...
@@ -761,17 +747,15 @@
let
pointDateForm
=
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
format
(
"YYYY-MM-DD 11:00:00"
);
let
dateTimeObj
=
{};
if
(
moment
(
endDate
).
valueOf
()
<
moment
(
pointDateForm
).
valueOf
()){
//
console.log("通宵套餐")
//
通宵套餐
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
console
.
log
(
dateTimeObj
,
"通宵套餐"
)
// 原时间
let
originTime
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
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
)){
//
console.log("实际时长小于原时长的60%则选择明天的时间");
//
实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if
(
this
.
dateIndex
!=
0
){
...
...
@@ -785,7 +769,6 @@
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
);
console
.
log
(
dateTimeObj
,
"通宵套餐2"
)
// 实际时间
actualTime
=
moment
(
dateTimeObj
.
tempEndDate
).
valueOf
()
-
moment
(
dateTimeObj
.
tempStartDate
).
valueOf
()
...
...
@@ -846,7 +829,6 @@
}
else
{
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
// console.log("闲时套餐")
dateTimeObj
=
this
.
onComputeStartDateAndEndDate
(
startDate
,
endDate
);
// 原时间
...
...
@@ -931,7 +913,6 @@
},
// 通过指定时长在当前时间段内查询合适的时间段
onComputeByDuration
(
duration
,
durationType
=
1
){
//重新设置开始时间和结束时间
let
m
=
Number
(
duration
)
*
60
;
if
(
durationType
===
2
)
{
...
...
@@ -1080,7 +1061,6 @@
getStoreActivity
({
storeId
:
this
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
){
let
obj
=
res
.
data
.
data
||
{}
...
...
@@ -1119,7 +1099,6 @@
if
(
this
.
roomInfo
.
packList
&&
this
.
roomInfo
.
packList
.
length
)
{
this
.
packageMode
=
[];
this
.
packList
=
this
.
roomInfo
.
packList
;
// console.log(this.packageMode,"通宵和闲时套餐")
// this.modeIndex = 0;
}
if
(
this
.
roomInfo
.
roomLabelList
&&
this
.
roomInfo
.
roomLabelList
.
length
)
{
...
...
@@ -1416,7 +1395,6 @@
// }
let
nowDate
=
moment
().
valueOf
();
let
setDate
=
moment
(
this
.
formatAllData
.
startDateTime
).
valueOf
();
console
.
log
(
nowDate
,
setDate
,
"时间对比"
)
// 如果当前时间大于开始时间,则不允许下单
if
(
this
.
orderType
==
1
&&
nowDate
>
setDate
)
{
uni
.
showToast
({
...
...
@@ -1436,7 +1414,6 @@
this
.
orderDateDes
=
moment
(
this
.
formatAllData
.
startDateTime
).
format
(
"YYYY年MM月DD日"
)
this
.
orderWeekDes
=
moment
(
this
.
formatAllData
.
startDateTime
).
days
();
console
.
log
(
this
.
orderWeekDes
,
9999
)
this
.
$refs
.
confirmPop
.
open
();
},
...
...
@@ -1627,35 +1604,30 @@
if
(
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点1"
)
}
else
{
if
(
this
.
orderType
==
1
){
if
(
startStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点2"
)
}
else
if
(
endStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点3"
)
}
else
if
(
startStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点4"
)
}
}
else
if
(
this
.
orderType
==
2
){
if
(
startStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点2"
)
}
else
if
(
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点4"
)
}
else
if
(
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点3"
)
}
}
...
...
@@ -1679,7 +1651,6 @@
//endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟
onTransiteForDate
(
params
)
{
console
.
log
(
params
,
"所有参数"
)
// 计算出时长,使用分钟计算
if
(
!
params
.
duration
){
return
{
...
...
@@ -1702,7 +1673,6 @@
startStamp
=
moment
(
params
.
startDateTime
).
valueOf
();
endStamp
=
startStamp
+
m
*
60000
;
dateObj
.
useStatus
=
this
.
onUseByStartAndDuration
(
params
.
startDateTime
,
m
,
2
)
console
.
log
(
dateObj
.
useStatus
,
999
)
}
else
if
(
params
.
duration
){
dateObj
=
this
.
onComputeByDuration
(
m
,
2
);
...
...
@@ -1710,7 +1680,6 @@
endStamp
=
moment
(
dateObj
.
endDateTime
).
valueOf
();
}
// 获取开始时间的当前小时
let
list
=
params
.
list
.
map
((
item
,
index
)
=>
{
let
startH
=
moment
(
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:00:00"
)).
valueOf
();
...
...
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