Authored by hf

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

... ... @@ -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));
}
}
... ...
... ... @@ -83,7 +83,7 @@ class HelperSearch
//分类条件(搜索页面)
if (isset($data['sort']['sort'])) {
//分类条件(搜索页面)
if (isset($options['controller']) && $options['controller'] != 'Search') {
if (isset($options['controller']) && $options['controller'] == 'Search') {
$result['filters']['sort'] = self::searchSort($data['sort']['sort']);
}else{
//左侧分类分类
... ... @@ -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'];
... ... @@ -283,6 +283,10 @@ class HelperSearch
//设置导航
self::setListNav($options);
$params = self::$params;
$gender = array();
if (isset($params['gender']) && !empty($params['gender'])) {
$gender['gender'] = $params['gender'];
}
$result = array(
'all' => array(
'name' => '全部品类',
... ... @@ -293,7 +297,7 @@ class HelperSearch
);
$sortList = array();
foreach ($sort as $key => $val) {
//若参数有分类,设置导航
//若url参数有分类,设置导航
if (isset($params['msort']) && $params['msort'] == $val['sort_id']) {
//是否有品牌
$navIndex = isset($option['brandName']) && $option['brandName'] ? 2 : 1;
... ... @@ -310,12 +314,12 @@ class HelperSearch
$sortList[$key]['active'] = isset(self::$params['msort']) && self::$params['msort'] == $val['sort_id'] ? true : false;
$sortList[$key]['childList'][] = array(
'name' => '全部分类',
'href' => self::buildUrl(array_merge($params, array('msort'=>$val['sort_id'])))
'href' => self::buildUrl(array_merge($gender, array('msort'=>$val['sort_id'])))
);
if (isset($val['sub']) && !empty($val['sub'])) {
foreach ($val['sub'] as $k => $v) {
$sortList[$key]['childList'][$k+1]['name'] = $v['sort_name'];
$sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($params, array('msort' => $val['sort_id'], 'misort' => $v['sort_id'])));
$sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($gender, array('msort' => $val['sort_id'], 'misort' => $v['sort_id'])));
$sortList[$key]['childList'][$k+1]['childActive'] = isset(self::$params['misort']) && self::$params['misort'] == $v['sort_id'] ? true : false;
}
}
... ...
... ... @@ -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>
... ...
... ... @@ -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.
... ... @@ -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;
... ... @@ -50,6 +51,7 @@ class IndexController extends WebAction
//调用模型获得数据
$data = Product\BrandsModel::getBrandSearchData($condition, $options);
$data = array(
//初始化js
'searchListPage' => true,
... ... @@ -106,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']);
}
}
}
/**
* 热销排行
*/
... ...