Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
周少峰
9 years ago
Commit
433eced07dabe701cc33dc10425caa81efb0484e
2 parents
18bd4ccc
7cd0b8c6
Merge branch 'feature/mBrandShop' of
http://git.dev.yoho.cn/web/yohobuywap
into feature/mBrandShop
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
25 deletions
static/js/product/shop.js
template/m.yohobuy.com/actions/product/index/shop.phtml
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
static/js/product/shop.js
View file @
433eced
...
...
@@ -31,8 +31,7 @@ var $subNav = $('.home-sub-nav'),
$pgc
=
$
(
$goodsChildren
.
get
(
1
)),
$dgc
=
$
(
$goodsChildren
.
get
(
2
)),
$shopId
=
$
(
'input[name="shop_id"]'
).
val
(),
$appVersion
=
$
(
'input[name="appVersion"]'
).
val
();
console
.
log
(
$shopId
)
$appVersion
=
$
(
'input[name="app_version"]'
).
val
();
var
winH
=
$
(
window
).
height
(),
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
...
...
@@ -139,8 +138,16 @@ $.jqtab = function(nav, posNav, main) {
}
else
if
(
activeTab
==
'popularity'
){
hotData
();
}
else
if
(
activeTab
==
'home-page'
)
{
myScroll
.
refresh
();
myScroll
&&
myScroll
.
refresh
();
// setTimeout(function() {
// scH = $('#scroller').outerHeight();
// },1000);
scH
=
$
(
'#scroller'
).
outerHeight
();
$nav1
.
removeClass
(
'fixed-top'
);
$nav1
.
removeClass
(
'absolute'
);
$nav2
.
removeClass
(
'fixed-top'
);
$nav2
.
removeClass
(
'absolute'
);
}
myScroll
.
scrollTo
(
0
,
0
);
...
...
@@ -173,12 +180,12 @@ function getPageGoods(info) {
success
:
function
(
data
)
{
info
.
callBack
(
data
);
myScroll
.
refresh
();
scH
=
$
(
'#scroller'
).
outerHeight
();
$nav1
.
addClass
(
'hide'
);
myScroll
.
scrollTo
(
0
,
0
);
myScroll
.
refresh
();
scH
=
$
(
'#scroller'
).
outerHeight
();
lazyLoad
(
$
(
'img.lazy'
));
searching
=
false
;
},
...
...
@@ -288,9 +295,10 @@ myScroll.on('scroll', function() {
}
if
(
sTop
<
scH
)
{
if
(
!
$nav2
.
hasClass
(
'fixed-top'
))
{
myScroll
.
refresh
();
scH
=
$
(
'#scroller'
).
outerHeight
();
// console.log(sTop);
// console.log(scH);
if
(
!
$nav2
.
hasClass
(
'fixed-top'
))
{
$nav2
.
addClass
(
'fixed-top'
)
.
removeClass
(
'absolute'
)
.
css
({
...
...
@@ -408,6 +416,7 @@ function search(opt) {
nav
=
navInfo
[
navType
];
page
=
nav
.
page
+
1
;
console
.
log
(
page
)
if
(
nav
.
reload
)
{
page
=
1
;
}
else
if
(
nav
.
end
)
{
...
...
@@ -422,6 +431,8 @@ function search(opt) {
page
:
page
});
console
.
log
(
page
)
searching
=
true
;
loading
.
showLoadingMask
();
...
...
@@ -743,7 +754,7 @@ function postCollect(info) {
}
if
(
data
.
code
===
401
)
{
url
=
data
.
url
+
'?refer='
+
location
.
href
;
url
=
data
.
url
;
$
(
'body'
).
append
(
'<a href="'
+
url
+
'"><span class="jump-login"><span></a>'
);
$
(
'.jump-login'
).
click
();
...
...
@@ -769,7 +780,7 @@ function collectShop() {
qew
.
url
=
'/product/index/shopFav'
;
qew
.
data
=
{
shop_id
:
$shopId
,
app
V
ersion
:
$appVersion
app
_v
ersion
:
$appVersion
};
postCollect
(
qew
);
}
...
...
@@ -780,7 +791,7 @@ function cancelShop() {
qew
.
url
=
'/product/index/cancelShopFav'
;
qew
.
data
=
{
shop_id
:
$shopId
,
app
V
ersion
:
$appVersion
app
_v
ersion
:
$appVersion
};
postCollect
(
qew
);
}
...
...
template/m.yohobuy.com/actions/product/index/shop.phtml
View file @
433eced
...
...
@@ -3,18 +3,20 @@
<div
id=
"scroller"
>
<div
id=
"nav-top"
>
{
{>
layout/header
}
}
<div
class=
"search-area"
>
<div
id=
"search-input"
class=
"search-input"
>
<form
id=
"search-form"
action=
{
{url
}
}
method=
"get"
>
<i
class=
"search-icon iconfont"
>
60
f;</i>
<input
type=
"text"
placeholder=
"搜索店铺内潮品"
name=
"query"
>
<input
type=
"hidden"
name=
"shop_id"
value=
"{{shopId}}"
>
<input
type=
"hidden"
name=
"appVersion"
value=
"{{appVersion}}"
>
<i
class=
"clear-input iconfont hide"
>
626
;</i>
<button
id=
"search"
class=
"search"
type=
"submit"
>搜索</button>
</form>
{
{#if
appVersion
}
}
<div
class=
"search-area"
>
<div
id=
"search-input"
class=
"search-input"
>
<form
id=
"search-form"
action=
{
{url
}
}
method=
"get"
>
<i
class=
"search-icon iconfont"
>
60
f;</i>
<input
type=
"text"
placeholder=
"搜索店铺内潮品"
name=
"query"
>
<input
type=
"hidden"
name=
"shop_id"
value=
"{{shopId}}"
>
<input
type=
"hidden"
name=
"app_version"
value=
"{{appVersion}}"
>
<i
class=
"clear-input iconfont hide"
>
626
;</i>
<button
id=
"search"
class=
"search"
type=
"submit"
>搜索</button>
</form>
</div>
</div>
</div>
{
{/if
}
}
<div
class=
"branner-top"
>
<img
src=
"{{branerImg}}"
>
<img
class=
"logo"
src=
"{{logoImg}}"
>
...
...
@@ -108,7 +110,9 @@
<div
id=
"new-arrival"
class=
"new-arrival main"
></div>
<div
id=
"popularity"
class=
"popularity main"
></div>
</div>
{
{>
product/shop-footer
}
}
{
{#if
appVersion
}
}
{
{>
product/shop-footer
}
}
{
{/if
}
}
<ul
id=
"pos-nav"
class=
"nav hide"
>
<li
class=
"active color"
tab=
"home-page"
>首页</li>
<li
tab=
"new-arrival"
>上新</li>
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
433eced
...
...
@@ -540,7 +540,7 @@ class IndexController extends AbstractAction
$data
=
array
(
'shopId'
=>
'104'
,
'appVersion'
=>
'1
11
'
,
'appVersion'
=>
'1
23
'
,
'branerImg'
=>
'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200'
,
'logoImg'
=>
''
,
'storeName'
=>
'Vans专营店'
,
...
...
Please
register
or
login
to post a comment