Authored by yangyang

修改收藏相关,keywords

@@ -30,6 +30,7 @@ class FavoriteData { @@ -30,6 +30,7 @@ class FavoriteData {
30 */ 30 */
31 public static function addUidProductFav($uid, $productSkn) 31 public static function addUidProductFav($uid, $productSkn)
32 { 32 {
  33 + //echo Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE;exit;
33 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'addUidProductFav', array($uid, $productSkn)); 34 return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'addUidProductFav', array($uid, $productSkn));
34 } 35 }
35 36
@@ -45,6 +46,18 @@ class FavoriteData { @@ -45,6 +46,18 @@ class FavoriteData {
45 } 46 }
46 47
47 /** 48 /**
  49 + * 根据uid和商品的skn收藏或取消收藏商品
  50 + * @param $uid
  51 + * @param $productSkn
  52 + * @return bool
  53 + */
  54 + public static function changeFavoriteProduct($uid, $productSkn)
  55 + {
  56 + //echo Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE;exit;
  57 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'toggleProduct', array($uid, $productSkn));
  58 + }
  59 +
  60 + /**
48 * 根据uid和商品的skn添加或取消收藏品牌 61 * 根据uid和商品的skn添加或取消收藏品牌
49 * @param $uid 62 * @param $uid
50 * @param $productSkn 63 * @param $productSkn
@@ -174,7 +174,7 @@ $goodInfoMain.on('click', '.col-btn', function() { @@ -174,7 +174,7 @@ $goodInfoMain.on('click', '.col-btn', function() {
174 url: '/product/list/changeFavorite', 174 url: '/product/list/changeFavorite',
175 data: { 175 data: {
176 skn: $this.closest('.good-info').data('skn'), 176 skn: $this.closest('.good-info').data('skn'),
177 - isFavorite: !$this.hasClass('coled') 177 + isFavorite: $this.hasClass('coled')
178 } 178 }
179 }).then(function(res) { 179 }).then(function(res) {
180 if (res.code === 200) { 180 if (res.code === 200) {
@@ -75,8 +75,17 @@ class BrandsModel @@ -75,8 +75,17 @@ class BrandsModel
75 } 75 }
76 76
77 //根据品牌域名处理相关品牌参数 77 //根据品牌域名处理相关品牌参数
78 - public static function getBrandByDomain($domain, $fields) 78 + public static function getBrandByDomain($domain, $type)
79 { 79 {
  80 + switch ($type) {
  81 + case 1:
  82 + $fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';
  83 + break;
  84 + case 2:
  85 + $fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
  86 + default:
  87 + break;
  88 + }
80 $brandInfo = BrandData::getBrandLogoByDomain($domain, $fields); 89 $brandInfo = BrandData::getBrandLogoByDomain($domain, $fields);
81 $result = array(); 90 $result = array();
82 if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) { 91 if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
@@ -18,8 +18,8 @@ class IndexController extends WebAction @@ -18,8 +18,8 @@ class IndexController extends WebAction
18 $this->go(SITE_MAIN); 18 $this->go(SITE_MAIN);
19 } 19 }
20 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页 20 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
21 - $fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';  
22 - $result = BrandsModel::getBrandByDomain($domain, $fields);//TODO 21 + $type = 1;
  22 + $result = BrandsModel::getBrandByDomain($domain, $type);
23 if (!$result) { 23 if (!$result) {
24 $this->go(SITE_MAIN); 24 $this->go(SITE_MAIN);
25 } 25 }
@@ -55,7 +55,9 @@ class IndexController extends WebAction @@ -55,7 +55,9 @@ class IndexController extends WebAction
55 'searchListPage' => true, 55 'searchListPage' => true,
56 'list' => $data 56 'list' => $data
57 ); 57 );
58 - //TODO 58 + $this->setTitle('潮流商品搜索 | YOHO!有货');
  59 + $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
  60 + $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
59 $this->setWebNavHeader(); 61 $this->setWebNavHeader();
60 //渲染模板 62 //渲染模板
61 $this->_view->display('list',$data); 63 $this->_view->display('list',$data);
@@ -73,8 +75,8 @@ class IndexController extends WebAction @@ -73,8 +75,8 @@ class IndexController extends WebAction
73 75
74 76
75 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页TODO 77 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页TODO
76 - $fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';  
77 - $result = BrandsModel::getBrandByDomain($domain, $fields); 78 + $type = 2;
  79 + $result = BrandsModel::getBrandByDomain($domain, $type);
78 if (!$result) { 80 if (!$result) {
79 $this->go(SITE_MAIN); 81 $this->go(SITE_MAIN);
80 } 82 }
@@ -112,16 +114,28 @@ class IndexController extends WebAction @@ -112,16 +114,28 @@ class IndexController extends WebAction
112 if (!$this->isAjax()) { 114 if (!$this->isAjax()) {
113 return; 115 return;
114 } 116 }
115 - //$uid = $this->post('uid');TODO  
116 - 117 + $result = array(
  118 + 'code' => '400',
  119 + 'message' => 'operation failed'
  120 + );
  121 + $uid = $this->getUid();
117 $brandId = $this->post('brandId'); 122 $brandId = $this->post('brandId');
118 - if ($uid && $brandId) {  
119 - //调用接口收藏或取消收藏  
120 - $result = FavoriteData::changeFavoriteBrand($uid, $brandId);  
121 - if (isset($result['code']) && $result['code'] == 200) {  
122 - $this ->echoJson($result);  
123 - }//TODO  
124 - } 123 + do{
  124 + if (!$uid) {
  125 + $result = array(
  126 + 'code' => '403',
  127 + 'message' => 'uid is null'
  128 + );
  129 + break;
  130 + }
  131 + if ($uid && $brandId) {
  132 + //调用接口收藏或取消收藏
  133 + $result = FavoriteData::changeFavoriteBrand($uid, $brandId);
  134 + break;
  135 + }
  136 + }while(false);
  137 +
  138 + $this->echoJson($result);
125 } 139 }
126 140
127 /** 141 /**
@@ -26,6 +26,9 @@ class ListController extends WebAction @@ -26,6 +26,9 @@ class ListController extends WebAction
26 'productListPage' => true, 26 'productListPage' => true,
27 'list' => $indexData 27 'list' => $indexData
28 ); 28 );
  29 + $this->setTitle('潮流商品搜索 | YOHO!有货');
  30 + $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
  31 + $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
29 $this->setWebNavHeader(); 32 $this->setWebNavHeader();
30 $this->_view->display('list', $data); 33 $this->_view->display('list', $data);
31 } 34 }
@@ -45,11 +48,11 @@ class ListController extends WebAction @@ -45,11 +48,11 @@ class ListController extends WebAction
45 $newData = NewModel::getNewSearchData($condition, $options); 48 $newData = NewModel::getNewSearchData($condition, $options);
46 $data = array( 49 $data = array(
47 'productListPage' => true, 50 'productListPage' => true,
48 - 'newSale' => $newData,  
49 - 'title' => '潮流商品搜索 | YOHO!有货',  
50 - 'keywords' => 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流',  
51 - 'description' => '潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜' 51 + 'newSale' => $newData
52 ); 52 );
  53 + $this->setTitle('潮流商品搜索 | YOHO!有货');
  54 + $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
  55 + $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
53 $this->setWebNavHeader(); 56 $this->setWebNavHeader();
54 //渲染模板 57 //渲染模板
55 $this->_view->display('new-sale', $data); 58 $this->_view->display('new-sale', $data);
@@ -75,11 +78,11 @@ class ListController extends WebAction @@ -75,11 +78,11 @@ class ListController extends WebAction
75 $data = array( 78 $data = array(
76 //初始化js 79 //初始化js
77 'productListPage' => true, 80 'productListPage' => true,
78 - 'list' => $list,  
79 - 'title' => '潮流商品搜索 | YOHO!有货',  
80 - 'keywords' => 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流',  
81 - 'description' => '潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜' 81 + 'list' => $list
82 ); 82 );
  83 + $this->setTitle('潮流商品搜索 | YOHO!有货');
  84 + $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
  85 + $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
83 $this->setWebNavHeader(); 86 $this->setWebNavHeader();
84 $this->_view->display('list', $data); 87 $this->_view->display('list', $data);
85 } 88 }
@@ -100,7 +103,6 @@ class ListController extends WebAction @@ -100,7 +103,6 @@ class ListController extends WebAction
100 } 103 }
101 $productSkn = $this->post('skn'); 104 $productSkn = $this->post('skn');
102 $uid = $this->getUid(); 105 $uid = $this->getUid();
103 -  
104 if (!$productSkn) { 106 if (!$productSkn) {
105 $this ->echoJson($res); 107 $this ->echoJson($res);
106 return ; 108 return ;
@@ -143,10 +145,10 @@ class ListController extends WebAction @@ -143,10 +145,10 @@ class ListController extends WebAction
143 public function changeFavoriteAction() 145 public function changeFavoriteAction()
144 { 146 {
145 $result = array( 147 $result = array(
146 - 'code'=>400 148 + 'code' => 400,
  149 + 'message' => 'operation failed'
147 ); 150 );
148 if (!$this->isAjax()) { 151 if (!$this->isAjax()) {
149 - $this->echoJson($resut);  
150 return; 152 return;
151 } 153 }
152 $productSkn = $this->post('skn'); 154 $productSkn = $this->post('skn');
@@ -154,10 +156,17 @@ class ListController extends WebAction @@ -154,10 +156,17 @@ class ListController extends WebAction
154 $uid = $this->getUid(); 156 $uid = $this->getUid();
155 157
156 do { 158 do {
157 - if (!$productSkn && !$uid) { 159 + if (!$uid) {
  160 + $result = array(
  161 + 'code' => '403',
  162 + 'message' => 'uid is null'
  163 + );
  164 + break;
  165 + }
  166 + if (!isset($productSkn)) {
158 break; 167 break;
159 } 168 }
160 - if ($isFavorite) { 169 + if ($isFavorite == 'true') {
161 $result = FavoriteData::delUidProductFav($uid, $productSkn); 170 $result = FavoriteData::delUidProductFav($uid, $productSkn);
162 break; 171 break;
163 }else{ 172 }else{
@@ -56,6 +56,9 @@ class SaleController extends WebAction @@ -56,6 +56,9 @@ class SaleController extends WebAction
56 'productListPage' => true, 56 'productListPage' => true,
57 'newSale' => $saleData 57 'newSale' => $saleData
58 ); 58 );
  59 + $this->setTitle('潮流商品搜索 | YOHO!有货');
  60 + $this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
  61 + $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
59 $this->setWebNavHeader(); 62 $this->setWebNavHeader();
60 //渲染模板 63 //渲染模板
61 $this->_view->display('new-sale', $data); 64 $this->_view->display('new-sale', $data);