Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
46deb8900102fd2d37c15d5ecfb9eeacab046130
1 parent
05139a57
优惠券显示优惠券名称
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
18 deletions
static/js/cart/good.js
static/js/cart/order-ensure.js
static/js/cart/order-info.js
static/js/cart/select-coupon.js
static/sass/cart/_order-ensure.scss
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/actions/cart/index/select-coupon.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
static/js/cart/good.js
View file @
46deb89
...
...
@@ -108,7 +108,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
fast
:
true
});
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'coupon
Valu
e'
,
null
);
orderInfo
(
'coupon
Nam
e'
,
null
);
history
.
go
(
0
);
}
else
{
tip
.
show
(
data
.
message
);
...
...
static/js/cart/order-ensure.js
View file @
46deb89
...
...
@@ -28,9 +28,9 @@ if (window.getUid() !== orderInfo('uid')) {
order
.
init
();
}
if
(
$couponUse
.
data
(
'
value'
)
!==
orderInfo
(
'couponValu
e'
))
{
if
(
$couponUse
.
data
(
'
name'
)
!==
orderInfo
(
'couponNam
e'
))
{
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'coupon
Valu
e'
,
null
);
orderInfo
(
'coupon
Nam
e'
,
null
);
}
function
dispacthTapEvt
(
e
)
{
...
...
static/js/cart/order-info.js
View file @
46deb89
...
...
@@ -15,7 +15,7 @@ function init() {
yohoCoin
:
$
(
'.coin'
).
data
(
'yoho-coin'
)
||
0
,
addressId
:
null
,
couponCode
:
null
,
coupon
Valu
e
:
null
,
coupon
Nam
e
:
null
,
invoice
:
null
,
invoiceText
:
null
,
invoiceType
:
null
,
...
...
static/js/cart/select-coupon.js
View file @
46deb89
...
...
@@ -37,7 +37,7 @@ $newCoupon.on('submit', function() {
if
(
res
.
code
===
200
)
{
tip
.
show
(
'优惠券可用'
);
orderInfo
(
'couponCode'
,
res
.
data
.
coupon_code
);
orderInfo
(
'coupon
Value'
,
res
.
data
.
coupon_valu
e
);
orderInfo
(
'coupon
Name'
,
res
.
data
.
coupon_nam
e
);
window
.
location
.
href
=
'/cart/index/orderEnsure'
;
}
else
{
tip
.
show
(
res
.
message
||
'网络错误'
);
...
...
@@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
var
$this
=
$
(
this
);
orderInfo
(
'couponCode'
,
$this
.
data
(
'coupon-code'
));
orderInfo
(
'coupon
Value'
,
$this
.
data
(
'coupon-valu
e'
));
orderInfo
(
'coupon
Name'
,
$this
.
data
(
'coupon-nam
e'
));
});
$
(
'body'
).
on
(
'touchend'
,
'.not-use'
,
function
()
{
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'coupon
Valu
e'
,
null
);
orderInfo
(
'coupon
Nam
e'
,
null
);
});
...
...
static/sass/cart/_order-ensure.scss
View file @
46deb89
...
...
@@ -118,14 +118,14 @@
margin-left
:
20rem
/
$pxConvertRem
;
}
.coupon-use
,
.coin-check
{
.coupon-use
{
float
:
right
;
color
:
#999
;
&
.used
{
color
:
#f00
;
}
text-align
:
right
;
width
:
360rem
/
$pxConvertRem
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
.iconfont
{
color
:
#999
;
...
...
@@ -141,6 +141,10 @@
color
:
#000
;
}
&
.used
{
color
:
#f00
;
}
em
{
color
:
#f00
;
}
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
46deb89
...
...
@@ -49,9 +49,9 @@
{
{count
}
}张可用
</span>
{
{#if
value
}
}
<span
class=
"used coupon-use"
data-value=
"{{value}}"
>
-¥
{
{value
}
}
{
{#if
name
}
}
<span
class=
"used coupon-use"
data-name=
"{{name}}"
>
{
{name
}
}
<i
class=
"iconfont"
>
614
;</i>
</span>
{
{^
}
}
...
...
template/m.yohobuy.com/actions/cart/index/select-coupon.phtml
View file @
46deb89
...
...
@@ -13,7 +13,7 @@
<script
id=
"tmpl-coupon"
type=
"text/tmpl"
>
\
{
{#coupons
}
}
\
{
{^
notAvailable
}
}
<a
class=
"employ-main"
data-coupon-code=
"\{{ couponCode}}"
data-coupon-
value=
"\{{ couponValue
}}"
href=
"/cart/index/orderEnsure"
>
<a
class=
"employ-main"
data-coupon-code=
"\{{ couponCode}}"
data-coupon-
name=
"\{{ couponDetailInfomation
}}"
href=
"/cart/index/orderEnsure"
>
<span>\
{
{
couponValue
}
}</span>
<p
class=
"coupon-name"
>\
{
{
couponDetailInfomation
}
}</p>
<p>有效期:\
{
{
couponValidity
}
}</p>
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
46deb89
...
...
@@ -498,7 +498,7 @@ class CartModel
// 优惠券数据
$coupons
=
array
();
!
empty
(
$orderCompute
[
'coupon_amount'
])
&&
$coupons
[
'
value'
]
=
$orderInfo
[
'couponValu
e'
];
!
empty
(
$orderCompute
[
'coupon_amount'
])
&&
$coupons
[
'
name'
]
=
$orderInfo
[
'couponNam
e'
];
$coupons
+=
self
::
getCouponList
(
$uid
,
true
);
$result
[
'coupon'
]
=
$coupons
;
}
...
...
Please
register
or
login
to post a comment