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
Show 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 @@
...
@@ -13,34 +13,12 @@
<!----------------------------------------------------可用------------------------------------------>
<!----------------------------------------------------可用------------------------------------------>
<view
v-show=
"active==0"
>
<view
v-show=
"active==0"
>
<view
class=
"middle"
>
<view
class=
"middle"
>
<
radio-group
@
change=
"radioChange"
v-if=
"couponList.usableCouponList&&couponList.usableCouponList.length>1
"
>
<
checkbox-group
@
change=
"checkboxChange"
v-if=
"couponList.masterSlaveCouponList&&couponList.masterSlaveCouponList.length>0
"
>
<view
v-for=
"(item,index) of couponList.
usabl
eCouponList"
:key=
"index"
class=
"listBox"
>
<view
v-for=
"(item,index) of couponList.
masterSlav
eCouponList"
:key=
"index"
class=
"listBox"
>
<label>
<label
class=
"listLabel"
>
<view>
<view>
{{
item
.
couponName
}}
{{
item
.
couponName
}}
<radio
:value=
"item.couponId"
:checked=
"item.couponId==chooseCoupon.couponId"
/>
<checkbox
: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"
/>
</view>
</view>
<view>
<view>
{{
item
.
couponRule
}}
{{
item
.
couponRule
}}
...
@@ -54,11 +32,10 @@
...
@@ -54,11 +32,10 @@
</view>
</view>
</label>
</label>
</view>
</view>
</checkbox-group>
</checkbox-group>
</view>
</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>
</view>
</view>
...
@@ -131,30 +108,24 @@
...
@@ -131,30 +108,24 @@
showCoupon
(){
//----------------------------------------展示弹窗
showCoupon
(){
//----------------------------------------展示弹窗
this
.
show
=
true
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
){
checkboxChange
(
evt
){
if
(
evt
.
detail
.
value
){
if
(
evt
.
detail
.
value
.
length
==
2
){
this
.
chooseCoupon
=
this
.
couponList
.
usableCouponList
.
find
((
item
)
=>
{
//删除第一个
return
item
.
couponId
==
evt
.
detail
.
value
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
)
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
else
{
}
else
if
(
evt
.
detail
.
value
.
length
==
0
)
{
this
.
$emit
(
"couponChoose"
,
""
)
this
.
$emit
(
"couponChoose"
,
""
)
}
}
},
cancelCoupon
(){
//------------------------------------取消选中优惠券
this
.
chooseCoupon
=
""
this
.
show
=
false
this
.
$emit
(
"couponChoose"
,
this
.
chooseCoupon
)
}
}
}
}
}
}
...
...
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