Toggle navigation
Toggle navigation
This project
Loading...
Sign in
chenchao
/
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
3a2c7af60bacfb169bef29de3c29d9824658e149
1 parent
da6af19f
购物车功能修改 code review by bikai
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
static/js/cart/chose-panel.js
static/js/cart/chose-panel.js
View file @
3a2c7af
...
...
@@ -20,9 +20,7 @@ var panelTmpl,
$chosed
,
re
=
/
\d
+/
,
leftNum
,
$colorList
,
$sizeList
,
firstColorId
,
colorIndex
,
confirming
,
hasChooseColor
=
false
,
...
...
@@ -45,6 +43,7 @@ $.get('/cart/index/giftinfoTpl', function(html) {
//初始化购物车面板显示
function
init
()
{
//$colorList = $('.chose-panel .color-list ul>li');
//$sizeList = $('.chose-panel .size-list ul>li');
//firstColorId = $colorList.eq(0).data('id');
...
...
@@ -55,8 +54,10 @@ function init() {
// $(this).removeClass('hide');
// }
//});
var
$firstRow
=
$sizeRowList
.
eq
(
0
);
//$firstRow.toggleClass('hide');
$firstRow
.
toggleClass
(
'hide'
);
$curSizeRow
=
$firstRow
;
}
...
...
@@ -100,6 +101,8 @@ $('.color-list').on('touchstart', '.block', function(e) {
numArray
,
index
,
curSelectedSizeBlock
,
$sizeChosed
,
scindex
,
i
;
var
$siblingBlock
=
$this
.
closest
(
'.block-list'
).
siblings
(
':first'
),
...
...
@@ -108,8 +111,8 @@ $('.color-list').on('touchstart', '.block', function(e) {
$this
.
siblings
(
'.chosed'
).
removeClass
(
'chosed'
);
index
=
$this
.
index
();
var
$sizeChosed
=
$siblingBlock
.
find
(
'.chosed'
);
var
scindex
=
$sizeChosed
.
index
();
$sizeChosed
=
$siblingBlock
.
find
(
'.chosed'
);
scindex
=
$sizeChosed
.
index
();
$curSizeRow
=
$sizeRowList
.
eq
(
index
);
// 当前颜色已经是选中状态,再点击时
...
...
@@ -163,18 +166,15 @@ $('.color-list').on('touchstart', '.block', function(e) {
}
});
}
else
if
(
$chosed
.
length
===
1
&&
$this
.
hasClass
(
'chosed'
))
{
//if ($this.closest('.block-list').hasClass('color-list')) {
$sizeList
.
addClass
(
'hide'
);
$sizeList
.
addClass
(
'hide'
);
//切换尺码信息
$sizeList
.
each
(
function
()
{
colorIndex
=
$
(
this
).
data
(
'colorid'
);
if
(
colorIndex
===
$this
.
data
(
'id'
))
{
$
(
this
).
removeClass
(
'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'
);
...
...
Please
register
or
login
to post a comment