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
361304c6
Commit
361304c6
authored
May 11, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
细节优化
parent
8f861dfe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
67 deletions
+109
-67
index.vue
pages/index/index.vue
+16
-5
order.vue
pages/order/order.vue
+57
-11
orderResult.vue
pages/orderResult/orderResult.vue
+36
-51
No files found.
pages/index/index.vue
View file @
361304c6
...
...
@@ -173,7 +173,7 @@
<view
class=
"flex-row list-point-box"
>
<view
v-for=
"(val,k) in list"
:key=
"k"
class=
"flex-1 flex-col"
>
<view
class=
"box"
:class=
"item.roomStatusList && item.roomStatusList[val].status==1
&& item.roomStatusList[val].m>=59?
'bg-pink':'bg-gray'"
>
:class=
"item.roomStatusList && item.roomStatusList[val].status==1
?
'bg-pink':'bg-gray'"
>
</view>
<text
class=
"text-gray text-sm"
>
{{
val
==
24
?
'次日'
:
val
>
24
?
val
-
24
:
val
}}
</text>
...
...
@@ -504,10 +504,16 @@
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[],
roomStatusList
:
item
.
roomStatusList
.
map
(
val
=>
{
let
status
=
val
.
status
;
if
(
status
==
1
){
if
(
!
this
.
onCheckHourUse
(
val
.
startHoldTime
,
val
.
endHoldTime
)){
status
=
0
}
}
return
{
...
val
,
m
:
val
.
endHoldTime
?
Number
(
moment
(
val
.
endHoldTime
).
format
(
"mm"
))
:
0
status
}
})
}
...
...
@@ -529,6 +535,11 @@
uni
.
hideLoading
()
})
},
// 检查当前小时段是否被全部占用 true 完全占用 false 部分占用
onCheckHourUse
(
startDate
,
endDate
)
{
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
return
timeStamp
>=
3599000
},
onGetSortDistance
(
i
=
0
)
{
if
(
i
>=
this
.
roomVoList
.
length
)
{
// this.$forceUpdate();
...
...
@@ -1132,11 +1143,11 @@
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
background
:
rgba
(
0
,
0
,
0
,
0.
2
);
background
:
rgba
(
0
,
0
,
0
,
0.
4
);
z-index
:
2
;
text{
color
:
#ffffff
;
font-size
:
2
4
upx
;
font-size
:
2
8
upx
;
margin
:
4
upx
0
;
}
}
...
...
pages/order/order.vue
View file @
361304c6
...
...
@@ -85,12 +85,15 @@
</view>
</view>
</view>
<view
class=
"flex-col package-list"
>
<view
v-if=
"packageMode.length"
class=
"flex-col package-list"
>
<view
v-for=
"(item,index) in packageMode"
:key=
"index"
class=
"package-list-box"
@
tap=
"onChangePackage2(index,item)"
>
<view
class=
"item"
:class=
" !item.show? 'gray': modeIndex2===index?'active':''"
>
<text>
{{
item
.
name
}}
</text>
</view>
<view
class=
"pre-icon"
>
<image
:src=
"assetsPath+'/pre_icon.png'"
mode=
"widthFix"
></image>
</view>
</view>
</view>
...
...
@@ -181,7 +184,7 @@
<view
v-for=
"(item,k) in formatAllData.list"
:key=
"k"
class=
"date-point-item"
v-if=
"k>=startHours && k
<
=
endHours
"
@
tap=
"onSelectDatePoint(item,k)"
>
<view
class=
"date-point"
:class=
"
item.status === 0 ?'free':item.status===1?'used': item.status==2?'check
ed':'error'"
>
:class=
"
item.status==2?'checked': item.tagStatus === 0 ?'free':item.tagStatus===1?'us
ed':'error'"
>
</view>
<text
class=
"text-gray"
>
{{
item
.
hour
}}
</text>
</view>
...
...
@@ -1029,9 +1032,15 @@
}).
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
)){
status
=
0
}
}
return
{
...
item
,
m
:
item
.
endHoldTime
?
Number
(
moment
(
item
.
endHoldTime
).
format
(
"mm"
))
:
0
,
tagStatus
:
status
,
hour
:
index
>
0
&&
index
-
24
==
0
?
'次日'
:
index
>
24
?
index
-
24
:
index
}
})
...
...
@@ -1495,16 +1504,40 @@
if
(
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点1"
)
}
else
{
if
(
startStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
}
if
(
endStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
if
(
this
.
orderType
==
1
){
if
(
startStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点2"
)
}
if
(
endStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点3"
)
}
}
else
if
(
this
.
orderType
==
2
){
if
(
m
<
60
&&
!
(
startStemp
>=
moment
(
item
.
endHoldTime
).
valueOf
()
&&
endStemp
<
end
)
){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点5"
)
}
else
{
if
(
startStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点2"
)
}
if
(
endStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
useStatus
=
true
;
nextStatus
=
true
;
console
.
log
(
"节点3"
)
}
}
}
}
}
}
...
...
@@ -1901,6 +1934,7 @@
margin-left
:
20
upx
;
padding
:
10
upx
6
upx
;
.package-list-box{
position
:
relative
;
padding
:
10
upx
6
upx
;
.item{
padding
:
8
rpx
20
rpx
;
...
...
@@ -1909,6 +1943,18 @@
background
:
#c3c3c3
;
color
:
#f5f5f5
;
}
.pre-icon
{
position
:
absolute
;
top
:
-8
upx
;
right
:
-10
upx
;
display
:
flex
;
width
:
64
upx
;
z-index
:
6
;
image{
width
:
100%
;
max-height
:
64
upx
;
}
}
}
}
.item
{
...
...
pages/orderResult/orderResult.vue
View file @
361304c6
...
...
@@ -101,7 +101,7 @@
<view
class=
"part"
>
<button
class=
"cu-btn block round line-pink lg"
open-type=
"share"
>
分享好友
</button>
</view>
<view
v-if=
"
(continStatus || orderInfo.status ==1) && userInfo.id == orderInfo.consumerId
"
class=
"part"
>
<view
v-if=
"
continStatus || orderInfo.status ==1
"
class=
"part"
>
<button
class=
"cu-btn block round bg-mauve lg"
@
tap=
"onNavToOrder"
>
房间续单
</button>
</view>
</view>
...
...
@@ -355,69 +355,49 @@
// 续单开始时间戳,订单未结束使用订单实际结束时间,订单结束使用当前时间
let
startDateStemp
=
this
.
orderInfo
.
status
==
2
?
moment
(
moment
().
format
(
"YYYY-MM-DD HH:mm:00"
)).
valueOf
():
moment
(
orderEndDate
).
valueOf
();
//
订单开始时间
let
orderStartTime
=
0
;
//
可续单的结束时间戳
let
endDateStemp
=
startDateStemp
+
60
*
60
*
100
0
;
let
continueStatus
=
fals
e
;
let
continueStatus
=
tru
e
;
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
&&
res
.
data
.
data
.
length
){
res
.
data
.
data
.
forEach
(
item
=>
{
if
(
continueStatus
)
return
;
if
(
orderStartTime
){
if
(
item
.
status
==
0
){
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
})
continueStatus
=
true
;
}
else
{
let
d
=
moment
(
item
.
startHoldTime
).
valueOf
()
if
(
d
-
orderStartTime
>=
3600
*
1000
){
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
})
continueStatus
=
true
;
return
let
start
=
moment
(
item
.
timeHour
+
':00:00'
).
valueOf
();
let
end
=
moment
(
item
.
timeHour
+
':59:59'
).
valueOf
();
if
(
end
>=
startDateStemp
&&
start
<=
end
){
if
(
item
.
stauts
==
1
){
if
(
this
.
onCheckHourUse
(
item
.
startHoldTime
,
item
.
endHoldTime
)){
continueStatus
=
false
;
console
.
log
(
"节点1"
)
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"此订单已无可续单时段"
})
continueStatus
=
true
;
return
if
(
startDateStemp
>
moment
(
item
.
startHoldTime
).
valueOf
()
&&
startDateStemp
<
moment
(
item
.
endHoldTime
).
valueOf
()){
continueStatus
=
false
;
console
.
log
(
"节点2"
)
}
if
(
endDateStemp
>=
moment
(
item
.
startHoldTime
).
valueOf
()
&&
endDateStemp
<=
moment
(
item
.
endHoldTime
).
valueOf
()){
continueStatus
=
false
;
console
.
log
(
"节点3"
)
}
}
}
}
else
{
if
(
item
.
status
==
1
)
{
let
d
=
moment
(
item
.
endHoldTime
).
valueOf
();
if
(
d
>=
startDateStemp
){
orderStartTime
=
d
;
console
.
log
(
moment
(
orderStartTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
),
"续单可开始的时间2"
)
}
}
}
})
}
return
;
let
h
=
this
.
orderInfo
.
endTime
.
split
(
":"
).
map
(
item
=>
Number
(
item
))
if
(
res
.
data
.
code
==
200
){
let
val
=
res
.
data
.
data
[
h
[
0
]
+
1
];
if
(
val
.
status
===
0
){
if
(
continueStatus
){
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
})
}
else
if
(
val
.
status
===
1
){
let
nextStartH
=
moment
(
val
.
startHoldTime
).
format
(
"HH:mm"
).
split
(
":"
).
map
(
item
=>
Number
(
item
))
if
(
nextStartH
[
1
]
>
h
[
1
]){
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
})
}
else
{
uni
.
showToast
({
icon
:
"none"
,
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"此订单已无可续单时段"
})
}
})
}
}
}).
catch
(
err
=>
{
...
...
@@ -429,6 +409,11 @@
})
})
},
// 检查当前小时段是否被全部占用 true 完全占用 false 部分占用
onCheckHourUse
(
startDate
,
endDate
)
{
let
timeStamp
=
moment
(
endDate
).
valueOf
()
-
moment
(
startDate
).
valueOf
();
return
timeStamp
>=
3599000
},
onOrderRefund
(){
this
.
$refs
.
popup
.
open
();
},
...
...
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