Authored by 周少峰

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

... ... @@ -34,4 +34,5 @@ web-static/npm-debug.log
.tags
.tags_sorted_by_file
yohobuyP.sublime-project
yohobuyP.sublime-workspace
\ No newline at end of file
yohobuyP.sublime-workspace
framework/
\ No newline at end of file
... ...
... ... @@ -475,65 +475,7 @@ class WebAction extends Controller_Abstract
$header = array(
'navbars'=> \Index\HomeModel::getNavBars($channel),
'gobytype'=> 'gobuy'.$channel,
'searchcate'=>'searchcate'.$channel,
'myyoho' => array(
'email'=>'hhh@126.com',
'viptype'=>'普通会员',
'currentscore' => 495,
'totalscore' => 600,
'cardtype' => '银卡',
'infolist' => array(
array(
'name' =>'待处理的订单',
'link' =>'',
'num' => '0'
),
array(
'name' =>'我的收藏',
'link' =>'',
'num' => '1'
),
array(
'name' =>'我的优惠券',
'link' =>'',
'num' => '2'
),
array(
'name' =>'我的YOHO币',
'link' =>'',
'num' => '1'
),
array(
'name' =>'我的退货换货',
'link' =>'',
'num' => '1'
)
),
'updlink' => ''
),
'gobuy'=> array(
'gobuynum' =>3
),
'breadcrumbnav'=> array(
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => 'BOYS首页'
)
),
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '上衣'
)
),
array(
'isend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '衬衫'
)
)
)
'searchcate'=>'searchcate'.$channel
);
$this->_view->assign('headerdata', $header);
}
... ...
... ... @@ -44,4 +44,14 @@ class FavoriteData {
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'delUidProductFav', array($uid, $productSkn));
}
/**
* 根据uid和商品的skn添加或取消收藏品牌
* @param $uid
* @param $productSkn
* @return bool
*/
public static function changeFavoriteBrand($uid, $productSkn)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'toggleBrandFav', array($uid, $productSkn));
}
}
... ...
... ... @@ -208,7 +208,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -428,9 +428,9 @@ class FloorProcess
{
// URL附加参数
$param = '';
if (isset(self::$channel[$type])) {
/*if (isset(self::$channel[$type])) {
$param = '/?gender=' . self::$channel[$type];
}
}*/
$result = array();
$result['hotBrandsScroll']['name'] = $data['title']['title'];
... ...
... ... @@ -39,7 +39,7 @@ class HelperSearch
}
self::$listNav[0] = array(
'href' => '',
'name' => $cookieChannel
'name' => strtoupper($cookieChannel).'首页'
);
self::$listNav[1] = array(
'href' => '',
... ... @@ -95,7 +95,7 @@ class HelperSearch
$result['leftContent'][]['newSales'] = self::recentShelve($data['recent']['recent']);
}
//品牌banner
$result['brandBanner'] = isset($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array();
$result['brandBanner'] = isset($data['brand']) && !empty($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array();
//总记录数
if (isset($data['product']['total'])) {
$result['totalCount'] = $data['product']['total'];
... ...
... ... @@ -6,7 +6,7 @@
<div class="send-tips"><i class="iconfont">&#xe61e;</i>我们已经把验证邮件发送至您的邮箱,请在24小时内通过邮件内的<br>链接继续设置新的密码。</div>
<div class="no-find">没有收到?到您邮箱的垃圾邮件里找找。</div>
<div class="to-my-email">
<a href="http://mail.qq.com" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a>
<a href="{{email}}" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a>
</div>
</div>
... ...
... ... @@ -60,7 +60,9 @@
<div class="qr-img"></div>
<h3 class="qr-words">扫描二维码</h3>
<h3 class="qr-words">下载有货手机客户端</h3>
<h3 class="qr-more">更多客户端下载</h3>
<h3 class="qr-more">
<a href="http://www.yohobuy.com/download/app">更多客户端下载</a>
</h3>
</div>
</li>
</ul>
... ...
... ... @@ -4448,8 +4448,8 @@ function phoneAjaxFn(page, callback) {
data = {
mobile: $pn.val(),
area: $region.text().split('+')[1],
openId: 1,
sourceType: 'QQ'
openId: $('#open-id').val(),
sourceType: $('#source-type').val()
};
}
... ...
This diff could not be displayed because it is too large.
... ... @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller = 'Index';
$action = 'Index';
// 二级域名
if (3 === $level) {
if (2 === $level) {
$url = strtolower($dispatcher->getRequest()->getRequestUri());
if(empty($url) || $url == '/index' || $url == '/') {
$urlAction = '/index';
... ...
... ... @@ -36,10 +36,10 @@ class HomeModel
// 男首首页
const CODE_BOYS_CHANNEL = 'c15bf0cbfbd4893fd70c869c991f6d3d';
// 女首首页
const CODE_GIRLS_CHANNEL = '4d897f3b8eec0c465db0125e5b1f9edf';
const CODE_GIRLS_CHANNEL = 'a519ba44ef3a85cf3c05e405c6ba8e53';//'4d897f3b8eec0c465db0125e5b1f9edf';
// 'a519ba44ef3a85cf3c05e405c6ba8e53';
// 潮童首页
const CODE_KIDS_CHANNEL = '331994d6fa8dc87f92a26dd45c0aa071';
const CODE_KIDS_CHANNEL = 'a7741b94e8bb9d56d0d36e00c05956f7';//'331994d6fa8dc87f92a26dd45c0aa071';
// 'a7741b94e8bb9d56d0d36e00c05956f7';
// 创意生活新
... ...
... ... @@ -221,8 +221,11 @@ class SearchModel
//组织数据结构
$data = HelperSearch::getProductPic($data['data']['product_list'], $options);
}
$data['isFavorite'] = $options['isFavorite'];
echo json_encode($data);
$res = array(
'pics'=>$data,
'isFavorite'=>$options['isFavorite']
);
echo json_encode($res);
}
/**
... ...
... ... @@ -20,7 +20,7 @@ class BackController extends WebAction {
'coverImg' => $banner ['img'],
'countryCode' => '86',
'countryName' => '中国',
'captchaUrl' => '/passport/images?t=1449799445',
'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
'countryList' => RegData::getAreasData()
)
);
... ... @@ -34,7 +34,7 @@ class BackController extends WebAction {
{
$phoneNum = $this->post('phoneNum', '');
$area = intval($this->post('area', '86'));
$verifyCode = $this->post('verifyCode', '');
$verifyCode = $this->post('verifyCode', '');//图形验证码
$data = array(
'code' => 200,
'message' => '验证成功'
... ... @@ -66,7 +66,7 @@ class BackController extends WebAction {
public function emailAction() {
$phoneNum = $this->post ('phoneNum', '');
$area = intval ($this->post('area', '86'));
$verifyCode = $this->post('verifyCode', '');
$verifyCode = $this->post('verifyCode', '');//图形验证码
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
... ... @@ -100,7 +100,7 @@ class BackController extends WebAction {
{
$mobile = $this->post ('mobile', '');
$area = intval ($this->post( 'area', '86' ));
$verifyCode = $this->post ('verifyCode', '');
$verifyCode = $this->post ('verifyCode', '');//图形验证码
$data = array('code' => 400, 'message' =>'验证失败');
if(Helpers::verifyMobile($mobile) && PassportModel::verifyCode($verifyCode)) { // 验证手机号
$data = BackData::sendCodeToMobile($mobile, $area);
... ... @@ -117,12 +117,21 @@ class BackController extends WebAction {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$emailArr = explode('@', $email);
$emailUrl = '';//邮箱地址
$emailUrls = array('yoho.cn' =>'http://smail.yoho.cn');
if(in_array($emailArr[1], $emailUrls)){
$emailUrl = $emailUrls[$emailArr[1]];//邮箱后缀
} else {
$emailUrl = 'http://mail.'.$emailArr[1];
}
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'sendEmail' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array ()
'countrys' => array (),
'email' => $emailUrl
)
);
$this->_view->display('send-email', $data);
... ... @@ -133,7 +142,7 @@ class BackController extends WebAction {
*/
public function backcodeAction()
{
$code = $this->get('code');
$code = $this->get('code');//加密code兼容以前参数
$info = $this->checkCode($code);
$verifyState = false;//验证状态
$ret = array();
... ... @@ -172,7 +181,7 @@ class BackController extends WebAction {
*/
public function updateAction()
{
$code = $this->post('code');
$code = $this->post('code');//加密code兼容以前参数
$password = $this->post('pwd');
$info = $this->checkCode($code);
if (Helpers::verifyPassword ($password)) {
... ... @@ -224,7 +233,7 @@ class BackController extends WebAction {
{
$mobile = $this->getSession ('mobile');
$area = $this->getSession ('area');
$verifyCode = $this->getSession ('verifyCode');
$verifyCode = $this->getSession ('verifyCode');//图形验证码
if (empty ($mobile)) {
$this->redirect ('index');
}
... ... @@ -251,8 +260,8 @@ class BackController extends WebAction {
{
$mobile = $this->post ( 'mobile' );
$area = $this->post ( 'area' );
$verifyCode = $this->post ( 'verifyCode' );
$code = $this->post ( 'code' ); // code
$verifyCode = $this->post ( 'verifyCode' );//图形验证码
$code = $this->post ( 'code' ); //手机验证码
$data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index');
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)) {
$result = BackData::validateMobileCode ( $mobile, $code, $area );
... ...
... ... @@ -19,13 +19,13 @@ class RegisterController extends WebAction
'registerPage' => true,
'simpleHeader' => PassportModel::getSimpleHeader(false),
'passport' => array(
'actionUrl' => '/passport/register/mobileregister',
'actionUrl' => SITE_MAIN.'/passport/register/mobileregister',
'region' => RegData::getAreasData(),
'location' => '+86',
'captchaUrl' => '/passport/images?t=1449799445',
'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9',
'referUrl' => $refer,
'loginUrl' => '/signin.html?refer='.$refer,
'loginUrl' => SITE_MAIN.'/signin.html?refer='.$refer,
'coverHref' => $cover['url'],
'coverImg' => $cover['img'],
'regBtnText' => '立即注册'
... ... @@ -183,14 +183,9 @@ class RegisterController extends WebAction
$mobile = trim($this->post('mobile'), ' ');//mobile
$area = intval(trim($this->post('area'), ' '));//area
$verifyCode = strtolower(trim($this->post('verifyCode'),' '));//图形验证码
$code = trim($this->post('code'),'');//code
$code = trim($this->post('code'),'');//手机验证码
$password = $this->post('password');
$url = '/passport/register/index';
$refer = $this->getCookie('refer');
$data = array('code' => 400, 'message' => '', 'data' => '');
if(!empty($refer)) {
$refer = $url.'?refer='.$refer;
}
do
{
/* 判断参数是否合法 */
... ...
<?php
use Action\WebAction;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\FavoriteData;
use \LibModels\Web\Product\HotrankData;
use product\HotrankModel;
... ... @@ -35,6 +36,10 @@ class IndexController extends WebAction
$condition = array();
$condition['brand'] = $brandId;
//品牌系列参数
$folderId = $this->get('folder_id');
$condition['folder_id'] = $folderId;
//$options参数数组
$options = array();
$options['brandName'] = $domain;
... ... @@ -46,6 +51,7 @@ class IndexController extends WebAction
//调用模型获得数据
$data = Product\BrandsModel::getBrandSearchData($condition, $options);
$data = array(
//初始化js
'searchListPage' => true,
... ... @@ -102,6 +108,24 @@ class IndexController extends WebAction
//渲染模板
$this->_view->display('list',$data);
}
//收藏品牌
public function favoriteBrandAction()
{
if (!$this->isAjax()) {
return;
}
$uid = $this->post('uid');
$brandId = $this->post('brandId');
if ($uid && $brandId) {
//调用接口收藏或取消收藏
$result = FavoriteData::changeFavoriteBrand($uid, $brandId);
if (isset($result['code']) && $result['code'] == 200) {
$this ->echoJson($result['message']);
}
}
}
/**
* 热销排行
*/
... ...