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
6a9ff6c8
Commit
6a9ff6c8
authored
Jan 09, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能较大优化
parent
af5ed6ad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
412 additions
and
130 deletions
+412
-130
login.vue
components/login/login.vue
+2
-1
toolBox.vue
components/toolBox/toolBox.vue
+8
-8
index.vue
pages/index/index.vue
+54
-41
myInfo.vue
pages/my/myInfo.vue
+6
-3
order.vue
pages/order/order.vue
+290
-65
orderResult.vue
pages/orderResult/orderResult.vue
+52
-12
No files found.
components/login/login.vue
View file @
6a9ff6c8
...
...
@@ -64,6 +64,7 @@
this
.
$refs
.
popupPhone
.
close
()
},
onGetPhoneNumber
(
e
){
let
that
=
this
;
this
.
phoneCode
=
e
.
detail
.
code
;
wx
.
login
({
success
:
(
res
)
=>
{
...
...
@@ -81,8 +82,8 @@
key
:
uni
.
getStorageSync
(
'tokenHeaders'
),
data
:
res
.
data
.
data
.
token
,
success
:
(
res
)
=>
{
this
.
$refs
.
popupPhone
.
close
()
that
.
$emit
(
'success'
)
this
.
$refs
.
popupPhone
.
close
()
}
})
}
...
...
components/toolBox/toolBox.vue
View file @
6a9ff6c8
...
...
@@ -38,13 +38,13 @@
imgUrl
:
config
.
assetsPath
+
'/order_2_icon.png'
,
sortName
:
"续"
},
{
name
:
"验券"
,
url
:
config
.
assetsPath
+
'/tool_3.png'
,
imgUrl
:
config
.
assetsPath
+
'/scan_code_icon.png'
,
sortName
:
"验"
,
routePath
:
"/pages/useCouponIllustrate/useCouponIllustrate?keyData=coupon_use_process"
},
//
{
//
name:"验券",
//
url:config.assetsPath+'/tool_3.png',
//
imgUrl: config.assetsPath+'/scan_code_icon.png',
//
sortName:"验",
//
routePath:"/pages/useCouponIllustrate/useCouponIllustrate?keyData=coupon_use_process"
//
},
{
name
:
"客服"
,
url
:
config
.
assetsPath
+
'/tool_4.png'
,
...
...
@@ -88,7 +88,7 @@
}
},
onHandle
(
val
,
index
){
if
(
index
===
3
){
if
(
index
===
2
){
this
.
onGetSysConfig
()
return
};
...
...
pages/index/index.vue
View file @
6a9ff6c8
...
...
@@ -50,7 +50,7 @@
</view>
<view
v-for=
"(item,index) in roomVoList"
:key=
"index"
class=
"list-item-box"
@
tap=
"onNavToOrder(item)"
>
<view
class=
"itemRow listStyle"
>
<view
class=
"itemRow listStyle"
>
<view
class=
"relative part-top"
>
<image
class=
"room-img"
:src=
"item.images[0]"
mode=
"aspectFill"
@
tap
.
stop=
"onPreview(item.images)"
></image>
</view>
...
...
@@ -70,7 +70,7 @@
<text>
{{
facilitieList
[
val
]
}}
</text>
</view>
</view>
<view
class=
"item-Go"
>
<view
class=
"flex-row room-type"
>
<view
class=
"flex-col"
>
...
...
@@ -78,13 +78,13 @@
<view
class=
"part-2"
>
<text
class=
"text-sm"
>
{{
val
.
duration
}}
小时套餐:
</text>
<text
class=
"text-red text-bold text-xl"
>
{{
val
.
price
}}
元
</text>
</view>
</view>
</view>
</view>
</view>
<view
class=
"flex-between confirm-box"
>
<view
class=
"flex-priceBox"
></view>
<view
class=
"confirm"
>
...
...
@@ -95,10 +95,10 @@
</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] && objListDate[index].length && objListDate[index][k].status==1&& objListDate[index][k
+1].status==1?'bg-pink':'bg-gray'"
>
<view
class=
"box"
:class=
"
item.list && item.list[val].status==1 && item.list[val
+1].status==1?'bg-pink':'bg-gray'"
>
</view>
<text
class=
"text-gray text-sm"
>
{{
val
>=
24
?
val
-
24
:
val
}}
</text>
<text
class=
"text-gray text-sm"
>
{{
val
==
24
?
'次日'
:
val
>
24
?
val
-
24
:
val
}}
</text>
</view>
</view>
</view>
...
...
@@ -156,11 +156,6 @@
LoginPop
},
data
()
{
let
h
=
new
Date
().
getHours
();
let
list
=
[]
for
(
let
i
=
0
;
i
<
24
;
i
++
){
list
.
push
(
h
+
i
)
}
return
{
scrollTop
:
0
,
storeId
:
''
,
...
...
@@ -214,13 +209,14 @@
show
:
true
,
timer
:
null
,
roomVoList
:[],
list
,
list
:[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
]
,
objListDate
:[]
}
},
onShow
()
{
this
.
onGetSysConfig
();
this
.
onLoading
()
this
.
onGetSysConfig
();
this
.
list
=
[];
this
.
onSetShowPoint
()
},
onReachBottom
()
{
if
(
this
.
status
==
'loadmore'
)
{
...
...
@@ -238,6 +234,15 @@
this
.
onGetDicts
();
},
methods
:
{
onSetShowPoint
(){
let
h
=
new
Date
().
getHours
();
let
list
=
[]
for
(
let
i
=
0
;
i
<
24
;
i
++
){
list
.
push
(
h
+
i
)
}
this
.
list
=
list
;
this
.
onLoading
()
},
onGetSysConfig
(){
systemConfig
().
then
(
res
=>
{
uni
.
setStorage
({
...
...
@@ -254,12 +259,15 @@
this
.
facilitieList
=
getDictItem
(
dicts
,
"indoor_facilities"
);
this
.
roomTypeEnum
=
getDictItem
(
dicts
,
"store_room_type"
);
this
.
roomStatusEnum
=
getDictItem
(
dicts
,
"store_room_status"
);
if
(
this
.
roomVoList
.
length
){
this
.
$forceUpdate
()
}
})
},
onLoading
()
{
uni
.
showLoading
({
title
:
'加载中'
})
})
uni
.
getLocation
({
type
:
"gcj02"
,
complete
:
(
res
)
=>
{
...
...
@@ -283,14 +291,13 @@
nowLatitude
:
this
.
latitude
,
nowLongitude
:
this
.
longitude
}).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
.
length
)
{
this
.
storeList
=
res
.
data
.
data
;
let
obj
=
{}
if
(
uni
.
getStorageSync
(
"storeId"
)){
obj
=
this
.
storeList
.
find
(
item
=>
item
.
id
===
uni
.
getStorageSync
(
"storeId"
))
}
else
{
obj
=
res
.
data
.
data
[
0
];
obj
=
res
.
data
.
data
[
0
];
}
that
.
storeInfo
=
{
...
obj
,
...
...
@@ -304,6 +311,7 @@
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
})
uni
.
hideLoading
()
that
.
onGetSortDistance
(
0
);
}
}
...
...
@@ -311,7 +319,7 @@
},
onGetSortDistance
(
i
=
0
){
if
(
i
>=
this
.
roomVoList
.
length
){
this
.
$forceUpdate
();
//
this.$forceUpdate();
return
}
listSortDistance
({
...
...
@@ -320,8 +328,13 @@
day
:
moment
().
format
(
"YYYY-MM-DD"
),
orderType
:
1
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
i
<=
this
.
roomVoList
.
length
-
1
){
this
.
objListDate
[
i
]
=
this
.
list
.
map
(
val
=>
res
.
data
.
data
[
val
])
if
(
res
.
data
.
code
==
200
){
this
.
roomVoList
=
this
.
roomVoList
.
map
((
item
,
k
)
=>
{
return
{
...
item
,
list
:
i
===
k
?
res
.
data
.
data
:
item
.
list
&&
item
.
list
.
length
?
item
.
list
:
[]
}
})
this
.
onGetSortDistance
(
++
i
)
}
})
...
...
@@ -353,7 +366,7 @@
scale
:
18
,
name
:
this
.
storeInfo
.
address
,
complete
:
(
res
)
=>
{
}
})
},
...
...
@@ -361,12 +374,12 @@
uni
.
makePhoneCall
({
phoneNumber
:
this
.
storeInfo
.
phone
,
complete
:
(
res
)
=>
{
}
})
},
onTouchStart
()
{
this
.
timer
=
null
;
this
.
show
=
true
;
},
...
...
@@ -403,7 +416,7 @@
if
(
res
.
authSetting
[
'scope.userLocation'
]){
this
.
onClose
();
this
.
onLoading
()
}
}
}
})
},
...
...
@@ -439,7 +452,7 @@
display
:
flex
;
flex
:
1
;
width
:
100vw
;
.content-box
{
position
:
absolute
;
...
...
@@ -509,7 +522,7 @@
margin-left
:
158
rpx
;
flex
:
1
;
}
.cu-btn
{
background
:
linear-gradient
(
to
right
,
rgba
(
250
,
219
,
73
,
1
),
rgba
(
250
,
219
,
75
,
1
),
rgba
(
255
,
167
,
81
,
1
));
box-shadow
:
0
0
6px
rgba
(
0
,
0
,
0
,
0.3
);
...
...
@@ -789,7 +802,7 @@
font-weight
:
500
!important
;
}
}
.text-dw
{
font-size
:
36
rpx
;
margin-left
:
-4
rpx
;
...
...
@@ -818,11 +831,11 @@
.part-bottom
{
display
:
flex
;
flex
:
1
;
border
:
0
!important
;
border-radius
:
0
rpx
!important
;
padding-left
:
20
rpx
;
.room-title{
padding
:
0
!important
;
display
:
flex
;
...
...
@@ -832,7 +845,7 @@
flex-direction
:
row
;
align-items
:
center
;
text{
color
:
#9e9e9e
;
color
:
#9e9e9e
;
}
}
//
标签
...
...
@@ -861,7 +874,7 @@
font-size
:
40
rpx
;
color
:
#e70486
;
}
}
}
}
...
...
@@ -907,7 +920,7 @@
//
}
//
}
}
.room-type
{
display
:
flex
;
flex-direction
:
row
;
...
...
@@ -925,7 +938,7 @@
//
border
:
2
rpx
solid
#fc3f21
;
margin
:
0
1%
;
overflow
:
hidden
;
.part-1{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -986,20 +999,21 @@
margin-bottom
:
4
upx
;
margin-right
:
4
upx
;
}
}
}
.list-point-box
{
width
:
100%
;
margin-bottom
:
20
upx
;
.flex-col{
text-align
:
center
;
align-items
:
center
;
}
.box
{
margin
:
0
4
upx
6
upx
;
height
:
20
upx
;
border-radius
:
8
upx
;
margin
:
0
2
upx
6
upx
;
width
:
10px
;
height
:
10px
;
border-radius
:
5px
;
}
.text-sm
{
font-size
:
20
upx
;
}
}
</
style
>
\ No newline at end of file
</
style
>
pages/my/myInfo.vue
View file @
6a9ff6c8
...
...
@@ -22,11 +22,11 @@
<text
class=
"text-gray"
>
修改资料
</text>
</view>
</view>
<view
v-else
class=
"none-login margin-left"
>
<view
v-else
class=
"none-login margin-left"
@
tap=
"onNavToLogin"
>
<view
class=
"cu-avatar xl round"
>
<image
class=
"avatar-img"
:src=
" assetsPath+'/avatar_no.png'"
mode=
"scaleToFill"
></image>
</view>
<text
class=
"text-gray margin-left"
@
tap=
"onNavToLogin"
>
未授权
</text>
<text
class=
"text-gray margin-left"
>
授权登录
</text>
</view>
<view
class=
"flex-between amount-coupon"
:style=
"
{background:'url('+assetsPath+'/my_coupon_bg.png) 0 0 / 100% 100% no-repeat'}">
<view
class=
"part-left"
>
...
...
@@ -216,11 +216,14 @@
},
onCheckUserLogin
()
{
let
tokenHeaders
=
uni
.
getStorageSync
(
"tokenHeaders"
);
console
.
log
(
tokenHeaders
,
909090
)
if
(
tokenHeaders
)
{
this
.
onGetUserInfo
();
}
else
{
this
.
loginStatus
=
false
;
uni
.
removeStorage
({
key
:
'userInfo'
})
this
.
userInfo
=
{}
}
},
onGetUserInfo
()
{
...
...
pages/order/order.vue
View file @
6a9ff6c8
...
...
@@ -131,9 +131,6 @@
<text>
{{
endTime
}}
</text>
</button>
</view>
</view>
</view>
<view
class=
"date-interval"
>
...
...
@@ -156,6 +153,7 @@
</view>
<view
class=
"date-point-box"
>
<view
v-for=
"(item,k) in intervalList"
: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?'checked':'error'"
>
...
...
@@ -249,11 +247,11 @@
<view
class=
"action text-pink"
@
tap=
"onSelectedDuration"
>
确定
</view>
</view>
<view
class=
"select-box"
>
<picker-view
class=
"picker-view"
indicator-style=
"height: 42px;"
:immediate-change=
"true"
v-model=
"durationIndex"
<picker-view
class=
"picker-view"
indicator-style=
"height: 42px;"
:immediate-change=
"true"
v-model=
"durationIndex
2
"
@
change=
"onBindDuratin"
>
<picker-view-column>
<view
class=
"item"
v-for=
"(item,index) in hourList"
:key=
"index"
>
<text>
{{
i
ndex
+
1
}}
小时
</text>
<view
class=
"item"
v-for=
"(item,index) in hourList
2
"
:key=
"index"
>
<text>
{{
i
tem
}}
小时
</text>
</view>
</picker-view-column>
</picker-view>
...
...
@@ -338,15 +336,6 @@
LoginPop
},
data
()
{
let
dateList
=
[];
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
let
obj
=
{
date
:
moment
().
add
(
i
,
"days"
).
format
(
"MM-DD"
),
readDate
:
moment
().
add
(
i
,
"days"
).
format
(
"YYYY-MM-DD"
),
weekday
:
moment
().
add
(
i
,
"days"
).
format
(
"dddd"
)
}
dateList
.
push
(
obj
)
}
return
{
id
:
''
,
orderType
:
1
,
//订单模式,1:下单;2续单
...
...
@@ -359,7 +348,13 @@
startTime
:
moment
().
format
(
"HH:mm"
),
endTime
:
'12:00'
,
dateIndex
:
0
,
dateList
,
dateList
:[
// {
// date:"02-28",
// readDate:'2024-02-28',
// weekday:''
// }
],
index
:
0
,
orderTypeList
:
[{
label
:
"小时模式"
,
...
...
@@ -416,6 +411,8 @@
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
],
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'
,
"30"
],
orderTypeEnum
:
{
1
:
"预定"
,
...
...
@@ -445,6 +442,8 @@
},
days
:
1
,
addM
:
false
,
//初始化加一分钟,之后不加
startHours
:
0
,
endHours
:
48
};
},
filters
:{
...
...
@@ -459,14 +458,23 @@
return
time
;
}
},
onLoad
(
option
)
{
watch
:{
dateIndex
(){
this
.
onSetSelectTime
()
this
.
onSetStartHours
()
}
},
onLoad
(
option
)
{
uni
.
showLoading
({
title
:
"加载中"
})
this
.
onInitDateList
();
this
.
onSetStartHours
();
this
.
onGetDicts
();
this
.
id
=
option
.
roomId
;
if
(
option
.
orderNo
)
{
this
.
orderType
=
2
;
this
.
distanceIndex
=
1
this
.
preOrderNo
=
option
.
orderNo
;
uni
.
setNavigationBarTitle
({
title
:
'房间续单'
...
...
@@ -474,15 +482,45 @@
this
.
onGetOrderInfo
()
}
else
{
this
.
onLoading
()
this
.
distanceIndex
=
0
}
},
onShow
()
{
// if( Number(moment().format("HHmm")) > Number(this.startTime.split(":").join(''))){
// this.startTime = moment().format("HH:mm"),
// this.onSetEndTime();
// }
},
methods
:
{
onInitDateList
(){
let
dateList
=
[];
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
let
obj
=
{
date
:
this
.
dateList
.
length
?
moment
(
this
.
dateList
[
1
].
readDate
).
add
(
i
,
"days"
).
format
(
"MM-DD"
):
moment
().
add
(
i
,
"days"
).
format
(
"MM-DD"
),
readDate
:
this
.
dateList
.
length
?
moment
(
this
.
dateList
[
1
].
readDate
).
add
(
i
,
"days"
).
format
(
"YYYY-MM-DD"
)
:
moment
().
add
(
i
,
"days"
).
format
(
"YYYY-MM-DD"
),
weekday
:
this
.
dateList
.
length
?
moment
(
this
.
dateList
[
1
].
readDate
).
add
(
i
,
"days"
).
format
(
"dddd"
)
:
moment
().
add
(
i
,
"days"
).
format
(
"dddd"
)
}
dateList
.
push
(
obj
)
}
this
.
dateList
=
dateList
;
},
onSetSelectTime
(){
if
(
this
.
dateIndex
===
0
){
let
h
=
new
Date
().
getHours
()
this
.
hourList
=
this
.
hourList
.
filter
(
item
=>
Number
(
item
)
>=
h
).
map
(
item
=>
{
return
item
>=
10
?
item
:
`0
${
item
}
`
}
)
}
else
{
this
.
hourList
=
[
"00"
,
"01"
,
"02"
,
"03"
,
"04"
,
"05"
,
"06"
,
"07"
,
"08"
,
"09"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
]
}
},
onSetStartHours
(){
if
(
this
.
dateIndex
===
0
){
this
.
startHours
=
new
Date
().
getHours
();
}
else
{
this
.
startHours
=
0
}
this
.
endHours
=
this
.
startHours
+
23
;
this
.
onSetSelectTime
();
},
onGetDicts
()
{
let
dicts
=
[]
if
(
uni
.
getStorageSync
(
'dicts'
))
{
...
...
@@ -548,12 +586,39 @@
}
else
{
this
.
duration
=
Number
(
this
.
distanceMode
[
this
.
distanceIndex
].
duration
);
}
this
.
dateIntervalList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
{
...
item
,
hour
:
index
>
0
&&
index
-
24
==
0
?
'次日'
:
index
>
24
?
index
-
24
:
index
}
})
// 今天可连续选择的时段
let
selectNum
=
0
;
// let startInex = this.dateIntervalList.findIndex(item => item.status === 0)
this
.
dateIntervalList
.
forEach
((
val
,
i
)
=>
{
if
(
i
<=
23
){
if
(
selectNum
>=
this
.
duration
){
return
}
else
if
(
val
.
status
===
0
){
selectNum
+=
1
}
else
{
selectNum
=
0
}
}
})
if
(
selectNum
<
this
.
duration
){
if
(
this
.
dateIndex
>=
this
.
dateList
.
length
-
1
){
this
.
onInitDateList
()
}
else
{
this
.
dateIndex
+=
1
;
}
this
.
onGetSortDistance
();
return
;
}
if
(
this
.
orderType
===
2
){
this
.
onSetEndTime
()
}
else
{
...
...
@@ -591,9 +656,10 @@
this
.
setStartTime
.
status
=
false
;
}
else
if
(
item
.
status
===
0
&&
this
.
setStartTime
.
duration
===
0
&&
!
this
.
setStartTime
.
status
){
this
.
setStartTime
.
duration
+=
1
;
this
.
setStartTime
.
startTime
=
`
${
index
}
:00`
;
this
.
setStartTime
.
startTime
=
`
${
index
>=
10
?
index
:
'0'
+
index
}
:00`
;
if
(
index
>=
24
){
this
.
setStartTime
.
startTime
=
`
${
index
-
24
}
:00`
;
let
ii
=
index
-
24
this
.
setStartTime
.
startTime
=
`
${
ii
>=
10
?
ii
:
'0'
+
ii
}
:00`
;
this
.
setStartTime
.
days
=
2
this
.
days
=
2
;
}
...
...
@@ -606,7 +672,7 @@
this
.
setStartTime
.
duration
+=
1
;
}
if
(
index
>=
this
.
dateIntervalList
.
length
-
1
){
if
(
!
this
.
addM
){
if
(
!
this
.
addM
&&
this
.
dateIntervalList
[
0
].
status
){
this
.
addM
=
true
// 开始时间加一分钟
let
arr
=
this
.
startTime
.
split
(
":"
);
...
...
@@ -701,9 +767,9 @@
let
end
=
Number
(
this
.
endTime
.
split
(
":"
)[
0
])
let
endM
=
Number
(
this
.
endTime
.
split
(
":"
)[
1
])
// 如果开始时间是第二天
if
(
this
.
setStartTime
.
days
>=
2
||
this
.
days
==
2
){
start
+=
24
}
//
if(this.setStartTime.days >=2 || this.days == 2){
//
start +=24
//
}
if
(
this
.
orderType
==
2
&&
end
<
start
){
end
+=
24
}
else
if
(
this
.
orderType
==
1
&&
end
<=
start
)
{
...
...
@@ -753,6 +819,7 @@
preStartDate
:
this
.
dateObj
.
startDate
,
preEndDate
:
this
.
dateObj
.
endDate
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
data
.
length
)
{
this
.
useCouponList
=
res
.
data
.
data
.
filter
(
item
=>
item
.
isAvailable
===
0
).
sort
((
a
,
...
...
@@ -795,7 +862,7 @@
//计算支付金额
onComputePrice
()
{
uni
.
showLoading
({
title
:
"
计算价格
中..."
title
:
"
加载
中..."
})
let
params
=
{
storeId
:
this
.
roomInfo
.
storeId
,
...
...
@@ -830,19 +897,43 @@
if
(
this
.
index
===
i
||
!
this
.
packageMode
.
length
)
return
;
this
.
index
=
i
this
.
modeIndex
=
0
;
this
.
distanceIndex
=
0
;
this
.
onSetEndTime
()
this
.
distanceIndex
=
this
.
orderType
==
2
?
1
:
0
;
this
.
setStartTime
=
{
status
:
false
,
startTime
:
''
,
startDate
:
''
,
duration
:
0
,
days
:
1
}
// if(Number(this.startTime.split(":")[0])
<
new
Date
().
getHours
()){
// this.days = 2
// }else{
// this.days =1
// }
this
.
days
=
1
this
.
checkedDateList
=
[
0
,
0
]
// this.onSetEndTime();
this
.
onGetSortDistance
();
},
async
onChangeMode
(
i
)
{
if
(
this
.
modeIndex
===
i
)
return
;
this
.
modeIndex
=
i
;
this
.
duration
=
Number
(
this
.
packageMode
[
this
.
modeIndex
].
duration
);
let
val
=
this
.
intervalList
.
findIndex
(
item
=>
item
.
status
===
2
)
let
len
=
this
.
intervalList
.
filter
(
item
=>
item
.
status
===
2
).
length
;
let
duration
=
Number
(
this
.
packageMode
[
this
.
modeIndex
].
duration
);
let
start
=
Number
(
this
.
startTime
.
split
(
":"
)[
0
])
let
startM
=
Number
(
this
.
startTime
.
split
(
":"
)[
1
])
let
h
=
val
;
if
(
val
>=
24
){
this
.
setStartTime
.
days
=
2
;
this
.
days
=
2
;
}
if
(
val
+
duration
>=
24
){
h
=
val
+
duration
-
24
}
else
{
...
...
@@ -873,7 +964,7 @@
})
}
// this.onComputePrice();
this
.
dateObj
=
await
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
this
.
dateObj
=
await
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
this
.
onGetUseCoupon
()
},
onDurationChange
(
i
)
{
...
...
@@ -893,14 +984,57 @@
onDateChange
(
k
)
{
if
(
this
.
orderType
==
2
)
return
;
if
(
this
.
dateIndex
===
k
)
return
;
this
.
dateIndex
=
k
this
.
onGetSortDistance
()
listSortDistance
({
storeId
:
this
.
roomInfo
.
storeId
,
roomId
:
this
.
roomInfo
.
id
,
day
:
this
.
dateList
[
k
].
readDate
,
orderType
:
this
.
orderType
}).
then
(
res
=>
{
let
n
=
0
res
.
data
.
data
.
forEach
((
item
,
k
)
=>
{
if
(
k
<
24
&&
n
<=
this
.
duration
&&
item
.
status
===
0
){
n
+=
1
}
else
{
if
(
n
<
this
.
duration
){
n
=
0
}
}
})
if
(
n
<
this
.
duration
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"当前日期无可预约时段"
})
return
}
this
.
dateIndex
=
k
this
.
setStartTime
=
{
status
:
false
,
startTime
:
''
,
startDate
:
''
,
duration
:
0
,
days
:
1
}
this
.
days
=
1
;
this
.
addM
=
false
;
this
.
onGetSortDistance
()
})
},
// 开始选择时间
onSelectDate
()
{
if
(
this
.
orderType
===
2
)
return
;
if
(
!
this
.
checkedIndex
.
length
)
{
let
arr
=
this
.
startTime
.
split
(
":"
)
let
arr
=
this
.
startTime
.
split
(
":"
).
map
((
item
,
k
)
=>
{
let
n
=
Number
(
item
)
if
(
k
===
0
&&
this
.
dateIndex
===
0
){
n
=
this
.
hourList
.
findIndex
(
val
=>
Number
(
val
)
===
n
)
}
return
n
})
if
(
arr
.
length
)
{
if
(
Number
(
arr
[
1
])
<=
10
)
{
this
.
checkedDateList
=
[
arr
[
0
],
0
]
...
...
@@ -927,7 +1061,7 @@
},
// 选择完时间
onSelectedDate
()
{
this
.
checkedDateList
=
this
.
checkedIndex
;
this
.
checkedDateList
=
this
.
checkedIndex
.
length
?
this
.
checkedIndex
.
map
(
item
=>
Number
(
item
)):[
0
,
0
]
;
this
.
startTime
=
`
${
this
.
hourList
[
this
.
checkedDateList
[
0
]]}
:
${
this
.
minuteList
[
this
.
checkedDateList
[
1
]]}
`
;
this
.
$forceUpdate
();
//重新设置结束时间
...
...
@@ -943,15 +1077,14 @@
},
onBindDuratin
(
e
)
{
this
.
durationIndex
=
e
.
target
.
value
this
.
durationIndex
2
=
e
.
target
.
value
},
onSelectedDuration
()
{
this
.
distanceIndex
=
3
this
.
editDuration
=
this
.
durationIndex
;
this
.
editDuration
=
this
.
durationIndex
2
;
this
.
distanceMode
[
this
.
distanceIndex
]
=
{
duration
:
this
.
editDuration
[
0
]
+
1
,
duration
:
this
.
hourList2
[
this
.
editDuration
[
0
]]
}
this
.
onHideModal
()
this
.
$forceUpdate
();
this
.
onSetEndTime
()
...
...
@@ -1031,7 +1164,9 @@
uni
.
navigateTo
({
url
:
`/pages/orderResult/orderResult?orderNo=
${
res
.
data
.
data
.
orderNo
}
&success=true`
})
},
1500
)
this
.
startTime
=
moment
(
this
.
dateObj
.
endDate
).
add
(
31
,
'm'
).
format
(
"HH:mm"
)
this
.
onGetSortDistance
()
},
1000
)
}
})
},
...
...
@@ -1055,6 +1190,8 @@
uni
.
navigateTo
({
url
:
`/pages/orderResult/orderResult?orderNo=
${
res
.
data
.
data
.
orderNo
}
&success=true`
})
this
.
startTime
=
moment
(
this
.
dateObj
.
endDate
).
add
(
31
,
'm'
).
format
(
"HH:mm"
)
this
.
onGetSortDistance
()
},
1000
)
}
})
...
...
@@ -1062,7 +1199,13 @@
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
msg
||
"下单失败"
title
:
res
.
data
.
msg
||
"下单失败"
,
duration
:
2000
,
success
:
()
=>
{
setTimeout
(()
=>
{
this
.
onGetSortDistance
()
},
2000
)
}
})
}
})
...
...
@@ -1105,26 +1248,93 @@
},
onSelectDatePoint
(
val
,
i
)
{
if
(
this
.
orderType
==
2
)
return
;
if
(
i
<
24
)
{
if
(
val
.
status
==
1
)
{
let
mTime
=
moment
(
val
.
endHoldTime
).
format
(
"mm"
)
if
(
mTime
>=
'59'
)
{
if
(
i
>=
24
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
'预约次日时段,请先选择日期'
})
return
}
let
time
=
i
;
if
(
i
>=
24
){
time
=
i
-
24
;
if
(
this
.
dateIndex
===
0
){
this
.
dateIndex
+=
1
;
}
}
if
(
val
.
status
==
1
)
{
let
mTime
=
Number
(
moment
(
val
.
endHoldTime
).
format
(
"mm"
))
if
(
mTime
>=
59
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'当前时段不可选'
})
return
;
}
else
{
this
.
startTime
=
`
${
i
>=
10
?
i
:
'0'
+
i
}
:
${
mTime
>=
10
?
mTime
:
'0'
+
mTime
}
`
;
this
.
onSetEndTime
()
this
.
startTime
=
`
${
time
>=
10
?
time
:
'0'
+
time
}
:
${
mTime
>=
10
?
mTime
:
'0'
+
mTime
}
`
;
if
(
time
>
0
){
// 开始时间加一分钟
let
arr
=
this
.
startTime
.
split
(
":"
);
let
m
=
Number
(
arr
[
1
])
+
1
let
h
=
Number
(
arr
[
0
])
this
.
startTime
=
`
${
h
>=
10
?
h
:
'0'
+
h
}
:
${
m
>=
10
?
m
:
'0'
+
m
}
`
}
this
.
endTime
=
this
.
startTime
.
split
(
":"
).
map
((
item
,
k
)
=>
{
let
n
=
Number
(
item
);
if
(
k
==
0
){
n
=
n
+
this
.
duration
>=
24
?
n
+
this
.
duration
-
24
:
n
+
this
.
duration
}
return
n
>=
10
?
n
:
`0
${
n
}
`
}).
join
(
":"
)
}
}
else
{
this
.
startTime
=
`
${
i
>=
10
?
i
:
'0'
+
i
}
:00`
;
this
.
onSetEndTime
()
}
else
{
let
mTime
=
Number
(
moment
(
val
.
endHoldTime
).
format
(
"mm"
))
this
.
startTime
=
`
${
time
>=
10
?
time
:
'0'
+
time
}
:00`
;
if
(
time
>
0
&&
this
.
dateIntervalList
[
time
-
1
].
status
==
1
&&
mTime
>=
59
){
// 开始时间加一分钟
let
arr
=
this
.
startTime
.
split
(
":"
);
let
m
=
Number
(
arr
[
1
])
+
1
let
h
=
Number
(
arr
[
0
])
this
.
startTime
=
`
${
h
>=
10
?
h
:
'0'
+
h
}
:
${
m
>=
10
?
m
:
'0'
+
m
}
`
}
this
.
endTime
=
this
.
startTime
.
split
(
":"
).
map
((
item
,
k
)
=>
{
let
n
=
Number
(
item
);
if
(
k
==
0
){
n
=
n
+
this
.
duration
>=
24
?
n
+
this
.
duration
-
24
:
n
+
this
.
duration
}
return
n
>=
10
?
n
:
`0
${
n
}
`
}).
join
(
":"
)
}
this
.
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
let
showHourUse
=
false
;
this
.
intervalList
=
this
.
intervalList
.
map
((
item
,
index
)
=>
{
let
status
=
item
.
status
;
if
(
index
>=
i
&&
index
<=
i
+
this
.
duration
){
status
=
2
if
(
this
.
dateIntervalList
[
index
].
status
===
1
&&
index
!==
i
){
showHourUse
=
true
}
}
else
{
status
=
this
.
dateIntervalList
[
index
].
status
}
return
{
...
item
,
status
}
})
if
(
showHourUse
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"选择时段有重复"
})
}
},
// 将时间转换成完整日期
onSetDateTime
(
startTime
,
endTime
)
{
onSetDateTime
(
startTime
,
endTime
)
{
let
obj
=
{
startDate
:
""
,
endDate
:
''
...
...
@@ -1133,14 +1343,15 @@
let
endArr
=
endTime
.
split
(
":"
)
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.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`
//
}
obj
.
startDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
if
((
this
.
orderType
==
1
&&
Number
(
endArr
[
0
])
<=
Number
(
startArr
[
0
])))
{
obj
.
endDate
=
...
...
@@ -1372,11 +1583,10 @@
}
.package-mode
{
padding
:
0
30
upx
30
upx
;
padding
:
0
0
30
upx
;
border-bottom
:
2
upx
solid
#F1F1F1
;
.part-1
{
margin
:
30
upx
0
;
margin
:
30
upx
;
}
.package-box
{
...
...
@@ -1548,6 +1758,7 @@
>
text
{
font-size
:
20
upx
;
text-align
:
center
;
}
}
}
...
...
@@ -1746,19 +1957,33 @@
padding
:
12
upx
;
border
:
4
upx
solid
#DBA556
;
border-radius
:
12
upx
;
margin
-top
:
20
upx
;
margin
:
20
upx
;
background
:
#FBF6EE
;
color
:
#B67D32
;
//
font-size
:
24
upx
;
}
.scroll-view
{
height
:
136
upx
;
width
:
100vw
;
.package-box{
position
:
absolute
;
top
:
0
;
left
:
2vw
;
height
:
136
upx
;
width
:
96vw
;
display
:
flex
;
flex-direction
:
row
;
.item{
min-width
:
27vw
;
display
:
flex
;
flex-direction
:
column
;
flex
:
1
;
height
:
100%
;
.text-title{
font-size
:
25
upx
;
}
.flex-row
{
font-size
:
23
upx
;
}
}
}
}
...
...
pages/orderResult/orderResult.vue
View file @
6a9ff6c8
...
...
@@ -97,10 +97,10 @@
<view
class=
"part"
>
<button
class=
"cu-btn block round bg-pink lg"
:class=
"openDoorStatus?'bg-gray':'bg-pink'"
@
tap=
"onOpenDoor"
>
进店开门
</button>
</view>
<view
class=
"part"
>
<view
v-if=
"userInfo.id == orderInfo.consumerId"
class=
"part"
>
<button
class=
"cu-btn block round line-pink lg"
open-type=
"share"
>
分享好友
</button>
</view>
<view
v-if=
"orderInfo.status === 1"
class=
"part"
>
<view
v-if=
"orderInfo.status === 1
&& userInfo.id == orderInfo.consumerId
"
class=
"part"
>
<button
class=
"cu-btn block round bg-mauve lg"
@
tap=
"onNavToOrder"
>
房间续单
</button>
</view>
</view>
...
...
@@ -122,7 +122,7 @@
</view>
</view>
<view
v-if=
"orderInfo.status ===0 && orderInfo.isRefund"
class=
"cancle-btn-box"
>
<view
v-if=
"orderInfo.status ===0 && orderInfo.isRefund
&& !shareOrder
"
class=
"cancle-btn-box"
>
<button
class=
"cu-btn bg-pink round block lg"
@
tap=
"onOrderRefund"
>
立即退单
</button>
</view>
</view>
...
...
@@ -133,14 +133,12 @@
</
template
>
<
script
>
import
{
getDictItem
}
from
"@/utils/tools.js"
import
{
getDictItem
}
from
"@/utils/tools.js"
import
fNavbar
from
'@/components/module/f-navbar/f-navbar'
;
import
{
getOrderInfoByNo
,
orderRefund
}
from
"@/api/order.js"
import
{
getOrderInfoByNo
,
orderRefund
,
openDoor
}
from
"@/api/order.js"
import
moment
from
"@/common/moment_zh_cn.js"
;
import
{
openDoor
}
from
"@/api/order.js"
import
config
from
"@/config/index.config"
import
{
listSortDistance
}
from
"@/api/store.js"
;
export
default
{
components
:{
...
...
@@ -154,11 +152,24 @@
hostUrl
:
config
.
hostUrl
,
orderStatusEnum
:{},
roomTypeEnum
:{},
openDoorStatus
:
false
openDoorStatus
:
false
,
shareOrder
:
false
,
userInfo
:{
id
:
''
}
};
},
onLoad
(
option
)
{
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
console
.
log
(
this
.
userInfo
,
"用户信息"
)
this
.
orderNo
=
option
.
orderNo
;
if
(
option
.
share
&&
option
.
share
==
"share"
){
this
.
shareOrder
=
true
}
else
{
this
.
shareOrder
=
false
}
this
.
onGetDicts
()
this
.
onLoading
();
if
(
option
.
success
){
...
...
@@ -169,7 +180,7 @@
onShareAppMessage
()
{
return
{
title
:
`
${
this
.
orderInfo
.
storeName
}
-
${
this
.
orderInfo
.
roomName
}
【
${
this
.
orderInfo
.
roomTypeName
}
】`
,
path
:
`/pages/orderResult/orderResult?orderNo=
${
this
.
orderNo
}
`
path
:
`/pages/orderResult/orderResult?orderNo=
${
this
.
orderNo
}
&share=share
`
}
},
methods
:{
...
...
@@ -231,6 +242,9 @@
icon
:
"none"
,
title
:
res
.
data
.
msg
})
if
(
res
.
data
.
code
==
200
){
this
.
onLoading
();
}
setTimeout
(()
=>
{
this
.
openDoorStatus
=
false
;
},
5000
)
...
...
@@ -249,8 +263,33 @@
})
},
onNavToOrder
(){
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
listSortDistance
({
storeId
:
this
.
orderInfo
.
storeId
,
roomId
:
this
.
orderInfo
.
roomId
,
day
:
this
.
orderInfo
.
endDate
,
orderType
:
2
}).
then
(
res
=>
{
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
){
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"
,
title
:
"此订单已无可续单时段"
})
}
}
}
})
},
onOrderRefund
(){
...
...
@@ -298,6 +337,7 @@
display
:
flex
;
flex-direction
:
column
;
width
:
100vw
;
padding-bottom
:
120
upx
;
.order-info-content{
display
:
flex
;
flex-direction
:
column
;
...
...
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