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
姜枫
9 years ago
Commit
bbaf60270707391955686974acb31e66eccc9b81
1 parent
b3401f7f
fix shop bugs
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
8 deletions
apps/product/models/helpers.js
apps/product/views/action/shop-index.hbs
config/common.js
public/js/product/shop.page.js
public/scss/product/_list.css
public/scss/product/_shop.css
apps/product/models/helpers.js
View file @
bbaf602
...
...
@@ -51,7 +51,7 @@ const helpers = {
let
other
=
false
;
_
.
forEach
(
brands
,
(
b
)
=>
{
let
name
=
b
.
brandNameEn
||
b
.
brandName
;
let
name
=
b
.
brand
Alif
||
b
.
brand
NameEn
||
b
.
brandName
;
let
char
=
name
.
toLowerCase
().
charAt
(
0
);
if
((
char
>=
'a'
&&
char
<=
'z'
)
||
(
char
>=
'A'
&&
char
<=
'Z'
))
{
...
...
@@ -240,6 +240,12 @@ const helpers = {
sorts
[
0
].
sub
[
0
].
checked
=
true
;
}
if
(
q
.
misort
)
{
sorts
[
0
].
sub
.
forEach
(
s
=>
{
s
.
checked
=
s
.
categoryId
===
q
.
misort
;
});
}
sorts
=
sorts
[
0
].
sub
;
}
...
...
apps/product/views/action/shop-index.hbs
View file @
bbaf602
...
...
@@ -42,7 +42,7 @@
<div
class=
"goods-wrap"
>
{{#
each
newProducts
}}
<div
class=
"goods-info"
data-skn=
"
{{
productSkn
}}
"
>
<a
href=
""
target=
"_blank"
>
<a
href=
"
/product/pro_
{{
productId
}}
_
{{
goodsId
}}
/
{{
cnAlphabet
}}
.html
"
target=
"_blank"
>
<img
class=
"lazy thumb"
data-original=
"
{{
src
}}
"
style=
"display: block;"
>
</a>
<div
class=
"desc"
>
...
...
@@ -66,7 +66,7 @@
<div
class=
"goods-wrap"
>
{{#
each
hotProducts
}}
<div
class=
"goods-info"
data-skn=
"
{{
productSkn
}}
"
>
<a
href=
""
target=
"_blank"
>
<a
href=
"
/product/pro_
{{
productId
}}
_
{{
goodsId
}}
/
{{
cnAlphabet
}}
.html
"
target=
"_blank"
>
<img
class=
"lazy thumb"
data-original=
"
{{
src
}}
"
style=
"display: block;"
>
</a>
<div
class=
"desc"
>
...
...
config/common.js
View file @
bbaf602
...
...
@@ -22,8 +22,8 @@ module.exports = {
},
cookieDomain
:
'yohoblk.com'
,
domains
:
{
api
:
'http://devapi.yoho.cn:58078/'
,
// devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service
:
'http://devservice.yoho.cn:58077/'
,
// testservice.yoho.cn:28077 devservice.yoho.cn:58077
api
:
'http://dev-api.yohops.com:9999/'
,
// devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service
:
'http://dev-service.yohops.com:9999/'
,
// testservice.yoho.cn:28077 devservice.yoho.cn:58077
search
:
'http://192.168.102.216:8080/yohosearch/'
},
useOneapm
:
false
,
...
...
public/js/product/shop.page.js
View file @
bbaf602
var
lazyload
=
require
(
'yoho-jquery-lazyload'
);
var
Dialog
=
require
(
'../plugins/dialog'
).
Dialog
;
var
tplFn
=
require
(
'../../tpl/product/shop-goods.hbs'
);
require
(
'../common/header'
);
...
...
@@ -16,6 +17,11 @@ $(function() {
var
total
=
parseInt
(
$
(
'.total-page'
,
$order
).
text
(),
10
);
var
page
=
1
;
var
orderBy
;
var
infoDaialog
=
new
Dialog
({
className
:
'brand-info-dialog'
,
content
:
$
(
'.brand-info-wrapper'
).
html
(),
keep
:
true
});
function
refreshProducts
(
data
)
{
$
(
'.cur-page'
,
$order
).
text
(
page
);
...
...
@@ -35,8 +41,9 @@ $(function() {
$
(
$nextPage
).
click
(
function
()
{
if
(
!
$
(
this
).
hasClass
(
'disable'
)
&&
page
<
total
)
{
page
+=
1
;
$
.
get
(
'/product/shop/query/all'
,
{
page
:
page
++
,
page
:
page
,
shopId
:
shopId
},
function
(
data
)
{
refreshProducts
(
data
);
...
...
@@ -46,8 +53,9 @@ $(function() {
$
(
$prePage
).
click
(
function
()
{
if
(
!
$
(
this
).
hasClass
(
'disable'
)
&&
page
>
1
)
{
page
-=
1
;
$
.
get
(
'/product/shop/query/all'
,
{
page
:
page
--
,
page
:
page
,
shopId
:
shopId
},
function
(
data
)
{
refreshProducts
(
data
);
...
...
@@ -88,5 +96,12 @@ $(function() {
refreshProducts
(
data
);
});
});
$
(
'#brand-info'
).
click
(
function
()
{
infoDaialog
.
show
();
$
(
'.brand-info'
).
addClass
(
'nano'
);
$
(
'.brand-info'
).
nanoScroller
();
});
});
...
...
public/scss/product/_list.css
View file @
bbaf602
...
...
@@ -42,6 +42,9 @@
font-weight
:
700
;
margin-left
:
10px
;
display
:
inline-block
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
max-width
:
200px
;
}
.input-radio
label
.round-color
{
margin-left
:
0
;
...
...
@@ -281,6 +284,9 @@
.goods-brand
{
font-weight
:
700
;
padding
:
10px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.goods-img
{
...
...
public/scss/product/_shop.css
View file @
bbaf602
...
...
@@ -113,7 +113,7 @@
margin
:
25px
10px
;
border-width
:
1px
;
.
name
{
.
desc
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
...
...
Please
register
or
login
to post a comment