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
f9621a9a
Commit
f9621a9a
authored
Jan 04, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
细节优化
parent
3b7daf0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
28 deletions
+45
-28
index.vue
pages/index/index.vue
+7
-15
order.vue
pages/order/order.vue
+38
-13
No files found.
pages/index/index.vue
View file @
f9621a9a
...
...
@@ -95,7 +95,7 @@
</view>
<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=
"objListDate.length && objListDate[index]
[k
].status==1?'bg-pink':'bg-gray'"
>
<view
class=
"box"
:class=
"objListDate.length && objListDate[index]
&& objListDate[index].length && objListDate[index][k].status==1&& objListDate[index][k+1
].status==1?'bg-pink':'bg-gray'"
>
</view>
<text
class=
"text-gray text-sm"
>
{{
val
>=
24
?
val
-
24
:
val
}}
</text>
...
...
@@ -215,7 +215,6 @@
timer
:
null
,
roomVoList
:[],
list
,
listDate
:[],
objListDate
:[]
}
},
...
...
@@ -273,7 +272,6 @@
this
.
$refs
.
popup
.
open
()
uni
.
hideLoading
()
}
this
.
objListDate
=
[];
this
.
onGetListStore
()
}
})
...
...
@@ -312,6 +310,10 @@
})
},
onGetSortDistance
(
i
=
0
){
if
(
i
>=
this
.
roomVoList
.
length
){
this
.
$forceUpdate
();
return
}
listSortDistance
({
storeId
:
this
.
storeInfo
.
id
,
roomId
:
this
.
roomVoList
[
i
].
id
,
...
...
@@ -319,18 +321,8 @@
orderType
:
1
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
i
<=
this
.
roomVoList
.
length
-
1
){
this
.
listDate
[
i
]
=
res
.
data
.
data
;
i
+=
1
if
(
i
>=
this
.
roomVoList
.
length
){
this
.
listDate
=
this
.
listDate
.
map
(
item
=>
{
return
this
.
list
.
map
(
val
=>
item
[
val
])
})
this
.
objListDate
=
this
.
listDate
;
}
else
{
this
.
onGetSortDistance
(
i
)
}
this
.
objListDate
[
i
]
=
this
.
list
.
map
(
val
=>
res
.
data
.
data
[
val
])
this
.
onGetSortDistance
(
++
i
)
}
})
},
...
...
pages/order/order.vue
View file @
f9621a9a
...
...
@@ -439,9 +439,11 @@
setStartTime
:
{
status
:
false
,
startTime
:
''
,
startDate
:
''
,
duration
:
0
,
days
:
1
}
},
days
:
1
};
},
filters
:{
...
...
@@ -509,7 +511,9 @@
}
// 判断房间有没有绑定套餐
if
(
this
.
roomInfo
.
packList
&&
this
.
roomInfo
.
packList
.
length
)
{
this
.
packageMode
=
this
.
roomInfo
.
packList
let
packageMode
=
this
.
roomInfo
.
packList
packageMode
.
sort
((
a
,
b
)
=>
Number
(
a
.
duration
)
-
Number
(
b
.
duration
))
this
.
packageMode
=
packageMode
this
.
index
=
1
;
this
.
modeIndex
=
0
;
}
else
{
...
...
@@ -559,15 +563,19 @@
this
.
dateIntervalList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
status
==
1
&&
this
.
setStartTime
.
duration
<
this
.
duration
&&
moment
(
item
.
endHoldTime
).
format
(
"mm"
)
<
59
){
this
.
setStartTime
.
startTime
=
moment
(
item
.
endHoldTime
).
format
(
"HH:mm"
);
if
(
index
>=
24
){
this
.
setStartTime
.
startDate
=
moment
(
item
.
endHoldTime
).
format
(
"YYYYMMDD"
);
if
(
index
>=
24
){
this
.
setStartTime
.
days
=
2
;
this
.
days
=
2
;
}
this
.
setStartTime
.
duration
=
0
;
this
.
setStartTime
.
status
=
true
;
}
if
(
item
.
status
==
1
&&
this
.
setStartTime
.
duration
<
this
.
duration
&&
moment
(
item
.
startHoldTime
).
format
(
"mm"
)
>
0
){
this
.
setStartTime
.
startTime
=
moment
(
item
.
endHoldTime
).
format
(
"HH:mm"
);
this
.
setStartTime
.
startDate
=
moment
(
item
.
endHoldTime
).
format
(
"YYYYMMDD"
);
if
(
index
>=
24
){
this
.
setStartTime
.
days
=
2
this
.
days
=
2
;
}
this
.
setStartTime
.
duration
=
0
;
this
.
setStartTime
.
status
=
true
;
...
...
@@ -583,6 +591,11 @@
}
else
if
(
item
.
status
===
0
&&
this
.
setStartTime
.
duration
===
0
&&
!
this
.
setStartTime
.
status
){
this
.
setStartTime
.
duration
+=
1
;
this
.
setStartTime
.
startTime
=
`
${
index
}
:00`
;
if
(
index
>=
24
){
this
.
setStartTime
.
startTime
=
`
${
index
-
24
}
:00`
;
this
.
setStartTime
.
days
=
2
this
.
days
=
2
;
}
this
.
setStartTime
.
status
=
true
;
}
else
if
(
item
.
status
===
0
&&
this
.
setStartTime
.
duration
>=
0
&&
this
.
setStartTime
.
duration
<
this
.
duration
&&
this
.
setStartTime
.
status
){
this
.
setStartTime
.
duration
+=
1
;
...
...
@@ -659,7 +672,6 @@
}
this
.
onGetUseCoupon
()
this
.
onUpdateIntervalList
()
this
.
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
},
// 更新时间的选取状态
onUpdateIntervalList
()
{
...
...
@@ -672,10 +684,11 @@
let
end
=
Number
(
this
.
endTime
.
split
(
":"
)[
0
])
let
endM
=
Number
(
this
.
endTime
.
split
(
":"
)[
1
])
// if(this.setStartTime.days >=2){
// start +=24
// this.setStartTime.days = 1
// }
// 如果开始时间是第二天
if
(
this
.
setStartTime
.
days
>=
2
||
this
.
days
==
2
){
start
+=
24
}
if
(
this
.
orderType
==
2
&&
end
<
start
){
end
+=
24
...
...
@@ -683,6 +696,8 @@
end
+=
24
}
this
.
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
// 重新将数据还原到元数据
this
.
intervalList
=
[
...
this
.
dateIntervalList
...
...
@@ -1111,15 +1126,25 @@
}
let
startArr
=
startTime
.
split
(
":"
)
let
endArr
=
endTime
.
split
(
":"
)
obj
.
startDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
if
(
this
.
orderType
==
1
&&
Number
(
endArr
[
0
])
<=
Number
(
startArr
[
0
]))
{
if
(
this
.
setStartTime
.
days
==
2
||
this
.
days
==
2
){
obj
.
startDate
=
`
${
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
startTime
}
:00`
this
.
setStartTime
.
days
=
1
;
this
.
days
=
1
}
else
{
obj
.
startDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
}
if
((
this
.
orderType
==
1
&&
Number
(
endArr
[
0
])
<=
Number
(
startArr
[
0
])))
{
obj
.
endDate
=
`
${
moment
(
this
.
dateList
[
this
.
dateIndex
].
read
Date
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
`
${
moment
(
obj
.
start
Date
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
}
else
if
(
this
.
orderType
==
2
&&
Number
(
endArr
[
0
])
<
Number
(
startArr
[
0
]))
{
obj
.
endDate
=
`
${
moment
(
this
.
dateList
[
this
.
dateIndex
].
read
Date
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
`
${
moment
(
obj
.
start
Date
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
}
else
{
obj
.
endDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
endTime
}
:00`
obj
.
endDate
=
`
${
moment
(
obj
.
startDate
).
format
(
"YYYY-MM-DD"
)
}
${
endTime
}
:00`
}
return
obj
;
}
...
...
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