Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
85330e1fd5f7ea5d52e5723a1484ceb58c99ce74
2 parents
332fccfc
3aac5d9c
Merge branch 'feature/cart' of
http://git.dev.yoho.cn/web/yohobuy
into feature/cart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
static/js/cart/chose-panel.js
static/js/cart/chose-panel.js
View file @
85330e1
...
...
@@ -20,7 +20,8 @@ var $num,
$colorList
=
$
(
'.color-list ul>li'
),
$sizeList
=
$
(
'.size-list ul>li'
),
firstColorId
=
$colorList
.
eq
(
0
).
data
(
'id'
),
colorIndex
;
colorIndex
,
confirming
;
//初始化购物车面板显示
$sizeList
.
each
(
function
()
{
...
...
@@ -31,7 +32,7 @@ $sizeList.each(function() {
}
});
// confirm;
// var tpl;
...
...
@@ -81,41 +82,47 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}).
on
(
'touchstart'
,
'#chose-btn-sure'
,
function
()
{
var
productSku
,
buyNumber
=
$
(
'#good-num'
)
-
0
;
buyNumber
=
$
(
'#good-num'
).
val
()
-
0
,
promotionId
,
isEdit
=
0
,
numInCart
=
$
(
'.num-tag'
).
html
()
-
0
;
// promotionId,
// goodsType,
// goodsType,
// isEdit;
$chosed
=
$
(
'.block-list>ul>li.chosed'
);
if
(
2
===
$chosed
.
length
&&
0
===
$chosed
.
closest
(
'.zero-stock'
).
length
)
{
productSku
=
$sizeList
.
closest
(
'.chosed'
).
data
(
'skuid'
);
promotionId
=
$
(
'[data-id="'
+
productSku
+
'"]'
).
closest
(
'.advance-block'
).
data
(
'promotion-id'
);
if
(
confirming
)
{
return
false
;
}
// if (confirm) {
// return false;
// }
// confirm = true;
confirming
=
true
;
loading
.
showLoadingMask
();
$
.
ajax
({
method
:
'POST'
,
url
:
'/cart/index/add'
,
data
:
{
productSku
:
productSku
,
buyNumber
:
buyNumber
buyNumber
:
buyNumber
,
promotionId
:
promotionId
,
isEdit
:
isEdit
}
}).
done
(
function
(
res
)
{
if
(
res
.
code
===
200
)
{
loading
.
hideLoadingMask
();
// confirm = false;
$
(
'.num-tag'
).
html
(
numInCart
+
buyNumber
);
$
(
'.num-tag'
).
removeClass
(
'hide'
);
confirming
=
false
;
remove
();
}
}).
fail
(
function
()
{
tip
.
show
(
'网络出了点问题~'
);
// confirm
= false;
confirming
=
false
;
});
}
...
...
Please
register
or
login
to post a comment