Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
1333ed32
Commit
1333ed32
authored
Feb 13, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券功能改成了可取消
parent
ebd721c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
47 deletions
+18
-47
orderCoupon.vue
components/orderCoupon.vue
+18
-47
No files found.
components/orderCoupon.vue
View file @
1333ed32
...
...
@@ -13,34 +13,12 @@
<!----------------------------------------------------可用------------------------------------------>
<view
v-show=
"active==0"
>
<view
class=
"middle"
>
<
radio-group
@
change=
"radioChange"
v-if=
"couponList.usableCouponList&&couponList.usableCouponList.length>1
"
>
<view
v-for=
"(item,index) of couponList.
usabl
eCouponList"
:key=
"index"
class=
"listBox"
>
<label>
<
checkbox-group
@
change=
"checkboxChange"
v-if=
"couponList.masterSlaveCouponList&&couponList.masterSlaveCouponList.length>0
"
>
<view
v-for=
"(item,index) of couponList.
masterSlav
eCouponList"
:key=
"index"
class=
"listBox"
>
<label
class=
"listLabel"
>
<view>
{{
item
.
couponName
}}
<radio
:value=
"item.couponId"
:checked=
"item.couponId==chooseCoupon.couponId"
/>
</view>
<view>
{{
item
.
couponRule
}}
</view>
<view>
{{
item
.
useStartDate
}}
-
{{
item
.
useEndDate
}}
<text>
<text>
¥
</text>
{{
parseFloat
(
item
.
savedMoney
.
toFixed
(
2
))
}}
</text>
</view>
</label>
</view>
</radio-group>
<checkbox-group
@
change=
"checkboxChange"
v-if=
"couponList.usableCouponList&&couponList.usableCouponList.length==1"
>
<view
v-for=
"(item,index) of couponList.usableCouponList"
:key=
"index"
class=
"listBox"
>
<label>
<view>
{{
item
.
couponName
}}
<checkbox
:value=
"item.couponId"
:checked=
"true"
/>
<checkbox
:value=
"item.couponId"
:checked=
"item.couponId==chooseCoupon.couponId"
/>
</view>
<view>
{{
item
.
couponRule
}}
...
...
@@ -54,11 +32,10 @@
</view>
</label>
</view>
</checkbox-group>
</view>
<view
class=
"empty"
v-if=
"!couponList.
usableCouponList||couponList.usabl
eCouponList.length==0"
>
<view
class=
"empty"
v-if=
"!couponList.
masterSlaveCouponList||couponList.masterSlav
eCouponList.length==0"
>
空空如也...
</view>
</view>
...
...
@@ -131,30 +108,24 @@
showCoupon
(){
//----------------------------------------展示弹窗
this
.
show
=
true
},
radioChange
(
evt
)
{
//-------------------------单选框值变化
if
(
evt
.
detail
.
value
){
this
.
chooseCoupon
=
this
.
couponList
.
usableCouponList
.
find
((
item
)
=>
{
return
item
.
couponId
==
evt
.
detail
.
value
})
this
.
show
=
false
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
},
//---多选框值变化
checkboxChange
(
evt
){
if
(
evt
.
detail
.
value
){
this
.
chooseCoupon
=
this
.
couponList
.
usableCouponList
.
find
((
item
)
=>
{
return
item
.
couponId
==
evt
.
detail
.
value
if
(
evt
.
detail
.
value
.
length
==
2
){
//删除第一个
evt
.
detail
.
value
.
splice
(
0
,
1
)
//获取选中券,传值给父组件
this
.
chooseCoupon
=
this
.
couponList
.
masterSlaveCouponList
.
find
((
item
)
=>
{
return
item
.
couponId
==
evt
.
detail
.
value
[
0
]
})
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
else
if
(
evt
.
detail
.
value
.
length
==
1
){
this
.
chooseCoupon
=
this
.
couponList
.
masterSlaveCouponList
.
find
((
item
)
=>
{
return
item
.
couponId
==
evt
.
detail
.
value
[
0
]
})
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
else
{
}
else
if
(
evt
.
detail
.
value
.
length
==
0
)
{
this
.
$emit
(
"couponChoose"
,
""
)
}
},
cancelCoupon
(){
//------------------------------------取消选中优惠券
this
.
chooseCoupon
=
""
this
.
show
=
false
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
}
}
...
...
@@ -168,7 +139,7 @@
.titleContent
view
text
{
width
:
40rpx
;
height
:
6rpx
;
background
:
$title-color
;
border-radius
:
6rpx
;
display
:inline-block
;
position
:
relative
;
top
:
-10rpx
;}
.middle
{
padding
:
24rpx
;
background
:
#f5f5f5
;}
.listBox
{
background
:
#FFFFFF
;
padding
:
24rpx
;
border-radius
:
10rpx
;}
.middle
.listBox
:not
(
:first-child
)
{
margin-top
:
20rpx
;}
.middle
.listBox
:not
(
:first-child
)
{
margin-top
:
20rpx
;}
.middle
view
view
:not
(
:first-child
)
{
margin-top
:
20rpx
;}
.middle
view
view
{
display
:
flex
;
justify-content
:
space-between
;}
.middle
view
view
:first-child
{
font-weight
:
bold
;}
...
...
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