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
97a362a1
Commit
97a362a1
authored
Feb 21, 2025
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/zk123/jz_travel
parents
f5e781bb
9c9a8453
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
19 deletions
+66
-19
index.vue
components/coupon/index.vue
+40
-2
jz_Reserve.vue
pages/jiuzhai/jz_Reserve.vue
+1
-1
visa_Reserve.vue
pages/visa/visa_Reserve.vue
+25
-16
No files found.
components/coupon/index.vue
View file @
97a362a1
...
...
@@ -69,6 +69,8 @@
value
:
''
,
ts
:
[],
stacking
:
0
,
TotalDiscounts
:
0
,
money
:
0
,
};
},
mounted
()
{
...
...
@@ -95,6 +97,7 @@
}
})
this
.
OverlayCalculation
()
this
.
checkOrderCoupon
()
},
methods
:
{
...
...
@@ -129,7 +132,7 @@
}
else
{
this
.
$emit
(
'close'
,
-
1
)
}
console
.
log
(
this
.
currentChosen
,
'-----'
)
//
console.log(this.currentChosen,'-----')
},
// 不可叠加使用优惠券
radioChange
(
e
){
...
...
@@ -144,9 +147,10 @@
if
(
!
this
.
currentChosen
||
this
.
currentChosen
.
length
==
0
||
(
this
.
currentChosen
.
length
==
1
&&
this
.
currentChosen
[
0
]
!=
e
)){
this
.
currentChosen
=
[
e
]
}
else
{
this
.
currentChosen
=
0
;
this
.
currentChosen
=
[]
;
this
.
value
=
0
}
this
.
OverlayCalculation
(
1
)
},
// 叠加使用优惠券
multipleChoice
(
e
,
i
){
...
...
@@ -165,6 +169,40 @@
let
list
=
this
.
currentChosen
.
findIndex
(
x
=>
x
==
this
.
ts
[
i
].
id
)
if
(
list
==-
1
)
this
.
currentChosen
.
push
(
e
)
}
this
.
OverlayCalculation
()
},
OverlayCalculation
(
type
){
this
.
TotalDiscounts
=
0
this
.
money
=
0
if
(
this
.
currentChosen
.
length
==
0
||
type
){
this
.
ts
.
forEach
(
x
=>
{
if
(
x
.
overlapUse
&&
(
x
.
err
||
type
)){
x
.
err
=
null
}
})
return
}
let
alreadyStacked
=
this
.
ts
.
filter
(
x
=>
{
return
x
.
check
})
alreadyStacked
.
forEach
(
x
=>
{
this
.
TotalDiscounts
+=
x
.
denomination
this
.
money
=
this
.
price
-
this
.
TotalDiscounts
})
this
.
ts
.
forEach
(
x
=>
{
if
(
x
.
overlapUse
){
if
(
!
x
.
check
&&
x
.
denomination
>
this
.
money
){
x
.
err
=
'订单金额不满足'
}
else
{
x
.
err
=
null
}
}
})
this
.
ts
.
sort
((
a
,
b
)
=>
{
const
aerr
=
(
a
.
err
?
a
.
err
:
''
).
length
const
berr
=
(
b
.
err
?
b
.
err
:
''
).
length
return
aerr
-
berr
})
}
},
};
...
...
pages/jiuzhai/jz_Reserve.vue
View file @
97a362a1
...
...
@@ -648,7 +648,7 @@
},
usePzCouponHandler
(){
this
.
showPz
=
false
this
.
closeCouponHandler
(
this
.
pzCoupon
.
id
)
this
.
closeCouponHandler
(
[
this
.
pzCoupon
.
id
]
)
this
.
pzCoupon
=
null
},
calcPzCouponHandler
(){
...
...
pages/visa/visa_Reserve.vue
View file @
97a362a1
...
...
@@ -653,7 +653,7 @@
<view
style=
"font-size: 12px;width:1px;flex:1"
>
请选择优惠券
</view>
<view
style=
"display: flex;align-items: center;"
>
<text
style=
"color:#F20707;font-size: 12px;"
@
click=
"showCouponHandler"
>
<text
style=
"flex: 1;"
v-if=
"useCouponId == 0 &&couponList.length>0"
>
{{
couponList
.
length
}}
张可用优惠券
</text>
<text
style=
"flex: 1;"
v-if=
"useCouponId
s
== 0 &&couponList.length>0"
>
{{
couponList
.
length
}}
张可用优惠券
</text>
<text
class=
"content"
style=
"color:grey"
v-else-if=
"couponList.length==0"
>
暂无优惠券
</text>
<text
class=
"content"
v-else
:style=
"
{ color: mainColor }">已优惠
{{
currentCoupon
.
discountMoney
}}
元
</text>
<!--
<u-icon
name=
"ellipsis"
size=
"36"
v-if=
"couponList.length > 0"
></u-icon>
-->
...
...
@@ -667,7 +667,7 @@
<view
class=
"empty-block"
></view>
</
template
>
<coupon
v-if=
"couponList.length > 0 && showCoupon"
:
list=
"couponList"
:current=
"useCouponId
"
@
close=
"closeCouponHandler"
:current-price=
"realCurrentPriceInfo"
:order=
"orderMsg"
></coupon>
<coupon
v-if=
"couponList.length > 0 && showCoupon"
:
price=
"price"
:list=
"couponList"
:current=
"useCouponIds
"
@
close=
"closeCouponHandler"
:current-price=
"realCurrentPriceInfo"
:order=
"orderMsg"
></coupon>
<view
style=
"padding: 50rpx 40rpx"
v-if=
"tips != ''"
>
<view
class=
"big-title"
>
<text>
重要提示
</text>
...
...
@@ -780,7 +780,7 @@
GuestList
:
[],
couponList
:
[],
showCoupon
:
false
,
useCouponId
:
0
,
useCouponId
s
:
[]
,
currentCoupon
:
{
discountMoney
:
0
},
...
...
@@ -973,18 +973,27 @@
},
closeCouponHandler
(
e
)
{
if
(
e
!=
-
1
)
{
this
.
useCouponId
=
e
;
if
(
this
.
useCouponId
){
this
.
currentCoupon
=
this
.
couponList
.
find
(
x
=>
x
.
id
==
this
.
useCouponId
)
if
(
this
.
currentCoupon
.
couponsType
==
1
)
{
this
.
currentCoupon
.
discountMoney
=
this
.
currentCoupon
.
denomination
}
else
{
this
.
currentCoupon
.
discountMoney
=
(
parseFloat
(
this
.
price
)
*
(
1
-
parseFloat
(
this
.
currentCoupon
.
denomination
/
10
)))
.
toFixed
(
2
)
}
}
else
{
this
.
currentCoupon
.
discountMoney
=
0
}
this
.
useCouponIds
=
e
;
//叠加使用优惠券
let
TotalDiscountAmount
=
0
this
.
couponList
.
forEach
(
x
=>
{
let
findIndex
=
this
.
useCouponIds
.
findIndex
(
y
=>
x
.
id
==
y
)
if
(
findIndex
!=-
1
){
let
discountMoney
=
0
if
(
x
.
couponsType
==
1
){
discountMoney
=
x
.
denomination
}
else
{
discountMoney
=
(
parseFloat
(
this
.
price
)
*
(
1
-
parseFloat
(
x
.
denomination
/
10
)))
.
toFixed
(
2
)
}
TotalDiscountAmount
+=
discountMoney
}
})
if
(
TotalDiscountAmount
)
this
.
currentCoupon
.
discountMoney
=
TotalDiscountAmount
else
this
.
currentCoupon
.
discountMoney
=
0
}
else
{
this
.
currentCoupon
.
discountMoney
=
0
this
.
useCouponIds
=
[]
}
this
.
showCoupon
=
false
;
},
...
...
@@ -1014,7 +1023,7 @@
},
usePzCouponHandler
(){
this
.
showPz
=
false
this
.
closeCouponHandler
(
this
.
pzCoupon
.
id
)
this
.
closeCouponHandler
(
[
this
.
pzCoupon
.
id
]
)
this
.
pzCoupon
=
null
},
calcPzCouponHandler
(){
...
...
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