Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
7b3fe52513709879853e0fe35e810a694b7d6fd2
2 parents
2da9f304
2887b7e6
Merge branch 'beta' of git.dev.yoho.cn:web/yohobuy into beta
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
34 deletions
static/dist/myohobuy/1.3.4/index-debug.js
static/dist/myohobuy/1.3.4/index.js
static/js/cart/chose-panel.js
static/js/category/brand.js
template/m.yohobuy.com/partials/cart/chose-panel.phtml
static/dist/myohobuy/1.3.4/index-debug.js
View file @
7b3fe52
...
...
@@ -595,7 +595,7 @@ if ($('.brand-search-page').length) {
if
(
$keyword
.
val
().
length
)
{
$icon
.
css
(
'color'
,
'#000'
);
$
(
this
).
closest
(
'.search-box'
).
css
(
'width'
,
'11.25rem'
);
$searchAction
.
show
();
$searchAction
.
show
()
.
find
(
'.clear-text'
).
show
()
;
}
else
{
$icon
.
css
(
'color'
,
'#b2b2b2'
);
$
(
this
).
closest
(
'.search-box'
).
css
(
'width'
,
'12.5rem'
);
...
...
@@ -607,7 +607,7 @@ if ($('.brand-search-page').length) {
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon
.
css
(
'color'
,
'#000'
);
$keyword
.
closest
(
'.search-box'
).
css
(
'width'
,
'11.25rem'
);
$searchAction
.
show
();
$searchAction
.
show
()
.
find
(
'.clear-text'
).
hide
()
;
clearTextHammer
=
new
Hammer
(
$
(
'.clear-text'
)[
0
]);
clearTextHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
@@ -5517,10 +5517,22 @@ function displayGoodNum(curGoodNum) {
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function
changeSizeChosed
(
oldSizeIndex
)
{
function
changeSizeChosed
(
newSizeIndex
)
{
var
sizes
,
queryString
,
i
;
if
(
curColorIndex
&&
$curSizeBlock
&&
$curSizeBlock
.
length
>
0
)
{
$curSizeBlock
.
removeClass
(
'chosed'
);
$curSizeBlock
=
$
(
$sizeRowList
.
eq
(
oldSizeIndex
).
children
().
get
(
curColorIndex
-
1
));
sizes
=
$sizeRowList
.
eq
(
newSizeIndex
).
children
();
for
(
i
=
0
;
i
<
sizes
.
length
;
i
++
)
{
if
(
$
(
sizes
[
i
]).
data
(
'name'
)
===
$curSizeBlock
.
data
(
'name'
))
{
$curSizeBlock
=
$
(
sizes
[
i
]);
queryString
=
'#'
+
$curSizeBlock
.
data
(
'name'
);
curColorIndex
=
$
(
queryString
).
data
(
'index'
);
}
}
$curSizeBlock
.
addClass
(
'chosed'
);
return
$curSizeBlock
.
data
(
'num'
);
}
...
...
@@ -5528,10 +5540,10 @@ function changeSizeChosed(oldSizeIndex) {
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function
changeColorChosed
(
old
ColorIndex
)
{
function
changeColorChosed
(
new
ColorIndex
)
{
if
(
curSizeIndex
&&
$curColorBlock
&&
$curColorBlock
.
length
>
0
)
{
$curColorBlock
.
removeClass
(
'chosed'
);
$curColorBlock
=
$
(
$colorRowList
.
eq
(
old
ColorIndex
).
children
().
get
(
curSizeIndex
-
1
));
$curColorBlock
=
$
(
$colorRowList
.
eq
(
new
ColorIndex
).
children
().
get
(
curSizeIndex
-
1
));
$curColorBlock
.
addClass
(
'chosed'
);
return
$curColorBlock
.
data
(
'num'
);
}
...
...
@@ -5579,15 +5591,15 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}
else
{
hasChooseColor
=
true
;
// 尺码行当前行隐藏
$sizeRowList
.
eq
(
curSizeIndex
).
addClass
(
'hide'
);
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum
=
changeSizeChosed
(
index
+
1
);
// 显示剩余数量
displayGoodNum
(
curGoodNum
);
// 尺码行当前行隐藏
$sizeRowList
.
eq
(
curSizeIndex
).
addClass
(
'hide'
);
//尺码对应行显示
$sizeRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
);
...
...
@@ -5607,7 +5619,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
updateConformButtonClassAndText
();
}).
on
(
'touchstart'
,
'.size-list .block'
,
function
()
{
var
$this
=
$
(
this
),
index
=
$this
.
index
()
,
index
,
curGoodNum
;
// 当前尺码已经是选中状态,再点击时
...
...
@@ -5619,10 +5631,10 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseSize
=
false
;
//当前颜色行隐藏
$colorRowList
.
eq
(
curColorIndex
).
removeClass
(
'show'
).
addClass
(
'hide'
);
$colorRowList
.
eq
(
curColorIndex
).
addClass
(
'hide'
);
//目标颜色行显示
$colorRowList
.
eq
(
0
).
removeClass
(
'hide'
)
.
addClass
(
'show'
)
;
$colorRowList
.
eq
(
0
).
removeClass
(
'hide'
);
curColorIndex
=
0
;
...
...
@@ -5633,17 +5645,19 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}
else
{
hasChooseSize
=
true
;
index
=
$
(
'#'
+
$this
.
data
(
'name'
)).
data
(
'index'
)
-
1
;
// 颜色当前行隐藏
$colorRowList
.
eq
(
curColorIndex
).
addClass
(
'hide'
);
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum
=
changeColorChosed
(
index
+
1
);
// 显示剩余数量
displayGoodNum
(
curGoodNum
);
// 颜色当前行隐藏
$colorRowList
.
eq
(
curColorIndex
).
removeClass
(
'show'
).
addClass
(
'hide'
);
//颜色对应行显示
$colorRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
)
.
addClass
(
'show'
)
;
$colorRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
);
curColorIndex
=
index
+
1
;
$curSizeBlock
=
$this
;
...
...
static/dist/myohobuy/1.3.4/index.js
View file @
7b3fe52
This diff could not be displayed because it is too large.
static/js/cart/chose-panel.js
View file @
7b3fe52
...
...
@@ -133,10 +133,22 @@ function displayGoodNum(curGoodNum) {
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function
changeSizeChosed
(
oldSizeIndex
)
{
function
changeSizeChosed
(
newSizeIndex
)
{
var
sizes
,
queryString
,
i
;
if
(
curColorIndex
&&
$curSizeBlock
&&
$curSizeBlock
.
length
>
0
)
{
$curSizeBlock
.
removeClass
(
'chosed'
);
$curSizeBlock
=
$
(
$sizeRowList
.
eq
(
oldSizeIndex
).
children
().
get
(
curColorIndex
-
1
));
sizes
=
$sizeRowList
.
eq
(
newSizeIndex
).
children
();
for
(
i
=
0
;
i
<
sizes
.
length
;
i
++
)
{
if
(
$
(
sizes
[
i
]).
data
(
'name'
)
===
$curSizeBlock
.
data
(
'name'
))
{
$curSizeBlock
=
$
(
sizes
[
i
]);
queryString
=
'#'
+
$curSizeBlock
.
data
(
'name'
);
curColorIndex
=
$
(
queryString
).
data
(
'index'
);
}
}
$curSizeBlock
.
addClass
(
'chosed'
);
return
$curSizeBlock
.
data
(
'num'
);
}
...
...
@@ -144,10 +156,10 @@ function changeSizeChosed(oldSizeIndex) {
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function
changeColorChosed
(
old
ColorIndex
)
{
function
changeColorChosed
(
new
ColorIndex
)
{
if
(
curSizeIndex
&&
$curColorBlock
&&
$curColorBlock
.
length
>
0
)
{
$curColorBlock
.
removeClass
(
'chosed'
);
$curColorBlock
=
$
(
$colorRowList
.
eq
(
old
ColorIndex
).
children
().
get
(
curSizeIndex
-
1
));
$curColorBlock
=
$
(
$colorRowList
.
eq
(
new
ColorIndex
).
children
().
get
(
curSizeIndex
-
1
));
$curColorBlock
.
addClass
(
'chosed'
);
return
$curColorBlock
.
data
(
'num'
);
}
...
...
@@ -195,15 +207,15 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}
else
{
hasChooseColor
=
true
;
// 尺码行当前行隐藏
$sizeRowList
.
eq
(
curSizeIndex
).
addClass
(
'hide'
);
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum
=
changeSizeChosed
(
index
+
1
);
// 显示剩余数量
displayGoodNum
(
curGoodNum
);
// 尺码行当前行隐藏
$sizeRowList
.
eq
(
curSizeIndex
).
addClass
(
'hide'
);
//尺码对应行显示
$sizeRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
);
...
...
@@ -223,7 +235,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
updateConformButtonClassAndText
();
}).
on
(
'touchstart'
,
'.size-list .block'
,
function
()
{
var
$this
=
$
(
this
),
index
=
$this
.
index
()
,
index
,
curGoodNum
;
// 当前尺码已经是选中状态,再点击时
...
...
@@ -235,10 +247,10 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseSize
=
false
;
//当前颜色行隐藏
$colorRowList
.
eq
(
curColorIndex
).
removeClass
(
'show'
).
addClass
(
'hide'
);
$colorRowList
.
eq
(
curColorIndex
).
addClass
(
'hide'
);
//目标颜色行显示
$colorRowList
.
eq
(
0
).
removeClass
(
'hide'
)
.
addClass
(
'show'
)
;
$colorRowList
.
eq
(
0
).
removeClass
(
'hide'
);
curColorIndex
=
0
;
...
...
@@ -249,17 +261,19 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}
else
{
hasChooseSize
=
true
;
index
=
$
(
'#'
+
$this
.
data
(
'name'
)).
data
(
'index'
)
-
1
;
// 颜色当前行隐藏
$colorRowList
.
eq
(
curColorIndex
).
addClass
(
'hide'
);
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum
=
changeColorChosed
(
index
+
1
);
// 显示剩余数量
displayGoodNum
(
curGoodNum
);
// 颜色当前行隐藏
$colorRowList
.
eq
(
curColorIndex
).
removeClass
(
'show'
).
addClass
(
'hide'
);
//颜色对应行显示
$colorRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
)
.
addClass
(
'show'
)
;
$colorRowList
.
eq
(
index
+
1
).
removeClass
(
'hide'
);
curColorIndex
=
index
+
1
;
$curSizeBlock
=
$this
;
...
...
static/js/category/brand.js
View file @
7b3fe52
...
...
@@ -165,7 +165,7 @@ if ($('.brand-search-page').length) {
if
(
$keyword
.
val
().
length
)
{
$icon
.
css
(
'color'
,
'#000'
);
$
(
this
).
closest
(
'.search-box'
).
css
(
'width'
,
'11.25rem'
);
$searchAction
.
show
();
$searchAction
.
show
()
.
find
(
'.clear-text'
).
show
()
;
}
else
{
$icon
.
css
(
'color'
,
'#b2b2b2'
);
$
(
this
).
closest
(
'.search-box'
).
css
(
'width'
,
'12.5rem'
);
...
...
@@ -177,7 +177,7 @@ if ($('.brand-search-page').length) {
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon
.
css
(
'color'
,
'#000'
);
$keyword
.
closest
(
'.search-box'
).
css
(
'width'
,
'11.25rem'
);
$searchAction
.
show
();
$searchAction
.
show
()
.
find
(
'.clear-text'
).
hide
()
;
clearTextHammer
=
new
Hammer
(
$
(
'.clear-text'
)[
0
]);
clearTextHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
template/m.yohobuy.com/partials/cart/chose-panel.phtml
View file @
7b3fe52
...
...
@@ -20,7 +20,7 @@
<div
class=
"color-list block-list"
>
<span>颜色</span>
{
{#
colors
}
}
<ul
class=
"size-row clearfix {{#unless @first}}hide{{/if}}"
>
<ul
id=
"{{sizeName}}"
data-index=
"{{@index}}"
class=
"size-row clearfix {{#unless @first}}hide{{/if}}"
>
{
{#
color
}
}
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}"
data-num=
"{{colorNum}}"
>
{
{name
}
}
...
...
@@ -34,7 +34,7 @@
{
{#
sizes
}
}
<ul
class=
"size-row clearfix {{#unless @first}}hide{{/if}}"
>
{
{#
size
}
}
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-num=
"{{sizeNum}}"
data-skuid=
"{{skuId}}"
>
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-num=
"{{sizeNum}}"
data-
name=
"{{name}}"
data-
skuid=
"{{skuId}}"
>
{
{name
}
}
</li>
{
{/
size
}
}
...
...
Please
register
or
login
to post a comment