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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
467 additions
and
43 deletions
+467
-43
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
+0
-0
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
This diff is collapsed.
Click to expand it.
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