Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
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
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
zhengke
jz_Travel
Commits
b0a87bef
Commit
b0a87bef
authored
Mar 07, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动勾选优惠券
parent
6d8f845c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
flightDetail.vue
pages/airTicket/flightDetail.vue
+22
-0
visa_Reserve.vue
pages/visa/visa_Reserve.vue
+22
-0
No files found.
pages/airTicket/flightDetail.vue
View file @
b0a87bef
...
@@ -624,11 +624,33 @@
...
@@ -624,11 +624,33 @@
if
(
res
.
resultCode
==
1
)
{
if
(
res
.
resultCode
==
1
)
{
this
.
couponList
=
res
.
data
this
.
couponList
=
res
.
data
this
.
calcPzCouponHandler
()
this
.
calcPzCouponHandler
()
this
.
calcMaxCouponHandle
()
}
}
},
},
(
err
)
=>
{}
(
err
)
=>
{}
);
);
},
},
calcMaxCouponHandle
(){
if
(
this
.
couponList
&&
this
.
couponList
.
length
>
0
){
let
maxCouponId
=
0
let
discount
=
0
const
money
=
this
.
price
this
.
couponList
.
forEach
(
x
=>
{
if
(
x
.
couponsType
==
1
&&
x
.
denomination
>
discount
)
{
discount
=
x
.
denomination
maxCouponId
=
x
.
id
}
if
(
x
.
couponsType
==
2
){
let
disMoney
=
money
*
(
1
-
x
.
denomination
)
if
(
discount
<
disMoney
){
discount
=
disMoney
maxCouponId
=
x
.
id
}
}
})
if
(
maxCouponId
>
0
)
this
.
closeCouponHandler
([
maxCouponId
])
}
},
usePzCouponHandler
()
{
usePzCouponHandler
()
{
this
.
showPz
=
false
this
.
showPz
=
false
this
.
closeCouponHandler
(
this
.
pzCoupon
.
id
)
this
.
closeCouponHandler
(
this
.
pzCoupon
.
id
)
...
...
pages/visa/visa_Reserve.vue
View file @
b0a87bef
...
@@ -1098,6 +1098,7 @@
...
@@ -1098,6 +1098,7 @@
console
.
log
(
"coupon_post_GetUserCanUseCouponList_res"
,
res
);
console
.
log
(
"coupon_post_GetUserCanUseCouponList_res"
,
res
);
this
.
couponList
=
res
.
data
this
.
couponList
=
res
.
data
this
.
calcPzCouponHandler
()
this
.
calcPzCouponHandler
()
this
.
calcMaxCouponHandle
()
}
}
},
},
(
err
)
=>
{
(
err
)
=>
{
...
@@ -1105,6 +1106,27 @@
...
@@ -1105,6 +1106,27 @@
}
}
);
);
},
},
calcMaxCouponHandle
(){
if
(
this
.
couponList
&&
this
.
couponList
.
length
>
0
){
let
maxCouponId
=
0
let
discount
=
0
const
money
=
this
.
price
this
.
couponList
.
forEach
(
x
=>
{
if
(
x
.
couponsType
==
1
&&
x
.
denomination
>
discount
)
{
discount
=
x
.
denomination
maxCouponId
=
x
.
id
}
if
(
x
.
couponsType
==
2
){
let
disMoney
=
money
*
(
1
-
x
.
denomination
)
if
(
discount
<
disMoney
){
discount
=
disMoney
maxCouponId
=
x
.
id
}
}
})
if
(
maxCouponId
>
0
)
this
.
closeCouponHandler
([
maxCouponId
])
}
},
usePzCouponHandler
(){
usePzCouponHandler
(){
this
.
showPz
=
false
this
.
showPz
=
false
this
.
closeCouponHandler
([
this
.
pzCoupon
.
id
])
this
.
closeCouponHandler
([
this
.
pzCoupon
.
id
])
...
...
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