Authored by Rock Zhang

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

Showing 67 changed files with 1781 additions and 825 deletions
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>找回密码-通过邮箱 | YOHO!有货</title>
<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css">
</head>
<body class=passport-body>
<div class="back-email-page passport-page yoho-page">
<div class="header">
<a class="go-back" href=/signin.html></a>
<p class="title">找回密码</p>
</div> <div class="content">
<div class="input-container row has-clear">
<input id="email" class="input email" type="text" placeholder="请输入邮箱" autocomplete="off">
</div>
<span id="btn-sure" class="btn btn-sure disable row">确定</span>
</div>
</div>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script>
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/passport/back/email');
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>国际账号登录 | YOHO!有货</title>
<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css">
</head>
<body class=passport-body>
<div class="login-international-page passport-page yoho-page">
<div class="header">
<a class="go-back" href=/></a>
<p class="title">登录</p>
</div> <div class="content">
<div class="select-container row">
<span class="select-title">国家和地区</span>
<select id="country-select" class="country-select select in-android-uc">
<option value=+61 >澳大利亚</option>
<option value=+82 >韩国</option>
<option value=+1 >加拿大</option>
<option value=+60 >马来西亚</option>
<option value=+1 >美国</option>
<option value=+81 >日本</option>
<option value=+65 >新加坡</option>
<option value=+44 >英国</option>
<option value=+86 selected>中国</option>
<option value=+853 >中国澳门</option>
<option value=+886 >中国台湾</option>
<option value=+852 >中国香港</option>
</select>
<div class="arrow-right"></div>
</div> <div class="input-container phone-container row has-clear">
<span id="area-code" class="area-code">+86</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号" value=>
</div>
<div class="input-container row has-eye">
<input id="pwd" class="pwd input" type="password" placeholder="密码">
</div>
<span id="btn-login" class="btn btn-login disble row">登录</span>
</div>
</div>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script>
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/passport/login/international');
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>找回密码-通过手机号 | YOHO!有货</title>
<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css">
</head>
<body class=passport-body>
<div class="back-mobile-page passport-page yoho-page">
<div class="header">
<a class="go-back" href=/signin.html></a>
<p class="title">找回密码</p>
</div> <div class="content">
<div class="select-container row">
<span class="select-title">国家和地区</span>
<select id="country-select" class="country-select select in-android-uc">
<option value=+61 >澳大利亚</option>
<option value=+82 >韩国</option>
<option value=+1 >加拿大</option>
<option value=+60 >马来西亚</option>
<option value=+1 >美国</option>
<option value=+81 >日本</option>
<option value=+65 >新加坡</option>
<option value=+44 >英国</option>
<option value=+86 selected>中国</option>
<option value=+853 >中国澳门</option>
<option value=+886 >中国台湾</option>
<option value=+852 >中国香港</option>
</select>
<div class="arrow-right"></div>
</div> <div class="input-container phone-container row has-clear">
<span id="area-code" class="area-code"></span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
</div>
<span id="btn-next" class="btn btn-next disable row">下一步</span>
</div>
</div>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script>
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/passport/back/mobile');
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>注册 | YOHO!有货</title>
<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css">
</head>
<body class=passport-body>
<div class="reg-page passport-page yoho-page">
<div class="header">
<a class="go-back" href=/></a>
<p class="title">注册</p>
</div> <div class="content">
<div class="select-container row">
<span class="select-title">国家和地区</span>
<select id="country-select" class="country-select select in-android-uc">
<option value=+61 >澳大利亚</option>
<option value=+82 >韩国</option>
<option value=+1 >加拿大</option>
<option value=+60 >马来西亚</option>
<option value=+1 >美国</option>
<option value=+81 >日本</option>
<option value=+65 >新加坡</option>
<option value=+44 >英国</option>
<option value=+86 selected>中国</option>
<option value=+853 >中国澳门</option>
<option value=+886 >中国台湾</option>
<option value=+852 >中国香港</option>
</select>
<div class="arrow-right"></div>
</div> <div class="input-container phone-container row has-clear">
<span id="area-code" class="area-code">+86</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
</div>
<span id="btn-next" class="btn btn-next disable row">下一步</span>
<p class="register-tip">YOHO!Family账号可登录YOHO!有货、YOHO!Boys、YOHO!Girls及SHOW</p>
</div>
</div>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script>
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/passport/register/register');
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录 | YOHO!有货</title>
<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
}());
})(document, window);
</script>
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.css">
</head>
<body class=passport-body>
<div class="login-page passport-page yoho-page">
<div class="header">
<a class="go-back" href=/></a>
<div class="img-header"></div>
</div> <div class="content">
<div class="acc-container input-container row has-clear">
<div class="yoho-logo"></div>
<input id="account" class="input account" type="text" placeholder="手机号/邮箱" autocomplete="off" value=>
</div>
<div class="input-container row has-eye">
<input id="pwd" class="pwd input" type="password" placeholder="密码">
</div>
<span id="btn-login" class="btn btn-login disable">登录</span>
<p class="op-container">
<a class="go-register" href=/reg.html>免费注册</a>
<span id="forget-pwd" class="forget-pwd">忘记密码</span>
</p>
<div class="third-party-login">
<span>其他登录方式</span>
<div class="tp-link">
<a class="alipay" href=/passport/login/alipay></a>
<a class="weibo" href=/passport/login/sina></a>
<a class="qq" href=/passport/login/qq></a>
</div>
</div>
<a class="international" href=/login.html>International Customer</a>
<div class="login-tip">
<div class="info-icon"></div>
Yoho!Family账号可登录YOHO!有货
</div>
<div id="retrive-pwd-mask" class="mask"></div>
<ul id="retrive-pwd-ways" class="retrive-pwd-ways">
<li>
<a href=/passport/back/mobile>通过手机找回密码</a>
</li>
<li>
<a href=/passport/back/email>通过邮箱找回密码</a>
</li>
<li id="cancel-retrive">
取消
</li>
</ul>
</div>
</div>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.1/index.js"></script>
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/passport/login/login');
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -56,7 +56,7 @@ conf/vhosts,nginx注册表文件,restart-nginx.bat, start-nginx.bat, start-php5.
127.0.0.1 static.m.dev.yohobuy.com
### 最后一步
进入yohobuy/static目录,运行npm install 和 spm install安装下依赖, 成功后在当前目录运行`gulp`启动开发环境服务...看看[m.dev.yohobuy.com](m.dev.yohobuy.com)有没有反应?
进入yohobuy/static目录,运行npm install 和 spm install(需要先`spm config set registry http://spm.yoho.cn`将源指定到我们自己的包仓库)安装下依赖, 成功后在当前目录运行`gulp`启动开发环境服务...看看[m.dev.yohobuy.com](m.dev.yohobuy.com)有没有反应?
Done ? 'congratulations' : '看看是不是缺了什么,不能解决的时候再问问其他人看看'
... ...
framework @ 119c247f
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
... ...
... ... @@ -89,6 +89,18 @@ class AbstractAction extends Controller_Abstract
}
/**
* 封装一下获取YAF内部的参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected function param($key, $default = null)
{
return $this->_request->getParam($key, $default);
}
/**
* 关闭模板自动渲染
*
* @return void
... ...
... ... @@ -30,5 +30,9 @@ class CacheConfig
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS = 'key_action_product_newsale_discount_girls'; // 女生折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS = 'key_action_product_newsale_discount_kids'; // 潮童折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE = 'key_action_product_newsale_discount_lifestyle'; // 创意生活折扣专区
const KEY_ACTION_PRODUCT_INDEX = 'key_action_product_index'; // 品类商品列表
const KEY_ACTION_PRODUCT_BRAND = 'key_action_product_brand'; // 品类商品列表
const KEY_ACTION_PRODUCT_BRAND_DOMAINS = 'key_action_product_brand_DOMAINS'; // 所有品牌域名列表
}
... ...
... ... @@ -44,7 +44,7 @@ class BrandData
$param['method'] = 'app.brand.brandlist';
$param['yh_channel'] = $channel;
$param['client_secret'] = Sign::getSign($param);
$urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
$urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param, 3600); // 有缓存1小时
return Yohobuy::getMulti($urlList);
}
... ... @@ -60,7 +60,9 @@ class BrandData
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.brand.brandlist';
$param['yh_channel'] = $channel;
if (is_numeric($channel)) {
$param['yh_channel'] = $channel;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -88,15 +90,18 @@ class BrandData
* @param integer $brandId 品牌ID
* @return array 品牌介绍信息
*/
public static function getBrandIntro($brandId)
public static function getBrandIntro($brandId, $uid)
{
// 构建必传参数
$param = Yohobuy::param();
$param['brand_id'] = $brandId;
$param['uid'] = $uid;
$param['method'] = 'app.brand.getBrandIntro';
$param['client_secret'] = Sign::getSign($param);
$cache = empty($uid) ? 3600 : false;
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 有缓存1小时
}
/**
... ... @@ -105,16 +110,15 @@ class BrandData
* @param integer $uid 用户id
* @return array banner数据
*/
public static function getBrandBanner($brandId, $uid)
public static function getBrandBanner($brandId)
{
// 构建必传参数
$param = Yohobuy::param();
$param['brand_id'] = $brandId;
$param['uid'] = $uid;
$param['method'] = 'app.brand.banner';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 有缓存1小时
}
/**
... ... @@ -161,5 +165,34 @@ class BrandData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 查询商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $order 排序方式,默认s_t_desc
* @param integer $limit 限制查询的数目,默认为60
* @param integer $page 查询第几页,默认为第1页
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function filterBrandData($condition, $order = 's_t_desc', $limit = 60, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.brand';
$param['page'] = $page;
$param['limit'] = $limit;
$param['order'] = $order;
$param += $condition;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
<?php
namespace LibModels\Wap\Category;
use Api\Yohobuy;
... ... @@ -15,62 +16,93 @@ use Api\Sign;
*/
class ClassData
{
/**
* 获取品类数据
*
* @return array 品类数据
*/
/**
* 获取品类数据
*
* @return array 品类数据
*/
public static function getClassesData()
{
// 构建必传参数
$param = Yohobuy::param();
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.sort.get';
$param['method'] = 'app.sort.get';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 查询品类商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $order 排序方式,默认s_t_desc
* @param integer $limit 限制查询的数目,默认为60
* @param integer $page 查询第几页,默认为第1页
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d, $channel = 1, $order = 's_t_desc', $limit = 60, $page = 1)
{
// 构建必传参数
$param = Yohobuy::param();
/**
* 查询品类商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $order 排序方式,默认s_t_desc
* @param integer $limit 限制查询的数目,默认为60
* @param integer $page 查询第几页,默认为第1页
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d, $order = 's_t_desc', $limit = 60, $page = 1)
{
// 构建必传参数
$param = Yohobuy::param();
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price,
'p_d' => $p_d
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems, function($v) {return $v !== null;});
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
'sort' => $sort,
'color' => $color,
'size' => $size,
'price' => $price,
'p_d' => $p_d
);
// 拉取筛选参数
$queriedParams = array_filter($selectItems);
$param += $queriedParams;
$param['method'] = 'app.search.category';
$param['page'] = $page;
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
$param['method'] = 'app.search.category';
$param['page'] = $page;
$param['limit'] = $limit;
$param['gender'] = $gender;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 查询商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $order 排序方式,默认s_t_desc
* @param integer $limit 限制查询的数目,默认为60
* @param integer $page 查询第几页,默认为第1页
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function filterClassData($condition, $order = 's_t_desc', $limit = 60, $page = 1)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.category';
$param['page'] = $page;
$param['limit'] = $limit;
$param['order'] = $order;
$param += $condition;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -9,6 +9,36 @@ class Helpers
{
/**
* 构建网站的URL
*
* 备注:所有的URL构建都尽量使用该方法,便于以后维护.
*
* @param string $uri 如 "/passport/reg/index"
* @param array $param 参数项 array(key1 => value1, key2 => value2,)
* @param string $module 模块名 如"index"表示默认, "guang"表示逛,"list"表示商品列表,"search"表示搜索
* @return string
*/
public static function url($uri, $param, $module = 'index')
{
$url = '';
switch ($module) {
case 'guang': // 逛
$url = 'http://guang' . SUB_DOMAIN;
break;
case 'list': // 商品列表
$url = 'http://list' . SUB_DOMAIN;
break;
case 'search': // 搜索
$url = 'http://search' . SUB_DOMAIN;
break;
}
$url .= $uri . '?' . http_build_query($param, null, '&');
return $url;
}
/**
* 根据尺寸获得图片url
* @param string $url 路径
* @param integer $width 图片宽度
... ... @@ -29,13 +59,53 @@ class Helpers
*/
public static function getFilterUrl($url)
{
$filter = strstr($url, 'openby:yohobuy=', true);
$filter = strtr(strstr($url, 'openby:yohobuy=', true), array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN));
if ($filter) {
return rtrim(rtrim($filter, '?'), '&');
} else {
return $url;
}
}
/**
* 根据用户访问的COOKIE判断出性别
*
* @return string
*/
public static function getGenderByCookie()
{
$cookie = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys';
switch (strval($cookie)) {
case 'boys': // 男
return '1,3';
case 'girls': // 女
return '2,3';
default: // 其它
return '1,2,3';
}
}
/**
* 根据用户访问的COOKIE判断出频道
*
* @return int
*/
public static function getChannelByCookie()
{
$cookie = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys';
switch (strval($cookie)) {
case 'boys': // 男
return 1;
case 'girls': // 女
return 2;
case 'kids': // 潮童
return 3;
case 'lifestyle': // 创意生活
return 4;
default: // 其它
return 1;
}
}
/**
* 格式化商品信息
... ... @@ -95,11 +165,11 @@ class Helpers
*
* @param array $articleData 需要格式化的资讯数据
* @param bool $showTag 是否显示左上角标签
* @param mixed $share 是否显示分享,在APP客户端里嵌入需要传url链接
* @param mixed $isApp 是否显示分享,在APP客户端里嵌入需要传url链接
* @param bool $showAuthor 控制是否显示作者信息
* @return array | false
*/
public static function formatArticle($articleData, $showTag = true, $share = false, $showAuthor = true)
public static function formatArticle($articleData, $showTag = true, $isApp = false, $showAuthor = true)
{
// 资讯ID不存在,则不显示
if (!isset($articleData['id'])) {
... ... @@ -110,7 +180,7 @@ class Helpers
$result['id'] = $articleData['id'];
$result['showTags'] = $showTag;
$result['img'] = self::getImageUrl($articleData['src'], 640, 640);
$result['url'] = '/guang/detail/index?id=' . $articleData['id']; // @todo
$result['url'] = $isApp && !empty($articleData['url']) ? $articleData['url'] : '/info/index?id=' . $articleData['id'];
$result['title'] = $articleData['title'];
$result['text'] = $articleData['intro'];
$result['publishTime'] = $articleData['publish_time'];
... ... @@ -121,7 +191,7 @@ class Helpers
// 收藏
// $result['collect'] = array();
// $result['collect']['isCollected'] = isset($articleData['isFavor']) && $articleData['isFavor'] === 'Y';
$result['share'] = $share;
$result['share'] = $isApp && isset($articleData['share']['url']) ? $articleData['share']['url'] : false;
// 判断是否显示作者信息
if ($showAuthor) {
... ...
server
{
listen 80;
server_name m.dev.yohobuy.com;
server_name m.dev.yohobuy.com *.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
... ...
... ... @@ -22,6 +22,37 @@ function cookie(name) {
return cookieVal;
}
function setCookie(name, value, options) {
var expires = '',
path,
domain,
secure,
date;
if (typeof value !== 'undefined') {
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
if (options.expires &&
(typeof options.expires === 'number' || options.expires.toUTCString)) {
if (typeof options.expires === 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString();
}
path = options.path ? '; path=' + options.path : '';
domain = options.domain ? '; domain=' + options.domain : '';
secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
}
}
function getUser() {
var c = cookie('_UID'),
user;
... ... @@ -60,7 +91,7 @@ function getShoppingKey() {
}
//页面通用底部位置及status设置
(function() {
(function () {
var $footer = $('#yoho-footer'),
$op = $footer.children('.op-row');
... ... @@ -94,8 +125,10 @@ function getShoppingKey() {
//暴露公共接口
window.cookie = cookie;
window.setCookie = setCookie;
window.getUser = getUser;
window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
\ No newline at end of file
window.getShoppingKey = getShoppingKey;
... ...
... ... @@ -95,7 +95,7 @@ function loadMore($container, opt) {
loading = true;
$.ajax({
type: 'GET',
url: ' /guang/list/page',
url: ' /guang/index/page',
data: opt,
success: function(data) {
if (data === ' ') {
... ...
... ... @@ -28,7 +28,7 @@ lazyLoad($('img.lazy'));
//$('img:in-viewport').trigger('appear');
//点击首页汉堡menu图标,滑出侧栏导航
$('.nav-btn').on('click', function (event) {
$('.nav-btn').on('tap', function (event) {
if (!$(this).hasClass('menu-open')) {
$('.mobile-wrap').addClass('menu-open');
$('.overlay').addClass('show');
... ... @@ -45,7 +45,7 @@ $('.nav-btn').on('click', function (event) {
});
//点击页面主体,收起侧栏导航及二级导航
$('.mobile-wrap').on('click', function () {
$('.mobile-wrap').on('tap', function () {
if ($(this).hasClass('menu-open')) {
$('.mobile-wrap').removeClass('menu-open');
$('.overlay').removeClass('show');
... ... @@ -59,7 +59,7 @@ $('.mobile-wrap').on('click', function () {
});
//点击一级导航,弹出二级导航
$('.side-nav').on('click', 'li', function () {
$('.side-nav').on('tap', 'li', function () {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
... ... @@ -68,7 +68,7 @@ $('.side-nav').on('click', 'li', function () {
//返回一级导航,收起二级导航
$('.sub-nav').each(function () {
$(this).find('li').eq(0).on('click', function (e) {
$(this).find('li').eq(0).on('tap', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
});
... ... @@ -84,6 +84,7 @@ $('.sub-nav').on('mouseenter', 'li', function () {
//头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
... ... @@ -137,15 +138,8 @@ $('.category-swiper').each(function (i, index) {
}
});
//回到顶部
// $('.back-to-top').bind('touchstart', function (e) {
// e.preventDefault();
// $(window).scrollTop(0);
// });
//关闭头部下载浮层
$('.header-download').on('click', '.close-btn', function () {
$('.header-download').on('tap', '.close-btn', function () {
$(this).parent().remove();
});
... ...
... ... @@ -34,7 +34,7 @@ if (kidsType) {
$curNav = $navList.children('.focus');
$('#maybe-like-nav').delegate('li', 'touchstart', function() {
$('#maybe-like-nav').delegate('li', 'tap', function() {
var $this = $(this),
$goods = $('.goods-list'),
$content;
... ...
/**
* 底部JS
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/26
*/
var $ = require('yoho.zepto');
function downLoadApp() {
var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445';
var clickedAt = new Date();
setTimeout(function () {
if ((new Date()) - clickedAt < 2000) {
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').bind('tap', function () {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
{
domain: '.yohobuy.com'
});
window.setCookie('_float-layer-app-close', 1,
{
domain: '.yohobuy.com',
expires: 1
});
});
$('#float-layer-btn').tap(function () {
downLoadApp('bottom');
});
if (!window.cookie('_float-layer-app')) {
$('#float-layer-app').show();
} else {
$('#float-layer-app').hide();
}
... ...
... ... @@ -5,4 +5,5 @@
*/
require('./search');
require('./channel');
\ No newline at end of file
require('./channel');
require('./footer');
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ $pwd.bind('input', function() {
}
});
$btnOk.on('touchstart', function() {
$btnOk.on('tap', function() {
var pwd = trim($pwd.val()),
mobileBack = true,
setting,
... ...
... ... @@ -54,7 +54,7 @@ var $listNav = $('#list-nav'),
end: false
}
},
$pre, //纪录进入筛选前的active
$pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中
searching;
/**
... ...
... ... @@ -59,6 +59,10 @@ var $listNav = $('#list-nav'),
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
pagination: '.swiper-pagination'
});
}
... ... @@ -216,7 +220,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'touchstart', function() {
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
... ...
... ... @@ -33,6 +33,10 @@ var defaultOpt = {
p_d: $('#p_d').val()
};
var now = new Date(),
month = now.getMonth() + 1,
date = now.getDate();
var $listNav = $('#list-nav'),
//导航数据信息
... ... @@ -59,9 +63,15 @@ var $listNav = $('#list-nav'),
$pgc.addClass('hide');
$dgc.addClass('hide');
$('#today a').text(month + '月' + date + '号');
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
pagination: '.swiper-pagination'
});
}
... ... @@ -237,7 +247,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'touchstart', function() {
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
... ... @@ -273,7 +283,7 @@ $listNav.delegate('li', 'touchstart', function() {
nav = navInfo[navType];
if (!($this.hasClass('active'))) {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
... ...
.float-layer {
height: 44px;
background: rgba(68, 68, 68, 0.95);
position: fixed;
width: 100%;
bottom: 0;
left: 0;
z-index: 9999;
padding: 10px 0;
.float-layer-left {
padding-left: 22px;
overflow: hidden;
float: left;
img {
height: 44px;
float: left;
margin-right: 10px;
}
p {
float: left;
font-size: 16px;
height: 44px;
line-height: 44px;
color: white;
}
}
}
#float-layer-close {
position: absolute;
left: 0;
top: 0;
width: 50px;
height: 50px;
}
#float-layer-btn {
position: absolute;
top: 50%;
right: 15px;
font-size: 16px;
padding: 0 10px;
height: 27px;
line-height: 27px;
background: white;
border-radius: 5px;
margin-top: -13px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.5);
}
\ No newline at end of file
... ...
... ... @@ -39,5 +39,5 @@
}
@import "search";
@import "search","footer";
... ...
... ... @@ -38,4 +38,5 @@
width: 100%;
bottom: 0;
}
}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="mobile-wrap boys-wrap yoho-page">
{{# headerDownload}}
{{> home/header_download}}
{{/ headerDownload}}
{{! 首页header}}
{{# homeHeader}}
{{> home/home_header}}
... ... @@ -20,4 +15,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="mobile-wrap girls-wrap yoho-page">
{{# headerDownload}}
{{> home/header_download}}
{{/ headerDownload}}
{{! 首页header}}
{{! 首页header}}
{{# homeHeader}}
{{> home/home_header}}
{{/ homeHeader}}
... ... @@ -14,5 +9,6 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
\ No newline at end of file
{{> home/side_nav}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -16,4 +16,5 @@
</div>
</div>
{{>layout/footer}}
\ No newline at end of file
{{>layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="mobile-wrap kids-wrap yoho-page">
{{! app下载}}
{{# headerDownload}}
{{> home/header_download}}
{{/ headerDownload}}
{{! 首页header}}
{{# homeHeader}}
{{> home/home_header}}
... ... @@ -26,4 +21,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="mobile-wrap lifestyle-wrap yoho-page">
{{! app下载}}
{{# headerDownload}}
{{> home/header_download}}
{{/ headerDownload}}
{{! 首页header}}
{{# homeHeader}}
{{> home/home_header}}
... ... @@ -24,4 +19,5 @@
<div class="overlay"></div>
</div>
{{> home/side_nav}}
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="good-list-page yoho-page">
{{# goodList}}
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value={{default}} name="query">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
{{/ search}}
{{# brandWay}}
<div class="brand-way">
<a href={{url}}>
<img class="brand-thumb" src={{thumb}}>
<span>{{name}}</span>
<span class="entry">
进入品牌
<i class="iconfont">&#xe614;</i>
</span>
</a>
</div>
{{/ brandWay}}
{{# brandHome}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
<a class="btn-intro" href="javascript:void(0);">
品牌介绍
</a>
<a class="btn-col" href="javascript:void(0);">
<span class="iconfont">&#xe622;</span>
收藏
</a>
</div>
<div id="intro-box" class="brand-intro-box hide">
<div id="brand-intro" class="brand-intro">
<h2>品牌介绍</h2>
<div class="con">
{{{intro}}}
</div>
<p class="fo">
<span></span>
100%品牌授权正品
</p>
<span class="iconfont close-intro">&#xe623;</span>
</div>
</div>
{{/ brandHome}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
最新
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
价格
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
折扣
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
筛选
<span class="iconfont">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container">
{{# new}}
{{> good}}
{{/ new}}
</div>
<div class="price-goods container hide"></div>
<div class="discount-goods container hide"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{/ goodList}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -5,9 +5,8 @@
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
<li class="today active">
<a href="javascript:void(0);">
1026
<li id="today" class="today active">
<a href="javascript:void(0);">
</a>
</li>
<li class="week">
... ...
{{> layout/header}}
<div class="good-list-page yoho-page">
{{# goodList}}
{{# search}}
<div id="search-input" class="search-input">
<form action="/product/list/index" method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value={{default}} name="query">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
{{/ search}}
{{# brandWay}}
<div class="brand-way">
<a href={{url}}>
<img class="brand-thumb" src={{thumb}}>
<span>{{name}}</span>
<span class="entry">
进入品牌
<i class="iconfont">&#xe614;</i>
</span>
</a>
</div>
{{/ brandWay}}
{{# brandHome}}
<div id="brand-header" class="brand-header" data-id={{id}}>
<img class="lazy" data-original={{banner}}>
<a class="btn-intro" href="javascript:void(0);">
品牌介绍
</a>
<a class="btn-col" href="javascript:void(0);">
<span class="iconfont">&#xe622;</span>
收藏
</a>
</div>
<div id="intro-box" class="brand-intro-box hide">
<div id="brand-intro" class="brand-intro">
<h2>品牌介绍</h2>
<div class="con">
{{{intro}}}
</div>
<p class="fo">
<span></span>
100%品牌授权正品
</p>
<span class="iconfont close-intro">&#xe623;</span>
</div>
</div>
{{/ brandHome}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
最新
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
价格
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
折扣
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
筛选
<span class="iconfont">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container">
{{# new}}
{{> good}}
{{/ new}}
</div>
<div class="price-goods container hide"></div>
<div class="discount-goods container hide"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{/ goodList}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{# new}}
{{> good}}
{{/ new}}
\ No newline at end of file
... ...
... ... @@ -4,8 +4,9 @@
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}" alt="">
<img class="swiper-lazy" data-src="{{img}}">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ list}}
</ul>
... ...
{{#showDownloadApp}}
<div class="float-layer hide" id="float-layer-app">
<div class="float-layer-left">
<img src="http://static.yohobuy.com/m/v1/img/yohobuy_new.png" alt="">
<p>新用户首单减10元</p>
</div>
<a href="javascript:void(0);" id="float-layer-close" >
<img src="http://static.yohobuy.com/m/v1/img/close_new.png" width="22">
</a>
<a href="http://m.yohobuy.com/download/hyapp" id="float-layer-btn">
立即下载
</a>
</div>
{{/showDownloadApp}}
\ No newline at end of file
... ...
... ... @@ -10,4 +10,6 @@
CopyRight©2007-2016 南京新与力文化传播有限公司
</address>
</footer>
{{/pageFooter}}
\ No newline at end of file
{{/pageFooter}}
\ No newline at end of file
... ...
... ... @@ -85,25 +85,36 @@
</script>
{{/if}}
{{!-- 频道选择页 --}}
{{#if channelPage}}
<script>
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 首页 --}}
{{#if grilsHomePage}}
<script>
seajs.use('js/home/home');
seajs.use('js/index/footer');
</script>
{{/if}}
{{#if boysHomePage}}
<script>
seajs.use('js/home/home');
seajs.use('js/index/footer');
</script>
{{/if}}
{{#if kidsHomePage}}
<script>
seajs.use('js/home/home');
seajs.use('js/index/footer');
</script>
{{/if}}
{{#if lifestyleHomePage}}
<script>
seajs.use('js/home/home');
seajs.use('js/index/footer');
</script>
{{/if}}
... ...
... ... @@ -16,11 +16,11 @@ use Yaf\Application;
use Yaf\Registry;
use Yaf\Loader;
use Yaf\Config;
use Plugin\TemplateLayout;
class Bootstrap extends Bootstrap_Abstract
{
private $_config;
/**
... ... @@ -64,9 +64,51 @@ class Bootstrap extends Bootstrap_Abstract
*/
public function _initRoute(Dispatcher $dispatcher)
{
$config = new Config\Ini(APPLICATION_PATH . '/configs/routes.ini');
if (isset($config->routes)) {
$dispatcher->getRouter()->addConfig($config->routes);
$hostParts = explode('.', $dispatcher->getRequest()->getServer('HTTP_HOST', ''));
$level = count($hostParts) - 1;
/* 根据域名的级别,设置默认的模块、控制器、方法 */
$module = 'Index';
$controller = 'Index';
$action = 'Index';
// 三级域名
if (3 === $level) {
$subDomain = strval($hostParts[0]);
switch (strtolower($subDomain)) {
case 'm': // 老版(到频道选择)
case 'buy': // 测试环境的域名, 以后可去掉
break;
case 'new': // 原新版(到男生首页)
$controller = 'Boys';
break;
case 'search': // 搜索
$controller = 'Search';
$action = 'List';
break;
case 'guang': // 逛
$module = 'Guang';
break;
case 'list': // 商品列表
$module = 'Product';
break;
default: // 其它(识别为品牌)
$module = 'Product';
$action = 'Brand';
$dispatcher->getRequest()->setParam('named', $subDomain);
break;
}
}
$dispatcher->getRequest()->module = $module;
$dispatcher->getRequest()->controller = $controller;
$dispatcher->getRequest()->action = $action;
/* 根据对应模块的配置,添加相应的路由规则 */
$iniFile = APPLICATION_PATH . '/configs/routes.' . strtolower($module) . '.ini';
if (file_exists($iniFile)) {
$config = new Config\Ini($iniFile);
if (isset($config->routes)) {
$dispatcher->getRouter()->addConfig($config->routes);
}
}
}
... ... @@ -78,15 +120,15 @@ class Bootstrap extends Bootstrap_Abstract
{
// 关闭自动渲染模板
$dispatcher->autoRender(false);
// 判断到不是AJAX请求时, 使用自定义的模板渲染 (Mustache or Handlebars)
//if (!$dispatcher->getRequest()->isXmlHttpRequest()) {
$layout = new TemplateLayout();
$layout->setScriptPath($this->_config->application->template->path);
$dispatcher->setView($layout);
$layout = new TemplateLayout();
$layout->setScriptPath($this->_config->application->template->path);
$dispatcher->setView($layout);
//}
}
// /**
// * 初始化第三方包
// * @param Dispatcher $dispatcher
... ... @@ -97,5 +139,4 @@ class Bootstrap extends Bootstrap_Abstract
// require $this->_config->composer->path . '/vendor/autoload.php';
// }
// }
}
... ...
... ... @@ -7,6 +7,9 @@ use LibModels\Wap\Product\SearchData;
*/
class SearchController extends AbstractAction
{
/**
* 搜索首页
*/
public function indexAction()
{
$data = array(
... ... @@ -41,7 +44,142 @@ class SearchController extends AbstractAction
)
)
);
$this->_view->display('index', array('search' => $data, 'searchPage' => true, 'pageFooter' => true));
$this->_view->display('index', array(
'search' => $data,
'searchPage' => true,
'pageFooter' => true
));
}
/**
* 搜索列表页
*/
public function listAction()
{
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->getCookie('_Channel', 'boys');
$p_d = $this->get('p_d', null);
$misort = $this->get('misort', null);
$msort = $this->get('msort', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navTitle' => '搜索',
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array(
'brand' => 0,
'msort' => 0,
'gender' => $gender,
'price' => 0,
'size' => 0,
'discount' => ''
)
);
// 首先查询是否属于内置品类
$classes = ClassModel::getClassesArr();
$classFlag = array_search($query, $classes);
if($classFlag !== false)// 属于内部品类
{
$data['pageHeader']['navTitle'] = '所有'.$query;
}
// 如果存在搜索字符串就显示搜索栏
if(!is_null($query) && $classFlag === false)
{
$data['search'] = array(
'default' => $query
);
}
// 转换性别
$this->genderTrans($gender);
// 查询数据
$listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
// 如果存在品牌信息就显示品牌字段
if(isset($tmpData['brand']) && !empty($tmpData['brand']))
{
$brandData = $tmpData['brand'];
$data['brandWay'] = array(
'url' => '/product/list/brand?brand='.$brandData['id'],
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
// 设置品牌默认值
$data['goodList']['brand'] = $brandData['id'];
}
$data['goodList'] += ListProcess::getListData($tmpData);
}
$this->_view->display('list', $data);
}
/**
* Ajax异步筛选请求
*/
public function searchAction()
{
if($this->isAjax())
{
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->get('gender', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$sort = $this->get('msort', null);
// 转换性别
$this->genderTrans($gender);
// 转换排序方式
$order = $this->get('order', null);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$data = array();
// 查询数据
$listData = SearchData::searchLiDatas($query, $brand, $gender, $color, $size, $price, $p_d, $sort, $order);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
unset($tmpData['filter']);// 不要筛选条件的数据
$data = ListProcess::getListData($tmpData);
}
if(empty($data))
{
echo ' ';
}
else
{
$this->_view->display('page', $data);
}
}
}
/**
... ...
... ... @@ -53,6 +53,9 @@ class BrandModel
break;
}
// 模板中的使用JS标识
$result['brandPage'] = true;
/* 顶部的轮翻广告列表 */
if (!empty($brand['brandTop'][0]['data'])) {
$build = array();
... ... @@ -86,7 +89,7 @@ class BrandModel
$list['name'] = $row['brand_name'];
$list['isHot'] = ($row['is_hot'] === 'Y') ? true : false;
$list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false;
$list['url'] = 'http://' . $row['brand_domain'] . '.' . OLD_DOMAIN;
$list['url'] = 'http://' . $row['brand_domain'] . SUB_DOMAIN;
$build['list'][] = $list;
}
$result['brandList'][] = $build;
... ...
... ... @@ -18,7 +18,7 @@ use Plugin\Cache;
*/
class ClassModel
{
/**
* 根据频道获取品牌一览数据
*
... ... @@ -41,20 +41,17 @@ class ClassModel
$num = 1;
$data = ClassData::getClassesData();
if(!isset($data['code']) || $data['code'] !== 200)
{
if (!isset($data['code']) || $data['code'] !== 200) {
break;
}
if(!isset($data['data']))
{
if (!isset($data['data'])) {
break;
}
foreach ($data['data'] as $k => $v){
$oneClass = array('name'=>$k, 'ca'=>array());
if($num === 1)
{
foreach ($data['data'] as $k => $v) {
$oneClass = array('name' => $k, 'ca' => array());
if ($num === 1) {
$oneClass['focus'] = true;
}
... ... @@ -66,8 +63,11 @@ class ClassModel
$subitem = array();
$subitem['name'] = $value['category_name'];
$subitem['id'] = $value['relation_parameter']['sort'];
$subitem['url'] = '/product/list/class?sort='.$value['relation_parameter']['sort'];
$subitem['url'] = Helpers::url('/', array(
'sort' => $value['relation_parameter']['sort'],
'sort_name' => $value['category_name']
), 'list');
$item['sub'][] = $subitem;
}
... ... @@ -88,13 +88,11 @@ class ClassModel
Cache::set(CacheConfig::KEY_CATEGORY_CLASSES_DATA, $classes);
}
}
}while(false);
} while (false);
return $classes;
}
/**
* 返回品类构成的数组
*
... ... @@ -115,12 +113,12 @@ class ClassModel
return $classes;
}
/**
* 自定义array_column函数
*
* @return array 返回数组中指定的一列组成的数组
*/
/**
* 自定义array_column函数
* @param array $input 需要取出数组咧的多维数组
... ... @@ -132,19 +130,18 @@ class ClassModel
{
$array = array();
foreach ($input as $value) {
if ( ! isset($value[$columnKey])) {
if (!isset($value[$columnKey])) {
trigger_error("Key \"$columnKey\" does not exist in array");
return false;
}
if (is_null($indexKey)) {
$array[] = $value[$columnKey];
}
else {
if ( ! isset($value[$indexKey])) {
} else {
if (!isset($value[$indexKey])) {
trigger_error("Key \"$indexKey\" does not exist in array");
return false;
}
if ( ! is_scalar($value[$indexKey])) {
if (!is_scalar($value[$indexKey])) {
trigger_error("Key \"$indexKey\" does not contain scalar value");
return false;
}
... ... @@ -152,7 +149,6 @@ class ClassModel
}
}
return $array;
}
}
... ...
<?php
namespace Guang;
use LibModels\Wap\Guang\ListData;
use Plugin\Helpers;
/**
*
* @name IndexModel
* @package models/Guang
* @copyright yoho.inc
* @version 1.0 (2015-10-27 11:31:49)
* @author fei.hong <fei.hong@yoho.cn>
*/
class IndexModel
{
/**
* 获取逛首页分类内容列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param int channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活
* @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $page 分页第几页, 默认第1页
* @return array
*/
public static function getArticleGroup($gender, $type, $uid, $udid, $page = 1)
{
// 逛首页的分类名称列表
$category = ListData::category();
$articleGroup = array();
switch ($gender) {
case '1,3': // 男
$articleGroup = ListData::articleGroup($category['data'], '1,3', $uid, $udid, $page);
break;
case '2,3': // 女
$articleGroup = ListData::articleGroup($category['data'], '2,3', $uid, $udid, $page);
break;
default: // 其它所有
$articleGroup = ListData::articleGroup($category['data'], '1,2,3', $uid, $udid, $page);
break;
}
$data = array();
$build = array();
// 模板中使用JS的标识
$data['guangHome'] = true;
// 顶部的分类列表
foreach ($category['data'] as $value) {
$build = array();
$build['typeId'] = $value['id'];
$build['type'] = $value['name'];
$build['focus'] = ($value['id'] == $type);
$data['navs'][] = $build;
}
$data['guang']['swiper'] = array();
$data['guang']['infos'] = array();
foreach ($articleGroup as $id => $value) {
// 判断是否有内容
if (empty($value['list'])) {
continue;
}
// 轮番广告
if ($id == 0) {
$build = array();
foreach ($value['list']['adlist'] as $banner) {
$build['url'] = Helpers::getFilterUrl($banner['url']);
$build['img'] = Helpers::getImageUrl($banner['src'], 830, 327);
$data['guang']['swiper'][] = $build;
}
}
// 内容列表
$build = array();
$build['show'] = ($id == $type);
foreach ($value['list']['artList'] as $article) {
$build['info'][] = Helpers::formatArticle($article, true, false);
}
$data['guang']['infos'][] = $build;
}
// 分页需要参数
$data['guang']['gender'] = $gender;
$category = array();
return $data;
}
}
... ...
... ... @@ -47,7 +47,7 @@ class SideModel
$result[$key]['textCn'] = $value['sort_name'];
$result[$key]['textEn'] = $value['sort_name_en'];
$result[$key]['styleClass'] = strtolower($value['sort_name_en']);
$result[$key]['url'] = $value['sort_url'];
$result[$key]['url'] = Helpers::getFilterUrl($value['sort_url']);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60);
}
}
... ...
<?php
namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Category\ClassData;
use LibModels\Wap\Category\BrandData;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
use Plugin\Cache;
/**
* 商品列表相关的模板数据模型
*
* @name ListModel
* @package models/Product
* @copyright yoho.inc
* @version 1.0 (2015-10-27 16:27:54)
* @author fei.hong <fei.hong@yoho.cn>
*/
class ListModel
{
/**
* 获取品类商品列表数据
*
* @param array $condition 条件
* @return array | false
*/
public static function getClassData($condition)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_PRODUCT_INDEX;
if (!empty($condition)) {
$key .= http_build_query($condition, null, '&');
}
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口查询数据
$listData = ClassData::filterClassData($condition);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$result = ListProcess::getListData($listData['data']);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 600); // 缓存10分钟
}
}
return $result;
}
/**
* 获取品牌商品列表数据
*
* @return array
*/
public static function getBrandData($condition, $id, $uid, &$title)
{
$result = array();
// 获取品牌介绍信息, 有缓存1小时
$introData = BrandData::getBrandIntro($id, $uid);
if (isset($introData['data']['brand_intro'])) {
$result['brandHome']['id'] = $id;
$result['brandHome']['intro'] = $introData['data']['brand_intro'];
// 顶部导航的标题
$title = isset($introData['data']['brand_name']) ? $introData['data']['brand_name'] : '';
}
// 获取品牌banner的数据, 有缓存1小时
$bannerData = BrandData::getBrandBanner($id);
if (isset($bannerData['data']['banner'])) {
$result['brandHome']['banner'] = Helpers::getImageUrl($bannerData['data']['banner'], 640, 75);
}
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_PRODUCT_BRAND;
if (!empty($condition)) {
$key .= http_build_query($condition, null, '&');
}
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result['goodList'] = Cache::get($key, 'master');
if (!empty($result['goodList'])) {
return $result;
}
}
// 调用接口查询数据
$listData = BrandData::filterBrandData($condition);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$result['goodList'] = ListProcess::getListData($listData['data']);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result['goodList'])) {
$result['goodList'] = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result['goodList'], 600); // 缓存10分钟
}
}
return $result;
}
/**
* 获取所有的品牌名称列表
*
* @return array(
* 品牌ID => 品牌命名(domain)
* )
*/
public static function getAllBrandDomains()
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_PRODUCT_BRAND_ALLNAMES;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
$brand = BrandData::getBrandsData(null);
/* 按字母'A-Z'分组的品牌列表 */
if (!empty($brand['data']['brands'])) {
foreach ($brand['data']['brands'] as $value) {
foreach ($value as $row) {
$result[ $row['id'] ] = $row['brand_domain'] ;
}
}
}
// 更多关联的品牌
if (!empty($brand['data']['morebrands'])) {
foreach ($brand['data']['morebrands'] as $row) {
$result[ $row['id'] ] = $row['brand_domain'];
}
}
$brand = array();
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 600); // 缓存10分钟
}
}
return $result;
}
}
... ...
... ... @@ -65,7 +65,7 @@ class NewsaleModel
*
* @return array
*/
public static function getSaleFocus()
public static function getSaleFocus($channel)
{
$result = array();
... ...
<?php
use Action\AbstractAction;
/**
... ... @@ -6,257 +7,40 @@ use Action\AbstractAction;
*/
class BrandController extends AbstractAction
{
/**
* 品牌一览
*
* @param string gender 老版本中使用的参数, 做兼容判断
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
*/
public function indexAction()
{
$this->setTitle('品牌一览');
$this->setNavHeader('品牌一览');
/* 判断参数是否有效 */
$channel = $this->get('channel', 1);
if (!is_numeric($channel) || intval($channel) > 4) {
$channel = 1;
$channel = null;
$gender = $this->get('gender');
if (!empty($gender)) {
switch ($gender) {
case '1,3': // 男
$channel = 1;
break;
case '2,3': // 女
$channel = 2;
break;
}
}
/* 获取渲染模板需要的数据 */
/*$data = Category\BrandModel::getBrandByChannel($channel);
if (!is_array($data)) {
$data = array();
if (!isset($channel)) {
$channel = $this->get('channel', 1);
if (!is_numeric($channel) || intval($channel) > 4) {
$channel = 1;
}
}
$data['brandPage'] = true;
$brandTop = array();
if($brandTopData['code'] == 200)
{
$brandTop = $brandTopData['data'];
}
$brands = array();
if($brandsData['code'] == 200)
{
$brands = $brandsData['data'];
}
/*echo '<pre>';
var_dump($brandTop, $brands);exit;*/
$data = array (
'brandPage' => true,
'pageHeader' => array (
'navBack' => 'sss ',
'navHome' => 'sss ',
'navTitle' => 'sss '
),
'bannerTop' => array (
'list' => array (
array (
'url' => '',
'img' => 'http://img10.static.yhbimg.com/adpic/2015/10/15/10/01c161398d3baec2868abe85e26ba1a71d.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/027c45cdc03e23c367ec0ff3d29b7c3f79.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/022e2ac6daa33fc3cb8a0f04025a35994f.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
)
)
),
'hotBrand' => array (
'list' => array (
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/08/12/17/0233d54f34d2534c08271a8fc27090a6af.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/020b17265b2103b49005c57395b8b154a9.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/11/27/09/02b403bdcbfb965bdc632fea5c29816746.png?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/brandLogo/2013/11/01/14/027e68260ba30c01b165c17fe043f2ce2c.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img11.static.yhbimg.com/brandLogo/2014/04/25/14/0179fa8eacf51fd1a89ec6f7fdeab88fc2.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/02608437f8d8b6b7b15786214b0a5ef502.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2013/02/28/17/020aae69720d683a7962c9b7fd3a92c801.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
),
array (
'url' => '',
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/01/27/11/02bca7ac6414c7475b4a337e28a0365590.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
)
)
),
'brandList' => array (
array (
'title' => '0~9',
'list' => array(
array (
'name' => '004',
'isHot' => true
),
array (
'name' => '10*1',
'isNew' => true
),
array (
'name' => '2%'
)
)
),
array (
'title' => 'A',
'list' => array(
array (
'name' => 'Aape',
'isHot' => true
),
array (
'name' => 'Adfdfd',
'isNew' => true
),
array (
'name' => 'Acrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
),
array (
'title' => 'B',
'list' => array(
array (
'name' => 'Bape'
),
array (
'name' => 'Bdfdfd'
),
array (
'name' => 'Bcrwewwe'
)
)
)
)
);
$this->_view->assign('title', 'YOHO!有货');
//$this->_view->display('brand', compact('brands'));
// 渲染模板
$this->_view->display('index', $data);
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
}
}
\ No newline at end of file
}
... ...
... ... @@ -19,11 +19,12 @@ class ClassController extends AbstractAction
'navTitle' => '商品分类'
),
'category' => array(
"class" => $classes
'class' => $classes
)
);
$this->_view->assign('title', 'YOHO!有货');
$this->setTitle('商品分类');
$this->_view->display('index', $data);
}
}
\ No newline at end of file
... ...
... ... @@ -7,159 +7,113 @@ use Plugin\Helpers;
/**
* 逛首页、列表页、编辑页
*/
class ListController extends AbstractAction
class IndexController extends AbstractAction
{
/**
* 首页
*
* @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
* @param string gender '1,3'表示男,'2,3'表示女
* @param int id 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
* @param string gender '1,3'表示男,'2,3'表示女, 默认为所有
*/
public function indexAction()
{
$this->setTitle('逛');
$this->setNavHeader('逛', true, SITE_MAIN);
$category = ListData::category();
$articleGroup = array();
$uid = $this->getUid();
$udid = $this->getUdid();
$type = $this->get('type', 0);
$type = $this->get('id', 0);
$gender = $this->get('gender');
// 男
if ($gender === '1,3') {
$articleGroup = ListData::articleGroup($category['data'], '1,3', $uid, $udid);
}
// 女
elseif ($gender === '2,3') {
$articleGroup = ListData::articleGroup($category['data'], '2,3', $uid, $udid);
}
// 所有
else {
$articleGroup = ListData::articleGroup($category['data'], '1,2,3', $uid, $udid);
}
$data = array();
$build = array();
// 模板中使用JS的标识
$data['guangHome'] = true;
// 顶部的分类列表
foreach ($category['data'] as $value) {
$build = array();
$build['typeId'] = $value['id'];
$build['type'] = $value['name'];
$build['focus'] = ($value['id'] == $type);
$data['navs'][] = $build;
}
$data['guang']['swiper'] = array();
$data['guang']['infos'] = array();
foreach ($articleGroup as $id => $value) {
// 判断是否有内容
if (empty($value['list'])) {
continue;
}
// 轮番广告
if ($id == 0) {
$build = array();
foreach ($value['list']['adlist'] as $banner) {
$build['url'] = $banner['url'];
$build['img'] = Helpers::getImageUrl($banner['src'], 830, 327);
$data['guang']['swiper'][] = $build;
}
}
// 内容列表
$build = array();
$build['show'] = ($id == $type);
foreach ($value['list']['artList'] as $article) {
$build['info'][] = Helpers::formatArticle($article, true, false);
}
$data['guang']['infos'][] = $build;
}
// 分页需要参数
$data['guang']['gender'] = $gender;
$this->_view->display('index', $data);
$this->_view->display('index', Guang\IndexModel::getArticleGroup($gender, $type, $uid, $udid));
}
/**
* 列表页
*
* @param string tag 标签名称
* @param int yh_channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活
*/
public function tagAction()
{
$tag = $this->get('query');
$uid = $this->getUid();
$udid = $this->getUdid();
$tag = $this->get('query');
$channel = $this->get('yh_channel');
// 标签聚合内容列表
$article = ListData::article('', 0, $uid, $udid, 1, $tag);
// 标签聚合内容不存在, 跳到错误页面
if (empty($article['data']['list']['artList'])) {
$this->error();
}
}
// 标识是不是APP客户端
$isApp = isset($channel);
$this->setTitle($tag);
$this->setNavHeader($tag, true, SITE_MAIN);
if (!$isApp) {
$this->setNavHeader($tag, true, SITE_MAIN);
}
$data = array();
// 模板中使用JS的标识
$data['guangList'] = true;
// 构建资讯文章内容
$build = array();
foreach ($article['data']['list']['artList'] as $article) {
$build[] = Helpers::formatArticle($article, true, false);
$build[] = Helpers::formatArticle($article, true, $isApp);
}
$data['guang']['infos'] = $build;
// 分页需要的参数
$data['guang']['tag'] = $tag;
$this->_view->display('list', $data);
}
/**
* 编辑页
*
* @param int id 作者ID
* @param int yh_channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活
*/
public function editorAction()
{
$id = $this->get('id');
$channel = $this->get('yh_channel');
// 获取作者信息
$author = ListData::author($id);
$author = ListData::author($id);
// 作者信息不存在,则跳到错误页面
if (!isset($author['name'])) {
$this->error();
}
// 标识是不是APP客户端
$isApp = isset($channel);
$this->setTitle('编辑简介');
$this->setNavHeader('编辑简介', true, SITE_MAIN);
if (!$isApp) {
$this->setNavHeader('编辑简介', true, SITE_MAIN);
}
$uid = $this->getUid();
$udid = $this->getUdid();
$data = array();
// 模板中使用JS的标识
$data['guangList'] = true;
// 作者信息
$data['author'] = array();
$data['author']['avatar'] = Helpers::getImageUrl($author['avatar'], 100, 100);
$data['author']['name'] = $author['name'];
$data['author']['info'] = $author['author_desc'];
$data['author']['id'] = $id;
// 标签聚合内容列表
$article = ListData::article('', 0, $uid, $udid, 1, null, $id);
$article = ListData::article('', 0, $uid, $udid, 1, null, $id);
// 构建资讯文章内容
if (!empty($article['data']['list']['artList'])) {
$build = array();
... ... @@ -171,7 +125,7 @@ class ListController extends AbstractAction
$this->_view->display('list', $data);
}
/**
* 逛列表页面的资讯分页
*
... ... @@ -191,7 +145,7 @@ class ListController extends AbstractAction
if (!$this->isAjax()) {
break;
}
/* 判断参数是否有效 */
$tag = $this->get('tag');
$sortId = $this->get('type', 0);
... ... @@ -203,22 +157,21 @@ class ListController extends AbstractAction
break;
}
if (!empty($page) && !is_numeric($page)) {
break;
}
if (!empty($authorId) && is_numeric($authorId)) {
$showAuthor = false;
}
/* 获取资讯文章列表 */
$uid = $this->getUid();
$udid = $this->getUdid();
$page = intval($page) + 1;
$article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
$article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
if (empty($article['data']['list']['artList'])) {
break;
}
/* 构建资讯文章内容 */
$data = array();
$build = array();
... ... @@ -226,14 +179,14 @@ class ListController extends AbstractAction
$build[] = Helpers::formatArticle($article, true, false, $showAuthor);
}
$data['infos'] = $build;
$this->_view->display('page', $data);
exit();
}
while (false);
} while (false);
echo ' ';
}
}
\ No newline at end of file
}
... ...
... ... @@ -8,7 +8,7 @@ use Plugin\Helpers;
/**
* 逛详情页
*/
class DetailController extends AbstractAction
class InfoController extends AbstractAction
{
/**
... ... @@ -41,7 +41,7 @@ class DetailController extends AbstractAction
$data['guang']['author']['avatar'] = $detail['getAuthor']['avatar'];
$data['guang']['author']['name'] = $detail['getAuthor']['name'];
$data['guang']['author']['intro'] = $detail['getAuthor']['author_desc'];
$data['guang']['author']['url'] = '/guang/list/editor?id=' . $detail['getArticle']['author_id'];
$data['guang']['author']['url'] = Helpers::url('/author/index', array('id' => $detail['getArticle']['author_id']), 'guang');
}
$data['detail'] = array();
... ... @@ -143,7 +143,7 @@ class DetailController extends AbstractAction
// 相关标签
if (!empty($detail['getArticle']['tags'])) {
foreach ($detail['getArticle']['tags'] as $value) {
$value['url'] = '/guang/list/tag?query=' . $value['name'];
$value['url'] = Helpers::url('/tags/index', array('query=' => $value['name']), 'guang');
$data['relatedTag'][] = $value;
}
}
... ... @@ -151,7 +151,7 @@ class DetailController extends AbstractAction
// 相关文章
if (!empty($detail['getOtherArticle'])) {
foreach ($detail['getOtherArticle'] as $value) {
$value['url'] = '/guang/detail/index?id=' . $value['id'];
$value['url'] = Helpers::url('/info/index', array('id' => $value['id']), 'guang');
$value['thumb'] = Helpers::getImageUrl($value['thumb'], 279, 175);
$data['relatedInfo'][] = $value;
}
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Category\ClassData;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
/**
* 商品列表相关的控制器
*
*/
class IndexController extends AbstractAction
{
/**
* 品类商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
*/
public function indexAction()
{
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'brand' => FILTER_VALIDATE_INT,
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_VALIDATE_INT,
'price' => FILTER_VALIDATE_INT,
'discount' => FILTER_VALIDATE_INT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
// 性别参数,不传则从COOKIE获取
if (!isset($condition['gender'])) {
$condition['gender'] = Helpers::getGenderByCookie();
}
// 品类名称参数, 不传则默认为全部
$name = $this->get('sort_name');
if (empty($name)) {
$name = $this->get('title', '全部');
}
$this->setTitle($name);
$this->setNavHeader($name, true, SITE_MAIN);
$goodList = Product\ListModel::getClassData($condition);
if (!empty($condition)) {
$goodList = array_merge($goodList, $condition);
}
$this->_view->display('index', array(
'goodListPage' => true,
'goodList' => $goodList,
));
}
/**
* 品牌商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
*/
public function brandAction()
{
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
if (empty($domain)) {
$this->error();
}
/* 通过品牌域名找到对应的品牌ID */
$domainList = Product\ListModel::getAllBrandDomains();
$brandIds = array_keys($domainList, $domain);
if (!isset($brandIds[0])) {
$this->error();
}
// 当前的登录用户UID
$uid = $this->getUid();
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_VALIDATE_INT,
'price' => FILTER_VALIDATE_INT,
'discount' => FILTER_VALIDATE_INT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandIds[0];
// 存标题信息
$title = '';
$data = Product\ListModel::getBrandData($condition, $brandIds[0], $uid, $title);
if (!empty($condition)) {
$data = array_merge($data, $condition);
}
$data['goodListPage'] = true;
$this->setTitle($title);
$this->setNavHeader($title, true, SITE_MAIN);
$this->_view->display('index', $data);
}
}
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Product\SearchData;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Category\ClassData;
use Category\ClassModel;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
/**
* 商品列表页
*/
class ListController extends AbstractAction
{
/**
* 搜索列表页
*/
public function indexAction()
{
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->getCookie('_Channel', 'boys');
$p_d = $this->get('p_d', null);
$misort = $this->get('misort', null);
$msort = $this->get('msort', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navTitle' => '搜索',
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array(
'brand' => 0,
'msort' => 0,
'gender' => $gender,
'price' => 0,
'size' => 0,
'discount' => ''
)
);
// 首先查询是否属于内置品类
$classes = ClassModel::getClassesArr();
$classFlag = array_search($query, $classes);
if($classFlag !== false)// 属于内部品类
{
$data['pageHeader']['navTitle'] = '所有'.$query;
}
// 如果存在搜索字符串就显示搜索栏
if(!is_null($query) && $classFlag === false)
{
$data['search'] = array(
'default' => $query
);
}
// 转换性别
$this->genderTrans($gender);
// 查询数据
$listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
// 如果存在品牌信息就显示品牌字段
if(isset($tmpData['brand']) && !empty($tmpData['brand']))
{
$brandData = $tmpData['brand'];
$data['brandWay'] = array(
'url' => '/product/list/brand?brand='.$brandData['id'],
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
// 设置品牌默认值
$data['goodList']['brand'] = $brandData['id'];
}
$data['goodList'] += ListProcess::getListData($tmpData);
}
$this->_view->display('index', $data);
}
/**
* Ajax异步筛选请求
*/
public function searchAction()
{
if($this->isAjax())
{
$query = $this->get('query', null);
$brand = $this->get('brand', null);
$gender = $this->get('gender', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$sort = $this->get('msort', null);
// 转换性别
$this->genderTrans($gender);
// 转换排序方式
$order = $this->get('order', null);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$data = array();
// 查询数据
$listData = SearchData::searchLiDatas($query, $brand, $gender, $color, $size, $price, $p_d, $sort, $order);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
unset($tmpData['filter']);// 不要筛选条件的数据
$data = ListProcess::getListData($tmpData);
}
if(empty($data))
{
echo ' ';
}
else
{
$this->_view->display('list', $data);
}
}
}
/**
* 品牌商品列表页
*/
public function brandAction()
{
$brand = $this->get('brand', null);
$gender = $this->getCookie('_Channel', 'boys');
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array(
'brandHome' => array(
'id' => $brand
),
'brand' => $brand,
'msort' => 0,
'gender' => $gender,
'sort' => 0,
'price' => 0,
'size' => 0,
'discount' => '',
'p_d' => ''
)
);
// 获取品牌介绍信息
$introData = BrandData::getBrandIntro($brand);
if(isset($introData['code']) && $introData['code'] === 200)
{
$data['goodList']['brandHome']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
}
// 获取品牌banner的数据
$uid = $this->getUid();
$bannerData = BrandData::getBrandBanner($brand, $uid);
if(isset($bannerData['code']) && $bannerData['code'] === 200)
{
$data['goodList']['brandHome']['banner'] = isset($bannerData['data']['banner']) ? Helpers::getImageUrl($bannerData['data']['banner'], 640, 75) : '';
}
// 查询数据
// 转换性别
$this->genderTrans($gender);
$listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
// 设置品牌名称
$data['pageHeader']['navTitle'] = isset($tmpData['brand_name']) ? $tmpData['brand_name'] : '';
$data['goodList'] += ListProcess::getListData($tmpData);
}
$this->_view->display('index', $data);
}
/**
* 品类商品列表页
*/
public function classAction()
{
$brand = $this->get('brand', null);
$gender = $this->getCookie('_Channel', 'boys');
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$data = array(
'pageHeader' => array(
'navBack' => true,
'navHome' => '/'
),
'goodListPage' => true,
'goodList' => array(
'brand' => 0,
'msort' => 0,
'gender' => $gender,
'sort' => $sort,
'price' => 0,
'size' => 0,
'discount' => ''
)
);
// 根据id查询类的名称
$classes = ClassModel::getClassesArr();
$data['pageHeader']['navTitle'] = isset($classes[$sort]) ? $classes[$sort] : '';
// 查询数据
// 转换性别
$this->genderTrans($gender);
$listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
// 处理返回的数据
if (isset($listData['code']) && $listData['code'] === 200) {
$tmpData = $listData['data'];
$data['goodList'] += ListProcess::getListData($tmpData);
}
$this->_view->display('index', $data);
}
/**
* 性别数据转换
*
* @param string &$gender 从cookie中获取的gender值,最后得到转换之后接口调用的值
*/
private function genderTrans(&$gender)
{
if($gender === 'boys')
{
$gender = '1,3';
}
elseif($gender === 'girls')
{
$gender = '2,3';
}
else
{
$gender = '1,2,3';
}
}
}
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use LibModels\Wap\Product\NewsaleData;
use Product\NewsaleModel;
use Plugin\Helpers;
/**
* 新品到着
... ... @@ -20,8 +21,7 @@ class NewsaleController extends AbstractAction
$this->setTitle('新品到着');
$this->setNavHeader('新品到着');
$channel = $this->getCookie('_Channel', 'boys');
$this->channelTrans($channel);
$channel = Helpers::getChannelByCookie();
$data = array();
$data['newArrivalPage'] = true;
... ... @@ -34,7 +34,7 @@ class NewsaleController extends AbstractAction
$data += array(
'brand' => 0,
'msort' => 0,
'gender' => $this->getCookie('_Channel', 'boys'),
'gender' => Helpers::getGenderByCookie(),
'price' => 0,
'size' => 0,
'dayLimit' => 1,
... ... @@ -54,9 +54,8 @@ class NewsaleController extends AbstractAction
$this->setTitle('折扣专区');
$this->setNavHeader('Sale');
$channel = $this->getCookie('_Channel', 'boys');
$this->channelTrans($channel);
$channel = Helpers::getChannelByCookie();
$data = array();
$data['discountPage'] = true;
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
... ... @@ -68,7 +67,7 @@ class NewsaleController extends AbstractAction
$data += array(
'brand' => 0,
'msort' => 0,
'gender' => $this->getCookie('_Channel', 'boys'),
'gender' => Helpers::getGenderByCookie(),
'price' => 0,
'size' => 0,
'discount' => '0.1,0.9'
... ... @@ -92,7 +91,6 @@ class NewsaleController extends AbstractAction
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$channel = $this->getCookie('_Channel', 'boys');
$dayLimit = $this->get('dayLimit', null);
$limit = $this->get('limit', 60);
$page = $this->get('page', 1);
... ... @@ -128,7 +126,7 @@ class NewsaleController extends AbstractAction
}
// 转换频道
$this->channelTrans($channel);
$channel = Helpers::getChannelByCookie();
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color,
... ... @@ -149,28 +147,4 @@ class NewsaleController extends AbstractAction
}
}
/**
* 转换频道
* @param string &$channel 待转换的频道
* @return integer 转换之后的频道
*/
private function channelTrans(&$channel)
{
switch ($channel) {
case 'girls':
$channel = 2;
break;
case 'kids':
$channel = 3;
break;
case 'lifestyle':
$channel = 4;
break;
case 'boys':
default:
$channel = 1;
break;
}
}
}
... ...
<?php
/**
*
* @name Opt
* @package
* @copyright yoho.inc
* @version 1.0 (2015-10-27 19:13:28)
* @author fei.hong <fei.hong@yoho.cn>
*/
class Opt
{
}
... ...
; 标签聚合列表
routes.tag.type = "rewrite"
routes.tag.match = "/tags/index"
routes.tag.route.module = Guang
routes.tag.route.controller = Index
routes.tag.route.action = Tag
; 作者聚合列表
routes.author.type = "rewrite"
routes.author.match = "/author/index"
routes.author.route.module = Guang
routes.author.route.controller = Index
routes.author.route.action = Editor
... ...
; 默认页
routes.index.type = "rewrite"
routes.index.match = "/index.html$"
routes.index.match = "/index.html"
routes.index.route.module = Index
routes.index.route.controller = Index
routes.index.route.action = Index
; 错误页
routes.error.type = "rewrite"
routes.error.match = "/error.html$"
routes.error.match = "/error.html"
routes.error.route.module = Index
routes.error.route.controller = Error
routes.error.route.action = Index
; 搜索页
routes.reg.type = "rewrite"
routes.reg.match = "/search.html"
routes.reg.route.module = Index
routes.reg.route.controller = Search
routes.reg.route.action = Index
; 注册页
routes.reg.type = "rewrite"
routes.reg.match = "/reg.html$"
routes.reg.match = "/reg.html"
routes.reg.route.module = Passport
routes.reg.route.controller = Reg
routes.reg.route.action = Index
; 登录页
routes.login.type = "rewrite"
routes.login.match = "/signin.html$"
routes.login.match = "/signin.html"
routes.login.route.module = Passport
routes.login.route.controller = Login
routes.login.route.action = Index
; 登录页(国际账号)
routes.interational.type = "rewrite"
routes.interational.match = "/login.html$"
routes.interational.match = "/login.html"
routes.interational.route.module = Passport
routes.interational.route.controller = Login
routes.interational.route.action = International
; 找回密码(手机号)
routes.phoneback.type = "rewrite"
routes.phoneback.match = "/phoneback.html$"
routes.phoneback.match = "/phoneback.html"
routes.phoneback.route.module = Passport
routes.phoneback.route.controller = Back
routes.phoneback.route.action = Mobile
; 找回密码(邮箱)
routes.emailback.type = "rewrite"
routes.emailback.match = "/emailback.html$"
routes.emailback.match = "/emailback.html"
routes.emailback.route.module = Passport
routes.emailback.route.controller = Back
routes.emailback.route.action = Email
; 所有品类
routes.cate.type = "rewrite"
routes.cate.match = "/cate"
routes.cate.route.module = Category
routes.cate.route.controller = Class
routes.cate.route.action = Index
; 品牌一览
routes.brands.type = "rewrite"
routes.brands.match = "/brands"
routes.brands.route.module = Category
routes.brands.route.controller = Brand
routes.brands.route.action = Index
; 新品到着(NEW)
routes.productnew.type = "rewrite"
routes.productnew.match = "/product/new"
routes.productnew.route.module = Product
routes.productnew.route.controller = Newsale
routes.productnew.route.action = Index
; 折扣专区(SALE)
routes.productsale.type = "rewrite"
routes.productsale.match = "/sale"
routes.productsale.route.module = Product
routes.productsale.route.controller = Newsale
routes.productsale.route.action = Discount
... ...
... ... @@ -4,6 +4,7 @@ use Yaf\Application;
define('SITE_MAIN', 'http://m.dev.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.m.dev.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.dev.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
... ...
... ... @@ -4,6 +4,7 @@ use Yaf\Application;
define('SITE_MAIN', 'http://buy.test.yoho.cn'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.test.yoho.cn'); // COOKIE作用域
define('SUB_DOMAIN', '.test.yoho.cn'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
... ...
... ... @@ -4,6 +4,7 @@ use Yaf\Application;
define('SITE_MAIN', 'http://mtesth5.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
... ...