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
f27b898b
Commit
f27b898b
authored
Nov 18, 2023
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能完善
parent
f2b55c49
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
494 additions
and
112 deletions
+494
-112
toolBox.vue
components/toolBox/toolBox.vue
+19
-11
pages.json
pages.json
+9
-1
index.vue
pages/cleanRecord/index.vue
+1
-1
myInfo.vue
pages/my/myInfo.vue
+38
-15
order.vue
pages/order/order.vue
+173
-81
orderRecord.vue
pages/orderRecord/orderRecord.vue
+9
-2
orderResult.vue
pages/orderResult/orderResult.vue
+20
-1
index.vue
pages/setUserInfo/index.vue
+225
-0
camera.png
static/camera.png
+0
-0
No files found.
components/toolBox/toolBox.vue
View file @
f27b898b
...
@@ -40,7 +40,8 @@
...
@@ -40,7 +40,8 @@
sortName
:
"客"
sortName
:
"客"
}
}
],
],
timer
:
null
timer
:
null
,
orderInfo
:{}
};
};
},
},
watch
:{
watch
:{
...
@@ -65,8 +66,8 @@
...
@@ -65,8 +66,8 @@
methods
:{
methods
:{
onHandle
(
val
,
index
){
onHandle
(
val
,
index
){
console
.
log
(
val
,
index
)
console
.
log
(
val
,
index
)
if
(
index
===
0
){
if
(
[
0
,
1
].
includes
(
index
)
){
this
.
onGetOrderByAvailable
()
this
.
onGetOrderByAvailable
(
index
)
return
return
}
}
if
(
val
.
routePath
){
if
(
val
.
routePath
){
...
@@ -75,13 +76,23 @@
...
@@ -75,13 +76,23 @@
})
})
}
}
},
},
onGetOrderByAvailable
(){
onGetOrderByAvailable
(
i
){
getOrderByAvailable
().
then
(
res
=>
{
getOrderByAvailable
().
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
data
.
code
===
200
){
if
(
res
.
data
.
code
===
200
){
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
length
===
1
){
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
length
===
1
){
this
.
orderNo
=
res
.
data
.
data
[
0
].
orderNo
;
this
.
orderInfo
=
res
.
data
.
data
[
0
];
this
.
onOpenDoor
()
if
(
i
===
1
){
// 去续单
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
})
}
else
{
// 去开门
this
.
onOpenDoor
()
}
}
else
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
length
>
1
){
}
else
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
length
>
1
){
uni
.
switchTab
({
uni
.
switchTab
({
url
:
"/pages/orderRecord/orderRecord"
url
:
"/pages/orderRecord/orderRecord"
...
@@ -89,7 +100,7 @@
...
@@ -89,7 +100,7 @@
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
"none"
,
icon
:
"none"
,
title
:
"暂无可用的订单"
title
:
"暂无可用的订单
,请先下单预约哦!
"
})
})
}
}
}
else
{
}
else
{
...
@@ -104,15 +115,12 @@
...
@@ -104,15 +115,12 @@
uni
.
showLoading
({
uni
.
showLoading
({
title
:
"开门中..."
title
:
"开门中..."
})
})
openDoor
(
this
.
orderNo
).
then
(
res
=>
{
openDoor
(
this
.
order
Info
.
order
No
).
then
(
res
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
uni
.
showToast
({
uni
.
showToast
({
icon
:
"none"
,
icon
:
"none"
,
title
:
res
.
data
.
msg
title
:
res
.
data
.
msg
})
})
// if(res.data.code ==200){
// }
})
})
}
}
}
}
...
...
pages.json
View file @
f27b898b
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
{
{
"path"
:
"pages/order/order"
,
"path"
:
"pages/order/order"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"预约"
,
"navigationBarTitleText"
:
"
房间
预约"
,
"navigationStyle"
:
"default"
"navigationStyle"
:
"default"
}
}
},
},
...
@@ -135,6 +135,14 @@
...
@@ -135,6 +135,14 @@
"navigationBarTitleText"
:
"保洁记录"
,
"navigationBarTitleText"
:
"保洁记录"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
{
"path"
:
"pages/setUserInfo/index"
,
"style"
:
{
"navigationBarTitleText"
:
"资料修改"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
}
}
}
],
],
...
...
pages/cleanRecord/index.vue
View file @
f27b898b
...
@@ -162,7 +162,7 @@ import NoLogin from "@/components/noLogin/noLogin"
...
@@ -162,7 +162,7 @@ import NoLogin from "@/components/noLogin/noLogin"
</
script
>
</
script
>
<
style
>
<
style
>
page
{
page
{
background-color
:
#f
fffff
;
background-color
:
#f
1f1f1
;
}
}
</
style
>
</
style
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
pages/my/myInfo.vue
View file @
f27b898b
...
@@ -4,25 +4,28 @@
...
@@ -4,25 +4,28 @@
<view
class=
"header-content-box"
>
<view
class=
"header-content-box"
>
<view
v-if=
"loginStatus"
class=
"login-content"
>
<view
v-if=
"loginStatus"
class=
"login-content"
>
<view
class=
"flex-1 flex-row"
>
<view
class=
"flex-1 flex-row"
>
<view
class=
"cu-avatar xl round margin-left"
<view
class=
"cu-avatar xl round margin-left"
>
style=
"background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"
>
<image
class=
"avatar-img"
:src=
"userInfo.avatar|| assetsPath+'/cart.png'"
mode=
"scaleToFill"
></image
>
</view>
</view>
<view
class=
"flex-col margin-left"
>
<view
class=
"flex-col margin-left"
>
<text
class=
"text-title text-lg text-white text-bold text-xxl"
>
{{
userInfo
.
nickName
||
"凑角001"
}}
</text>
<text
class=
"text-title text-lg text-white text-bold text-xxl"
>
{{
userInfo
.
nickName
||
"凑角001"
}}
</text>
<view
class=
"flex-row
margin-top
"
>
<view
class=
"flex-row
"
style=
"margin-top: 10rpx;
"
>
<
text
class=
"cuIcon-hotfill text-white"
></text
>
<
!--
<text
class=
"cuIcon-hotfill text-white"
></text>
--
>
<text
class=
"text-white text-lg"
>
会员用户
</text>
<text
class=
"text-white text-lg"
>
会员用户
</text>
</view>
</view>
</view>
</view>
<view
class=
"nav-right"
@
tap=
"onNavToSetUserInfo"
>
<text
class=
"text-white text-xl"
>
修改资料
</text>
</view>
</view>
</view>
<view
class=
"flex-row amount-coupon"
>
<view
class=
"flex-row amount-coupon"
>
<view
class=
"flex-col"
>
<!--
<view
class=
"flex-col"
>
<text
class=
"text-white text-xl"
>
余额
</text>
<text
class=
"text-white text-xl"
>
余额
</text>
<text
class=
"text-white text-xl"
>
¥
{{
(
Number
(
userInfo
.
amount
)
+
Number
(
userInfo
.
freeAmount
)).
toFixed
(
2
)
}}
</text>
<text
class=
"text-white text-xl"
>
¥
{{
(
Number
(
userInfo
.
amount
)
+
Number
(
userInfo
.
freeAmount
)).
toFixed
(
2
)
}}
</text>
</view>
</view>
<view
class=
"line"
>
<view
class=
"line"
></view>
-->
</view>
<view
class=
"flex-col"
@
tap=
"onNavToMyCoupon"
>
<view
class=
"flex-col"
@
tap=
"onNavToMyCoupon"
>
<text
class=
"text-white text-xl"
>
优惠券
</text>
<text
class=
"text-white text-xl"
>
优惠券
</text>
<text
class=
"text-white text-xl"
>
{{
userInfo
.
number
||
0
}}
张
</text>
<text
class=
"text-white text-xl"
>
{{
userInfo
.
number
||
0
}}
张
</text>
...
@@ -104,13 +107,13 @@
...
@@ -104,13 +107,13 @@
type
:
""
,
type
:
""
,
show
:
true
show
:
true
},
},
{
//
{
label
:
"消费记录"
,
//
label:"消费记录",
iconUrl
:
config
.
assetsPath
+
'/record_icon.png'
,
//
iconUrl:config.assetsPath+'/record_icon.png',
routePath
:
""
,
//
routePath:"",
type
:
""
,
//
type:"",
show
:
true
//
show:true
},
//
},
// {
// {
// label:"立即充值",
// label:"立即充值",
// iconUrl:config.assetsPath+'/vip_icon.png',
// iconUrl:config.assetsPath+'/vip_icon.png',
...
@@ -149,6 +152,7 @@
...
@@ -149,6 +152,7 @@
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
data
.
code
==
200
){
if
(
res
.
data
.
code
==
200
){
this
.
userInfo
=
res
.
data
.
data
;
this
.
userInfo
=
res
.
data
.
data
;
uni
.
setStorageSync
(
'userInfo'
,
this
.
userInfo
)
this
.
loginStatus
=
true
;
this
.
loginStatus
=
true
;
}
}
})
})
...
@@ -177,6 +181,13 @@
...
@@ -177,6 +181,13 @@
}
}
},
},
onNavToSetUserInfo
(){
if
(
this
.
loginStatus
==
true
){
uni
.
navigateTo
({
url
:
"/pages/setUserInfo/index"
})
}
},
// 退出登录,解除手机号与当前微信的绑定
// 退出登录,解除手机号与当前微信的绑定
onLoginOut
(){
onLoginOut
(){
uni
.
showLoading
({
uni
.
showLoading
({
...
@@ -228,7 +239,13 @@
...
@@ -228,7 +239,13 @@
width
:
100%
;
width
:
100%
;
>.flex-row
{
>.flex-row
{
position
:
relative
;
align-items
:
center
;
align-items
:
center
;
.nav-right{
position
:
absolute
;
right
:
5vw
;
margin-top
:
40
upx
;
}
}
}
.amount-coupon
{
.amount-coupon
{
...
@@ -309,4 +326,9 @@
...
@@ -309,4 +326,9 @@
width
:
94%
;
width
:
94%
;
margin-top
:
40
upx
;
margin-top
:
40
upx
;
}
}
.avatar-img
{
width
:
100%
;
height
:
100%
;
border-radius
:
50%
;
}
</
style
>
</
style
>
\ No newline at end of file
pages/order/order.vue
View file @
f27b898b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</view>
</view>
<view
class=
"flex-between part-2"
>
<view
class=
"flex-between part-2"
>
<text
class=
"text-title text-lg"
>
预定须知
</text>
<text
class=
"text-title text-lg"
>
预定须知
</text>
<
text
class=
"text-blue text-lg"
>
使用教程>
</text
>
<
!--
<text
class=
"text-blue text-lg"
>
使用教程>
</text>
--
>
</view>
</view>
<view
class=
"part-3"
>
<view
class=
"part-3"
>
<text
class=
"text-gray"
>
预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单
</text>
<text
class=
"text-gray"
>
预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单
</text>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
</view>
</view>
</view>
</view>
<view
v-show=
"index == 0"
class=
"flex-row distance-mode"
>
<view
v-show=
"
orderType ===1 &&
index == 0"
class=
"flex-row distance-mode"
>
<view
class=
""
>
<view
class=
""
>
<text
class=
"text-title text-lg text-bold"
>
时长选择:
</text>
<text
class=
"text-title text-lg text-bold"
>
时长选择:
</text>
</view>
</view>
...
@@ -65,12 +65,27 @@
...
@@ -65,12 +65,27 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"flex-row date-mode"
>
<view
v-if=
"orderType ===2"
class=
"flex-row distance-mode"
style=
"margin: 40upx 20upx 40upx;"
>
<view
class=
""
>
<text
class=
"text-title text-lg text-bold"
>
时长选择:
</text>
</view>
<view
class=
"flex-1 distance-box"
>
<view
v-for=
"(item,index) in distanceMode2"
:key=
"index"
class=
"flex-col"
style=
"margin: 0 6upx;"
@
tap=
"onDurationChange(index)"
>
<view
class=
"cu-tag radius"
:class=
"index===distanceIndex? 'line-pink':'line-gray'"
>
<text>
{{
item
.
duration
<
1
?
'半小时'
:
item
.
duration
+
'小时'
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"flex-row date-mode"
>
<view
class=
""
>
<view
class=
""
>
<text
class=
"text-title text-lg text-bold"
>
时间选择:
</text>
<text
class=
"text-title text-lg text-bold"
>
时间选择:
</text>
</view>
</view>
<view
class=
"flex-1 date-box"
>
<view
class=
"flex-1 date-box"
>
<button
class=
"cu-btn round
line-pink
"
@
tap=
"onSelectDate"
>
<button
class=
"cu-btn round
"
:class=
"orderType===1?'line-pink':'line-gray'
"
@
tap=
"onSelectDate"
>
<text>
{{
startTime
}}
</text>
<text>
{{
startTime
}}
</text>
<text
class=
"cuIcon-edit"
></text>
<text
class=
"cuIcon-edit"
></text>
</button>
</button>
...
@@ -144,14 +159,13 @@
...
@@ -144,14 +159,13 @@
{{
Number
(
roomInfo
.
price
)
*
duration
>
computePriceInfo
.
payFee
?
'-¥'
+
Number
(
Number
(
roomInfo
.
price
)
*
duration
-
computePriceInfo
.
payFee
).
toFixed
(
2
):
'¥0'
}}
{{
Number
(
roomInfo
.
price
)
*
duration
>
computePriceInfo
.
payFee
?
'-¥'
+
Number
(
Number
(
roomInfo
.
price
)
*
duration
-
computePriceInfo
.
payFee
).
toFixed
(
2
):
'¥0'
}}
</text>
</text>
</view>
</view>
<view
class=
"flex-between price"
>
<!--
<view
class=
"flex-between price"
>
<text
class=
"text-title text-lg"
>
账户余额
</text>
<text
class=
"text-title text-lg"
>
账户余额
</text>
<view
class=
"flex-row text-pink"
>
<view
class=
"flex-row text-pink"
>
<text
class=
"text-title text-lg"
>
¥0.00
</text>
<text
class=
"text-title text-lg"
>
¥0.00
</text>
<button
class=
"recharge-btn cu-btn round bg-pink sm"
@
tap=
"onNavRecharge"
>
去充值
</button>
<button
class=
"recharge-btn cu-btn round bg-pink sm"
@
tap=
"onNavRecharge"
>
去充值
</button>
<!--
<text
class=
"text-title cuIcon-right "
></text>
-->
</view>
</view>
</view>
</view>
-->
</view>
</view>
<view
class=
"pay-content-box"
>
<view
class=
"pay-content-box"
>
<view
class=
"flex-row"
>
<view
class=
"flex-row"
>
...
@@ -162,8 +176,8 @@
...
@@ -162,8 +176,8 @@
</view>
</view>
</view>
</view>
<view
class=
""
>
<view
class=
""
>
<button
class=
"cu-btn bg-pink round lg margin-right"
@
tap=
"onNavToCheckedCoupon"
>
团购验券
</button>
<button
v-if=
"orderType===1"
class=
"cu-btn bg-pink round lg margin-right"
@
tap=
"onNavToCheckedCoupon"
>
团购验券
</button>
<button
class=
"cu-btn bg-pink round lg"
@
tap=
"onOrderConfirm"
>
预约
</button>
<button
class=
"cu-btn bg-pink round lg"
@
tap=
"onOrderConfirm"
>
{{
orderType
===
1
?
'预约'
:
'续单'
}}
</button>
</view>
</view>
</view>
</view>
...
@@ -214,14 +228,14 @@
...
@@ -214,14 +228,14 @@
<view
class=
"confirm-pop"
>
<view
class=
"confirm-pop"
>
<view
class=
"pop-content-box"
>
<view
class=
"pop-content-box"
>
<view
class=
"title"
>
<view
class=
"title"
>
<text
class=
"text-black text-bold text-xl"
>
预约
信息确认
</text>
<text
class=
"text-black text-bold text-xl"
>
{{
orderType
==
1
?
'预约'
:
'续单'
}}
信息确认
</text>
</view>
</view>
<view
class=
"info-box"
>
<view
class=
"info-box"
>
<view
class=
"info"
>
<view
class=
"info"
>
<text
class=
"text-black text-lg"
>
预约
门店:
{{
roomInfo
.
storeName
||
''
}}
</text>
<text
class=
"text-black text-lg"
>
{{
orderType
==
1
?
'预约'
:
'续单'
}}
门店:
{{
roomInfo
.
storeName
||
''
}}
</text>
</view>
</view>
<view
class=
"info"
>
<view
class=
"info"
>
<text
class=
"text-black text-lg"
>
预约
包间:
{{
roomInfo
.
name
}}
</text>
<text
class=
"text-black text-lg"
>
{{
orderType
==
1
?
'预约'
:
'续单'
}}
包间:
{{
roomInfo
.
name
}}
</text>
</view>
</view>
<view
class=
"info"
>
<view
class=
"info"
>
<text
class=
"text-black text-lg"
>
开始时间:
{{
dateObj
.
startDate
}}
</text>
<text
class=
"text-black text-lg"
>
开始时间:
{{
dateObj
.
startDate
}}
</text>
...
@@ -247,7 +261,7 @@
...
@@ -247,7 +261,7 @@
<button
class=
"cu-btn round block line-pink lg"
@
tap=
"onCancle"
>
返回修改
</button>
<button
class=
"cu-btn round block line-pink lg"
@
tap=
"onCancle"
>
返回修改
</button>
</view>
</view>
<view
class=
"btn-box"
>
<view
class=
"btn-box"
>
<button
class=
"cu-btn round block bg-pink lg"
@
tap=
"onOrderCreate"
>
立即
预定
</button>
<button
class=
"cu-btn round block bg-pink lg"
@
tap=
"onOrderCreate"
>
立即
{{
orderType
==
1
?
'预约'
:
'续单'
}}
</button>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -269,7 +283,8 @@
...
@@ -269,7 +283,8 @@
}
from
"@/api/coupon"
}
from
"@/api/coupon"
import
{
import
{
orderCreate
,
orderCreate
,
computePrice
computePrice
,
getOrderInfoByNo
}
from
"@/api/order"
}
from
"@/api/order"
export
default
{
export
default
{
...
@@ -307,7 +322,8 @@
...
@@ -307,7 +322,8 @@
],
],
// 时长选择
// 时长选择
distanceIndex
:
0
,
distanceIndex
:
0
,
distanceMode
:
[{
distanceMode
:
[
{
duration
:
4
duration
:
4
},
},
{
{
...
@@ -320,6 +336,23 @@
...
@@ -320,6 +336,23 @@
duration
:
'其他'
,
duration
:
'其他'
,
}
}
],
],
distanceMode2
:[
{
duration
:
0.5
},
{
duration
:
1
},
{
duration
:
2
},
{
duration
:
3
},
{
duration
:
4
}
],
// 套餐
// 套餐
modeIndex
:
0
,
modeIndex
:
0
,
packageMode
:
[{
packageMode
:
[{
...
@@ -365,11 +398,20 @@
...
@@ -365,11 +398,20 @@
payFee
:
''
,
payFee
:
''
,
totalFee
:
''
,
totalFee
:
''
,
},
},
dateObj
:
{}
dateObj
:
{},
preOrderNo
:
''
};
};
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
this
.
id
=
option
.
roomId
||
106
;
this
.
id
=
option
.
roomId
||
106
;
if
(
option
.
orderNo
){
this
.
orderType
=
2
;
this
.
preOrderNo
=
option
.
orderNo
;
uni
.
setNavigationBarTitle
({
title
:
'房间续单'
})
this
.
onGetOrderInfo
()
}
uni
.
showLoading
({
uni
.
showLoading
({
title
:
"加载中"
title
:
"加载中"
})
})
...
@@ -388,7 +430,8 @@
...
@@ -388,7 +430,8 @@
images
:
res
.
data
.
data
.
images
?
res
.
data
.
data
.
images
images
:
res
.
data
.
data
.
images
?
res
.
data
.
data
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
}
if
(
this
.
roomInfo
.
packList
&&
this
.
roomInfo
.
packList
.
length
)
{
// 判断房间有没有绑定套餐
if
(
this
.
orderType
===
1
&&
this
.
roomInfo
.
packList
&&
this
.
roomInfo
.
packList
.
length
)
{
this
.
packageMode
=
this
.
roomInfo
.
packList
this
.
packageMode
=
this
.
roomInfo
.
packList
this
.
index
=
1
;
this
.
index
=
1
;
this
.
modeIndex
=
0
;
this
.
modeIndex
=
0
;
...
@@ -397,6 +440,15 @@
...
@@ -397,6 +440,15 @@
}
}
})
})
},
},
onGetOrderInfo
(){
getOrderInfoByNo
(
this
.
preOrderNo
).
then
(
res
=>
{
console
.
log
(
res
,
909090
)
if
(
res
.
data
.
code
==
200
){
this
.
startTime
=
moment
(
res
.
data
.
data
.
endDate
).
add
(
1
,
"m"
).
format
(
"HH:mm"
)
}
})
},
//获取时间段是否被占用
onGetSortDistance
()
{
onGetSortDistance
()
{
listSortDistance
({
listSortDistance
({
storeId
:
this
.
roomInfo
.
storeId
,
storeId
:
this
.
roomInfo
.
storeId
,
...
@@ -404,7 +456,6 @@
...
@@ -404,7 +456,6 @@
day
:
this
.
dateList
[
this
.
dateIndex
].
readDate
day
:
this
.
dateList
[
this
.
dateIndex
].
readDate
}).
then
(
res
=>
{
}).
then
(
res
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
console
.
log
(
res
)
this
.
dateIntervalList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
this
.
dateIntervalList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
{
return
{
...
item
,
...
item
,
...
@@ -435,20 +486,43 @@
...
@@ -435,20 +486,43 @@
}).
join
(
":"
)
}).
join
(
":"
)
}
else
{
}
else
{
// 小时模式
// 小时模式
this
.
duration
=
Number
(
this
.
distanceMode
[
this
.
distanceIndex
].
duration
);
if
(
this
.
orderType
===
1
){
this
.
endTime
=
this
.
startTime
.
split
(
":"
).
map
((
item
,
k
)
=>
{
this
.
duration
=
Number
(
this
.
distanceMode
[
this
.
distanceIndex
].
duration
);
let
num
=
''
}
else
if
(
this
.
orderType
===
2
){
if
(
k
==
0
)
{
this
.
duration
=
Number
(
this
.
distanceMode2
[
this
.
distanceIndex
].
duration
);
if
((
Number
(
item
)
+
this
.
duration
)
>
23
)
{
}
num
=
Number
(
item
)
+
this
.
duration
-
24
console
.
log
(
this
.
duration
,
"时长数据"
)
}
else
{
num
=
Number
(
item
)
+
this
.
duration
if
(
this
.
orderType
===
2
&&
this
.
duration
<
1
){
let
startDateArr
=
this
.
startTime
.
split
(
":"
).
map
(
item
=>
Number
(
item
))
// 分钟
let
m
=
startDateArr
[
1
]
+
60
*
this
.
duration
if
(
m
>=
60
){
startDateArr
[
0
]
+=
1
if
(
startDateArr
[
0
]
>
23
){
startDateArr
[
0
]
=
startDateArr
[
0
]
-
23
}
}
}
else
{
}
else
{
num
=
Number
(
item
)
startDateArr
[
1
]
=
m
}
}
return
num
>=
10
?
num
:
`0
${
num
}
`
this
.
endTime
=
startDateArr
.
map
(
num
=>
num
>=
10
?
num
:
`0
${
num
}
`
).
join
(
':'
);
}).
join
(
":"
)
}
else
{
this
.
endTime
=
this
.
startTime
.
split
(
":"
).
map
((
item
,
k
)
=>
{
let
num
=
''
if
(
k
==
0
)
{
if
((
Number
(
item
)
+
this
.
duration
)
>
23
)
{
num
=
Number
(
item
)
+
this
.
duration
-
24
}
else
{
num
=
Number
(
item
)
+
this
.
duration
}
}
else
{
num
=
Number
(
item
)
}
return
num
>=
10
?
num
:
`0
${
num
}
`
}).
join
(
":"
)
}
}
}
this
.
onGetUseCoupon
()
this
.
onGetUseCoupon
()
this
.
onUpdateIntervalList
()
this
.
onUpdateIntervalList
()
...
@@ -466,7 +540,7 @@
...
@@ -466,7 +540,7 @@
let
endM
=
Number
(
this
.
endTime
.
split
(
":"
)[
1
])
let
endM
=
Number
(
this
.
endTime
.
split
(
":"
)[
1
])
console
.
log
(
start
,
end
,
"start"
)
console
.
log
(
start
,
end
,
"start"
)
if
(
end
<
=
start
)
{
if
(
end
<
start
)
{
end
+=
24
end
+=
24
}
}
...
@@ -531,7 +605,7 @@
...
@@ -531,7 +605,7 @@
onNavToSelectCoupon
()
{
onNavToSelectCoupon
()
{
let
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
let
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
let
that
=
this
;
let
that
=
this
;
//
if (this.useCouponList.length) {
if
(
this
.
useCouponList
.
length
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/useCoupon/index"
,
url
:
"/pages/useCoupon/index"
,
events
:
{
events
:
{
...
@@ -552,7 +626,7 @@
...
@@ -552,7 +626,7 @@
})
})
}
}
})
})
//
}
}
},
},
//计算支付金额
//计算支付金额
onComputePrice
()
{
onComputePrice
()
{
...
@@ -583,6 +657,13 @@
...
@@ -583,6 +657,13 @@
},
},
// 下单模式切换
// 下单模式切换
onTypeChange
(
i
)
{
onTypeChange
(
i
)
{
if
(
this
.
orderType
==
2
){
uni
.
showToast
({
icon
:
'none'
,
title
:
'房间续单无法选择套餐模式'
})
return
}
if
(
this
.
index
===
i
||
!
this
.
packageMode
.
length
)
return
;
if
(
this
.
index
===
i
||
!
this
.
packageMode
.
length
)
return
;
this
.
index
=
i
this
.
index
=
i
this
.
modeIndex
=
0
;
this
.
modeIndex
=
0
;
...
@@ -604,11 +685,13 @@
...
@@ -604,11 +685,13 @@
this
.
onSetEndTime
()
this
.
onSetEndTime
()
},
},
onDateChange
(
k
)
{
onDateChange
(
k
)
{
if
(
this
.
orderType
==
2
)
return
;
if
(
this
.
dateIndex
===
k
)
return
;
if
(
this
.
dateIndex
===
k
)
return
;
this
.
dateIndex
=
k
this
.
dateIndex
=
k
this
.
onGetSortDistance
()
this
.
onGetSortDistance
()
},
},
onSelectDate
()
{
onSelectDate
()
{
if
(
this
.
orderType
===
2
)
return
;
if
(
!
this
.
checkedIndex
.
length
)
{
if
(
!
this
.
checkedIndex
.
length
)
{
let
arr
=
this
.
startTime
.
split
(
":"
)
let
arr
=
this
.
startTime
.
split
(
":"
)
if
(
arr
.
length
)
{
if
(
arr
.
length
)
{
...
@@ -690,7 +773,7 @@
...
@@ -690,7 +773,7 @@
title
:
"下单中..."
title
:
"下单中..."
})
})
let
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
let
dateObj
=
this
.
onSetDateTime
(
this
.
startTime
,
this
.
endTime
);
orderCreate
(
{
let
params
=
{
storeId
:
this
.
roomInfo
.
storeId
,
storeId
:
this
.
roomInfo
.
storeId
,
roomId
:
this
.
roomInfo
.
id
,
roomId
:
this
.
roomInfo
.
id
,
orderType
:
this
.
orderType
,
orderType
:
this
.
orderType
,
...
@@ -702,54 +785,60 @@
...
@@ -702,54 +785,60 @@
totalFee
:
Number
(
this
.
roomInfo
.
price
)
*
this
.
duration
,
totalFee
:
Number
(
this
.
roomInfo
.
price
)
*
this
.
duration
,
payFee
:
this
.
computePriceInfo
.
payFee
||
0
,
payFee
:
this
.
computePriceInfo
.
payFee
||
0
,
packId
:
this
.
index
>
0
?
this
.
packageMode
[
this
.
modeIndex
].
id
:
''
packId
:
this
.
index
>
0
?
this
.
packageMode
[
this
.
modeIndex
].
id
:
''
}).
then
(
res
=>
{
}
console
.
log
(
res
,
909090
)
if
(
this
.
orderType
===
2
&&
this
.
preOrderNo
){
params
.
preOrderNo
=
this
.
preOrderNo
}
orderCreate
(
params
).
then
(
res
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
// uni.showToast({
if
(
res
.
data
.
data
.
jsConfig
){
// icon: "success",
wx
.
requestPayment
({
// title: "下单成功",
"timeStamp"
:
res
.
data
.
data
.
jsConfig
.
timeStamp
,
// success: () => {
"nonceStr"
:
res
.
data
.
data
.
jsConfig
.
nonceStr
,
// setTimeout(() => {
"package"
:
res
.
data
.
data
.
jsConfig
.
packages
,
// uni.navigateTo({
"signType"
:
res
.
data
.
data
.
jsConfig
.
signType
,
// url: "/pages/orderResult/orderResult?orderNo=" +
"paySign"
:
res
.
data
.
data
.
jsConfig
.
paySign
,
// res.data.data.orderNo
"success"
:(
resp
)
=>
{
// })
// 支付成功
// }, 1000)
uni
.
showToast
({
// }
icon
:
"success"
,
// })
title
:
"下单成功"
,
wx
.
requestPayment
({
success
:
()
=>
{
"timeStamp"
:
res
.
data
.
data
.
jsConfig
.
timeStamp
,
setTimeout
(()
=>
{
"nonceStr"
:
res
.
data
.
data
.
jsConfig
.
nonceStr
,
uni
.
navigateTo
({
"package"
:
res
.
data
.
data
.
jsConfig
.
packages
,
url
:
"/pages/orderResult/orderResult?orderNo="
+
"signType"
:
res
.
data
.
data
.
jsConfig
.
signType
,
res
.
data
.
data
.
orderNo
"paySign"
:
res
.
data
.
data
.
jsConfig
.
paySign
,
})
"success"
:
function
(
resp
){
},
1500
)
// 支付成功
}
uni
.
showToast
({
})
icon
:
"success"
,
},
title
:
"下单成功"
,
"fail"
:(
resp
)
=>
{
success
:
()
=>
{
// 取消支付或支付失败
setTimeout
(()
=>
{
uni
.
showToast
({
uni
.
navigateTo
({
title
:
"取消支付或支付失败"
url
:
"/pages/orderResult/orderResult?orderNo="
+
})
res
.
data
.
data
.
orderNo
// 调用取消订单接口
})
},
},
1500
)
"complete"
:(
resp
)
=>
{
}
// 接口调用结束的回调函数(调用成功、失败都会执行)
})
}
},
});
"fail"
:
function
(
resp
){
}
else
{
// 取消支付或支付失败
uni
.
showToast
({
uni
.
showToast
({
icon
:
"success"
,
title
:
"取消支付或支付失败"
title
:
"下单成功"
,
})
success
:
()
=>
{
// 调用取消订单接口
setTimeout
(()
=>
{
},
uni
.
navigateTo
({
"complete"
:
function
(
resp
){
url
:
"/pages/orderResult/orderResult?orderNo="
+
// 接口调用结束的回调函数(调用成功、失败都会执行)
res
.
data
.
data
.
orderNo
}
})
});
},
1000
)
}
})
}
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
"下单失败"
title
:
"下单失败"
...
@@ -796,6 +885,7 @@
...
@@ -796,6 +885,7 @@
},
},
// 将时间转换成完整日期
// 将时间转换成完整日期
onSetDateTime
(
startTime
,
endTime
)
{
onSetDateTime
(
startTime
,
endTime
)
{
console
.
log
(
startTime
,
endTime
,
'时间段'
)
let
obj
=
{
let
obj
=
{
startDate
:
""
,
startDate
:
""
,
endDate
:
''
endDate
:
''
...
@@ -803,7 +893,7 @@
...
@@ -803,7 +893,7 @@
let
startArr
=
startTime
.
split
(
":"
)
let
startArr
=
startTime
.
split
(
":"
)
let
endArr
=
endTime
.
split
(
":"
)
let
endArr
=
endTime
.
split
(
":"
)
obj
.
startDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
obj
.
startDate
=
`
${
this
.
dateList
[
this
.
dateIndex
].
readDate
}
${
startTime
}
:00`
if
(
Number
(
endArr
[
0
])
<
=
Number
(
startArr
[
0
]))
{
if
(
Number
(
endArr
[
0
])
<
Number
(
startArr
[
0
]))
{
obj
.
endDate
=
obj
.
endDate
=
`
${
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
`
${
moment
(
this
.
dateList
[
this
.
dateIndex
].
readDate
).
add
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)}
${
endTime
}
:00`
}
else
{
}
else
{
...
@@ -1224,4 +1314,5 @@
...
@@ -1224,4 +1314,5 @@
}
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
pages/orderRecord/orderRecord.vue
View file @
f27b898b
...
@@ -173,14 +173,21 @@ import NoLogin from "@/components/noLogin/noLogin"
...
@@ -173,14 +173,21 @@ import NoLogin from "@/components/noLogin/noLogin"
</
script
>
</
script
>
<
style
>
<
style
>
page
{
page
{
background-color
:
#f
fffff
;
background-color
:
#f
1f1f1
;
}
}
</
style
>
</
style
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.order-record
{
.order-record
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
padding-top
:
100
upx
;
.nav{
position
:
fixed
;
top
:
0
;
left
:
0
;
height
:
90
upx
;
z-index
:
999
;
}
.content-box
{
.content-box
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
...
pages/orderResult/orderResult.vue
View file @
f27b898b
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
</view>
</view>
</view>
</view>
<view
class=
"part-2"
>
<view
v-if=
"orderInfo.status
<
=
1
"
class=
"part-2"
>
<view
class=
"flex-between title"
>
<view
class=
"flex-between title"
>
<view
class=
"flex-row"
>
<view
class=
"flex-row"
>
<text
class=
"cuIcon-titles text-pink text-xl"
></text>
<text
class=
"cuIcon-titles text-pink text-xl"
></text>
...
@@ -95,6 +95,9 @@
...
@@ -95,6 +95,9 @@
</view>
</view>
</view>
</view>
<view
v-if=
"orderInfo.status === 0"
class=
"cancle-btn-box"
>
<button
class=
"cu-btn bg-pink round block lg"
>
立即退单
</button>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -176,6 +179,7 @@
...
@@ -176,6 +179,7 @@
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
width
:
100vw
;
width
:
100vw
;
padding-bottom
:
120
upx
;
.order-info-content{
.order-info-content{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -309,4 +313,19 @@
...
@@ -309,4 +313,19 @@
}
}
}
}
}
}
.cancle-btn-box
{
position
:
fixed
;
left
:
0
;
bottom
:
0
;
width
:
100%
;
height
:
120
upx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
background-color
:
#ffffff
;
z-index
:
99
;
.cu-btn{
width
:
80%
;
}
}
</
style
>
</
style
>
pages/setUserInfo/index.vue
0 → 100644
View file @
f27b898b
<
template
>
<view
class=
"set-user-info"
>
<f-navbar
title=
"个人资料"
fontColor=
"#333333"
:bgColor=
"PrimaryColor"
:isShowLeft=
"true"
:isShowTransparentTitle=
"true"
>
<view
class=
"u-flex"
slot=
"left"
>
<text
style=
"font-size: 44rpx;"
class=
"cuIcon-back text-black"
></text>
</view>
</f-navbar>
<view
class=
"main-content"
>
<view
class=
"user-avatar-box"
@
tap=
"onChangeAvatar"
>
<view
class=
"avatar"
>
<image
class=
"avatar-img"
:src=
"userInfo.avatar|| assetsPath+'/cart.png'"
mode=
"scaleToFill"
></image>
<view
class=
"camera"
>
<image
src=
"../../static/camera.png"
mode=
"widthFix"
></image>
</view>
</view>
<text
class=
"text-gray margin-top"
>
请上传头像
</text>
</view>
<form>
<view
class=
"cu-form-group"
>
<text
class=
"text-black text-bold margin-right"
>
会员昵称
</text>
<input
v-model=
"userInfo.nickName"
type=
"text"
:maxlength=
"12"
placeholder=
"请输入用户昵称"
name=
"input"
></input>
</view>
<view
class=
"cu-form-group"
>
<view
class=
"text-black text-bold margin-right"
>
会员性别
</view>
<radio-group
class=
"block"
@
change=
"onSwitch"
>
<view
class=
"radio-group-box flex-row"
>
<view
class=
"flex-row"
>
<text>
男
</text>
<radio
class=
'pink radio'
:class=
"userInfo.sex == 1?'checked':''"
:checked=
"userInfo.sex==1?true:false"
value=
"1"
></radio>
</view>
<view
class=
"flex-row"
>
<text>
女
</text>
<radio
class=
'pink radio'
:class=
"userInfo.sex == 2?'checked':''"
:checked=
"userInfo.sex==2?true:false"
value=
"2"
></radio>
</view>
<view
class=
"flex-row"
>
<text>
未知
</text>
<radio
class=
'pink radio'
:class=
"userInfo.sex == '0'?'checked':''"
:checked=
"userInfo.sex=='0'?true:false"
value=
"0"
></radio>
</view>
</view>
</radio-group>
</view>
<view
class=
"cu-form-group"
>
<text
class=
"text-black text-bold margin-right"
>
手机号
</text>
<input
v-model=
"userInfo.phone"
type=
"number"
:maxlength=
"12"
placeholder=
"请输入您的手机号"
name=
"input"
></input>
</view>
</form>
<view
class=
"confirm-btn-box"
>
<view
class=
"confirm-btn"
>
<button
class=
"btn cu-btn bg-pink block"
@
tap=
"onSaveUserInfo"
>
确认修改
</button>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
fNavbar
from
'@/components/module/f-navbar/f-navbar'
;
import
{
uploadFile
,
updateUserInfo
}
from
"@/api/index.js"
;
import
config
from
"@/config/index.config"
import
{
checkPhone
}
from
"@/utils/tools.js"
export
default
{
components
:
{
fNavbar
},
data
(){
return
{
userInfo
:{
avatar
:
""
,
nickName
:
""
,
phone
:
''
},
assetsPath
:
config
.
assetsPath
,
nickName
:
""
,
PrimaryColor
:
'#ffffff'
,
//主题色
switchBtn
:
true
}
},
onLoad
()
{
this
.
onLoading
();
},
methods
:{
onLoading
(){
this
.
userInfo
=
uni
.
getStorageSync
(
"userInfo"
)
},
onSwitch
(
e
){
this
.
userInfo
.
sex
=
e
.
target
.
value
;
},
onChangeAvatar
(){
let
that
=
this
;
uni
.
chooseImage
({
count
:
1
,
success
:
(
result
)
=>
{
uploadFile
({
url
:
result
.
tempFilePaths
[
0
]}).
then
(
res
=>
{
let
data
=
JSON
.
parse
(
res
.
data
)
console
.
log
(
data
,
1212
)
if
(
data
.
code
==
200
){
that
.
userInfo
.
avatar
=
data
.
url
;
}
})
}
})
},
onSaveUserInfo
(){
if
(
this
.
userInfo
.
phone
&&
!
checkPhone
(
this
.
userInfo
.
phone
)){
uni
.
showToast
({
icon
:
'none'
,
title
:
'手机号输入不正确'
})
return
}
updateUserInfo
(
this
.
userInfo
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"保存成功"
})
}
})
}
}
}
</
script
>
<
style
>
page
{
background-color
:
#FFFFFF
;
}
</
style
>
<
style
lang=
"scss"
scoped
>
.main-content
{
display
:
flex
;
flex-direction
:
column
;
width
:
100vw
;
.user-avatar-box{
height
:
30vh
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
margin-top
:
40
upx
;
.avatar{
width
:
90px
;
height
:
90px
;
border-radius
:
50%
;
position
:
relative
;
overflow
:
hidden
;
.avatar-img{
display
:
block
;
width
:
100%
;
height
:
100%
;
border-radius
:
50%
;
}
.camera
{
position
:
absolute
;
right
:
0
;
bottom
:
0
;
display
:
flex
;
width
:
24px
;
height
:
24px
;
border-radius
:
50%
;
justify-content
:
center
;
align-items
:
center
;
background-color
:
#127FFF
;
image{
display
:
block
;
width
:
28
upx
;
height
:
auto
;
}
}
}
.margin-top
{
margin-top
:
20
upx
;
}
}
.cu-form-group
{
width
:
642
/
750
*
100vw
;
height
:
90
upx
;
margin
:
10
upx
auto
0
;
//
border-bottom
:
1px
solid
#F0F3F6
;
.bg-blue
{
background-color
:
#035EAC
;
}
.bg-gray
{
background-color
:
#999999
;
text
{
color
:
#FFFFFF
;
}
}
}
.confirm-btn-box
{
width
:
100vw
;
margin-top
:
40
upx
;
.confirm-btn
{
margin
:
0
36
upx
;
.btn
{
height
:
90
upx
;
box-shadow
:
0px
12px
26px
1px
rgba
(
7
,
83
,
254
,
0.2
);
border-radius
:
20
upx
;
font-size
:
30
*
1.2
upx
;
color
:
#FFFFFF
;
}
}
}
}
.radio-group-box
{
.flex-row{
display
:
flex
;
align-items
:
center
;
margin
:
0
10
upx
;
text{
margin-right
:
8
upx
;
}
}
}
</
style
>
static/camera.png
0 → 100644
View file @
f27b898b
563 Bytes
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