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 @@ -475,65 +475,7 @@ class WebAction extends Controller_Abstract
475 $header = array( 475 $header = array(
476 'navbars'=> \Index\HomeModel::getNavBars($channel), 476 'navbars'=> \Index\HomeModel::getNavBars($channel),
477 'gobytype'=> 'gobuy'.$channel, 477 'gobytype'=> 'gobuy'.$channel,
478 - 'searchcate'=>'searchcate'.$channel,  
479 - 'myyoho' => array(  
480 - 'email'=>'hhh@126.com',  
481 - 'viptype'=>'普通会员',  
482 - 'currentscore' => 495,  
483 - 'totalscore' => 600,  
484 - 'cardtype' => '银卡',  
485 - 'infolist' => array(  
486 - array(  
487 - 'name' =>'待处理的订单',  
488 - 'link' =>'',  
489 - 'num' => '0'  
490 - ),  
491 - array(  
492 - 'name' =>'我的收藏',  
493 - 'link' =>'',  
494 - 'num' => '1'  
495 - ),  
496 - array(  
497 - 'name' =>'我的优惠券',  
498 - 'link' =>'',  
499 - 'num' => '2'  
500 - ),  
501 - array(  
502 - 'name' =>'我的YOHO币',  
503 - 'link' =>'',  
504 - 'num' => '1'  
505 - ),  
506 - array(  
507 - 'name' =>'我的退货换货',  
508 - 'link' =>'',  
509 - 'num' => '1'  
510 - )  
511 - ),  
512 - 'updlink' => ''  
513 - ),  
514 - 'gobuy'=> array(  
515 - 'gobuynum' =>3  
516 - ),  
517 - 'breadcrumbnav'=> array(  
518 - array(  
519 - 'notend'=>array(  
520 - 'link' => 'http=>//www.baidu.com',  
521 - 'name' => 'BOYS首页'  
522 - )  
523 - ),  
524 - array(  
525 - 'notend'=>array(  
526 - 'link' => 'http=>//www.baidu.com',  
527 - 'name' => '上衣'  
528 - )  
529 - ),  
530 - array(  
531 - 'isend'=>array(  
532 - 'link' => 'http=>//www.baidu.com',  
533 - 'name' => '衬衫'  
534 - )  
535 - )  
536 - ) 478 + 'searchcate'=>'searchcate'.$channel
537 ); 479 );
538 $this->_view->assign('headerdata', $header); 480 $this->_view->assign('headerdata', $header);
539 } 481 }
@@ -44,4 +44,14 @@ class FavoriteData { @@ -44,4 +44,14 @@ class FavoriteData {
44 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'delUidProductFav', array($uid, $productSkn)); 44 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'delUidProductFav', array($uid, $productSkn));
45 } 45 }
46 46
  47 + /**
  48 + * 根据uid和商品的skn添加或取消收藏品牌
  49 + * @param $uid
  50 + * @param $productSkn
  51 + * @return bool
  52 + */
  53 + public static function changeFavoriteBrand($uid, $productSkn)
  54 + {
  55 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'toggleBrandFav', array($uid, $productSkn));
  56 + }
47 } 57 }
@@ -83,7 +83,7 @@ class HelperSearch @@ -83,7 +83,7 @@ class HelperSearch
83 //分类条件(搜索页面) 83 //分类条件(搜索页面)
84 if (isset($data['sort']['sort'])) { 84 if (isset($data['sort']['sort'])) {
85 //分类条件(搜索页面) 85 //分类条件(搜索页面)
86 - if (isset($options['controller']) && $options['controller'] != 'Search') { 86 + if (isset($options['controller']) && $options['controller'] == 'Search') {
87 $result['filters']['sort'] = self::searchSort($data['sort']['sort']); 87 $result['filters']['sort'] = self::searchSort($data['sort']['sort']);
88 }else{ 88 }else{
89 //左侧分类分类 89 //左侧分类分类
@@ -95,7 +95,7 @@ class HelperSearch @@ -95,7 +95,7 @@ class HelperSearch
95 $result['leftContent'][]['newSales'] = self::recentShelve($data['recent']['recent']); 95 $result['leftContent'][]['newSales'] = self::recentShelve($data['recent']['recent']);
96 } 96 }
97 //品牌banner 97 //品牌banner
98 - $result['brandBanner'] = isset($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array(); 98 + $result['brandBanner'] = isset($data['brand']) && !empty($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array();
99 //总记录数 99 //总记录数
100 if (isset($data['product']['total'])) { 100 if (isset($data['product']['total'])) {
101 $result['totalCount'] = $data['product']['total']; 101 $result['totalCount'] = $data['product']['total'];
@@ -283,6 +283,10 @@ class HelperSearch @@ -283,6 +283,10 @@ class HelperSearch
283 //设置导航 283 //设置导航
284 self::setListNav($options); 284 self::setListNav($options);
285 $params = self::$params; 285 $params = self::$params;
  286 + $gender = array();
  287 + if (isset($params['gender']) && !empty($params['gender'])) {
  288 + $gender['gender'] = $params['gender'];
  289 + }
286 $result = array( 290 $result = array(
287 'all' => array( 291 'all' => array(
288 'name' => '全部品类', 292 'name' => '全部品类',
@@ -293,7 +297,7 @@ class HelperSearch @@ -293,7 +297,7 @@ class HelperSearch
293 ); 297 );
294 $sortList = array(); 298 $sortList = array();
295 foreach ($sort as $key => $val) { 299 foreach ($sort as $key => $val) {
296 - //若参数有分类,设置导航 300 + //若url参数有分类,设置导航
297 if (isset($params['msort']) && $params['msort'] == $val['sort_id']) { 301 if (isset($params['msort']) && $params['msort'] == $val['sort_id']) {
298 //是否有品牌 302 //是否有品牌
299 $navIndex = isset($option['brandName']) && $option['brandName'] ? 2 : 1; 303 $navIndex = isset($option['brandName']) && $option['brandName'] ? 2 : 1;
@@ -310,12 +314,12 @@ class HelperSearch @@ -310,12 +314,12 @@ class HelperSearch
310 $sortList[$key]['active'] = isset(self::$params['msort']) && self::$params['msort'] == $val['sort_id'] ? true : false; 314 $sortList[$key]['active'] = isset(self::$params['msort']) && self::$params['msort'] == $val['sort_id'] ? true : false;
311 $sortList[$key]['childList'][] = array( 315 $sortList[$key]['childList'][] = array(
312 'name' => '全部分类', 316 'name' => '全部分类',
313 - 'href' => self::buildUrl(array_merge($params, array('msort'=>$val['sort_id']))) 317 + 'href' => self::buildUrl(array_merge($gender, array('msort'=>$val['sort_id'])))
314 ); 318 );
315 if (isset($val['sub']) && !empty($val['sub'])) { 319 if (isset($val['sub']) && !empty($val['sub'])) {
316 foreach ($val['sub'] as $k => $v) { 320 foreach ($val['sub'] as $k => $v) {
317 $sortList[$key]['childList'][$k+1]['name'] = $v['sort_name']; 321 $sortList[$key]['childList'][$k+1]['name'] = $v['sort_name'];
318 - $sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($params, array('msort' => $val['sort_id'], 'misort' => $v['sort_id']))); 322 + $sortList[$key]['childList'][$k+1]['href'] = self::buildUrl(array_merge($gender, array('msort' => $val['sort_id'], 'misort' => $v['sort_id'])));
319 $sortList[$key]['childList'][$k+1]['childActive'] = isset(self::$params['misort']) && self::$params['misort'] == $v['sort_id'] ? true : false; 323 $sortList[$key]['childList'][$k+1]['childActive'] = isset(self::$params['misort']) && self::$params['misort'] == $v['sort_id'] ? true : false;
320 } 324 }
321 } 325 }
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <div class="send-tips"><i class="iconfont">&#xe61e;</i>我们已经把验证邮件发送至您的邮箱,请在24小时内通过邮件内的<br>链接继续设置新的密码。</div> 6 <div class="send-tips"><i class="iconfont">&#xe61e;</i>我们已经把验证邮件发送至您的邮箱,请在24小时内通过邮件内的<br>链接继续设置新的密码。</div>
7 <div class="no-find">没有收到?到您邮箱的垃圾邮件里找找。</div> 7 <div class="no-find">没有收到?到您邮箱的垃圾邮件里找找。</div>
8 <div class="to-my-email"> 8 <div class="to-my-email">
9 - <a href="http://mail.qq.com" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a> 9 + <a href="{{email}}" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a>
10 </div> 10 </div>
11 11
12 </div> 12 </div>
@@ -4448,8 +4448,8 @@ function phoneAjaxFn(page, callback) { @@ -4448,8 +4448,8 @@ function phoneAjaxFn(page, callback) {
4448 data = { 4448 data = {
4449 mobile: $pn.val(), 4449 mobile: $pn.val(),
4450 area: $region.text().split('+')[1], 4450 area: $region.text().split('+')[1],
4451 - openId: 1,  
4452 - sourceType: 'QQ' 4451 + openId: $('#open-id').val(),
  4452 + sourceType: $('#source-type').val()
4453 }; 4453 };
4454 } 4454 }
4455 4455
This diff could not be displayed because it is too large.
@@ -36,10 +36,10 @@ class HomeModel @@ -36,10 +36,10 @@ class HomeModel
36 // 男首首页 36 // 男首首页
37 const CODE_BOYS_CHANNEL = 'c15bf0cbfbd4893fd70c869c991f6d3d'; 37 const CODE_BOYS_CHANNEL = 'c15bf0cbfbd4893fd70c869c991f6d3d';
38 // 女首首页 38 // 女首首页
39 - const CODE_GIRLS_CHANNEL = '4d897f3b8eec0c465db0125e5b1f9edf'; 39 + const CODE_GIRLS_CHANNEL = 'a519ba44ef3a85cf3c05e405c6ba8e53';//'4d897f3b8eec0c465db0125e5b1f9edf';
40 // 'a519ba44ef3a85cf3c05e405c6ba8e53'; 40 // 'a519ba44ef3a85cf3c05e405c6ba8e53';
41 // 潮童首页 41 // 潮童首页
42 - const CODE_KIDS_CHANNEL = '331994d6fa8dc87f92a26dd45c0aa071'; 42 + const CODE_KIDS_CHANNEL = 'a7741b94e8bb9d56d0d36e00c05956f7';//'331994d6fa8dc87f92a26dd45c0aa071';
43 // 'a7741b94e8bb9d56d0d36e00c05956f7'; 43 // 'a7741b94e8bb9d56d0d36e00c05956f7';
44 44
45 // 创意生活新 45 // 创意生活新
@@ -221,8 +221,11 @@ class SearchModel @@ -221,8 +221,11 @@ class SearchModel
221 //组织数据结构 221 //组织数据结构
222 $data = HelperSearch::getProductPic($data['data']['product_list'], $options); 222 $data = HelperSearch::getProductPic($data['data']['product_list'], $options);
223 } 223 }
224 - $data['isFavorite'] = $options['isFavorite'];  
225 - echo json_encode($data); 224 + $res = array(
  225 + 'pics'=>$data,
  226 + 'isFavorite'=>$options['isFavorite']
  227 + );
  228 + echo json_encode($res);
226 } 229 }
227 230
228 /** 231 /**
@@ -20,7 +20,7 @@ class BackController extends WebAction { @@ -20,7 +20,7 @@ class BackController extends WebAction {
20 'coverImg' => $banner ['img'], 20 'coverImg' => $banner ['img'],
21 'countryCode' => '86', 21 'countryCode' => '86',
22 'countryName' => '中国', 22 'countryName' => '中国',
23 - 'captchaUrl' => '/passport/images?t=1449799445', 23 + 'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
24 'countryList' => RegData::getAreasData() 24 'countryList' => RegData::getAreasData()
25 ) 25 )
26 ); 26 );
@@ -34,7 +34,7 @@ class BackController extends WebAction { @@ -34,7 +34,7 @@ class BackController extends WebAction {
34 { 34 {
35 $phoneNum = $this->post('phoneNum', ''); 35 $phoneNum = $this->post('phoneNum', '');
36 $area = intval($this->post('area', '86')); 36 $area = intval($this->post('area', '86'));
37 - $verifyCode = $this->post('verifyCode', ''); 37 + $verifyCode = $this->post('verifyCode', '');//图形验证码
38 $data = array( 38 $data = array(
39 'code' => 200, 39 'code' => 200,
40 'message' => '验证成功' 40 'message' => '验证成功'
@@ -66,7 +66,7 @@ class BackController extends WebAction { @@ -66,7 +66,7 @@ class BackController extends WebAction {
66 public function emailAction() { 66 public function emailAction() {
67 $phoneNum = $this->post ('phoneNum', ''); 67 $phoneNum = $this->post ('phoneNum', '');
68 $area = intval ($this->post('area', '86')); 68 $area = intval ($this->post('area', '86'));
69 - $verifyCode = $this->post('verifyCode', ''); 69 + $verifyCode = $this->post('verifyCode', '');//图形验证码
70 if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱 70 if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
71 $email = $phoneNum; 71 $email = $phoneNum;
72 $data = BackData::sendCodeToEmail($email); 72 $data = BackData::sendCodeToEmail($email);
@@ -100,7 +100,7 @@ class BackController extends WebAction { @@ -100,7 +100,7 @@ class BackController extends WebAction {
100 { 100 {
101 $mobile = $this->post ('mobile', ''); 101 $mobile = $this->post ('mobile', '');
102 $area = intval ($this->post( 'area', '86' )); 102 $area = intval ($this->post( 'area', '86' ));
103 - $verifyCode = $this->post ('verifyCode', ''); 103 + $verifyCode = $this->post ('verifyCode', '');//图形验证码
104 $data = array('code' => 400, 'message' =>'验证失败'); 104 $data = array('code' => 400, 'message' =>'验证失败');
105 if(Helpers::verifyMobile($mobile) && PassportModel::verifyCode($verifyCode)) { // 验证手机号 105 if(Helpers::verifyMobile($mobile) && PassportModel::verifyCode($verifyCode)) { // 验证手机号
106 $data = BackData::sendCodeToMobile($mobile, $area); 106 $data = BackData::sendCodeToMobile($mobile, $area);
@@ -117,12 +117,21 @@ class BackController extends WebAction { @@ -117,12 +117,21 @@ class BackController extends WebAction {
117 $this->redirect ('index'); 117 $this->redirect ('index');
118 } 118 }
119 $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE); 119 $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  120 + $emailArr = explode('@', $email);
  121 + $emailUrl = '';//邮箱地址
  122 + $emailUrls = array('yoho.cn' =>'http://smail.yoho.cn');
  123 + if(in_array($emailArr[1], $emailUrls)){
  124 + $emailUrl = $emailUrls[$emailArr[1]];//邮箱后缀
  125 + } else {
  126 + $emailUrl = 'http://mail.'.$emailArr[1];
  127 + }
120 $data = array ( 128 $data = array (
121 'simpleHeader' => PassportModel::getSimpleHeader(false), 129 'simpleHeader' => PassportModel::getSimpleHeader(false),
122 'sendEmail' => array ( 130 'sendEmail' => array (
123 'coverHref' => $banner ['url'], 131 'coverHref' => $banner ['url'],
124 'coverImg' => $banner ['img'], 132 'coverImg' => $banner ['img'],
125 - 'countrys' => array () 133 + 'countrys' => array (),
  134 + 'email' => $emailUrl
126 ) 135 )
127 ); 136 );
128 $this->_view->display('send-email', $data); 137 $this->_view->display('send-email', $data);
@@ -133,7 +142,7 @@ class BackController extends WebAction { @@ -133,7 +142,7 @@ class BackController extends WebAction {
133 */ 142 */
134 public function backcodeAction() 143 public function backcodeAction()
135 { 144 {
136 - $code = $this->get('code'); 145 + $code = $this->get('code');//加密code兼容以前参数
137 $info = $this->checkCode($code); 146 $info = $this->checkCode($code);
138 $verifyState = false;//验证状态 147 $verifyState = false;//验证状态
139 $ret = array(); 148 $ret = array();
@@ -172,7 +181,7 @@ class BackController extends WebAction { @@ -172,7 +181,7 @@ class BackController extends WebAction {
172 */ 181 */
173 public function updateAction() 182 public function updateAction()
174 { 183 {
175 - $code = $this->post('code'); 184 + $code = $this->post('code');//加密code兼容以前参数
176 $password = $this->post('pwd'); 185 $password = $this->post('pwd');
177 $info = $this->checkCode($code); 186 $info = $this->checkCode($code);
178 if (Helpers::verifyPassword ($password)) { 187 if (Helpers::verifyPassword ($password)) {
@@ -224,7 +233,7 @@ class BackController extends WebAction { @@ -224,7 +233,7 @@ class BackController extends WebAction {
224 { 233 {
225 $mobile = $this->getSession ('mobile'); 234 $mobile = $this->getSession ('mobile');
226 $area = $this->getSession ('area'); 235 $area = $this->getSession ('area');
227 - $verifyCode = $this->getSession ('verifyCode'); 236 + $verifyCode = $this->getSession ('verifyCode');//图形验证码
228 if (empty ($mobile)) { 237 if (empty ($mobile)) {
229 $this->redirect ('index'); 238 $this->redirect ('index');
230 } 239 }
@@ -251,8 +260,8 @@ class BackController extends WebAction { @@ -251,8 +260,8 @@ class BackController extends WebAction {
251 { 260 {
252 $mobile = $this->post ( 'mobile' ); 261 $mobile = $this->post ( 'mobile' );
253 $area = $this->post ( 'area' ); 262 $area = $this->post ( 'area' );
254 - $verifyCode = $this->post ( 'verifyCode' );  
255 - $code = $this->post ( 'code' ); // code 263 + $verifyCode = $this->post ( 'verifyCode' );//图形验证码
  264 + $code = $this->post ( 'code' ); //手机验证码
256 $data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index'); 265 $data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index');
257 if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)) { 266 if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)) {
258 $result = BackData::validateMobileCode ( $mobile, $code, $area ); 267 $result = BackData::validateMobileCode ( $mobile, $code, $area );
@@ -19,13 +19,13 @@ class RegisterController extends WebAction @@ -19,13 +19,13 @@ class RegisterController extends WebAction
19 'registerPage' => true, 19 'registerPage' => true,
20 'simpleHeader' => PassportModel::getSimpleHeader(false), 20 'simpleHeader' => PassportModel::getSimpleHeader(false),
21 'passport' => array( 21 'passport' => array(
22 - 'actionUrl' => '/passport/register/mobileregister', 22 + 'actionUrl' => SITE_MAIN.'/passport/register/mobileregister',
23 'region' => RegData::getAreasData(), 23 'region' => RegData::getAreasData(),
24 'location' => '+86', 24 'location' => '+86',
25 - 'captchaUrl' => '/passport/images?t=1449799445', 25 + 'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
26 'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9', 26 'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9',
27 'referUrl' => $refer, 27 'referUrl' => $refer,
28 - 'loginUrl' => '/signin.html?refer='.$refer, 28 + 'loginUrl' => SITE_MAIN.'/signin.html?refer='.$refer,
29 'coverHref' => $cover['url'], 29 'coverHref' => $cover['url'],
30 'coverImg' => $cover['img'], 30 'coverImg' => $cover['img'],
31 'regBtnText' => '立即注册' 31 'regBtnText' => '立即注册'
@@ -183,14 +183,9 @@ class RegisterController extends WebAction @@ -183,14 +183,9 @@ class RegisterController extends WebAction
183 $mobile = trim($this->post('mobile'), ' ');//mobile 183 $mobile = trim($this->post('mobile'), ' ');//mobile
184 $area = intval(trim($this->post('area'), ' '));//area 184 $area = intval(trim($this->post('area'), ' '));//area
185 $verifyCode = strtolower(trim($this->post('verifyCode'),' '));//图形验证码 185 $verifyCode = strtolower(trim($this->post('verifyCode'),' '));//图形验证码
186 - $code = trim($this->post('code'),'');//code 186 + $code = trim($this->post('code'),'');//手机验证码
187 $password = $this->post('password'); 187 $password = $this->post('password');
188 - $url = '/passport/register/index';  
189 - $refer = $this->getCookie('refer');  
190 $data = array('code' => 400, 'message' => '', 'data' => ''); 188 $data = array('code' => 400, 'message' => '', 'data' => '');
191 - if(!empty($refer)) {  
192 - $refer = $url.'?refer='.$refer;  
193 - }  
194 do 189 do
195 { 190 {
196 /* 判断参数是否合法 */ 191 /* 判断参数是否合法 */
1 <?php 1 <?php
2 use Action\WebAction; 2 use Action\WebAction;
3 use LibModels\Web\Product\BrandData; 3 use LibModels\Web\Product\BrandData;
  4 +use LibModels\Web\Product\FavoriteData;
4 5
5 use \LibModels\Web\Product\HotrankData; 6 use \LibModels\Web\Product\HotrankData;
6 use product\HotrankModel; 7 use product\HotrankModel;
@@ -50,6 +51,7 @@ class IndexController extends WebAction @@ -50,6 +51,7 @@ class IndexController extends WebAction
50 51
51 //调用模型获得数据 52 //调用模型获得数据
52 $data = Product\BrandsModel::getBrandSearchData($condition, $options); 53 $data = Product\BrandsModel::getBrandSearchData($condition, $options);
  54 +
53 $data = array( 55 $data = array(
54 //初始化js 56 //初始化js
55 'searchListPage' => true, 57 'searchListPage' => true,
@@ -106,6 +108,24 @@ class IndexController extends WebAction @@ -106,6 +108,24 @@ class IndexController extends WebAction
106 //渲染模板 108 //渲染模板
107 $this->_view->display('list',$data); 109 $this->_view->display('list',$data);
108 } 110 }
  111 +
  112 + //收藏品牌
  113 + public function favoriteBrandAction()
  114 + {
  115 + if (!$this->isAjax()) {
  116 + return;
  117 + }
  118 + $uid = $this->post('uid');
  119 + $brandId = $this->post('brandId');
  120 + if ($uid && $brandId) {
  121 + //调用接口收藏或取消收藏
  122 + $result = FavoriteData::changeFavoriteBrand($uid, $brandId);
  123 + if (isset($result['code']) && $result['code'] == 200) {
  124 + $this ->echoJson($result['message']);
  125 + }
  126 + }
  127 + }
  128 +
109 /** 129 /**
110 * 热销排行 130 * 热销排行
111 */ 131 */