Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigwood
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
罗超
bigwood
Commits
b9aab4fa
Commit
b9aab4fa
authored
Dec 19, 2022
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
33381cff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
173 additions
and
15 deletions
+173
-15
index.ts
src/i18n/zh-TW/index.ts
+3
-9
HotelSure.vue
src/pages/scattered/HotelSure.vue
+170
-6
No files found.
src/i18n/zh-TW/index.ts
View file @
b9aab4fa
...
...
@@ -747,15 +747,9 @@ export default {
youhuiquanshiyong
:
'优惠券使用'
,
nokeyongyouhuiquan
:
'暂无可用优惠券'
,
xiadan
:
'下单'
,
inputlabel1
:
'请输入入住时间'
,
inputlabel2
:
''
,
inputlabel3
:
''
,
inputlabel4
:
''
,
inputlabel5
:
''
,
inputlabel6
:
''
,
inputlabel7
:
''
,
inputlabel8
:
''
,
Errorruzhushu
:
'入住人数与总入住数不匹配'
Errorruzhushu
:
'入住人数与总入住数不匹配'
,
duihuanSuccess
:
'兑换成功'
,
xiadanSuccess
:
'下单成功'
,
}
}
...
...
src/pages/scattered/HotelSure.vue
View file @
b9aab4fa
<
template
>
<div
class=
"q-pa-lg"
>
<div
class=
"q-pa-lg
commonSure
"
>
<div
style=
"shadow: 0px 0px 50px 0px rgba(82, 63, 105, 0.15);margin: auto;"
:style=
"
{'width':$q.platform.is.desktop?'70vw':'100vw'}">
<div
class=
"bg-white rounded-border q-mb-md q-px-lg q-py-md"
>
<div
class=
"row items-center text-orange-6"
>
...
...
@@ -354,6 +354,41 @@
<span>
{{$t('v101.scatteredOrder.nokeyongyouhuiquan')}}
</span>
</div>
</div>
<!-- 优惠券 -->
<div
class=
"Yhq column"
v-if=
"!isLoginB2B"
>
<p
class=
"pfR text-dark q-pl-lg"
>
优惠券使用
</p>
<ul
class=
"yhqUl"
>
<p
v-if=
"!Verification.length || Verification[0].ApplyState !== 1"
class=
"_trip_xiangqing_tips"
>
您还未进行
<span
@
click=
"goShenqing"
>
实名认证
</span>
,认证后可使用优惠券哦~如果已提认证申请,申请审核通过后即可使用优惠券!
</p>
<li
v-for=
"(item,index) in UserCanUseCouponList"
:class=
"{'blue':item.couponsType===1,'_active':item.active,'disab': !Platfrom(item.fromPlatform)|| !Verification.length || Verification[0].ApplyState !== 1}"
@
click=
"!Platfrom(item.fromPlatform) || !Verification.length || Verification[0].ApplyState !== 1 ? '' : clickCoupon(item)"
:key=
"index+5000"
class=
"sawtooth"
>
<div
class=
"yhqImg"
>
<img
v-if=
"item.fromPlatform=='1'"
src=
"../../assets/images/yhq/app.png"
alt=
""
>
<img
v-if=
"item.fromPlatform=='2'"
src=
"../../assets/images/yhq/xcx.png"
alt=
""
>
<img
v-if=
"item.fromPlatform=='3'"
src=
"../../assets/images/yhq/pc.png"
alt=
""
>
</div>
<span
class=
"kdj"
>
<span
v-if=
"item.overlapUse==1"
>
可叠加
</span>
<span
v-else
>
不可叠加
</span>
</span>
<p
style=
"margin-top:10px"
>
<span
v-if=
"item.couponsType==1"
>
¥
<span>
{{item.denomination}}
</span></span>
<span
v-else
>
{{item.denomination}}折
</span>
</p>
<p
style=
"font-size:14px"
>
满{{item.useCondition}}使用
</p>
<p
style=
"font-size:12px;color:#4C58A4;margin-top:6px"
>
有效期:{{item.effectDate | YMD}}-{{item.expirationDate | YMD}}
</p>
<div
v-if=
"Platfrom(item.fromPlatform)"
class=
"_choice_box"
>
<span
v-if=
"!item.active"
></span>
<span
v-else
class=
"iconfont icon-xuanzhong2"
></span>
</div>
</li>
<div
v-if=
"UserCanUseCouponList.length==0"
class=
"_no_coupon"
>
<p>
暂无可用优惠券
</p>
</div>
</ul>
</div>
</div>
<div
class=
"col row q-mb-md"
>
<q-btn
class=
"col-12 bg-blue rounded-border text-white q-py-sm"
:label=
"$t('v101.scatteredOrder.xiadan')"
:loading=
"submLoading"
@
click=
"submitForm"
/>
...
...
@@ -403,6 +438,10 @@
// const HotelLength = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH) as any
const
data
=
reactive
({
isShowTime
:
true
,
isLoginB2B
:
true
,
Verification
:
''
,
CouponIds
:
''
,
CodeLoading
:
false
,
UserCanUseCouponList
:
[]
as
Array
<
any
>
,
CouponList
:
[]
as
Array
<
any
>
,
...
...
@@ -466,8 +505,6 @@
isBaoChild
:
false
,
SettlementPrice
:
0
,
price
:
0
,
isShowTime
:
true
,
isLoginB2B
:
true
,
pickerBeginDateBefore
:
''
,
//入住时间前可选范围
pickerBeginDateAfter
:
''
,
//入住时间后可选范围
RoomTypeList
:
[]
as
Array
<
HotelArea
>
,
//房间等级
...
...
@@ -567,7 +604,7 @@
data
.
submLoading
=
false
if
(
r
.
data
.
resultCode
==
ApiResult
.
SUCCESS
)
{
localStorage
.
removeItem
(
DirtionmaryHelper
.
SCATTERED_HOTEL_ORDER_MSG
)
message
.
successMsg
(
`
${
t
(
'
s
uccess'
)}
`
)
message
.
successMsg
(
`
${
t
(
'
v101.scatteredOrder.xiadanS
uccess'
)}
`
)
let
num
=
0
;
data
.
sureMsg
.
roomGroup
.
forEach
(
x
=>
{
num
+=
parseInt
(
x
.
roomFemaleCount
)
+
parseInt
(
x
.
roomMaleCount
)
+
parseInt
(
x
.
roomChildCount
)
...
...
@@ -848,6 +885,82 @@
message
.
errorMsg
(
e
.
message
)
})
},
clickCoupon
(
item
){
let
list
=
[];
if
(
!
item
.
active
)
{
// 是否选中
if
(
item
.
denomination
>
this
.
SettlementPrice
){
message
.
errorMsg
(
"该优惠券不满足使用条件!"
)
return
;
}
if
(
item
.
overlapUse
===
1
)
{
// 1允许叠加使用
data
.
CouponList
.
forEach
(
x
=>
{
if
(
x
.
overlapUse
===
1
&&
x
.
couponsType
===
item
.
couponsType
)
{
// 优惠券列表筛选出允许叠加并且type相同的
list
.
push
(
x
)
}
})
item
.
active
=
!
item
.
active
data
.
UserCanUseCouponList
=
list
}
else
{
// 不允许叠加使用
data
.
CouponList
.
forEach
(
x
=>
{
// 筛选掉其他
if
(
x
.
id
===
item
.
id
)
{
list
.
push
(
x
)
}
})
item
.
active
=
!
item
.
active
data
.
UserCanUseCouponList
=
list
}
}
else
{
item
.
active
=
!
item
.
active
if
(
data
.
UserCanUseCouponList
.
length
===
1
)
{
// 取消优惠券选中状态 之前直选择了一个优惠券
data
.
UserCanUseCouponList
=
this
.
CouponList
}
else
{
//... 之前选择了多个优惠券 循环判断是否已全部取消
let
num
=
0
data
.
UserCanUseCouponList
.
forEach
(
x
=>
{
if
(
x
.
active
)
num
+=
1
})
if
(
num
===
0
)
{
data
.
CouponList
.
forEach
(
x
=>
{
x
.
active
=
false
})
data
.
UserCanUseCouponList
=
this
.
CouponList
}
}
}
if
(
data
.
UserCanUseCouponList
.
length
>
0
)
{
let
CouponIds
=
''
let
CouponMoney
=
0
let
CouponSale
=
1
let
type
=
0
data
.
UserCanUseCouponList
.
forEach
(
x
=>
{
if
(
x
.
active
)
{
type
=
x
.
couponsType
CouponIds
=
CouponIds
+
x
.
id
+
','
if
(
x
.
couponsType
===
1
)
{
CouponMoney
=
CouponMoney
+
x
.
denomination
}
else
{
CouponSale
=
CouponSale
*
(
x
.
denomination
/
10
)
}
}
})
data
.
CouponIds
=
CouponIds
if
(
type
===
1
)
{
data
.
SettlementPrice
=
data
.
price
-
CouponMoney
}
else
if
(
type
===
2
)
{
data
.
SettlementPrice
=
data
.
price
*
CouponSale
}
else
if
(
type
===
0
)
{
data
.
SettlementPrice
=
data
.
price
}
}
else
{
data
.
SettlementPrice
=
data
.
price
}
// this.SettlementPrice=parseInt(this.SettlementPrice).toFixed(2);
let
allmonney
=
data
.
price
-
data
.
SettlementPrice
;
data
.
sureMsg
.
DiscountMoney
=
(
data
.
price
-
data
.
SettlementPrice
).
toFixed
(
2
);
data
.
CouponIds
=
data
.
CouponIds
.
substring
(
0
,
data
.
CouponIds
.
length
-
1
)
data
.
sureMsg
.
CouponAllotIds
=
data
.
CouponIds
;
},
// 兑换优惠券
GetCode
(){
if
(
data
.
CodeLoading
)
return
if
(
!
data
.
ActivateCode
)
return
...
...
@@ -860,7 +973,7 @@
.
then
(
r
=>
{
data
.
CodeLoading
=
false
if
(
r
.
data
.
resultCode
==
ApiResult
.
SUCCESS
)
{
message
.
successMsg
(
`
${
t
(
'
s
uccess'
)}
`
)
message
.
successMsg
(
`
${
t
(
'
v101.scatteredOrder.duihuanS
uccess'
)}
`
)
methods
.
getUserCanUseCouponList
();
}
else
{
message
.
errorMsg
(
r
.
message
)
...
...
@@ -920,5 +1033,56 @@
.ischeckInTimeSure
.q-field__control
{
border
:
1px
solid
red
;
}
.commonSure
.yhqUl
{
padding
:
0
20px
;
margin
:
20px
0
;
}
.commonSure
.icon-xuanzhong2
{
color
:
#31AA21
;
}
.commonSure
.sawtooth
:hover
{
cursor
:
pointer
;
/* box-shadow: 0px 1px 13px 0px rgb(189, 189, 189);
transition: all linear .5s; */
}
.commonSure
.yhqUl
.blue
{
background-color
:
#8794E2
;
}
.commonSure
.yhqUl
.blue
:hover
{
background-color
:
#6776D2
;
}
.commonSure
.yhqUl
.blue
._time
{
color
:
#4C58A4
!important
;
}
.commonSure
.yhqUl
._active
{
background-color
:
#D9A24D
;
}
.commonSure
.yhqUl
.blue._active
{
background-color
:
#6776D2
;
}
.commonSure
._trip_xiangqing_tips
{
color
:
red
!important
;
font-size
:
14px
!important
;
}
.commonSure
._trip_xiangqing_tips
span
{
color
:
#3965B0
;
cursor
:
pointer
;
}
.commonSure
.yhqImg
{
position
:
absolute
;
right
:
80px
;
top
:
10px
;
width
:
50px
;
height
:
50px
;
}
.commonSure
.yhqImg
img
{
width
:
100%
;
height
:
100%
;
display
:
block
;
}
.commonSure
.yhqUl
.disab
{
background-color
:
#7d7d7d
!important
;
}
</
style
>
\ No newline at end of file
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