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
4d1020f0e8d3876bdb7dea34585d4f66768bce22
1 parent
55b199ab
订单确认页面逻辑修改
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 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/js/cart/good.js
View file @
4d1020f
...
...
@@ -10,8 +10,9 @@ var $ = require('jquery'),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
dialog
=
require
(
'../me/dialog'
),
tip
=
require
(
'../plugin/tip'
),
orderInfo
=
require
(
'./order-info'
).
orderInfo
;
tip
=
require
(
'../plugin/tip'
);
// orderInfo = require('./order-info').orderInfo;
var
$selectAllBtn
=
$
(
'.balance .checkbox'
),
requesting
=
false
;
...
...
@@ -106,8 +107,9 @@ $('.icon-del').on('touchstart', function(e) {
autoHide
:
true
,
fast
:
true
});
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'couponName'
,
null
);
// orderInfo('couponCode', null);
// orderInfo('couponName', null);
window
.
setCookie
(
'_yoho-cart-refreshByDelete'
,
true
);
window
.
location
.
href
=
'/cart/index/index?cartType='
+
$
(
'#cartType'
).
val
();
}
else
{
...
...
static/js/cart/order-ensure.js
View file @
4d1020f
...
...
@@ -40,6 +40,12 @@ if ($couponUse.data('name') !== orderInfo('couponName')) {
orderInfo
(
'couponName'
,
null
);
}
// 来自购物车的链接默认不使用优惠券
if
(
document
.
referrer
&&
document
.
referrer
.
indexOf
(
'/cart/index/index'
)
!==
-
1
)
{
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'couponName'
,
null
);
}
orderInfo
(
'cartType'
,
queryString
.
cartType
||
queryString
.
carttype
||
'ordinary'
);
function
dispacthTapEvt
(
e
)
{
...
...
@@ -120,6 +126,9 @@ function orderCompute() {
});
}
// 进入页面计算一次价格
orderCompute
();
function
submitOrder
()
{
var
invoiceText
=
$invoice
.
find
(
'[name="invoice-title"]'
).
val
()
||
orderInfo
(
'invoiceText'
),
msg
=
$
(
'#msg'
).
find
(
'input'
).
val
()
||
orderInfo
(
'msg'
);
...
...
static/js/cart/order-info.js
View file @
4d1020f
...
...
@@ -30,9 +30,9 @@ function init() {
// info 必须是 JSON 字符串
try
{
info
=
JSON
.
parse
(
info
);
// 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下
info
[
'yohoCoin'
]
=
$
(
'.coin'
).
data
(
'yoho-coin'
)
||
0
;
// info.yohoCoin
= $('.coin').data('yoho-coin') || 0;
}
catch
(
e
)
{
init
();
}
...
...
static/js/cart/select-coupon.js
View file @
4d1020f
...
...
@@ -158,15 +158,14 @@ function getCouponHandle(coupons) {
couponCode
:
couponCode
}
}).
then
(
function
(
res
)
{
if
(
res
.
message
)
{
tip
.
show
(
res
.
message
);
}
if
(
res
.
code
===
200
)
{
//tip.show('优惠券可用');
orderInfo
(
'couponCode'
,
res
.
data
.
coupon_code
);
orderInfo
(
'couponName'
,
res
.
data
.
coupon_title
);
window
.
location
.
href
=
'/cart/index/orderEnsure'
;
}
else
if
(
res
.
message
)
{
tip
.
show
(
res
.
message
);
}
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
...
...
Please
register
or
login
to post a comment