Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f6c2130b
authored
Feb 23, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
ea1a1f19
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
49 deletions
src/assets/css/gift-detail.scss
src/views/gift/create.vue
src/views/gift/detail.vue
src/assets/css/gift-detail.scss
View file @
f6c2130
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
.detail
{
.detail
{
border-bottom
:
1px
solid
rgba
(
195
,
195
,
195
,
0
.3
);
border-bottom
:
1px
solid
rgba
(
195
,
195
,
195
,
0
.3
);
position
:
relative
;
&
:last-of-type
{
&
:last-of-type
{
border-bottom
:
none
;
border-bottom
:
none
;
}
}
...
@@ -60,13 +59,14 @@
...
@@ -60,13 +59,14 @@
font-size
:
12px
;
font-size
:
12px
;
color
:
#333333
;
color
:
#333333
;
padding
:
12px
5px
;
padding
:
12px
5px
;
position
:
relative
;
&
:last-of-type
{
&
:last-of-type
{
border-bottom
:
none
;
border-bottom
:
none
;
}
}
.name
{
.name
{
font-size
:
14px
;
font-size
:
14px
;
&
-tips
{
&
-tips
{
margin-left
:
8px
;
margin-left
:
8px
;
width
:
46px
;
width
:
46px
;
...
@@ -98,13 +98,12 @@
...
@@ -98,13 +98,12 @@
padding
:
0
12px
;
padding
:
0
12px
;
display
:
inline-flex
;
display
:
inline-flex
;
}
}
.del
{
.del
{
position
:
absolute
;
position
:
absolute
;
top
:
8
px
;
top
:
14
px
;
right
:
0
;
right
:
2px
;
}
}
.coupon-disabled
{
.coupon-disabled
{
.detail-list
{
color
:
#999999
;
color
:
#999999
;
.num
{
.num
{
...
@@ -117,7 +116,6 @@
...
@@ -117,7 +116,6 @@
}
}
}
}
}
}
}
.readonly-box
{
.readonly-box
{
padding
:
10px
16px
20px
;
padding
:
10px
16px
20px
;
...
@@ -225,7 +223,8 @@
...
@@ -225,7 +223,8 @@
box-sizing
:
border-box
;
box-sizing
:
border-box
;
height
:
100px
;
height
:
100px
;
}
}
.van-field--min-height
.van-field__control
{
.van-field--min-height
.van-field__control
{
height
:
82px
;
height
:
82px
;
}
}
}
}
...
...
src/views/gift/create.vue
View file @
f6c2130
...
@@ -37,32 +37,37 @@
...
@@ -37,32 +37,37 @@
</div>
</div>
<template
v-if=
"obj.couponList && obj.couponList.length"
>
<template
v-if=
"obj.couponList && obj.couponList.length"
>
<div
class=
"detail-box"
>
<div
class=
"detail-box"
>
<template
v-for=
"(i,index) in obj.couponList"
>
<template
v-for=
"(i,index) in obj.couponList
View
"
>
<div
<div
:class=
"['detail',
{'coupon-disabled':i.status != 2}]
"
class=
"detail
"
:key=
"index"
:key=
"index"
>
>
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<span
class=
"detail-title text-center"
>
{{
discountEnum
[
i
.
discountType
]
}}
</span>
<span
class=
"detail-title text-center"
>
{{
discountEnum
[
i
.
discountType
]
}}
</span>
<div
class=
"detail-list"
>
<template
v-for=
"(e,ind) in i.list"
>
<div
:class=
"['detail-list',
{'coupon-disabled':e.status != 2
&&
obj.receivedFlag != 2}]"
:key="ind"
>
<div
class=
"name flex"
>
<div
class=
"name flex"
>
{{
i
.
couponName
}}
{{
e
.
couponName
}}
<template
v-if=
"i.status
!= 2"
>
<template
v-if=
"e.status != 2 && obj.receivedFlag
!= 2"
>
<div
class=
"name-tips text-center"
>
{{
{
1
:
'未生效'
,
3
:
'已失效'
}
[
i
.
status
]
}}
<
/div
>
<div
class=
"name-tips text-center"
>
{{
{
1
:
'未生效'
,
3
:
'已失效'
}
[
e
.
status
]
}}
<
/div
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
div
class
=
"num flex"
>
<
div
class
=
"num flex"
>
数量:
x
{{
i
.
couponAmount
}}
数量:
x
{{
e
.
couponAmount
}}
<
div
class
=
"price"
>
¥
{{
centsToyuan
(
i
.
couponAnticipatedCost
*
i
.
couponAmount
)
}}
<
/div
>
<
div
class
=
"price"
>
¥
{{
centsToyuan
(
e
.
couponAnticipatedCost
*
e
.
couponAmount
)
}}
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"del sprite-icon icon-gift-del"
@
click
=
"delCoupon(e)"
><
/div
>
<
/div
>
<
/div
>
<
div
class
=
"del sprite-icon icon-gift-del"
@
click
=
"delCoupon(index)"
><
/div
>
<
/template>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
div
:
class
=
"
[
'add-box text-center'
,{
'add-line'
:
obj
.
couponList
.
length
>
0
}
]
">
<
div
:
class
=
"
[
'add-box text-center'
,{
'add-line'
:
obj
.
couponList
.
length
}
]
">
<div
<div
class="
add
-
btn
text
-
center
"
class="
add
-
btn
text
-
center
"
@click="
showGiftModal
"
@click="
showGiftModal
"
...
@@ -162,20 +167,33 @@ export default {
...
@@ -162,20 +167,33 @@ export default {
if
(
i
&&
i
.
key
==
'vin'
)
this
.
obj
[
i
.
key
]
=
e
.
replace
(
/
[^
0-9a-zA-Z
]
/g
,
''
)
if
(
i
&&
i
.
key
==
'vin'
)
this
.
obj
[
i
.
key
]
=
e
.
replace
(
/
[^
0-9a-zA-Z
]
/g
,
''
)
this
.
checkData
()
this
.
checkData
()
}
,
}
,
getDetail
(
id
)
{
setCouponData
(
res
)
{
let
total
=
0
let
total
=
0
let
discountTypeList
=
Array
.
from
(
new
Set
([...
res
.
couponList
.
map
(
e
=>
e
.
discountType
)]))
res
.
couponListView
=
discountTypeList
.
map
(
i
=>
{
let
list
=
[]
res
.
couponList
.
map
(
e
=>
{
if
(
e
.
status
==
2
)
total
+=
e
.
couponAnticipatedCost
*
e
.
couponAmount
if
(
i
==
e
.
discountType
)
list
.
push
(
e
)
}
)
return
{
discountType
:
i
,
list
}
}
)
this
.
total
=
total
return
res
}
,
getDetail
(
id
)
{
let
{
radioObj
}
=
this
let
{
radioObj
}
=
this
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
res
.
couponList
.
length
&&
res
.
couponList
.
map
(
e
=>
{
res
=
this
.
setCouponData
(
res
)
if
(
e
.
status
==
2
)
total
+=
e
.
couponAnticipatedCost
*
e
.
couponAmount
}
)
this
.
flag
=
true
this
.
flag
=
true
radioObj
.
map
(
e
=>
e
.
active
=
false
)
radioObj
.
map
(
e
=>
e
.
active
=
false
)
if
(
res
.
receiveWay
==
1
)
res
.
phone
=
res
.
receiveDetails
if
(
res
.
receiveWay
==
1
)
res
.
phone
=
res
.
receiveDetails
else
res
.
vin
=
res
.
receiveDetails
else
res
.
vin
=
res
.
receiveDetails
this
.
obj
=
res
this
.
obj
=
res
this
.
total
=
total
this
.
checkData
()
this
.
checkData
()
}
)
}
)
}
,
}
,
...
@@ -190,12 +208,8 @@ export default {
...
@@ -190,12 +208,8 @@ export default {
this
.
$refs
.
GiftModal
.
toggle
()
this
.
$refs
.
GiftModal
.
toggle
()
}
,
}
,
couponConfirm
({
chooseItems
}
)
{
couponConfirm
({
chooseItems
}
)
{
let
total
=
0
chooseItems
.
map
(
i
=>
{
if
(
i
.
status
==
2
)
total
+=
i
.
couponAnticipatedCost
*
i
.
couponAmount
}
)
this
.
obj
.
couponList
=
JSON
.
parse
(
JSON
.
stringify
(
chooseItems
))
this
.
obj
.
couponList
=
JSON
.
parse
(
JSON
.
stringify
(
chooseItems
))
this
.
total
=
total
this
.
obj
=
this
.
setCouponData
(
this
.
obj
)
this
.
checkData
()
this
.
checkData
()
}
,
}
,
checkData
()
{
checkData
()
{
...
@@ -222,15 +236,15 @@ export default {
...
@@ -222,15 +236,15 @@ export default {
}
}
this
.
disabled
=
false
this
.
disabled
=
false
}
,
}
,
delCoupon
(
index
)
{
delCoupon
(
e
)
{
let
{
obj
:
{
couponList
}
}
=
this
let
{
obj
:
{
couponList
}
}
=
this
let
total
=
0
let
index
=
null
couponList
.
map
((
i
,
ind
)
=>
{
if
(
i
.
discountType
==
e
.
discountType
&&
i
.
couponId
==
e
.
couponId
)
index
=
ind
}
)
couponList
.
splice
(
index
,
1
)
couponList
.
splice
(
index
,
1
)
this
.
obj
.
couponList
=
couponList
this
.
obj
.
couponList
=
couponList
couponList
.
map
(
i
=>
{
this
.
obj
=
this
.
setCouponData
(
this
.
obj
)
if
(
i
.
status
==
2
)
total
+=
i
.
couponAnticipatedCost
*
i
.
couponAmount
}
)
this
.
total
=
total
this
.
checkData
()
this
.
checkData
()
}
,
}
,
submit
()
{
submit
()
{
...
...
src/views/gift/detail.vue
View file @
f6c2130
...
@@ -44,35 +44,38 @@
...
@@ -44,35 +44,38 @@
<div
class=
"label"
>
礼包明细
</div>
<div
class=
"label"
>
礼包明细
</div>
<div
class=
"value"
>
预估成本:
<span>
¥{{centsToyuan(total)}}
</span></div>
<div
class=
"value"
>
预估成本:
<span>
¥{{centsToyuan(total)}}
</span></div>
</div>
</div>
<
template
v-if=
"obj.couponList && obj.couponList.length"
>
<div
class=
"detail-box"
>
<div
class=
"detail-box"
>
<template
v-for=
"(i,index) in obj.couponList
"
>
<
template
v-for=
"(i,index) in obj.couponListView
"
>
<div
<div
:class=
"['detail',
{'coupon-disabled':i.status != 2
&&
obj.receivedFlag != 2}]
"
class=
"detail
"
:key=
"index"
:key=
"index"
>
>
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- status 优惠券状态(1:未生效,2:生效中,3:已失效) -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<!-- 优惠券类型 1:满减券,2:折扣券,3:代金券,4:兑换券 5:购车代金券 6:商品折扣券,7:会员服务 -->
<span
class=
"detail-title text-center"
>
{{
discountEnum
[
i
.
discountType
]
}}
</span>
<span
class=
"detail-title text-center"
>
{{
discountEnum
[
i
.
discountType
]
}}
</span>
<div
class=
"detail-list"
>
<template
v-for=
"(e,ind) in i.list"
>
<div
:class=
"['detail-list',
{'coupon-disabled':e.status != 2
&&
obj.receivedFlag != 2}]"
:key="ind"
>
<div
class=
"name flex"
>
<div
class=
"name flex"
>
{{
i
.
couponName
}}
{{
e
.
couponName
}}
<template
v-if=
"
i
.status != 2 && obj.receivedFlag != 2"
>
<template
v-if=
"
e
.status != 2 && obj.receivedFlag != 2"
>
<div
class=
"name-tips text-center"
>
{{
{
1
:
'未生效'
,
3
:
'已失效'
}
[
i
.
status
]
}}
<
/div
>
<div
class=
"name-tips text-center"
>
{{
{
1
:
'未生效'
,
3
:
'已失效'
}
[
e
.
status
]
}}
<
/div
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
div
class
=
"num flex"
>
<
div
class
=
"num flex"
>
数量:
x
{{
i
.
couponAmount
}}
数量:
x
{{
e
.
couponAmount
}}
<
div
class
=
"price"
>
¥
{{
centsToyuan
(
i
.
couponAnticipatedCost
*
i
.
couponAmount
)
}}
<
/div
>
<
div
class
=
"price"
>
¥
{{
centsToyuan
(
e
.
couponAnticipatedCost
*
e
.
couponAmount
)
}}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/template>
<!--
<
template
v
-
if
=
"i.status != 2 && obj.receivedFlag != 2"
>
<!--
<
template
v
-
if
=
"i.status != 2 && obj.receivedFlag != 2"
>
<
div
class
=
"del sprite-icon icon-gift-del"
@
click
=
"changeGift"
><
/div
>
<
div
class
=
"del sprite-icon icon-gift-del"
@
click
=
"changeGift"
><
/div
>
<
/template> --
>
<
/template> --
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
/template
>
<
/div
>
<
/div
>
<
div
class
=
"box readonly-box"
>
<
div
class
=
"box readonly-box"
>
<
div
class
=
"title"
>
领取条件
<
/div
>
<
div
class
=
"title"
>
领取条件
<
/div
>
...
@@ -115,17 +118,30 @@ export default {
...
@@ -115,17 +118,30 @@ export default {
this
.
getDetail
()
this
.
getDetail
()
}
,
}
,
methods
:
{
methods
:
{
setCouponData
(
res
)
{
let
total
=
0
let
discountTypeList
=
Array
.
from
(
new
Set
([...
res
.
couponList
.
map
(
e
=>
e
.
discountType
)]))
res
.
couponListView
=
discountTypeList
.
map
(
i
=>
{
let
list
=
[]
res
.
couponList
.
map
(
e
=>
{
if
(
e
.
status
==
2
)
total
+=
e
.
couponAnticipatedCost
*
e
.
couponAmount
if
(
i
==
e
.
discountType
)
list
.
push
(
e
)
}
)
return
{
discountType
:
i
,
list
}
}
)
this
.
total
=
total
return
res
}
,
getDetail
()
{
getDetail
()
{
let
{
id
}
=
this
.
getQuery
()
let
{
id
}
=
this
.
getQuery
()
let
total
=
0
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
res
.
couponList
.
length
&&
res
.
couponList
.
map
(
e
=>
{
res
=
this
.
setCouponData
(
res
)
if
(
e
.
status
==
2
)
total
+=
e
.
couponAnticipatedCost
*
e
.
couponAmount
}
)
this
.
flag
=
true
this
.
flag
=
true
this
.
obj
=
res
this
.
obj
=
res
this
.
total
=
total
}
)
}
)
}
,
}
,
changeGift
()
{
changeGift
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment