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
b01256ba
Commit
b01256ba
authored
Apr 12, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能优化
parent
383821af
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
588 additions
and
145 deletions
+588
-145
coupon.js
api/coupon.js
+9
-0
couponStoreList.vue
components/storeList/couponStoreList.vue
+232
-0
toolBox.vue
components/toolBox/toolBox.vue
+27
-24
index.config.js
config/index.config.js
+2
-2
couponCheck.vue
pages/couponCheck/couponCheck.vue
+139
-14
index.vue
pages/index/index.vue
+121
-102
order.vue
pages/order/order.vue
+58
-3
No files found.
api/coupon.js
View file @
b01256ba
...
...
@@ -16,5 +16,14 @@ export const couponChecked=(data)=>{
return
http
.
get
(
url
,
data
)
}
export
const
getStoreListByCouponCode
=
(
data
)
=>
{
let
url
=
`/chessCards/queryshop`
return
http
.
get
(
url
,
data
)
}
export
const
getCouponByCode
=
(
data
)
=>
{
let
url
=
`/consumerCoupon/queryCode`
return
http
.
get
(
url
,
data
)
}
components/storeList/couponStoreList.vue
0 → 100644
View file @
b01256ba
<
template
>
<view
class=
"store-list-content"
>
<scroll-view
class=
"scroll-view"
scroll-y=
"true"
>
<view
class=
"store-list"
>
<view
class=
"flex-col"
v-for=
"(val,i) in list"
:key=
"i"
@
tap
.
stop=
"onNavToHome(val)"
>
<view
class=
"flex-row"
>
<view
class=
"room-img-box"
>
<image
:src=
"val.images[0]"
mode=
"aspectFill"
@
tap
.
stop=
"onPreview(val)"
></image>
</view>
<view
class=
"flex-1 part-right"
>
<view
class=
"part-title"
>
<view
class=
'cu-tag radius sm bg-pink'
>
{{
storeTypeEnum
[
val
.
storeType
]
}}
</view>
<text
class=
"text-title text-lg text-bold"
>
【
{{
val
.
name
}}
】
</text>
</view>
<view
class=
"flex-between"
>
<view
class=
"flex-row part-title"
>
<text
class=
"cuIcon-location text-pink margin-right"
></text>
<view
class=
"flex-1"
>
<text
class=
"text-gray text-sm"
>
{{
val
.
address
}}
</text>
</view>
</view>
<!--
<view
class=
"nav-icon"
@
tap
.
stop=
"onNavToMap(val)"
>
<image
:src=
"assetsPath+'/map_icon.png'"
mode=
"widthFix"
></image>
</view>
-->
</view>
<view
class=
"flex-between part-title"
>
<view
class=
'cu-tag radius line-pink'
>
距离
{{
Number
(
val
.
distance
).
toFixed
(
2
)
}}
km
</view>
<view
class=
"location"
>
<button
class=
"cu-btn bg-pink"
>
选择
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</
template
>
<
script
>
import
config
from
"@/config/index.config"
import
{
getDictItem
}
from
"@/utils/tools.js"
export
default
{
name
:
"storeList"
,
props
:
{
value
:
{
type
:
Array
,
default
:
[]
}
},
data
()
{
return
{
assetsPath
:
config
.
assetsPath
,
list
:
[],
storeTypeEnum
:
{},
};
},
watch
:
{
value
:
{
deep
:
true
,
handler
(
val
,
oldVal
)
{
this
.
onLoading
()
}
}
},
mounted
()
{
let
dicts
=
JSON
.
parse
(
uni
.
getStorageSync
(
'dicts'
))
this
.
storeTypeEnum
=
getDictItem
(
dicts
,
"store_type"
);
},
methods
:
{
onLoading
()
{
this
.
list
=
this
.
value
;
},
onNavToHome
(
val
)
{
this
.
$emit
(
"change"
,
val
.
id
)
},
onPreview
(
item
)
{
uni
.
previewImage
({
urls
:
item
.
images
,
current
:
0
})
},
onNavToMap
(
val
)
{
uni
.
openLocation
({
latitude
:
Number
(
val
.
latitude
),
longitude
:
Number
(
val
.
longitude
),
scale
:
18
,
name
:
val
.
address
,
address
:
val
.
address
,
success
:
(
res
)
=>
{
console
.
log
(
res
)
},
complete
:
(
res
)
=>
{
console
.
log
(
res
,
909090
)
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.store-list-content
{
width
:
100%
;
height
:
100%
;
}
.scroll-view
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
}
.store-list
{
position
:
absolute
;
top
:
0
;
left
:
2%
;
display
:
flex
;
flex-direction
:
column
;
width
:
96%
;
>.flex-col
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
background
:
#ffffff
;
box-shadow
:
0
4
upx
8
upx
rgba
(
0
,
0
,
0
,
0.1
);
border-radius
:
12
upx
;
overflow
:
hidden
;
padding
:
12
upx
;
margin
:
12
upx
0
;
.room-img-box
{
display
:
flex
;
width
:
200
upx
;
height
:
240
upx
;
border-radius
:
12
upx
;
overflow
:
hidden
;
margin
:
0
20
upx
0
0
;
image
{
height
:
100%
;
}
}
.part-right
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
padding
:
0
10
upx
0
0
;
.part-title
{
display
:
flex
;
flex
:
1
;
align-items
:
center
;
width
:
100%
;
.margin-right
{
margin-right
:
6
upx
;
margin-top
:
4
upx
;
}
.location
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
.cu-btn
{
padding
:
12
upx
20
upx
;
height
:
auto
;
}
}
}
.part-tag-box
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
width
:
100%
;
padding
:
10
upx
12
upx
;
.part-tag
{
display
:
flex
;
flex-wrap
:
wrap
;
width
:
96%
;
.cu-tag
{
margin
:
4
upx
1%
;
}
}
}
}
.part-bottom-box
{
display
:
flex
;
width
:
100%
;
justify-content
:
space-between
;
height
:
100
upx
;
.flex-row
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
margin-left
:
20
upx
;
font-size
:
32
upx
;
}
.nav-use
{
display
:
flex
;
align-items
:
flex-end
;
}
}
}
}
.nav-icon
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
80
upx
;
image
{
display
:
block
;
width
:
100%
;
height
:
auto
;
}
}
</
style
>
\ No newline at end of file
components/toolBox/toolBox.vue
View file @
b01256ba
<
template
>
<view
class=
"tool-box"
>
<view
v-for=
"(item, index) in toolList"
:key=
"index"
class=
"tool-item"
:class=
"
{active:!show}" :style="{transitionDuration: dNum+'s' }" @tap.stop="onHandle(item
,index
)">
<view
v-for=
"(item, index) in toolList"
:key=
"index"
class=
"tool-item"
:class=
"
{active:!show}" :style="{transitionDuration: dNum+'s' }" @tap.stop="onHandle(item)">
<!--
<text
class=
"text-white text-bold text-xl"
>
{{
item
.
name
}}
</text>
-->
<image
v-if=
"show"
class=
"image"
:src=
"item.url"
mode=
"scaleToFill"
></image>
...
...
@@ -26,29 +26,34 @@
dNum
:
0.4
,
toolList
:[
{
name
:
"验券"
,
url
:
config
.
assetsPath
+
'/tool_3.png'
,
imgUrl
:
config
.
assetsPath
+
'/scan_code_icon.png'
,
sortName
:
"验"
,
routePath
:
"/pages/couponCheck/couponCheck"
,
value
:
1
},
{
name
:
"开门"
,
url
:
config
.
assetsPath
+
'/tool_1.png'
,
imgUrl
:
config
.
assetsPath
+
'/open_door_icon.png'
,
sortName
:
"开"
sortName
:
"开"
,
value
:
2
},
{
name
:
"续单"
,
url
:
config
.
assetsPath
+
'/tool_2.png'
,
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/couponCheck/couponCheck"
sortName
:
"续"
,
value
:
3
},
{
name
:
"
客服
"
,
name
:
"
咨询
"
,
url
:
config
.
assetsPath
+
'/tool_4.png'
,
imgUrl
:
config
.
assetsPath
+
'/zcpt.png'
,
sortName
:
"客"
sortName
:
"客"
,
value
:
4
}
],
timer
:
null
,
...
...
@@ -86,13 +91,13 @@
})
}
},
onHandle
(
val
,
index
){
if
(
index
===
3
){
onHandle
(
val
){
if
(
val
.
value
===
4
){
this
.
onGetSysConfig
()
return
};
if
([
0
,
1
].
includes
(
index
)){
this
.
onGetOrderByAvailable
(
index
)
if
([
2
,
3
].
includes
(
val
.
value
)){
this
.
onGetOrderByAvailable
(
val
.
value
)
return
}
if
(
val
.
routePath
){
...
...
@@ -106,7 +111,7 @@
if
(
res
.
data
.
code
===
200
){
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
length
===
1
){
this
.
orderInfo
=
res
.
data
.
data
[
0
];
if
(
i
===
1
){
if
(
i
===
3
){
if
(
this
.
orderInfo
.
status
==
1
){
// 去续单
uni
.
navigateTo
({
...
...
@@ -118,8 +123,6 @@
title
:
"无使用中的订单,无法续单哦!"
})
}
}
else
{
// 去开门
this
.
onOpenDoor
()
...
...
@@ -131,7 +134,7 @@
if
(
list
.
length
===
1
){
this
.
orderInfo
=
list
[
0
];
if
(
i
===
1
){
if
(
i
===
3
){
// 去续单
uni
.
navigateTo
({
url
:
`/pages/order/order?roomId=
${
this
.
orderInfo
.
roomId
}
&orderNo=
${
this
.
orderInfo
.
orderNo
}
`
...
...
@@ -187,8 +190,8 @@
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
width
:
5
0px
;
height
:
4
4px
;
width
:
6
0px
;
height
:
5
4px
;
border-radius
:
20
upx
0
0
20
upx
;
background
:
rgba
(
255
,
255
,
255
,
0.72
);
//
border-top
:
1px
solid
#E40583
;
...
...
@@ -210,8 +213,8 @@
}
}
.active
{
width
:
3
0
px
;
height
:
26
px
;
width
:
3
6
px
;
height
:
32
px
;
border-radius
:
12
upx
0
0
12
upx
;
opacity
:
0.9
;
}
...
...
config/index.config.js
View file @
b01256ba
...
...
@@ -2,8 +2,8 @@ const CONFIG = {
// 开发环境配置
development
:
{
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
assetsPath
:
'https://coujiao.pseer.com/wechat_static'
,
// 静态资源路径
//
assetsPath: 'http://localhost:8211/static', // 静态资源路径
//
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
assetsPath
:
'http://localhost:8211/static'
,
// 静态资源路径
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
baseUrl
:
'https://coujiao.pseer.com/front-api'
,
// 后台接口请求地址
// baseUrl: 'http://10.24.3.185:8883/front-api',
...
...
pages/couponCheck/couponCheck.vue
View file @
b01256ba
...
...
@@ -31,6 +31,29 @@
<text>
3.核销验券之后的券会进入到我的优惠券当中,可去门店预约时自动抵扣使用,若显示无法使用团购券,请核验团购券的可用门店、可用时间段。团购券过期后自动作废,不退款不更换不延期,请尽快使用。
</text>
</view>
</view>
<uni-popup
ref=
"popupStoreList"
type=
"center"
>
<view
class=
"flex-col pop-store-list"
>
<!--
<image
style=
"width: 699upx;"
:src=
"assetsPath +'/pop_bg.png'"
mode=
"widthFix"
></image>
-->
<view
class=
"flex-col absolute"
>
<view
class=
"content-box"
>
<view
class=
"title margin-left-lg"
>
<text
style=
"color: #512C19;"
class=
"text-xl text-bold"
>
温馨提示
</text>
</view>
<view
class=
"close-box text-xxl margin-right"
@
tap=
"onStoreClose(true)"
>
<text
class=
"cuIcon-roundclosefill"
style=
"color: #bf9e62;"
></text>
</view>
</view>
<view
class=
"tip-text"
>
<text
class=
"text-title"
style=
"color: #512C19;"
>
当前优惠券适用以下门店,请选择即将预定的门店:
</text>
</view>
<!-- 展示所有房间列表 -->
<view
class=
"store-box"
>
<StoreList
style=
"width: 100%;"
v-model=
"popStoreList"
@
change=
"onStoreChage"
></StoreList>
</view>
</view>
</view>
</uni-popup>
<uni-popup
ref=
"popup"
type=
"center"
>
<view
class=
"content-box"
>
<view
class=
"content"
>
...
...
@@ -62,12 +85,17 @@
<
script
>
import
config
from
"@/config/index.config"
import
{
couponChecked
}
from
"@/api/coupon.js"
;
import
{
couponChecked
,
getStoreListByCouponCode
,
getCouponByCode
}
from
"@/api/coupon.js"
;
import
moment
from
"@/common/moment_zh_cn.js"
;
import
StoreList
from
"@/components/storeList/couponStoreList"
export
default
{
components
:
{
StoreList
},
data
()
{
return
{
hostUrl
:
config
.
hostUrl
,
assetsPath
:
config
.
assetsPath
,
code
:
""
,
openShopUuid
:
''
,
...
...
@@ -81,9 +109,12 @@
name
:
"抖音"
}
],
storeId
:
''
,
couponInfo
:
''
,
eventChannel
:
null
,
orderPage
:
false
orderPage
:
false
,
popStoreList
:[],
qrCode
:
''
};
},
filters
:{
...
...
@@ -97,8 +128,10 @@
console
.
log
(
data
,
99999
)
if
(
data
.
orderPage
){
this
.
orderPage
=
true
this
.
storeId
=
data
.
storeId
}
else
{
this
.
orderPage
=
false
this
.
storeId
=
''
}
})
},
...
...
@@ -112,21 +145,70 @@
})
return
}
this
.
qrCode
=
this
.
code
.
split
(
" "
).
join
(
""
)
if
(
/http/g
.
test
(
this
.
qrCode
)){
this
.
code
=
""
}
uni
.
showLoading
({
title
:
"券码核验中"
title
:
'加载中...'
})
let
qrCode
=
this
.
code
.
split
(
" "
).
join
(
""
)
if
(
/http/g
.
test
(
qrCode
)){
this
.
code
=
""
getStoreListByCouponCode
({
code
:
this
.
qrCode
,
longitude
:
uni
.
getStorageSync
(
"longitude"
),
latitude
:
uni
.
getStorageSync
(
"latitude"
)
}).
then
(
res
=>
{
uni
.
hideLoading
();
console
.
log
(
res
,
9999
)
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
.
length
){
this
.
popStoreList
=
res
.
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
});
if
(
this
.
orderPage
){
this
.
onExchangeCoupon
(
this
.
qrCode
,
this
.
storeId
)
}
else
{
this
.
$refs
.
popupStoreList
.
open
();
}
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
msg
})
}
})
},
onStoreChage
(
val
){
console
.
log
(
val
,
90909
)
let
info
=
this
.
popStoreList
.
find
(
item
=>
item
.
id
===
val
)
if
(
info
.
status
==
1
){
this
.
$refs
.
popupStoreList
.
close
();
this
.
storeId
=
val
;
this
.
onExchangeCoupon
(
this
.
qrCode
,
this
.
storeId
)
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"门店维护中,请选择其他门店"
})
}
},
onExchangeCoupon
(
code
,
storeId
){
let
that
=
this
;
uni
.
showLoading
({
title
:
"券码核验中"
})
couponChecked
({
code
:
qrCode
,
storeId
:
uni
.
getStorageSync
(
'storeId'
)
code
,
storeId
}).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
data
.
code
===
200
){
this
.
couponInfo
=
res
.
data
.
data
uni
.
showToast
({
icon
:
"success"
,
title
:
"核验成功"
,
...
...
@@ -134,13 +216,18 @@
setTimeout
(()
=>
{
if
(
that
.
orderPage
){
that
.
eventChannel
.
emit
(
'acceptData'
,
{
data
:
true
});
uni
.
navigateBack
()
}
else
{
getCouponByCode
({
code
:
that
.
qrCode
}).
then
(
result
=>
{
that
.
couponInfo
=
res
.
data
.
data
;
that
.
$refs
.
popup
.
open
();
})
}
uni
.
navigateBack
()
},
1000
)
}
})
// this.$refs.popup.open()
}
else
{
uni
.
showToast
({
icon
:
"none"
,
...
...
@@ -162,6 +249,7 @@
})
},
onNavHome
(){
uni
.
setStorageSync
(
"storeId"
,
this
.
storeId
)
uni
.
switchTab
({
url
:
"/pages/index/index"
})
...
...
@@ -303,4 +391,41 @@
}
}
}
.pop-store-list
{
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
width
:
92vw
;
height
:
78vh
;
background-color
:
#ffffff
;
border-radius
:
20
upx
;
box-shadow
:
0
6
upx
16
upx
rgba
(
255
,
0
,
255
,
0.34
);
padding-bottom
:
20
upx
;
overflow
:
hidden
;
.content-box
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
9%
;
width
:
100%
;
padding-top
:
1%
;
.close-box
{
}
}
.tip-text
{
width
:
90%
;
margin
:
0
auto
10px
;
}
.store-box
{
display
:
flex
;
flex
:
1
;
width
:
100%
;
overflow-y
:
auto
;
padding
:
0
2%
3%
;
}
}
</
style
>
pages/index/index.vue
View file @
b01256ba
...
...
@@ -46,7 +46,7 @@
<image
:src=
"assetsPath +'/banner2.png'"
mode=
"widthFix"
></image>
</view>
<view
class=
"flex-col list-box"
>
<!--
<view
class=
"title titleStyle"
>
<!--
<view
class=
"title titleStyle"
>
<text
class=
"text-title"
>
房间预览
</text>
</view>
-->
<view
v-for=
"(item,index) in roomVoList"
:key=
"index"
class=
"list-item-box"
...
...
@@ -55,24 +55,24 @@
<view
class=
"relative part-top"
>
<image
class=
"room-img"
:src=
"item.images[0]"
mode=
"aspectFill"
@
tap
.
stop=
"onPreview(item.images)"
></image>
<view
class=
"absolute"
>
<view
class=
'status-bg bg-gray'
v-if=
"item.roomStat >= 3"
>
维护
</view>
<view
class=
'status-bg bg-red'
v-else-if=
"item.isDirtyRoom >= 1"
>
未保洁
</view>
<view
v-else-if=
"item.recordsStatus>=0"
class=
"status-bg bg-red"
>
{{
recordsStatusEnum
[
item
.
recordsStatus
]
}}
</view>
<view
v-else
class=
'status-bg'
:class=
"item.status==0?'bg-green':item.status==1?'bg-pink':'bg-blue'"
>
{{
roomStatusEnum
[
item
.
status
]
}}
{{
item
.
recordsTime
?
'('
+
item
.
recordsTime
+
'结束)'
:
''
}}
</view>
<view
class=
"absolute"
>
<view
class=
'status-bg bg-gray'
v-if=
"item.roomStat >= 3"
>
维护
</view>
<view
class=
'status-bg bg-red'
v-else-if=
"item.isDirtyRoom >= 1"
>
未保洁
</view>
<view
v-else-if=
"item.recordsStatus>=0"
class=
"status-bg bg-red"
>
{{
recordsStatusEnum
[
item
.
recordsStatus
]
}}
</view>
<view
v-else
class=
'status-bg'
:class=
"item.status==0?'bg-green':item.status==1?'bg-pink':'bg-blue'"
>
{{
roomStatusEnum
[
item
.
status
]
}}
{{
item
.
recordsTime
?
'('
+
item
.
recordsTime
+
'结束)'
:
''
}}
</view>
</view>
</view>
<view
class=
"flex-col part-bottom"
>
<view
class=
"flex-between room-title"
>
...
...
@@ -81,8 +81,8 @@
</view>
<view
class=
"price"
>
<!--
<text
v-if=
"item.recordsTime"
class=
"text-sm text-orange text-bold"
>
{{
item
.
recordsTime
}}
结束
</text>
-->
<!--
<view
class=
""
>
<!--
<view
class=
""
>
<view
class=
'cu-tag radius line-orange'
v-if=
"item.roomStat >= 3"
>
维护
</view>
...
...
@@ -130,7 +130,7 @@
</view>
</view>
<!--
<view
class=
"flex-between confirm-box"
>
<!--
<view
class=
"flex-between confirm-box"
>
<view
class=
"flex-priceBox"
></view>
<view
class=
"confirm"
>
<button
class=
"cu-btn"
>
预定
</button>
...
...
@@ -170,29 +170,33 @@
</view>
</view>
</uni-popup>
<uni-popup
ref=
"popupStoreList"
type=
"center"
>
<view
class=
"flex-col pop-store-list"
>
<view
class=
"flex-col content-box"
>
<view
class=
"title"
>
<text
class=
"text-black text-xl text-bold"
>
温馨提示
</text>
<!--
<image
style=
"width: 699upx;"
:src=
"assetsPath +'/pop_bg.png'"
mode=
"widthFix"
></image>
-->
<view
class=
"flex-col absolute"
>
<view
class=
"content-box"
>
<view
class=
"title margin-left-lg"
>
<text
style=
"color: #512C19;"
class=
"text-xl text-bold"
>
温馨提示
</text>
</view>
<view
class=
"close-box text-xxl margin-right"
@
tap=
"onStoreClose(true)"
>
<text
class=
"cuIcon-roundclosefill"
style=
"color: #bf9e62;"
></text>
</view>
</view>
<view
class=
"close-box text-xxl"
@
tap=
"onStoreClose(true)"
>
<text
class=
"cuIcon-roundclosefill text-pink"
></text>
<view
class=
"tip-text"
>
<text
class=
"text-title"
style=
"color: #512C19;"
>
本店当前时段所有包厢已被占用,您可以预约本店的其它时段,或者预订凑角附近的其它门店。
</text>
</view>
<!-- 展示所有房间列表 -->
<view
class=
"store-box"
>
<StoreList
style=
"width: 100%;"
v-model=
"popStoreList"
@
change=
"onStoreChage"
></StoreList>
</view>
</view>
<view
class=
"tip-text"
>
<text
class=
"text-title text-lg"
>
本店当前时段所有包厢已被预定,您可以预约本店的其他时段,或者预定凑角附近的其它门店。
</text>
</view>
<!-- 展示所有房间列表 -->
<view
class=
"store-box"
>
<StoreList
style=
"width: 100%;"
v-model=
"popStoreList"
@
change=
"onStoreChage"
></StoreList>
</view>
</view>
</uni-popup>
<LoginPop
ref=
"loginPop"
/>
<f-tabbar></f-tabbar>
</view>
...
...
@@ -218,7 +222,7 @@
getDictItem
}
from
"@/utils/tools.js"
import
moment
from
'@/common/moment'
;
import
StoreList
from
"@/components/storeList/popStoreList"
import
StoreList
from
"@/components/storeList/popStoreList"
export
default
{
components
:
{
StoreList
,
...
...
@@ -289,20 +293,20 @@
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
:
[],
timer2
:
null
,
timerLocation
:
null
timerLocation
:
null
}
},
onShow
()
{
this
.
onGetSysConfig
();
this
.
onGetListStore
();
this
.
timerLocation
=
setInterval
(()
=>
{
this
.
onGetListStore
();
this
.
timerLocation
=
setInterval
(()
=>
{
uni
.
removeStorageSync
(
"storeId"
)
this
.
onLoading
();
},
2
*
60
*
1000
)
},
2
*
60
*
1000
)
},
onHide
()
{
if
(
this
.
timerLocation
)
{
if
(
this
.
timerLocation
)
{
clearInterval
(
this
.
timerLocation
)
this
.
timerLocation
=
null
;
}
...
...
@@ -325,12 +329,12 @@
this
.
$refs
.
loginPop
.
open
();
},
methods
:
{
onStoreChage
(
id
){
onStoreChage
(
id
)
{
uni
.
setStorageSync
(
"storeId"
,
id
);
this
.
onStoreClose
(
false
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
onGetListStore
();
},
200
)
},
200
)
},
onSetShowPoint
()
{
let
h
=
new
Date
().
getHours
();
...
...
@@ -390,9 +394,9 @@
uni
.
setStorageSync
(
"latitude"
,
res
.
latitude
)
uni
.
setStorageSync
(
"longitude"
,
res
.
longitude
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
removeStorageSync
(
'storeId'
);
let
aaa
=
uni
.
getStorageSync
(
'storeId'
)
?
true
:
false
;
let
aaa
=
uni
.
getStorageSync
(
'storeId'
)
?
true
:
false
;
console
.
log
(
aaa
,
"是否删除数据"
)
this
.
onGetListStore
()
},
10
)
...
...
@@ -427,14 +431,14 @@
distance
:
obj
.
distance
?
Number
(
obj
.
distance
.
substr
(
0
,
8
)).
toFixed
(
2
)
:
0
}
that
.
onGetRoomList
(
obj
.
id
)
this
.
popStoreList
=
res
.
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
}).
filter
(
item
=>
item
.
id
!=
obj
.
id
)
return
{
...
item
,
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
}).
filter
(
item
=>
item
.
id
!=
obj
.
id
)
}
})
},
...
...
@@ -446,22 +450,23 @@
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
.
length
)
{
let
list
=
res
.
data
.
data
.
map
(
item
=>
{
let
sortNum
=
1
;
if
(
item
.
roomStat
===
3
)
{
if
(
item
.
roomStat
===
3
)
{
sortNum
=
5
}
else
if
(
item
.
recordsStatus
===
0
)
{
}
else
if
(
item
.
recordsStatus
===
0
)
{
sortNum
=
4
}
else
if
(
item
.
recordsStatus
===
1
)
{
}
else
if
(
item
.
recordsStatus
===
1
)
{
sortNum
=
3
}
else
if
(
item
.
status
===
1
)
{
}
else
if
(
item
.
status
===
1
)
{
sortNum
=
2
}
else
if
(
item
.
status
===
0
)
{
}
else
if
(
item
.
status
===
0
)
{
sortNum
=
1
}
return
{
...
item
,
sortNum
,
recordsTime
:
item
.
recordsTime
?
moment
(
item
.
recordsTime
).
format
(
"HH:mm"
)
:
""
,
recordsTime
:
item
.
recordsTime
?
moment
(
item
.
recordsTime
).
format
(
"HH:mm"
)
:
""
,
facilities
:
item
.
facilities
?
item
.
facilities
.
split
(
","
)
:
[],
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[],
...
...
@@ -474,17 +479,17 @@
})
}
})
list
.
sort
((
a
,
b
)
=>
a
.
sortNum
-
b
.
sortNum
);
list
.
sort
((
a
,
b
)
=>
a
.
sortNum
-
b
.
sortNum
);
that
.
roomVoList
=
list
;
let
l
=
that
.
roomVoList
.
filter
(
item
=>
item
.
sortNum
===
1
)
if
(
l
.
length
<=
0
)
{
if
(
!
uni
.
getStorageSync
(
"storePopShow"
))
{
let
l
=
that
.
roomVoList
.
filter
(
item
=>
item
.
sortNum
===
1
)
if
(
l
.
length
<=
0
)
{
if
(
!
uni
.
getStorageSync
(
"storePopShow"
))
{
that
.
$refs
.
popupStoreList
.
open
();
}
}
}
else
{
that
.
roomVoList
=
[]
}
...
...
@@ -602,10 +607,10 @@
},
onClose
()
{
this
.
$refs
.
popup
.
close
()
},
onStoreClose
(
storePopShow
=
true
){
uni
.
setStorageSync
(
"storePopShow"
,
storePopShow
)
onStoreClose
(
storePopShow
=
true
)
{
uni
.
setStorageSync
(
"storePopShow"
,
storePopShow
)
this
.
$refs
.
popupStoreList
.
close
()
},
onNavToSet
()
{
...
...
@@ -624,7 +629,7 @@
current
:
0
,
urls
:
val
,
complete
:
(
res
)
=>
{
}
})
}
...
...
@@ -672,6 +677,7 @@
min-height
:
280
upx
;
backdrop-filter
:
blur
(
5px
);
background-color
:
#E40583
;
image
{
display
:
block
;
width
:
100%
;
...
...
@@ -862,7 +868,7 @@
width
:
100%
;
//
min-height
:
314
upx
;
//
background-color
:
#FBF6EE
;
background
:
linear-gradient
(
to
bottom
,
rgba
(
229
,
38
,
139
,
0.08
),
#ffffff
);
background
:
linear-gradient
(
to
bottom
,
rgba
(
229
,
38
,
139
,
0.08
),
#ffffff
);
border-radius
:
14
upx
;
overflow
:
hidden
;
margin
:
0
0
20
upx
0
;
...
...
@@ -1044,7 +1050,8 @@
.room-img
{
height
:
100%
;
}
.absolute
{
.absolute
{
position
:
absolute
;
top
:
auto
;
left
:
0
;
...
...
@@ -1054,24 +1061,29 @@
justify-content
:
center
;
align-items
:
center
;
height
:
60
upx
;
.status-bg{
.status-bg
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
height
:
100%
;
}
.bg-gray
{
.bg-gray
{
background
:
rgba
(
136
,
136
,
136
,
0.96
);
color
:
#ffffff
;
}
.bg-pink
{
.bg-pink
{
background
:
rgba
(
230
,
58
,
159
,
0.8
);
}
.bg-green
{
background
:
rgba
(
57
,
181
,
74
,
0.8
);
.bg-green
{
background
:
rgba
(
57
,
181
,
74
,
0.8
);
}
.bg-red
{
.bg-red
{
background
:
rgba
(
229
,
77
,
66
,
0.8
);
}
}
...
...
@@ -1107,20 +1119,22 @@
padding
:
0
;
align-items
:
center
;
min-height
:
88
upx
;
margin-top
:
10
upx
;
margin-top
:
10
upx
;
.bg-brown
{
color
:
rgba
(
185
,
75
,
112
,
0.9
);
color
:
rgba
(
185
,
75
,
112
,
0.9
);
background-color
:
transparent
;
border
:
1
upx
solid
rgba
(
185
,
75
,
112
,
0.9
);
border
:
1
upx
solid
rgba
(
185
,
75
,
112
,
0.9
);
margin
:
4
upx
;
padding
:
0
8
upx
;
height
:
36
upx
;
}
}
.records-time
{
.records-time
{
margin-top
:
10
upx
;
}
//
价格
.flex-priceBox
{
padding
:
0
6
rpx
;
...
...
@@ -1190,6 +1204,7 @@
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
.item
{
display
:
flex
;
flex-direction
:
row
;
...
...
@@ -1280,11 +1295,12 @@
//
background-color
:
#fad2bb
;
}
.bg-gray
{
.bg-gray
{
//
background-color
:
rgba
(
229
,
229
,
229
,
0.9
);
background-color
:
transparent
;
border
:
1px
solid
#e5e5e5
;
}
.flex-col
{
align-items
:
center
;
}
...
...
@@ -1300,38 +1316,40 @@
font-size
:
20
upx
;
}
}
.pop-store-list
{
.pop-store-list
{
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
width
:
9
0
vw
;
height
:
68
vh
;
width
:
9
2
vw
;
height
:
74
vh
;
background-color
:
#ffffff
;
border-radius
:
20
upx
;
box-shadow
:
0
6
upx
16
upx
rgba
(
255
,
0
,
255
,
0.34
);
padding-bottom
:
20
upx
;
overflow
:
hidden
;
.content-box{
position
:
relative
;
.content-box
{
display
:
flex
;
justify-content
:
center
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
10%
;
.close-box{
position
:
absolute
;
top
:
30
upx
;
right
:
30
upx
;
}
height
:
9%
;
padding-top
:
1%
;
.close-box
{
}
}
.tip-text
{
.tip-text
{
width
:
90%
;
margin
:
0
auto
10px
;
}
.store-box
{
.store-box
{
display
:
flex
;
flex
:
1
;
width
:
100%
;
overflow-y
:
auto
;
padding
:
0
2%
;
padding
:
0
2%
3%
;
}
}
</
style
>
\ No newline at end of file
pages/order/order.vue
View file @
b01256ba
...
...
@@ -664,7 +664,9 @@
}
else
{
this
.
duration
=
Number
(
this
.
distanceMode
[
this
.
distanceIndex
].
duration
);
}
let
startDateTime
=
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
)
this
.
onTransiteForDate
(
res
.
data
.
data
,
startDateTime
,
this
.
duration
)
this
.
dateIntervalList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
{
...
item
,
...
...
@@ -1374,7 +1376,10 @@
uni
.
navigateTo
({
url
:
"/pages/couponCheck/couponCheck?openShopUuid="
+
this
.
roomInfo
.
openShopUuid
,
success
:
(
res
)
=>
{
res
.
eventChannel
.
emit
(
'acceptDataFromOpenerPage'
,
{
orderPage
:
true
})
res
.
eventChannel
.
emit
(
'acceptDataFromOpenerPage'
,
{
orderPage
:
true
,
storeId
:
that
.
roomInfo
.
storeId
})
},
events
:
{
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
...
...
@@ -1485,8 +1490,58 @@
}
return
obj
;
},
//list(Array):当前日期的时间占用情况
//startDateTime(YYYY-MM-DD HH:mm:ss): 开始时间
//duration(Number||String): 时长,小时或分钟
//durationType(Number) : 时长类型,1:小时,2:分钟
// 返回值
// list,当前日期的时间占用情况,已被预定、已选择、可预定
//startDateTime(YYYY-MM-DD HH:mm:ss): 开始详细时间
//endDateTime(YYYY-MM-DD HH:mm:ss): 结束详细时间
//startTime(HH:mm): 开始时间,显示使用
//endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟
onTransiteForDate
(
list
=
[],
startDateTime
,
duration
,
durationType
=
1
){
console
.
log
(
list
,
"数据列表"
)
// 计算出时长,使用分钟计算
let
m
=
duration
if
(
durationType
==
1
){
m
=
duration
*
60
}
// 开始时间的毫秒数
let
startStamp
=
moment
(
startDateTime
).
valueOf
();
let
endStamp
=
startStamp
+
m
*
60
*
1000
;
console
.
log
(
startStamp
,
endStamp
)
console
.
log
(
endStamp
-
startStamp
)
// 记录可开始的时间点
let
startPoint
=
''
;
let
endPoint
=
''
list
.
forEach
((
item
,
index
)
=>
{
console
.
log
(
item
)
// 如果开始时间有,则需要计算可预定的时长
if
(
startPoint
){
if
(
item
.
status
===
0
){
endPoint
=
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:59:59"
)
}
else
{
endPoint
=
moment
(
item
.
startHoldTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
}
else
{
// 如果开始时间没有,则需要赋值开始时间
if
(
item
.
status
===
0
){
startPoint
=
moment
(
item
.
timeHour
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
else
{
// 当前小时时间是被占用状态且低于59分钟
let
mm
=
moment
(
item
.
endHoldTime
).
format
(
"mm"
)
if
(
mm
<
59
){
startPoint
=
moment
(
item
.
endHoldTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
}
}
})
},
onCheckDate
()
{
// 今天可连续选择的时段
let
selectNum
=
0
;
//预定节点
...
...
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