Authored by xuqi

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

Showing 35 changed files with 327 additions and 333 deletions
... ... @@ -3,9 +3,11 @@ nbproject
.idea
.gitignore
.gitmodules
compile/
assets/
compile
assets
script/nginx/logs
npm-debug.log
composer.lock
vendor/
.jscsrc
.jshintrc
\ 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.6/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.6/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/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.6/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.6/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/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
... ... @@ -210,7 +210,7 @@ class Yohobuy
* @param int $timeout 超时时间,单位是秒
* @return array
*/
public static function getMulti($urlList = array(), $options = array(), $cache = false, $timeout = 3)
public static function getMulti($urlList = array(), $options = array(), $cache = false, $timeout = 5)
{
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
... ...
... ... @@ -40,6 +40,7 @@ class CacheConfig
const KEY_ACTION_PRODUCT_BRAND_NAMES = 'key_action_product_brand_names'; // 所有品牌名称列表
const KEY_ACTION_PRODUCT_BRAND_LOGO = 'key_action_product_brand_logo'; // 品牌信息
const KEY_ACTION_INDEX_SEARCH = 'key_action_search_search'; // 搜索的数据
const KEY_ACTION_SEARCH_SEARCH = 'key_action_search_search'; // 搜索的数据
const KEY_ACTION_SEARCH_FILTER = 'key_action_search_filter'; // 搜索的过滤条件
}
... ...
... ... @@ -143,7 +143,8 @@ class SearchData
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
if (!isset($orderMaps[ $condition['order'] ] )) {
// $param['needFilter'] = 1; // 是否需要返回筛选条件
if (!isset($condition['order'])) {
$param['order'] = $orderMaps['s_t_desc'];
} else {
$param['order'] = $orderMaps[ $condition['order'] ];
... ...
... ... @@ -59,12 +59,9 @@ class FloorProcess
{
$result = array();
foreach ($data as &$one) {
$one['url'] = Helpers::getFilterUrl($one['url']);
$one['img'] = Helpers::getImageUrl($one['src'], 640, 310);
unset($one['src']);
foreach ($data as $one) {
$result['bannerTop']['list'][] = Helpers::formatBanner($one, 640, 240);
}
$result['bannerTop']['list'] = $data;
return $result;
}
... ...
... ... @@ -197,6 +197,8 @@ class ListProcess
foreach ($result['subs'] as &$val) {
if ($val['dataId'] === $gender) {
$val['chosed'] = true;
$result['name'] = $val['name'];
}
}
... ...
... ... @@ -154,11 +154,11 @@ class TemplateLayout implements View_Interface
else {
$template = file_get_contents($viewName, false, null);
$phpStr = LightnCandy::compile($template, array(
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags' => LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
'fileext' => array($tplExt), // 允许查找文件的后缀
'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags' => LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
'fileext' => array($tplExt), // 允许查找文件的后缀
'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
));
// 文件流方式读取PHP方法
$renderer = LightnCandy::prepare($phpStr);
... ...
... ... @@ -14,12 +14,15 @@ var swiper,
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
searchArray = [];
var brandsData,
$keyword,
searchBtnHammer,
clearTextHammer;
clearTextHammer,
removeHistory,
searchList,
yohoHistory;
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
... ... @@ -31,7 +34,8 @@ swiper = new Swiper('.swiper-container', {
lazyLoad($('img.lazy'));
$('.yoho-header').css({
'z-index': 2,
position: 'fixed'
position: 'fixed',
top: 0
});
$(window).scroll(function() {
... ... @@ -96,12 +100,15 @@ function searchResult() {
brandHtml.push(k);
brandHtml.push('</h2></div>');
$.each(v, function(i, brand) {
brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
// brandHtml.push('<p><span>' + brand.name);
if (brand.isNew) {
brandHtml.push('<i class="icon-hot">Hot</i>');
brandHtml.push('<i class="icon-hot">HOT</i>');
}
if (brand.isHot) {
brandHtml.push('<i class="icon-new">New</i>');
brandHtml.push('<i class="icon-new">NEW</i>');
}
brandHtml.push('</a></p>');
});
... ... @@ -127,6 +134,20 @@ function searchResult() {
if (Object.keys(result).length > 0) {
rightBarBindClick();
}
$('.search-result .brand-list p').each(function (index) {
searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]);
searchList.on('tap', function() {
if (localStorage.getItem('yohoHistory')) {
yohoHistory = localStorage.getItem('yohoHistory');
searchArray.push(yohoHistory);
}
searchArray.push('{"searchName":"' +
$('.search-result .brand-list p').eq(index).find('a').html() +
'","searchHref":"' + $('.search-result .brand-list p')
.eq(index).find('a').attr('href') + '"}');
localStorage.setItem('yohoHistory', searchArray);
});
});
}
if ($('.brand-search-page').length) {
... ... @@ -134,6 +155,7 @@ if ($('.brand-search-page').length) {
$keyword = $('#keyword');
$keyword.on('input', function() {
$('.history').css('display', 'none');
if ($keyword.val().length) {
searchResult();
$(this).closest('.search-box').css('width', '11.25rem');
... ... @@ -142,14 +164,7 @@ if ($('.brand-search-page').length) {
$(this).closest('.search-box').css('width', '12.5rem');
$('.search-action').hide();
}
});
searchBtnHammer = new Hammer($('.search-btn')[0]);
searchBtnHammer.on('tap', function(e) {
searchResult();
e.srcEvent.stopPropagation();
});
}).focus();
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
... ... @@ -160,16 +175,18 @@ if ($('.brand-search-page').length) {
$('form.search-box').on('submit', function() {
return false;
});
if (localStorage && localStorage.getItem('yohoHistory')) {
yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']');
if (yohoHistory) {
$.each(yohoHistory, function(index, content) {
$('<a href="' + content.searchHref + '">' + content.searchName + '</a>').appendTo('.historyList');
});
}
}
// clearHistoryHammer = new Hammer($('#clear-text')[0]);
// clearHistoryHammer.on('tap', function() {
// // setcookie('h_brands', '', {
// // expire: -1,
// // path: '/',
// // domain: '.m.yohobuy.com'
// // });
// $('#history-keyword').remove();
// $(this).hide();
// });
removeHistory = new Hammer($('.removeHistory')[0]);
removeHistory.on('tap', function(e) {
$('.historyList').html(' ');
localStorage.clear();
});
}
... ...
... ... @@ -10,7 +10,7 @@ var $searchBox = $('.search-box'),
function showBigSearch() {
$indexLogo.css({
width: 0
opacity: 0
});
$searchBox.css({
width: '12.8rem'
... ... @@ -23,7 +23,7 @@ function showBigSearch() {
function hideBigSearch() {
$indexLogo.css({
width: '5.4rem'
opacity: 1
});
$searchBox.css({
width: '8.8rem'
... ...
... ... @@ -290,6 +290,7 @@ navHammer.on('tap', function(e) {
navType,
$active;
e.preventDefault();
if ($this.hasClass('filter')) {
//筛选面板切换状态
... ...
{
"name": "yohobuy",
"version": "0.0.6",
"version": "0.0.9",
"description": "yohobuy statics",
"keywords": [],
"homepage": "",
... ...
... ... @@ -47,7 +47,7 @@
color: #fff;
}
.limit-tag {
width: 90rem / $pxConvertRem;
width: 100rem / $pxConvertRem;
border: 1px solid #000;
color: #000;
}
... ...
.brand-page {
.newbrand-search {
.newbrand-search {
width: 93.75%;
height: 60rem / $pxConvertRem;
padding: 14rem / $pxConvertRem 3.125%;
... ... @@ -9,27 +9,28 @@
top: 88rem / $pxConvertRem;
position: fixed;
z-index: 2;
.search-box {
position: relative;
width: 500rem / $pxConvertRem;//450
width: 500rem / $pxConvertRem; //450
height: 60rem / $pxConvertRem;
background-color: #FFF;
border-radius: 30rem / $pxConvertRem;
padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem;
a {
width: 100%;
height: 60rem / $pxConvertRem;
border: 0;
display: block;
span{
a {
width: 100%;
height: 60rem / $pxConvertRem;
border: 0;
display: block;
span {
line-height: 60rem / $pxConvertRem;
color: #bdbdbd;
font-size: 1.2em;
padding-left: 18rem / $pxConvertRem;
}
}
}
}
.search-icon {
position: absolute;
font-size: 24rem / $pxConvertRem;
... ... @@ -38,6 +39,7 @@
line-height: 60rem / $pxConvertRem;
color: #bdbdbd;
}
.search-input {
border: none;
width: 95%;
... ... @@ -45,6 +47,7 @@
line-height: 1;
padding: 0 10rem / $pxConvertRem;
}
.search-action {
display: none;
position: absolute;
... ... @@ -54,11 +57,15 @@
line-height: 60rem / $pxConvertRem;
color: #666;
}
.cancel-btn {
display: inline;
}
.clear-text {
margin-right: 20rem / $pxConvertRem;
}
}
}
.banner-top {
... ... @@ -67,14 +74,15 @@
.hot-brand {
margin: (30rem / $pxConvertRem) 0 0;
.hot-brand-list {
background: #fff;
background: #fff;
li {
float: left;
width: 158rem / $pxConvertRem;
height: 158rem / $pxConvertRem;
.img-box {
display: table-cell;
vertical-align: middle;
... ... @@ -91,11 +99,11 @@
.title-bar {
width: 100%;
background: #eeeeee;
color: #999999;
// font-weight: bold;
position: relative;
h2 {
h2 {
// width: 100%;
padding: 0 20rem / $pxConvertRem;
height: 50rem / $pxConvertRem;
... ... @@ -105,11 +113,12 @@
background-color: #f4f4f4;
}
}
p {
cursor: pointer;
// height: 50rem / $pxConvertRem;
padding: 0 20rem / $pxConvertRem;
a {
display: block;
// padding-top: 10rem / $pxConvertRem;
... ... @@ -117,7 +126,8 @@
line-height: 76rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
border-bottom: 1px solid #f3f3f3;
border-top: 1px solid #f9f9f9;
border-top: 1px solid #f9f9f9;
i {
display: inline-block;
margin-top: -4rem / $pxConvertRem;
... ... @@ -129,11 +139,14 @@
font-size: 18rem / $pxConvertRem;
line-height: 38rem / $pxConvertRem;
color: #fff;
border-radius: 50rem / $pxConvertRem;;
border-radius: 50rem / $pxConvertRem;
;
}
.icon-hot {
background: #ff0000;
}
.icon-new {
background: #86c048;
}
... ... @@ -141,32 +154,82 @@
}
}
.right-bar {
width: 60rem / $pxConvertRem;
height: 75%;
top: 20%;
overflow: auto;
position: fixed;
right: 2rem / $pxConvertRem;
border-radius: 12rem / $pxConvertRem;
background: rgba(0,0,0,.8);
z-index: 2;
b {
height: 36rem / $pxConvertRem;
line-height: 36rem / $pxConvertRem;
text-align: center;
display: block;
color: #999999;
font-weight: bold;
}
}
.con {
padding-top: 10rem / $pxConvertRem;
.right-bar {
width: 60rem / $pxConvertRem;
height: 75%;
top: 20%;
overflow: auto;
position: fixed;
right: 2rem / $pxConvertRem;
border-radius: 12rem / $pxConvertRem;
background: rgba(0, 0, 0, .8);
z-index: 2;
b {
height: 36rem / $pxConvertRem;
line-height: 36rem / $pxConvertRem;
text-align: center;
display: block;
color: #999999;
font-weight: bold;
}
}
.right-bar::-webkit-scrollbar {
display: none;
}
.con {
padding-top: 10rem / $pxConvertRem;
}
.search-result {
padding-top: 176rem / $pxConvertRem;
}
}
\ No newline at end of file
}
.history{
width: 100%;
height: auto;
overflow: hidden;
position: absolute;
left: 0;
top: 176rem / $pxConvertRem;
> h6{
width: 100%;
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
color: #999;
text-indent: .6rem;
font-size: 36em / $pxConvertRem;
}
.historyList{
width: 100%;
height: auto;
overflow: hidden;
display: block;
> a{
width: auto;
height: 58rem / $pxConvertRem;
overflow: hidden;
line-height: 58rem / $pxConvertRem;
margin: 0 0 20rem / $pxConvertRem .6rem;
padding: 0 20rem / $pxConvertRem;
float: left;
background-color:#f8f8f8;
color: #444;
}
}
> span{
width: auto;
height: 68rem / $pxConvertRem;
overflow: hidden;
display: inline-block;
line-height: 68rem / $pxConvertRem;
border:1px solid #e6e6e6;
padding: 0 28rem / $pxConvertRem;
font-size: 48em / $pxConvertRem;
margin-left: .6rem;
color: #000;
}
}
... ...
... ... @@ -50,7 +50,6 @@
width: 191rem / $pxConvertRem;
height: 191rem / $pxConvertRem;
border-left: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.first-show {
display: none;
}
... ... @@ -85,7 +84,7 @@
font-size: 22rem / $pxConvertRem;
}
}
// li:nth-child(4), li:nth-child(5) {
// border-top: 1px solid #e0e0e0;
// }
li:nth-child(4), li:nth-child(5) {
border-top: 1px solid #e0e0e0;
}
}
\ No newline at end of file
... ...
... ... @@ -13,8 +13,8 @@
font-size: 50rem / $pxConvertRem;
width: 216rem / $pxConvertRem;
color: #343434;
overflow: hidden;
transition: width 400ms;
opacity: 1;
transition: all 400ms;
}
.index-search {
... ... @@ -22,7 +22,8 @@
top: 0;
right: 0;
width: 384rem / $pxConvertRem;
height: 112rem / $pxConvertRem;
height: 96rem / $pxConvertRem;
background: #fff;
overflow: hidden;
z-index: 3;
@include transition(width .4s);
... ...
... ... @@ -39,10 +39,10 @@
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">Hot</i>
<i class="icon-hot">HOT</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">New</i>
<i class="icon-new">NEW</i>
{{/ isNew}}
</a>
</p>
... ...
... ... @@ -6,14 +6,20 @@
<i class="search-icon iconfont">&#xe60f;</i>
<div class="search-action">
<span class="iconfont clear-text">&#xe623;</span>
<span class="search-btn">搜索</span>
<a class="cancel-btn" href="javascript: history.go(-1);">取消</span>
</div>
</form>
</div>
<div class="history">
<h6>历史纪录</h6>
<div class="historyList">
</div>
<span class='removeHistory'>清空搜索历史</span>
</div>
<div class="search-result">
</div>
</div>
<script id="brands-data" type="text/tmpl">
{{{brandList}}}
</script>
... ...
... ... @@ -20,7 +20,7 @@ class KidsController extends AbstractAction
// 设置网站标题
$this->setTitle('潮童首页');
// 显示侧边栏
$this->setNavSide();
$this->setNavSide('kids');
// 显示底部TAB
$this->setNavFooterTab();
... ...
... ... @@ -20,7 +20,7 @@ class LifestyleController extends AbstractAction
// 设置网站标题
$this->setTitle('创意生活首页');
// 显示侧边栏
$this->setNavSide();
$this->setNavSide('lifestyle');
// 显示底部TAB
$this->setNavFooterTab();
... ...
... ... @@ -291,7 +291,7 @@ class SearchController extends AbstractAction
}
// 区别各种列表页面的筛选数据
$data = Product\FilterModel::getFilterData($condition);
$data = Product\SearchModel::getFilterData($condition);
}
if (empty($data)) {
... ...
... ... @@ -60,8 +60,18 @@ class BrandModel
// 搜索链接地址
$result['searchUrl'] = Helpers::url('/brands/search', null);
/* 顶部的轮翻广告列表 */
if (!empty($brand['brandTop'][0]['data'])) {
/* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */
if (!empty($brand['brandTop'][0]['data']['list'])) {
$build = array();
foreach ($brand['brandTop'][0]['data']['list'] as $value) {
$build['url'] = Helpers::getFilterUrl($value['url']);
$build['img'] = Helpers::getImageUrl($value['src'], 144, 144);
$build['name'] = $value['name'];
$result['hotBrand']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop'][0]['data'])) {
$build = array();
foreach ($brand['brandTop'][0]['data'] as $value) {
$build['url'] = Helpers::getFilterUrl($value['url']);
... ... @@ -71,7 +81,7 @@ class BrandModel
}
}
/* 顶部的热门品牌列表 */
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if (!empty($brand['brandTop'][1]['data']['list'])) {
$build = array();
foreach ($brand['brandTop'][1]['data']['list'] as $value) {
... ...
... ... @@ -52,6 +52,17 @@ class ClassModel
$item = array();
$item['name'] = $val['category_name'];
$item['id'] = $val['relation_parameter']['sort'];
// 首先添加一级分类
$item['sub'][] = array(
'name' => '全部'.$item['name'],
'id' => $item['id'],
'url' => Helpers::url('/', array(
'sort' => $item['id'],
'sort_name' => $item['name']), 'list')
);
$subitem = array();
foreach ($val['sub'] as $value) {
$subitem = array();
$subitem['name'] = $value['category_name'];
... ...
... ... @@ -77,6 +77,16 @@ class SideModel
*/
private static function genLeftNavGuang($guangChoosed = 'all')
{
// 判断逛的背景色
$color = false;
if($guangChoosed === 'girls') {
$color = '#FF88AE';
} else if($guangChoosed === 'kids') {
$color = '#7ad9f9';
} else if($guangChoosed === 'lifestyle') {
$color = '#4f4138';
}
return array(
'textCn' => '逛',
'textEn' => 'TRENDFINDER',
... ... @@ -88,7 +98,7 @@ class SideModel
'textEn' => 'TrendFinder',
'back' => true,
'isSelect' => false,
'bgColor' => ($guangChoosed === 'girls') ? '#FF88AE' : false,
'bgColor' => $color,
),
1 => array(
'textCn' => '查看全部',
... ...
<?php
namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Product\SearchData;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Category\ClassData;
use Plugin\DataProcess\ListProcess;
/**
* 搜索相关的模板数据模型
*
* @name Filter
* @package Product
* @copyright yoho.inc
* @version 1.0 (2015-11-1 17:35:52)
*/
class FilterModel
{
/**
* 获取筛选的数据
*
* @param array $condition 查询条件
* @return array
*/
public static function getFilterData($condition)
{
$result = array();
// 区别各种列表页面的筛选数据
if (isset($condition['brand'])) {
$listData = BrandData::filterBrandData($condition);
} else if(isset($condition['sort'])) {
$listData = ClassData::filterClassData($condition);
} else {
$listData = SearchData::searchByCondition($condition);
}
if (isset($listData['data']) && isset($listData['data']['filter'])) {
$result['filter'] = ListProcess::getFilterData($listData['data']['filter']);
}
return $result;
}
}
... ... @@ -183,8 +183,14 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
if(count($newsale['data'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
}
}
}
if (USE_CACHE) {
... ...
... ... @@ -4,7 +4,10 @@ namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Product\SearchData;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Category\ClassData;
use Plugin\DataProcess\ListProcess;
use Plugin\Cache;
/**
* 搜索相关的模板数据模型
... ... @@ -28,7 +31,7 @@ class SearchModel
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_INDEX_SEARCH;
$key = CacheConfig::KEY_ACTION_SEARCH_SEARCH;
if (!empty($condition)) {
$key .= http_build_query($condition, null, '&');
}
... ... @@ -40,7 +43,7 @@ class SearchModel
}
// 调用接口查询数据 (使用新的 Elastic Engine)
$listData = SearchData::searchElasticByCondition($condition);
$listData = SearchData::searchElasticByCondition($condition);
// 调用接口查询数据 (使用老的 Sphinx Engine)
// $listData = SearchData::searchByCondition($condition);
// 处理返回的数据
... ... @@ -62,4 +65,53 @@ class SearchModel
return $result;
}
/**
* 获取筛选的数据
*
* @param array $condition 查询条件
* @return array
*/
public static function getFilterData($condition)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_SEARCH_FILTER;
if (!empty($condition)) {
$key .= http_build_query($condition, null, '&');
}
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
// 区别各种列表页面的筛选数据
if (isset($condition['brand'])) {
$listData = BrandData::filterBrandData($condition);
} else if (isset($condition['sort'])) {
$listData = ClassData::filterClassData($condition);
} else {
$listData = SearchData::searchByCondition($condition);
}
if (isset($listData['data']['filter'])) {
$result['filter'] = ListProcess::getFilterData($listData['data']['filter']);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 1800); // 缓存30分钟
}
}
return $result;
}
}
... ...
... ... @@ -209,7 +209,7 @@ class BackController extends AbstractAction
'phoneNum' => $phoneNum
);
$this->_view->assign('title', 'YOHO!有货');
$this->setTitle('找回密码-通过手机号');
$this->_view->display('mobile-code', $data);
}
... ... @@ -246,6 +246,11 @@ class BackController extends AbstractAction
// 邮箱验证码
$code = $this->get('code', '');
// 判断是否允许访问, 不允许则跳转到错误页面
if ((!$token || !Helpers::verifyMobile($phoneNum)) && !$code) {
$this->error();
}
$data = array(
'backUrl' => '/signin.html',
... ... @@ -258,7 +263,7 @@ class BackController extends AbstractAction
'code' => $code
);
$this->_view->assign('title', 'YOHO!有货');
$this->setTitle('找回密码-输入新密码');
$this->_view->display('new-password', $data);
}
... ...
... ... @@ -249,6 +249,11 @@ class RegController extends AbstractAction
if (!Helpers::verifyToken($mobile, $token)) {
break;
}
/* 判断密码是否符合规则 */
if (!Helpers::verifyPassword($password)) {
break;
}
/* 验证注册的标识码是否有效 */
$data = RegData::regMobile($area, $mobile, $password);
... ...
... ... @@ -15,7 +15,7 @@ use Plugin\Helpers;
*/
class OptController extends AbstractAction
{
/**
* 品牌[店铺]收藏/取消收藏
*
... ... @@ -25,44 +25,47 @@ class OptController extends AbstractAction
*/
public function favoriteBrandAction()
{
$result = array('code' => 400, 'message' => '未登录', 'data' => false);
$result = array('code' => 401, 'message' => '未登录', 'data' => false);
do {
/* 判断是否是AJAX请求 */
if (!$this->isAjax()) {
break;
}
/* 判断品牌ID是否有效 */
$id = $this->post('id');
if (!is_numeric($id)) {
break;
}
/* 判断用户是否登录 */
$uid = $this->getUdid();
if (!$uid) {
break;
}
/* 取消收藏 */
$opt = $this->post('opt', 'ok');
if ($opt !== 'ok') {
$result = BrandData::favoriteCancel($id, $uid);
break;
}
/* 收藏 */
$result = BrandData::favorite($id, $uid);
}
while (false);
if (isset($result['code']) && $result['code'] == 412) {
$referer = $this->server('HTTP_REFERER', SITE_MAIN);
$result['data'] = Helpers::url('/signin.html', array('refer' => $referer));
}
if (!isset($result['code'])) {
break;
}
/* 未登录的情况,加跳转链接 */
if ($result['code'] == 412 || $result['code'] == 400) {
$referer = $this->server('HTTP_REFERER', SITE_MAIN);
$result['data'] = Helpers::url('/signin.html', array('refer' => $referer));
}
} while (false);
$this->echoJson($result);
}
}
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.6"
application.version = "0.0.9"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.6"
application.version = "0.0.9"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.6"
application.version = "0.0.9"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.6"
application.version = "0.0.9"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
... ...