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
79e30dc5e35c0043c5945f2ace00ce189ee5ff3d
2 parents
de004fad
665310b7
Merge branch 'master' into qCloud
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
100 additions
and
83 deletions
apps/guang/models/plusstar.js
apps/guang/views/action/plusstar/resources-template.hbs
apps/home/models/index.js
doraemon/middleware/auth.js
doraemon/middleware/sub-domain.js
package.json
public/js/common.js
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
utils/product-process.js
apps/guang/models/plusstar.js
View file @
79e30dc
...
...
@@ -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 @
79e30dc
...
...
@@ -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>
...
...
apps/home/models/index.js
View file @
79e30dc
...
...
@@ -208,7 +208,7 @@ const myDetails = (uid) => {
// return finalResult;
});
}
else
{
return
false
;
return
Promise
.
resolve
({})
;
}
};
...
...
@@ -404,7 +404,7 @@ const getGrade = (param) => {
return
resu
;
});
}
else
{
return
false
;
return
Promise
.
resolve
({})
;
}
};
...
...
doraemon/middleware/auth.js
View file @
79e30dc
...
...
@@ -16,7 +16,7 @@ module.exports = (req, res, next) => {
});
}
res
.
redirect
(
helpers
.
urlFormat
(
'/signin.html'
,
{
re
turn
re
s
.
redirect
(
helpers
.
urlFormat
(
'/signin.html'
,
{
refer
:
req
.
originalUrl
}));
}
...
...
doraemon/middleware/sub-domain.js
View file @
79e30dc
...
...
@@ -16,6 +16,12 @@ module.exports = () => {
req
.
url
=
`
/
activity$
{
req
.
url
}
`
;
}
if
(
/^
\/
sale/
.
test
(
req
.
url
))
{
// sale 兼容php的url
res
.
redirect
(
301
,
helpers
.
urlFormat
(
'/product/sale'
,
req
.
query
,
'default'
));
return
;
}
if
(
req
.
subdomains
.
length
)
{
switch
(
req
.
subdomains
[
0
])
{
case
'guang'
:
// 逛
...
...
@@ -75,4 +81,4 @@ module.exports = () => {
}
next
();
};
};
\ No newline at end of file
};
...
...
package.json
View file @
79e30dc
{
"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/common.js
View file @
79e30dc
...
...
@@ -352,32 +352,34 @@ function givePoint(parameter) {
var
channel
=
cookie
(
'_Channel'
);
var
header
=
$
(
'#yoho-header'
);
switch
(
channel
)
{
case
'boys'
:
if
(
!
header
.
hasClass
(
'boys'
))
{
header
.
addClass
(
'boys'
);
}
break
;
case
'girls'
:
if
(
!
header
.
hasClass
(
'girls'
))
{
header
.
addClass
(
'girls'
);
}
break
;
case
'lifestyle'
:
if
(
!
header
.
hasClass
(
'life-style'
))
{
header
.
addClass
(
'life-style'
);
}
break
;
case
'kids'
:
if
(
!
header
.
hasClass
(
'kids'
))
{
header
.
addClass
(
'kids'
);
}
break
;
default
:
if
(
!
header
.
hasClass
(
'boys'
))
{
header
.
addClass
(
'boys'
);
}
break
;
if
(
!
/^
\/
home/
.
test
(
location
.
pathname
))
{
switch
(
channel
)
{
case
'boys'
:
if
(
!
header
.
hasClass
(
'boys'
))
{
header
.
addClass
(
'boys'
);
}
break
;
case
'girls'
:
if
(
!
header
.
hasClass
(
'girls'
))
{
header
.
addClass
(
'girls'
);
}
break
;
case
'lifestyle'
:
if
(
!
header
.
hasClass
(
'life-style'
))
{
header
.
addClass
(
'life-style'
);
}
break
;
case
'kids'
:
if
(
!
header
.
hasClass
(
'kids'
))
{
header
.
addClass
(
'kids'
);
}
break
;
default
:
if
(
!
header
.
hasClass
(
'boys'
))
{
header
.
addClass
(
'boys'
);
}
break
;
}
}
}());
...
...
public/js/guang/plusstar-index.page.js
View file @
79e30dc
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 @
79e30dc
...
...
@@ -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 @
79e30dc
...
...
@@ -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 @
79e30dc
...
...
@@ -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
;
}
}
}
...
...
utils/product-process.js
View file @
79e30dc
...
...
@@ -88,6 +88,10 @@ exports.processProductList = (list, options) => {
},
options
);
_
.
forEach
(
list
,
(
product
)
=>
{
if
(
!
product
)
{
return
;
}
// 商品信息有问题,则不显示
if
(
!
product
.
product_id
||
!
product
.
goods_list
||
product
.
goods_list
.
length
===
0
)
{
return
;
...
...
Please
register
or
login
to post a comment