Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
9 years ago
Commit
f9c22260a8d07c14db1fa1e32e7f763fcc1fc0ce
1 parent
ec84e65e
颜色切换
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
public/js/product/item.page.js
public/js/product/item.page.js
View file @
f9c2226
/**
*
退换货申请
*
商品详情
* @author: yyqing<yanqing.yang@yoho.cn>
* @date: 2016/7/15
*/
...
...
@@ -10,9 +10,9 @@ var $tradeWrapper = $('.trade-wrapper'),
$balanceWrapper
=
$
(
'.balance-wrapper'
),
$colorText
=
$
(
'.choose-color .color'
),
$sizeText
=
$
(
'.choose-size .size'
),
$color
List
=
$
(
'.color-list
'
),
$color
Item
=
$
(
'.color-list .round-color
'
),
$sizeList
=
$
(
'.size-list'
),
$sizeItem
=
$
(
'.size-list
'
).
children
(
);
$sizeItem
=
$
(
'.size-list
> li'
);
var
$addToBag
=
$
(
'#add-to-bag'
);
...
...
@@ -37,20 +37,23 @@ function getBuyProduct() {
}
// 颜色
$
colorList
.
on
(
'click'
,
'.round-color
'
,
function
()
{
$
(
'.color-list'
).
on
(
'click'
,
'.color-item
'
,
function
()
{
var
$this
=
$
(
this
),
data
=
$this
.
parent
().
data
();
index
=
$this
.
index
(),
data
=
$this
.
data
();
if
(
!
$this
.
hasClass
(
'cur'
))
{
$colorList
.
removeClass
(
'cur'
);
$colorItem
.
removeClass
(
'cur'
);
$sizeList
.
not
(
'.hide'
).
addClass
(
'hide'
);
$sizeList
.
eq
(
index
).
removeClass
(
'hide'
);
$sizeItem
.
removeClass
(
'cur'
);
$colorText
.
text
(
data
.
color
?
data
.
color
:
''
);
$this
.
addClass
(
'cur'
);
$this
.
children
().
addClass
(
'cur'
);
}
});
// 尺码
$
sizeList
.
on
(
'click'
,
'li'
,
function
()
{
$
(
'.size-list'
)
.
on
(
'click'
,
'li'
,
function
()
{
var
$this
=
$
(
this
),
data
=
$this
.
data
();
...
...
Please
register
or
login
to post a comment