Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
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
Plain Diff
Browse Files
Authored by
ccbikai(👎🏻🍜)
8 years ago
Commit
665310b7ea8e21135fd5fb970cba46a6cd151bb4
2 parents
acdab513
2f00b31d
Merge branch 'grey'
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
53 deletions
apps/guang/models/plusstar.js
apps/guang/views/action/plusstar/resources-template.hbs
package.json
public/js/guang/plusstar-index.page.js
public/js/product/search/index.js
public/js/product/search/write-search.js
public/scss/guang/plusstar/_index.css
apps/guang/models/plusstar.js
View file @
665310b
...
...
@@ -104,9 +104,10 @@ const getResources = (params, options) => {
}
list
=
{
id
:
res
.
template_id
,
title
:
res
.
data
.
title
,
more_url
:
res
.
data
.
more_url
,
more_name
:
res
.
data
.
more_name
,
moreUrl
:
res
.
data
.
more_url
,
moreName
:
res
.
data
.
more_name
,
image
:
res
.
data
.
image
};
...
...
@@ -115,8 +116,8 @@ const getResources = (params, options) => {
case
'titleFloor'
:
list
=
{
name
:
res
.
data
.
title
.
name
,
more_url
:
res
.
data
.
title
.
more_url
,
more_name
:
res
.
data
.
title
.
more_name
moreUrl
:
res
.
data
.
title
.
more_url
,
moreName
:
res
.
data
.
title
.
more_name
};
if
(
res
.
data
.
title
.
name
===
'热门商品'
)
{
...
...
apps/guang/views/action/plusstar/resources-template.hbs
View file @
665310b
...
...
@@ -45,7 +45,7 @@
<div
class=
"focus-left-right"
>
{{#
each
result
.
focus2
.
data
}}
<a
href=
"
{{
url
}}
"
title=
"
{{
title
}}
"
>
<img
class=
"lazy"
data-original
=
"
{{
image
src
250
250
}}
"
>
<img
src
=
"
{{
image
src
250
250
}}
"
>
</a>
{{/
each
}}
</div>
...
...
package.json
View file @
665310b
{
"name"
:
"m-yohobuy-node"
,
"version"
:
"5.0.1
1
"
,
"version"
:
"5.0.1
2
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/guang/plusstar-index.page.js
View file @
665310b
var
$
=
require
(
'yoho-jquery'
),
tip
=
require
(
'../plugin/tip'
),
Swiper
=
require
(
'yoho-swiper'
),
loading
=
require
(
'../plugin/loading'
),
lazyLoad
=
require
(
'yoho-jquery-lazyload'
);
loading
=
require
(
'../plugin/loading'
);
var
plusstar
=
{},
$footer
=
$
(
'#yoho-footer'
);
require
(
'yoho-jquery-lazyload'
);
require
(
'../common'
);
plusstar
=
{
...
...
@@ -82,16 +82,8 @@ plusstar = {
that
.
resInit
();
loading
.
hideLoadingMask
();
lazyLoad
(
$
(
'img.lazy'
));
// 处理左右滑动,未加载的图片
setTimeout
(
function
()
{
$
(
'img.lazy'
).
each
(
function
()
{
if
(
$
(
this
).
attr
(
'src'
)
!==
$
(
this
).
data
(
'original'
))
{
$
(
this
).
attr
(
'src'
,
$
(
this
).
data
(
'original'
));
}
});
},
40
);
$
(
'.plusstar-resources'
).
find
(
'img.lazy'
).
lazyload
();
// 设置滚动条的位置
if
(
window
.
localStorage
)
{
...
...
public/js/product/search/index.js
View file @
665310b
...
...
@@ -169,36 +169,42 @@ $search.on('touchend', function() {
history
,
historys
,
i
,
num
=
1
;
if
(
localStorage
)
{
historys
=
localStorage
.
getItem
(
historyval
);
try
{
if
(
localStorage
)
{
historys
=
localStorage
.
getItem
(
historyval
);
if
(
historys
&&
historys
.
length
>
0
)
{
historys
=
historys
.
split
(
ranToken
);
for
(
i
=
historys
.
length
;
i
>
0
;
i
--
)
{
history
=
historys
[
i
-
1
];
if
(
historys
&&
historys
.
length
>
0
)
{
historys
=
historys
.
split
(
ranToken
);
for
(
i
=
historys
.
length
;
i
>
0
;
i
--
)
{
history
=
historys
[
i
-
1
];
if
(
history
===
''
)
{
continue
;
}
if
(
history
===
''
)
{
continue
;
}
if
(
num
++
>
10
)
{
break
;
if
(
num
++
>
10
)
{
break
;
}
html
+=
'<li><a href="javascript:void(0);">'
+
history
+
'</li>'
;
}
html
+=
'<li><a href="javascript:void(0);">'
+
history
+
'</li>'
;
}
$history
.
html
(
html
);
$history
.
html
(
html
);
if
(
html
!==
''
)
{
$clearHistory
.
removeClass
(
'hide'
);
$historySearch
.
removeClass
(
'hide'
);
}
if
(
html
!==
''
)
{
$clearHistory
.
removeClass
(
'hide'
);
$historySearch
.
removeClass
(
'hide'
);
window
.
rePosFooter
();
}
else
{
$historySearch
.
hide
();
$clearHistory
.
hide
();
}
window
.
rePosFooter
();
}
else
{
$historySearch
.
hide
();
$clearHistory
.
hide
();
}
}
catch
(
e
)
{
console
.
log
(
e
);
$historySearch
.
hide
();
$clearHistory
.
hide
();
}
}());
...
...
public/js/product/search/write-search.js
View file @
665310b
...
...
@@ -20,17 +20,21 @@ function getHistoryval() {
function
setHistoryValFun
(
query
)
{
var
historys
;
if
(
localStorage
)
{
historys
=
localStorage
.
getItem
(
historyval
);
try
{
if
(
localStorage
)
{
historys
=
localStorage
.
getItem
(
historyval
);
historys
=
historys
?
historys
.
replace
(
new
RegExp
((
query
+
ranToken
),
'g'
),
''
)
:
''
;
historys
=
historys
?
historys
.
replace
(
new
RegExp
((
query
+
ranToken
),
'g'
),
''
)
:
''
;
if
(
historys
===
''
)
{
query
=
ranToken
+
query
;
}
if
(
historys
===
''
)
{
query
=
ranToken
+
query
;
}
historys
+=
query
+
ranToken
;
localStorage
.
setItem
(
historyval
,
historys
);
historys
+=
query
+
ranToken
;
localStorage
.
setItem
(
historyval
,
historys
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
...
...
public/scss/guang/plusstar/_index.css
View file @
665310b
...
...
@@ -163,13 +163,11 @@
a
{
display
:
inline-block
;
margin
:
0
15px
;
width
:
213px
;
height
:
213px
;
}
img
{
width
:
100%
;
height
:
100%
;
width
:
213px
;
height
:
213px
;
}
}
...
...
@@ -180,7 +178,11 @@
a
{
display
:
inline-block
;
width
:
50%
;
overflow
:
hidden
;
img
{
width
:
320px
;
height
:
320px
;
}
}
}
...
...
Please
register
or
login
to post a comment