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
Email Patches
Plain Diff
Browse Files
Authored by
Lynnic
9 years ago
Commit
e4fd9e837f484ddf58608ab291a27d14bdd3b5f9
1 parent
a8e51496
购物车逻辑修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
static/js/shopping-cart/chose-panel.js
static/js/shopping-cart/chose-panel.js
View file @
e4fd9e8
...
...
@@ -17,14 +17,15 @@ var $num,
leftNum
,
$colorList
=
$
(
'.color-list ul>li'
),
$sizeList
=
$
(
'.size-list ul>li'
),
firstColorId
=
$colorList
.
eq
(
0
).
data
(
'id'
);
firstColorId
=
$colorList
.
eq
(
0
).
data
(
'id'
),
colorIndex
;
//初始化购物车面板显示
$sizeList
.
each
(
function
()
{
var
id
=
$
(
this
).
data
(
'colorid'
);
colorIndex
=
$
(
this
).
data
(
'colorid'
);
if
(
id
===
firstColorId
)
{
if
(
colorIndex
===
firstColorId
)
{
$
(
this
).
removeClass
(
'hide'
);
}
});
...
...
@@ -149,6 +150,19 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}
});
}
else
if
(
$chosed
.
length
===
1
&&
$this
.
hasClass
(
'chosed'
))
{
if
(
$this
.
closest
(
'.block-list'
).
hasClass
(
'color-list'
))
{
$sizeList
.
addClass
(
'hide'
);
//切换尺码信息
$sizeList
.
each
(
function
()
{
colorIndex
=
$
(
this
).
data
(
'colorid'
);
if
(
colorIndex
===
$this
.
data
(
'id'
))
{
$
(
this
).
removeClass
(
'hide'
);
}
});
}
numArray
=
$chosed
.
data
(
'numstr'
).
split
(
'/'
);
$siblingBlock
.
find
(
'.block'
).
removeClass
(
'zero-stock'
);
for
(
i
=
0
;
i
<
numArray
.
length
;
i
++
)
{
...
...
Please
register
or
login
to post a comment