Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

... ... @@ -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
... ...
This diff could not be displayed because it is too large.
... ... @@ -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);
}
... ...
... ... @@ -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
... ...