Authored by uedxwg

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

... ... @@ -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'];
}
}
... ...
... ... @@ -155,7 +155,7 @@ class TemplateLayout implements View_Interface
$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的模板格式
'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
... ...
... ... @@ -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'
... ...
... ... @@ -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);
... ...
... ... @@ -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) {
... ...
... ... @@ -99,7 +99,7 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart(self::CODE_BG);
if (isset($banner['data'][0]['data']['list'][0]['src'])) {
$result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2);
$result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 1);
}
if (USE_CACHE) {
... ...
<?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])) {
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,6 +4,8 @@ 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;
... ... @@ -29,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, '&');
}
... ... @@ -63,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;
}
}
... ...
... ... @@ -25,7 +25,7 @@ class OptController extends AbstractAction
*/
public function favoriteBrandAction()
{
$result = array('code' => 400, 'message' => '未登录', 'data' => false);
$result = array('code' => 401, 'message' => '未登录', 'data' => false);
do {
/* 判断是否是AJAX请求 */
... ... @@ -54,13 +54,16 @@ class OptController extends AbstractAction
/* 收藏 */
$result = BrandData::favorite($id, $uid);
if (!isset($result['code'])) {
break;
}
while (false);
if (isset($result['code']) && $result['code'] == 412) {
/* 未登录的情况,加跳转链接 */
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);
}
... ...