Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
周少峰
8 years ago
Commit
e0c834f5580608031da90f7e5873d30cb810af67
2 parents
8544947a
37e16716
Merge branch 'hotfix/productMaterial' into gray
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
29 deletions
apps/3party/views/action/material.hbs
apps/3party/views/partial/tbl.hbs
public/hbs/material/tbl.hbs
public/img/sprite.base.png
public/js/3party/material.page.js
public/scss/3party/_material.css
apps/3party/views/action/material.hbs
View file @
e0c834f
...
...
@@ -36,9 +36,9 @@
</div>
<div
class=
"line"
>
<label
for=
""
>
品类:
</label>
<select
name=
""
id=
"category-1"
class=
"sel"
></select>
<select
name=
""
id=
"category-2"
class=
"sel"
></select>
<select
name=
""
id=
"category-3"
class=
"sel"
></select>
<select
name=
""
id=
"category-1"
class=
"sel"
><option
value=
""
>
--请选择--
</option></select>
<select
name=
""
id=
"category-2"
class=
"sel"
><option
value=
""
>
--请选择--
</option></select>
<select
name=
""
id=
"category-3"
class=
"sel"
><option
value=
""
>
--请选择--
</option></select>
<div
class=
"search-recommend-btn"
>
自动推荐
</div>
<div
class=
"search-btn"
>
搜索
</div>
</div>
...
...
apps/3party/views/partial/tbl.hbs
View file @
e0c834f
...
...
@@ -11,8 +11,8 @@
{{#
each
product_list
}}
<tr>
<td>
{{
productSkn
}}
</td>
<td><a
href=
"/p
{{
productId
}}
.html"
target=
"_blank"
>
{{
productName
}}
</a></td>
<td><a
href=
"/p
{{
productId
}}
.html"
target=
"_blank"
><img
src=
"
{{
picImgUrl
}}
"
alt=
""
></a></td>
<td><a
href=
"//item.yohobuy.com/p
{{
productId
}}
.html"
target=
"_blank"
>
{{
productName
}}
</a></td>
<td><a
href=
"//item.yohobuy.com/p
{{
productId
}}
.html"
target=
"_blank"
><img
src=
"
{{
picImgUrl
}}
"
alt=
""
></a></td>
<td>
{{
standardVal
}}
</td>
<td>
{{
style
}}
</td>
<td>
{{
pattern
}}
</td>
...
...
public/hbs/material/tbl.hbs
View file @
e0c834f
...
...
@@ -11,8 +11,8 @@
{{#
each
product_list
}}
<tr>
<td>
{{
productSkn
}}
</td>
<td><a
href=
"/p
{{
productId
}}
.html"
target=
"_blank"
>
{{
productName
}}
</a></td>
<td><a
href=
"/p
{{
productId
}}
.html"
target=
"_blank"
><img
src=
"
{{
picImgUrl
}}
"
alt=
""
></a></td>
<td><a
href=
"//item.yohobuy.com/p
{{
productId
}}
.html"
target=
"_blank"
>
{{
productName
}}
</a></td>
<td><a
href=
"//item.yohobuy.com/p
{{
productId
}}
.html"
target=
"_blank"
><img
src=
"
{{
picImgUrl
}}
"
alt=
""
></a></td>
<td>
{{
standardVal
}}
</td>
<td>
{{
style
}}
</td>
<td>
{{
pattern
}}
</td>
...
...
public/img/sprite.base.png
View file @
e0c834f
6.57 KB
|
W:
|
H:
7.35 KB
|
W:
|
H:
2-up
Swipe
Onion skin
public/js/3party/material.page.js
View file @
e0c834f
var
$
=
require
(
'yoho-jquery'
);
var
_
=
require
(
'lodash'
);
var
brandTmp
=
require
(
'hbs/material/brand.hbs'
);
var
tableTmp
=
require
(
'hbs/material/tbl.hbs'
);
var
$mask
=
$
(
'.mask'
);
var
$brand
=
$
(
'#brand_container'
);
var
query
=
{
page
:
1
,
maxSortId
:
0
,
middleSortId
:
0
,
smallSortId
:
0
maxSortId
:
''
,
middleSortId
:
''
,
smallSortId
:
''
};
var
brandList
=
{
list1
:
[],
...
...
@@ -16,6 +15,7 @@ var brandList = {
list3
:
[],
list4
:
[]
};
var
option0
=
'<option value="">--请选择--</option>'
;
function
brandItemEventBind
()
{
$
(
'#brand_container .item'
).
off
().
on
(
'click'
,
function
()
{
...
...
@@ -45,7 +45,7 @@ function getBrandList(_index, yhChannel) {
}
function
getCategoryOpt
(
opts
)
{
var
html
=
''
;
var
html
=
option0
;
$
.
each
(
opts
,
function
(
k
,
c
)
{
html
+=
'<option value="'
+
c
.
sort_id
+
'">'
+
c
.
sort_name
+
'</option>'
;
...
...
@@ -54,6 +54,18 @@ function getCategoryOpt(opts) {
return
html
;
}
function
findSub
(
data
,
id
)
{
var
sub
=
[];
$
.
each
(
data
,
function
(
k
,
c
)
{
if
(
c
.
sort_id
===
id
)
{
sub
=
c
.
sub
;
}
});
return
sub
;
}
getBrandList
(
1
,
1
);
/* 获取品类数据*/
...
...
@@ -72,21 +84,34 @@ $.get('/3party/material/getCategory', function(res) {
$category1
.
on
(
'change'
,
function
()
{
var
id
=
$
(
this
).
val
();
var
html
=
option0
;
sub
=
_
.
find
(
categoryData
,
{
sort_id
:
id
}).
sub
;
$category2
.
html
(
getCategoryOpt
(
sub
)).
show
();
$category3
.
html
(
''
).
hide
();
query
.
maxSortId
=
id
;
query
.
middleSortId
=
$category2
.
find
(
'option'
).
eq
(
0
).
attr
(
'value'
);
query
.
maxSortId
=
''
;
query
.
middleSortId
=
''
;
query
.
smallSortId
=
''
;
if
(
$
(
this
).
find
(
'option:selected'
).
index
()
!==
0
)
{
sub
=
findSub
(
categoryData
,
id
);
html
=
getCategoryOpt
(
sub
);
query
.
maxSortId
=
id
;
}
$category2
.
html
(
html
);
$category3
.
html
(
option0
);
});
$category2
.
on
(
'change'
,
function
()
{
var
id
=
$
(
this
).
val
();
var
third
=
_
.
find
(
sub
,
{
sort_id
:
id
}).
sub
;
var
third
=
[]
;
$category3
.
html
(
getCategoryOpt
(
third
)).
show
();
query
.
middleSortId
=
id
;
query
.
smallSortId
=
$category3
.
find
(
'option'
).
eq
(
0
).
attr
(
'value'
);
query
.
smallSortId
=
''
;
query
.
middleSortId
=
''
;
if
(
$
(
this
).
find
(
'option:selected'
).
index
()
!==
0
)
{
third
=
findSub
(
sub
,
id
);
$category3
.
html
(
getCategoryOpt
(
third
));
query
.
middleSortId
=
id
;
}
});
$category3
.
on
(
'change'
,
function
()
{
...
...
public/scss/3party/_material.css
View file @
e0c834f
...
...
@@ -133,14 +133,6 @@
}
}
#category-2
{
display
:
none
;
}
#category-3
{
display
:
none
;
}
.search-btn
{
float
:
right
;
border-radius
:
4px
;
...
...
Please
register
or
login
to post a comment