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
b0b1f23da838a49a86b76843bb91f3042311ef17
2 parents
dccd86bb
4e7e5eb3
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
30 deletions
library/Plugin/HelperSearch.php
web-static/dist/yohobuy/0.0.1/index-debug.js
web-static/dist/yohobuy/0.0.1/index.js
yohobuy/www.yohobuy.com/application/Bootstrap.php
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
yohobuy/www.yohobuy.com/configs/routes.product.ini
library/Plugin/HelperSearch.php
View file @
b0b1f23
...
...
@@ -1157,7 +1157,6 @@ class HelperSearch
'activities_id_desc' => 'activities.activity_id:desc',
'activities_id_asc' => 'activities.activity_id:asc',
);
$param
= array();
$param['status']
= 1; // 是否上架,1表示在架,2表示不在
$param['sales']
= 'Y'; // 只搜索销售的产品
...
...
@@ -1182,7 +1181,6 @@ class HelperSearch
if (!empty(
$condition
)) {
$param
+=
$condition
;
}
return Yohobuy::httpBuildQuery(self::getUrl(),
$param
);
}
...
...
@@ -1218,8 +1216,8 @@ class HelperSearch
}
/**
* 并行调接口url获取(获取品牌数据)
*/
* 并行调接口url获取(获取品牌数据)
*/
public static function getBrandUrl(
$customOptions
= array())
{
// 构建必传参数
...
...
@@ -1312,8 +1310,8 @@ class HelperSearch
elseif (
$type
== 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://192.168.10.64:8080/yohosearch/search-once.json';
// return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search-once.json';
}
}
...
...
web-static/dist/yohobuy/0.0.1/index-debug.js
View file @
b0b1f23
...
...
@@ -1050,28 +1050,34 @@ function actionNav() {
});
}
/**
* 获取三级导航的tip图标
* @return {[type]} [description]
*/
function
actionTipPic
()
{
var
$content_code
=
''
var
tipscode
=
{};
var
$contentcode
=
''
;
var
serverApi
=
'http://www.yohobuy.com/common/getbanner?content_code='
;
var
$img
=
''
;
var
$title
=
''
;
var
$link
=
''
;
$
(
document
).
on
(
'mouseenter'
,
'.sub-nav-item'
,
function
(){
$content_code
=
$
(
this
).
find
(
'.showdetail'
).
attr
(
'data-code'
);
if
(
$content_code
){
$
(
document
).
on
(
'mouseenter'
,
'.sub-nav-item'
,
function
()
{
$contentcode
=
$
(
this
).
find
(
'.showdetail'
).
attr
(
'data-code'
);
if
(
$contentcode
)
{
if
(
!
tipscode
[
$contentcode
])
{
tipscode
[
$contentcode
]
=
$contentcode
;
$img
=
$
(
this
).
find
(
'.showdetail'
).
find
(
'img'
);
$title
=
$
(
this
).
find
(
'.showdetail'
).
find
(
'.title'
);
$link
=
$
(
this
).
find
(
'.showdetail'
).
find
(
'a'
);
$
.
get
(
serverApi
+
$content_code
+
'&width=337&height=250&client_type=web'
,
function
(
rsdata
)
{
$img
.
attr
(
'src'
,
rsdata
.
data
.
src
);
$link
.
attr
(
'href'
,
rsdata
.
data
.
url
);
$
.
get
(
serverApi
+
$contentcode
+
'&width=337&height=250&client_type=web'
,
function
(
rsdata
)
{
$img
.
attr
(
'src'
,
rsdata
.
data
.
src
);
$link
.
attr
(
'href'
,
rsdata
.
data
.
url
);
$title
.
text
(
rsdata
.
data
.
title
);
},
'jsonp'
);
}
})
}
});
}
/**
...
...
@@ -1678,7 +1684,7 @@ function actionLoginInfo() {
*/
function
init
()
{
actionNav
();
//处理导航
actionTipPic
();
//鼠标移入后查询
actionTipPic
();
//鼠标移入后查询
actionExeTemplate
();
//处理模板
actionInitCookie
();
//初始化cookie
actionExeCookieMap
();
//格式化cookie
...
...
web-static/dist/yohobuy/0.0.1/index.js
View file @
b0b1f23
This diff could not be displayed because it is too large.
yohobuy/www.yohobuy.com/application/Bootstrap.php
View file @
b0b1f23
...
...
@@ -72,6 +72,12 @@ class Bootstrap extends Bootstrap_Abstract
$action
=
'Index'
;
// 二级域名
if
(
2
===
$level
)
{
$url
=
strtolower
(
$dispatcher
->
getRequest
()
->
getRequestUri
());
if
(
empty
(
$url
)
||
$url
==
'/index'
||
$url
==
'/'
)
{
$urlAction
=
'/index'
;
}
else
{
$urlAction
=
$url
;
}
$subDomain
=
strval
(
$hostParts
[
0
]);
switch
(
strtolower
(
$subDomain
))
{
case
'www'
:
// 主站
...
...
@@ -80,17 +86,18 @@ class Bootstrap extends Bootstrap_Abstract
case
'web'
:
break
;
case
'search'
:
// 搜索
$searchRequest
=
new
Yaf\Request\Http
(
'/product/search/index'
);
$dispatcher
->
setRequest
(
$searchRequest
);
if
(
$urlAction
==
'/index'
)
{
$searchRequest
=
new
Yaf\Request\Http
(
'/product/search/index'
);
$dispatcher
->
setRequest
(
$searchRequest
);
}
break
;
case
'guang'
:
// 逛
$module
=
'Guang'
;
break
;
case
'list'
:
// 商品列表
$module
=
'Product'
;
$url
=
strtolower
(
$dispatcher
->
getRequest
()
->
getRequestUri
());
//list列表的index
if
(
empty
(
$url
)
||
$url
==
'/index'
||
$url
==
'/
'
)
{
if
(
$urlAction
==
'/index
'
)
{
$listRequest
=
new
Yaf\Request\Http
(
'/product/list/index'
);
$dispatcher
->
setRequest
(
$listRequest
);
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
b0b1f23
...
...
@@ -110,7 +110,7 @@ class SearchModel
);
//接收高级选项
foreach
(
$_GET
as
$key
=>
$val
)
{
if
(
strpos
(
'parameter_'
,
$key
)
!==
false
)
{
if
(
strpos
(
$key
,
'parameter_'
)
!==
false
)
{
$condition
[
$key
]
=
(
int
)
$val
;
}
}
...
...
@@ -129,7 +129,6 @@ class SearchModel
$data
[
'condition'
]
=
$condition
;
$data
[
'sortCondition'
]
=
$sortCondition
;
$data
[
'options'
]
=
$options
;
return
$data
;
}
...
...
@@ -221,7 +220,7 @@ class SearchModel
$data
.=
'<li><a style="display: block;" href="http://search.yohobuy.com/?query='
.
$v
[
'item'
]
.
'" class="clearfix clear search-item" title="'
.
$v
[
'item'
]
.
'" act="http://search.yohobuy.com/?query='
.
$v
[
'item'
]
.
'"><span class="searchvalue" >'
.
$v
[
'item'
]
.
'</span><span class="valuenum">约'
.
$v
[
'frequency'
]
.
'个商品</span></a></li>'
;
}
}
echo
$data
;
return
$data
;
}
/**
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
b0b1f23
...
...
@@ -49,10 +49,7 @@ class ListController extends WebAction
*/
public
function
saleAction
()
{
//排序
$condition
[
'order'
]
=
's_n_desc'
;
//打折
$condition
[
'p_d'
]
=
'0,0.9'
;
$condition
=
array
();
$list
=
SearchModel
::
getListData
(
$condition
);
$data
=
array
(
//初始化js
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
View file @
b0b1f23
...
...
@@ -21,11 +21,13 @@ class SearchController extends WebAction
*/
public
function
suggestAction
()
{
$suggest
=
''
;
$query
=
rawurldecode
(
$this
->
get
(
'query'
));
if
(
$query
)
{
$param
[
'query'
]
=
$query
;
SearchModel
::
getSuggest
(
$param
);
$suggest
=
SearchModel
::
getSuggest
(
$param
);
}
echo
$suggest
;
}
/**
...
...
@@ -35,7 +37,6 @@ class SearchController extends WebAction
{
$condition
[
'msort'
]
=
$this
->
get
(
'msort'
);
$size
=
SearchModel
::
getSortSize
(
$condition
);
print_r
(
$size
);
exit
;
$this
->
echoJson
(
$size
);
}
}
\ No newline at end of file
...
...
yohobuy/www.yohobuy.com/configs/routes.product.ini
View file @
b0b1f23
...
...
@@ -18,3 +18,10 @@ routes.productgetProductPic.match = "/getProductPic"
routes.productgetProductPic.route.module
=
Product
routes.productgetProductPic.route.controller
=
List
routes.productgetProductPic.route.action
=
getProductPic
;api(search api suggest)
routes.searchsuggest.type
=
"rewrite"
routes.searchsuggest.match = "/api/suggest"
routes.searchsuggest.route.module
=
Product
routes.searchsuggest.route.controller
=
Search
routes.searchsuggest.route.action
=
suggest
...
...
Please
register
or
login
to post a comment