Authored by Rock Zhang

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

framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -224,7 +224,7 @@ class AbstractAction extends Controller_Abstract
*/
protected function setTitle($title)
{
$this->_view->assign('title', $title);
$this->_view->assign('title', $title . ' | ');
}
/**
... ... @@ -235,7 +235,7 @@ class AbstractAction extends Controller_Abstract
*/
protected function setKeywords($keywords)
{
$this->_view->assign('keywords', $keywords);
$this->_view->assign('keywords', rtrim($keywords, ',') . ',');
}
/**
... ...
... ... @@ -22,7 +22,7 @@ class PlusstarData
const URI_BRANDINFO_PLUSSTAR = 'guang/service/v1/plustar/';
const URI_BRANDINFO_FAVORITE = 'shops/service/v1/favorite/';
const URI_BRANDINFO_ARTICLE = 'guang/service/v1/article/';
/**
* 品牌列表
*
... ... @@ -39,25 +39,25 @@ class PlusstarData
$urlList = array();
// 接口调用的URL
$url = Yohobuy::SERVICE_URL . self::URI_BRANDLIST;
// 公共的参数
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['is_recommend'] = '0';
$param['yh_channel'] = $channel;
// 构建明星品牌参数及调用接口的URL
$star = $param;
$star['brand_type'] = '2';
$star['client_secret'] = Sign::getSign($star);
$urlList['star'] = Yohobuy::httpBuildQuery($url, $star);
// 构建原创品牌参数及调用接口的URL
$original = $param;
$original['brand_type'] = '3';
$original['client_secret'] = Sign::getSign($original);
$urlList['original'] = Yohobuy::httpBuildQuery($url, $original);
return Yohobuy::getMulti($urlList);
}
... ... @@ -84,15 +84,16 @@ class PlusstarData
$result['getNewProduct'] = array();
$result['getUidProductFav'] = array();
$result['getArticleByBrand'] = array();
// 品牌详情信息
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)) );
$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;
}
// 是否收藏店铺
$isUidOk = $uid && is_numeric($uid);
if ($isUidOk) {
... ... @@ -100,17 +101,17 @@ class PlusstarData
$result['getUidBrandFav'] = empty($retval['data']) ? false : $retval['data'];
});
}
// 相关资讯列表 (3篇)
$result['getArticleByBrand'] = array();
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_ARTICLE, 'getArticleByBrand', array($brandInfo['data']['brand_id'], 3, $udid), function($retval) use(&$result) {
$result['getArticleByBrand'] = empty($retval) ? array() : $retval;
});
// 新品到着列表 (6篇)
$result['getNewProduct'] = array();
$result['getUidProductFav'] = array();
do {
// 调用搜索接口
$param = Yohobuy::param();
... ... @@ -121,34 +122,43 @@ class PlusstarData
$param['gender'] = $gender;
$param['order'] = 's_t_desc';
$param['client_secret'] = Sign::getSign($param);
$newProduct = Yohobuy::get(Yohobuy::API_URL, $param);
$newProduct = Yohobuy::get(Yohobuy::API_URL, $param);
if (empty($newProduct['data']['product_list'])) {
break;
}
$skn = '';
$i = 0;
foreach ($newProduct['data']['product_list'] as $value) {
// 最多6个
if ($i > 5) {
break;
}
if (empty($value['goods_list'])) {
continue;
}
// 商品信息列表
$result['getNewProduct'][] = Helpers::formatProduct($value);
$result['getNewProduct'][$i] = Helpers::formatProduct($value);
// 用户是否收藏该商品
$skn = $value['product_skn'];
$result['getUidProductFav'][ $skn ] = false;
$result['getUidProductFav'][$skn] = false;
if ($isUidOk) {
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE, 'getUidProductFav', array($uid, $value['product_skn']), function($retval) use(&$result,&$skn) {
$result['getUidProductFav'][ $skn ] = empty($retval['data']) ? false : $retval['data'];
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_FAVORITE, 'getUidProductFav', array($uid, $value['product_skn']), function($retval) use(&$result, &$skn) {
$result['getUidProductFav'][$skn] = empty($retval['data']) ? false : $retval['data'];
});
}
$i ++;
}
} while (false);
}
while (false);
// 调用发起请求
Yohobuy::yarConcurrentLoop();
return $result;
// $goods_url = MakeUrl::h5ProductDetailUrl($baseUrl,$new_goods_info['product_id'],$new_goods_info['goods_list'][0]['goods_id'],$new_goods_info['cn_alphabet']);
... ...
... ... @@ -98,11 +98,11 @@ class Helpers
// 判断是否显示作者信息
if ($showAuthor) {
$result['author'] = $articleData['author'];
$result['author'] = empty($articleData['author']) ? false : $articleData['author'];
}
// 模板中需要的标签标识
if ($showTag) {
if ($showTag && isset($articleData['category_id'])) {
switch (strval($articleData['category_id'])) {
case '1': // 话题
$result['isTopic'] = true;
... ...
... ... @@ -51,21 +51,28 @@ function setLazyLoadAndMellipsis($infos) {
function initInfosEvt($container) {
$container.delegate('.like-btn', 'touchstart', function(e) {
var $likeBtn = $(e.currentTarget),
$info = $likeBtn.closest('.guang-info');
$info = $likeBtn.closest('.guang-info'),
opt = 'ok';
if ($likeBtn.hasClass('like')) {
opt = 'cancel';
}
$.ajax({
type: 'GET',
url: '/guang/info/prise', //TODO:cancelPrise
type: 'POST',
url: '/guang/opt/praiseArticle',
data: {
id: $info.data('id')
id: $info.data('id'),
opt: opt
},
success: function(data) {
var code = data.code;
if (code === 200) {
$likeBtn.next('.like-count').text(data.data);
} else if (code === 400) {
tip.show('未登录');
//切换点赞状态
$likeBtn.toggleClass('like');
}
},
error: function() {
... ...
... ... @@ -14,6 +14,10 @@ var $intro = $('#intro'),
var info = require('../info');
var tip = require('../../plugin/tip');
var brandId = $('#brand-info').data('id');
var mIntro, aIntro;
ellipsis.init();
... ... @@ -53,5 +57,31 @@ $('#more-intro').bind('touchstart', function() {
//品牌收藏
$('#brand-like').bind('touchstart', function(e) {
var opt = 'ok',
$this = $(this);
e.preventDefault();
if ($this.hasClass('like')) {
opt = 'cancel';
}
$.ajax({
type: 'POST',
url: '/guang/opt/favoriteBrand',
data: {
id: brandId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('like');
} else if (data.code === 400) {
tip.show('未登录');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
\ No newline at end of file
... ...
{{>layout/header}}
<div class="ps-detail-page ps-page yoho-page">
{{# ps}}
<div class="header brand-info ps-block" data-id="{{id}}">
<div id="brand-info" class="header brand-info ps-block" data-id="{{id}}">
<img class="banner lazy" data-original="{{banner}}">
<img class="logo lazy" data-original="{{logo}}">
<div class="header-content clearfix">
... ...
... ... @@ -2,9 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<title>{{title}}YOHO!有货</title>
<meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
<meta name="description" content="{{description}}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" />
... ... @@ -22,17 +22,15 @@
}());
})(document, window);
</script>
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if rlsEnv}}
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
{{/if}}
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="http://static.wap.yohobuy.com/css/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
{{/if}}
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{> layout/page_header}}
\ No newline at end of file
... ...
... ... @@ -101,6 +101,7 @@ class RecomController extends AbstractAction
/**
* 你可能喜欢的创意生活的新品到着和人气单品列表
*
* @param int page 分页的页码
* @return html
*/
public function maylikelifeAction()
... ... @@ -111,12 +112,6 @@ class RecomController extends AbstractAction
break;
}
/* 判断分页参数是否有效 */
$page = $this->get('page', 1);
if (!is_numeric($page)) {
break;
}
/* 取可能喜欢的数据 */
$recom = RecomData::mayLikeLifestyle();
if (empty($recom['data']['product_list'])) {
... ...
... ... @@ -42,7 +42,7 @@ class PlusstarController extends AbstractAction
// 情况1: 多张图
if (isset($star['data'][1])) {
foreach ($star['data'] as $value) {
$build['url'] = $value['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$imgs[] = $build;
}
... ... @@ -50,7 +50,7 @@ class PlusstarController extends AbstractAction
}
// 情况2: 单张图
elseif (isset($star['data'][0])) {
$build['url'] = $star['data'][0]['url'];
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
$build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310);
$data['ps']['star'][] = $build;
}
... ... @@ -66,7 +66,7 @@ class PlusstarController extends AbstractAction
// 情况1: 多张图
if (isset($original['data'][1])) {
foreach ($original['data'] as $value) {
$build['url'] = $value['url'];
$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;
... ... @@ -75,7 +75,7 @@ class PlusstarController extends AbstractAction
}
// 情况2: 单张图
elseif (isset($original['data'][0])) {
$build['url'] = $original['data'][0]['url'];
$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;
... ... @@ -98,8 +98,8 @@ class PlusstarController extends AbstractAction
$id = $this->get('id');
$gender = $this->get('gender', '1,3');
$uid = 0; // @todo
$udid = null; // @todo
$uid = $this->getUid();
$udid = $this->getUdid();
do {
/* 判断参数是否有效 */
... ... @@ -109,46 +109,30 @@ class PlusstarController extends AbstractAction
/* 判断品牌信息是否为空 */
$brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid);
if (empty($brandInfo['getBrandInfo']['brand_id'])) {
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
break;
}
$data['psDetail'] = true;
$data['ps']['id'] = $brandInfo['getBrandInfo']['brand_id'];
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['cover_img'], 640, 309);
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['brand_ico'], 160, 160);
$data['ps']['name'] = $brandInfo['getBrandInfo']['brand_name'];
$data['ps']['id'] = $brandInfo['getBrandInfo']['data']['brand_id'];
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['cover_img'], 640, 309);
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['brand_ico'], 160, 160);
$data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name'];
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
$data['ps']['likeUrl'] = "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']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['brand_intro']), 'nbsp;', ' ');
$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']['newArrival'] = array();
$data['ps']['newArrival']['moreUrl'] = ''; // @todo
$data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
$data['ps']['infos'] = array();
if (empty($brandInfo['getArticleByBrand'])) {
break;
}
// 相关文章
$build = array();
foreach ($brandInfo['getArticleByBrand'] as $value) {
$build = array();
$build['id'] = $value['id'];
$build['showTags'] = false; // 不显示标签
$build['img'] = Helpers::getImageUrl($value['src'], 640, 640, $value['cover_image_type']);
$build['url'] = $value['url']; // @todo
$build['title'] = $value['title'];
$build['text'] = $value['intro'];
$build['publishTime'] = $value['publish_time'];
$build['pageView'] = $value['views_num'];
$build['like'] = array();
$build['like']['isLiked'] = $value['like']['isLiked'];
$build['like']['count'] = $value['like']['count'];
$build['share'] = ''; //分享链接
$build['author'] = false; // 作者信息(接口暂未上线)
$data['ps']['infos'][] = $build;
$data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false);
}
$brandInfo = array();
... ...
... ... @@ -2,7 +2,8 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BackData;
use Hood\Core\Security\AuthCode;
use LibModels\Wap\Passport\RegData;
/**
* 频道选择
*/
... ... @@ -11,14 +12,17 @@ class BackController extends AbstractAction
public function emailAction()
{
$this->setTitle('找回密码-通过邮箱');
$data = array(
'backUrl' => '/passport/login/index',
'backUrl' => '/signin.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmail' => true
);
$this->_view->assign('title', 'YOHO!有货');
// 生成HTML (emailback.html)
$this->_view->html('emailback');
$this->_view->display('email', $data);
}
... ... @@ -60,13 +64,15 @@ class BackController extends AbstractAction
public function successAction()
{
$this->setTitle('找回密码-通过邮箱');
$email = $this->get('email', '');
// 获取到邮箱域名
list($name, $domain) = explode('@', $email);
$domain_name = 'http://' . (($domain == 'gmail.com') ? 'mail.google.com' : 'mail.' . $domain);
$data = array(
'backUrl' => '/passport/back/email',
'backUrl' => 'emailback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmailSuccess' => true,
... ... @@ -74,7 +80,6 @@ class BackController extends AbstractAction
'resendUrl' => '/passport/back/resendemail?email='.$email
);
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('email-success', $data);
}
... ... @@ -106,42 +111,20 @@ class BackController extends AbstractAction
public function mobileAction()
{
// 获取地区信息
$areas = array();
$areaDatas = $data = BackData::getAreasData();
if($areaDatas['code'] == 200)
{
$areas = $areaDatas['data'];
}
// 处理地区信息
foreach ($areas as &$val) {
$val['areaCode'] = '+'.$val['area'];
if($val['area'] === '86')
{
$val['selected'] = true;
}
unset($val['area']);
}
/*// 排序
uasort($areas, function($a, $b) {
if($a['id'] === $b['id'])
{
return 0;
}
return ($a['id'] < $b['id'] ? -1 : 1);
});*/
$this->setTitle('找回密码-通过手机号');
$data = array(
'backUrl' => '/passport/login/index',
'backUrl' => '/signin.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backMobile' => true,
'countrys' => $areas,
'areaCode' => '+86'
'countrys' => RegData::getAreasData(),
'countryCode' => '+86'
);
$this->_view->assign('title', 'YOHO!有货');
// 生成HTML (mobileback.html)
$this->_view->html('mobileback.html');
$this->_view->display('mobile', $data);
}
... ... @@ -176,7 +159,7 @@ class BackController extends AbstractAction
$areaCode = '+'.$areaCode;
$data = array(
'backUrl' => '/passport/back/mobile',
'backUrl' => '/mobileback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backCode' => true,
... ...
... ... @@ -25,9 +25,9 @@ class LoginController extends AbstractAction
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'registerUrl' => '/reg.html', // 注册的URL链接
'aliLoginUrl' => '/passport/login/alipay', // 注册的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 注册的URL链接
'qqLoginUrl' => '/passport/login/qq', // 注册的URL链接
'aliLoginUrl' => '/passport/login/alipay', // 支付宝快捷登录的URL链接
'weiboLoginUrl' => '/passport/login/sina', // 微博登录的URL链接
'qqLoginUrl' => '/passport/login/qq', // 腾讯QQ登录的URL链接
'interationalUrl' => '/login.html', // 国际号登录的URL链接
'phoneRetriveUrl' => '/passport/back/mobile', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接
... ...
[common]
servers.host = 127.0.0.1:11211:90
[memcached:common]
servers.hosts = 127.0.0.1:11212:90,127.0.0.1:11213:10
[memcached]
master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
[redis]
servers.hosts = 127.0.0.1:6379
\ No newline at end of file
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...