Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
Commits
Go to a project
GitLab
Go to group
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
6489765456c1d0f9d4d84806664621232afa94e4
1 parent
f30f5fd9
不同用户 确认订单cookie信息隔离
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
static/js/cart/order-ensure.js
static/js/cart/order-info.js
static/js/cart/order-ensure.js
View file @
6489765
...
...
@@ -10,7 +10,7 @@ var $ = require('jquery'),
Handlebars
=
require
(
'yoho.handlebars'
),
tip
=
require
(
'../plugin/tip'
),
loading
=
require
(
'../plugin/loading'
),
order
Info
=
require
(
'./order-info'
).
orderInfo
;
order
=
require
(
'./order-info'
)
;
var
dispatchModeHammer
,
dispatchTimeHammer
,
...
...
@@ -18,10 +18,15 @@ var dispatchModeHammer,
$price
=
$
(
'.price-cal'
),
payType
,
priceTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-price'
).
html
()),
queryString
=
$
.
queryString
();
queryString
=
$
.
queryString
(),
orderInfo
=
order
.
orderInfo
;
lazyLoad
();
if
(
window
.
getUid
()
!==
orderInfo
(
'uid'
))
{
order
.
init
();
}
function
dispacthTapEvt
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
);
...
...
static/js/cart/order-info.js
View file @
6489765
...
...
@@ -6,11 +6,9 @@
var
$
=
require
(
'jquery'
);
var
info
=
window
.
cookie
(
'order-info'
);
// info 必须是 JSON 字符串
try
{
info
=
JSON
.
parse
(
info
);
}
catch
(
e
)
{
function
init
()
{
info
=
{
uid
:
window
.
getUid
(),
deliveryId
:
1
,
deliveryTimeId
:
1
,
paymentTypeId
:
1
,
...
...
@@ -26,6 +24,15 @@ try {
window
.
setCookie
(
'order-info'
,
JSON
.
stringify
(
info
));
}
// info 必须是 JSON 字符串
try
{
info
=
JSON
.
parse
(
info
);
}
catch
(
e
)
{
init
();
}
exports
.
init
=
init
;
exports
.
orderInfo
=
function
(
key
,
value
)
{
if
(
value
===
undefined
)
{
return
info
[
key
];
...
...
Please
register
or
login
to post a comment