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
biao
9 years ago
Commit
f41e2d3d720bd5bdc32e42a60fffa355c72cc9ea
2 parents
ca0af99a
85414cc8
Merge branch 'feature/cart' of
http://git.dev.yoho.cn/web/yohobuy
into fix/cart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
static/js/cart/chose-panel.js
static/js/cart/chose-panel.js
View file @
f41e2d3
...
...
@@ -117,6 +117,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
$
(
'.num-tag'
).
html
(
numInCart
+
buyNumber
);
$
(
'.num-tag'
).
removeClass
(
'hide'
);
confirming
=
false
;
tip
.
show
(
'选择成功'
);
remove
();
}
}).
fail
(
function
()
{
...
...
@@ -147,14 +148,21 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}
if
(
$chosed
.
length
===
0
)
{
$
this
.
closest
(
'ul>li'
)
.
each
(
function
()
{
$
colorList
.
each
(
function
()
{
$
(
this
).
removeClass
(
'zero-stock'
);
if
(
0
===
$
(
this
).
data
(
'num'
)
-
0
)
{
$
(
this
).
addClass
(
'zero-stock'
);
}
});
$siblingBlock
.
find
(
'ul>li'
).
each
(
function
()
{
$sizeList
.
each
(
function
()
{
colorIndex
=
$
(
this
).
data
(
'colorid'
);
if
(
colorIndex
===
firstColorId
)
{
$
(
this
).
removeClass
(
'hide'
);
}
});
$sizeList
.
not
(
'.hide'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'zero-stock'
);
if
(
0
===
$
(
this
).
data
(
'num'
)
-
0
)
{
$
(
this
).
addClass
(
'zero-stock'
);
...
...
@@ -178,7 +186,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
$siblingBlock
.
find
(
'.block'
).
removeClass
(
'zero-stock'
);
for
(
i
=
0
;
i
<
numArray
.
length
;
i
++
)
{
if
(
0
===
numArray
[
i
]
-
0
)
{
$siblingBlock
.
find
(
'.block'
).
eq
(
i
).
addClass
(
'zero-stock'
);
$siblingBlock
.
find
(
'.block'
).
not
(
'.hide'
).
eq
(
i
).
addClass
(
'zero-stock'
);
}
}
}
else
if
(
$chosed
.
length
===
1
&&
!
$this
.
hasClass
(
'chosed'
))
{
...
...
@@ -199,7 +207,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
$siblingBlock
.
find
(
'.block'
).
eq
(
i
).
addClass
(
'zero-stock'
);
}
}
numArray
=
$siblingBlock
.
find
(
'.chosed'
).
data
(
'numstr
'
).
split
(
'/'
);
numArray
=
(
$siblingBlock
.
find
(
'.chosed'
).
data
(
'numstr'
)
+
'
'
).
split
(
'/'
);
$that
.
find
(
'.num .left-num'
).
html
(
'剩余'
+
numArray
[
index
]
+
'件'
);
if
(
2
===
$chosed
.
closest
(
'.zero-stock'
).
length
)
{
$
(
'#chose-btn-sure'
).
css
(
'background-color'
,
'#c0c0c0'
);
...
...
Please
register
or
login
to post a comment