Authored by hf

do fixes bug refs YW-797

<!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://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/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://cdn.yoho.cn/myohobuy/0.0.2/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/0.0.2/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
... ...
... ... @@ -20,4 +20,7 @@ class CacheConfig
const KEY_ACTION_PRODUCT_NEWSALE_INDEX = 'key_action_product_newsale_index'; // 新品到着
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT = 'key_action_product_newsale_discount'; // 折扣专区
const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选
const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创
}
... ...
... ... @@ -24,7 +24,45 @@ class PlusstarData
const URI_BRANDINFO_ARTICLE = 'guang/service/v1/article/';
/**
* 品牌列表
* 国际优选-品牌列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param string $channel 1表示男, 2表示女
* @return array(
* "star" => array(推荐品牌列表数据),
* "original" => array(所有品牌列表数据)
* )
*/
public static function firstBrandList($gender, $channel)
{
// 存放接口列表
$urlList = array();
// 接口调用的URL
$url = Yohobuy::SERVICE_URL . self::URI_BRANDLIST;
// 公共的参数
$param = Yohobuy::param();
$param['brand_type'] = '1';
$param['gender'] = $gender;
$param['yh_channel'] = $channel;
// 构建推荐的品牌参数及调用接口的URL
$build = $param;
$build['is_recommend'] = '1';
$build['client_secret'] = Sign::getSign($build);
$urlList['recom'] = Yohobuy::httpBuildQuery($url, $build);
// 构建所有的品牌参数及调用接口的URL
$build = $param;
$build['is_recommend'] = '0';
$build['client_secret'] = Sign::getSign($build);
$urlList['all'] = Yohobuy::httpBuildQuery($url, $build);
return Yohobuy::getMulti($urlList);
}
/**
* 明星原创-品牌列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param string $channel 1表示男, 2表示女
... ... @@ -89,8 +127,7 @@ class PlusstarData
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)));
if (!isset($brandInfo['data']['brand_id'])) {
return $result;
}
else {
} else {
$result['getBrandInfo'] = $brandInfo;
}
... ... @@ -153,8 +190,7 @@ class PlusstarData
$i ++;
}
}
while (false);
} while (false);
// 调用发起请求
Yohobuy::yarConcurrentLoop();
... ...
{{>layout/header}}
<div class="ps-list-page ps-page yoho-page">
{{# ps}}
<ul id="nav-tab" class="nav-tab clearfix">
<li class="star-nav focus">推荐</li>
<li class="plus-nav">ALL</li>
</ul>
<div id="ps-content" class="ps-content">
<ul class="star-content content">
{{# star}}
{{> guang/ps_item}}
{{/ star}}
</ul>
<ul class="plus-content content hide">
{{# plus}}
{{> guang/ps_item}}
{{/ plus}}
</ul>
</div>
{{/ ps}}
</div>
{{>layout/footer}}
\ No newline at end of file
... ...
<?php
namespace Guang;
use Configs\CacheConfig;
use LibModels\Wap\Guang\PlusstarData;
use Plugin\Helpers;
/**
* 明星原创品牌相关的模板数据模型
*
* @name PlusstarModel
* @package models/Guang
* @copyright yoho.inc
* @version 1.0 (2015-10-23 15:30:00)
* @author fei.hong <fei.hong@yoho.cn>
*/
class PlusstarModel
{
/**
* 获取国际优先的品牌列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @return array
*/
public static function getFirstBrands($gender)
{
$channel = '1';
switch (strval($gender)) {
case '1,3': // 男
$channel = '1';
break;
case '2,3': // 女
$channel = '2';
break;
default: // 默认
$gender = '1,3';
$channel = '1';
break;
}
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_GUANG_PLUSSTAR_INDEX . $channel;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
$result = array();
$brandList = PlusstarData::firstBrandList($gender, $channel);
if (!empty($brandList['recom']['data']['list'][0]['data'])) {
$result['ps']['star'] = self::formatData($brandList['recom']['data']['list'][0]['data'], $gender, true);
$result['leftName'] = isset($brandList['recom']['data']['brand_type_name']) ? $brandList['recom']['data']['brand_type_name'] : '';
}
if (!empty($brandList['all']['data']['list'][0]['data'])) {
$result['ps']['plus'] = self::formatData($brandList['all']['data']['list'][0]['data'], $gender, true);
$result['rightName'] = isset($brandList['all']['data']['brand_type_name']) ? $brandList['all']['data']['brand_type_name'] : '';
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
}
return $result;
}
/**
* 获取明星原创的品牌列表
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @return array
*/
public static function getBrands($gender)
{
$channel = '1';
switch (strval($gender)) {
case '1,3': // 男
$channel = '1';
break;
case '2,3': // 女
$channel = '2';
break;
default: // 默认
$gender = '1,3';
$channel = '1';
break;
}
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_GUANG_PLUSSTAR_LIST . $channel;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
$result = array();
$brandList = PlusstarData::brandList($gender, $channel);
if (!empty($brandList['star']['data']['list'][0]['data'])) {
$result['ps']['star'] = self::formatData($brandList['star']['data']['list'][0]['data'], $gender, false);
$result['leftName'] = isset($brandList['star']['data']['brand_type_name']) ? $brandList['star']['data']['brand_type_name'] : '';
}
if (!empty($brandList['original']['data']['list'][0]['data'])) {
$result['ps']['plus'] = self::formatData($brandList['original']['data']['list'][0]['data'], $gender, true);
$result['leftName'] = isset($brandList['original']['data']['brand_type_name']) ? $brandList['original']['data']['brand_type_name'] : '';
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
}
return $result;
}
/**
* 格式化成模板数据格式
*
* @param array $data 源数据
* @param string $gender "1,3"表示男, "2,3"表示女
* @param bool $showDesciption 控制是否显示摘要内容
* @return array
*/
private static function formatData($data, $gender, $showSummary = true)
{
$result = array();
$build = array();
$imgs = array();
foreach ($data as $value) {
$build = array();
// 情况1: 多张图
if (isset($value['data'][1])) {
$imgs = array();
foreach ($value['data'] as $ps) {
$build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender;
$build['img'] = Helpers::getImageUrl($ps['src'], 640, 310);
$build['deps'] = $showSummary ? $value['brand_title'] : false;
$imgs[] = $build;
}
$result[] = array('imgs' => $imgs);
}
// 情况2: 单张图
elseif (isset($value['data'][0])) {
$build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender;
$build['img'] = Helpers::getImageUrl($value['data'][0]['src'], 640, 310);
$build['deps'] = $showSummary ? $value['brand_title'] : false;
$result[] = $build;
}
}
return $result;
}
}
... ...
... ... @@ -11,82 +11,39 @@ class PlusstarController extends AbstractAction
{
/**
* 品牌列表页
* 国际精选-品牌列表页
*
* @param int gender "1,3"表示男, "2,3"表示女
*/
public function listAction()
public function indexAction()
{
$data = array('psList' => true, 'ps' => array('star' => array(), 'plus' => array()));
$brandList = array();
$build = array();
$imgs = array();
$this->setTitle('国际优选');
$this->setNavHeader('国际优选', true, SITE_MAIN);
$gender = $this->get('gender', '1,3');
// 女
if ($gender === '2,3') {
$brandList = PlusstarData::brandList('2,3', 2);
}
// 男
else {
$brandList = PlusstarData::brandList('1,3', 1);
}
// 明星品牌列表
if (!empty($brandList['star']['data']['list'][0]['data'])) {
foreach ($brandList['star']['data']['list'][0]['data'] as $star) {
$imgs = array();
$build = array();
// 情况1: 多张图
if (isset($star['data'][1])) {
foreach ($star['data'] as $value) {
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$imgs[] = $build;
}
$data['ps']['star'][] = array('imgs' => $imgs);
}
// 情况2: 单张图
elseif (isset($star['data'][0])) {
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310);
$data['ps']['star'][] = $build;
}
}
}
$data = Guang\PlusstarModel::getFirstBrands($gender);
$data['psList'] = true; // 控制模板中的JS使用
// 原创品牌列表
if (!empty($brandList['original']['data']['list'][0]['data'])) {
foreach ($brandList['original']['data']['list'][0]['data'] as $original) {
$imgs = array();
$build = array();
// 情况1: 多张图
if (isset($original['data'][1])) {
foreach ($original['data'] as $value) {
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['deps'] = $original['brand_title'];
$imgs[] = $build;
}
$data['ps']['plus'][] = array('imgs' => $imgs);
}
// 情况2: 单张图
elseif (isset($original['data'][0])) {
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($original['data'][0]['src'], 640, 310);
$build['deps'] = $original['brand_title'];
$data['ps']['plus'][] = $build;
}
}
$this->_view->display('index', $data);
}
$this->_view->display('list', $data);
/**
* 明星原创-品牌列表页
*
* @param int gender "1,3"表示男, "2,3"表示女
*/
public function listAction()
{
$this->setTitle('明星原创');
$this->setNavHeader('明星原创', true, SITE_MAIN);
$brandList = array();
$data = array();
$gender = $this->get('gender', '1,3');
$data = Guang\PlusstarModel::getBrands($gender);
$data['psList'] = true; // 控制模板中的JS使用
$this->_view->display('list', $data);
}
/**
... ... @@ -120,7 +77,7 @@ class PlusstarController extends AbstractAction
$data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name'];
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
$data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array('&nbsp;' => ' ') );
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array('&nbsp;' => ' '));
$data['ps']['newArrival'] = array();
$data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
... ... @@ -136,7 +93,6 @@ class PlusstarController extends AbstractAction
}
$brandInfo = array();
} while (false);
if (array() === $data) {
... ...