Authored by yangyang

修改收藏相关,keywords

... ... @@ -30,6 +30,7 @@ class FavoriteData {
*/
public static function addUidProductFav($uid, $productSkn)
{
//echo Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE;exit;
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'addUidProductFav', array($uid, $productSkn));
}
... ... @@ -45,6 +46,18 @@ class FavoriteData {
}
/**
* 根据uid和商品的skn收藏或取消收藏商品
* @param $uid
* @param $productSkn
* @return bool
*/
public static function changeFavoriteProduct($uid, $productSkn)
{
//echo Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE;exit;
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'toggleProduct', array($uid, $productSkn));
}
/**
* 根据uid和商品的skn添加或取消收藏品牌
* @param $uid
* @param $productSkn
... ...
... ... @@ -174,7 +174,7 @@ $goodInfoMain.on('click', '.col-btn', function() {
url: '/product/list/changeFavorite',
data: {
skn: $this.closest('.good-info').data('skn'),
isFavorite: !$this.hasClass('coled')
isFavorite: $this.hasClass('coled')
}
}).then(function(res) {
if (res.code === 200) {
... ...
... ... @@ -75,8 +75,17 @@ class BrandsModel
}
//根据品牌域名处理相关品牌参数
public static function getBrandByDomain($domain, $fields)
public static function getBrandByDomain($domain, $type)
{
switch ($type) {
case 1:
$fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';
break;
case 2:
$fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
default:
break;
}
$brandInfo = BrandData::getBrandLogoByDomain($domain, $fields);
$result = array();
if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
... ...
... ... @@ -18,8 +18,8 @@ class IndexController extends WebAction
$this->go(SITE_MAIN);
}
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
$fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';
$result = BrandsModel::getBrandByDomain($domain, $fields);//TODO
$type = 1;
$result = BrandsModel::getBrandByDomain($domain, $type);
if (!$result) {
$this->go(SITE_MAIN);
}
... ... @@ -55,7 +55,9 @@ class IndexController extends WebAction
'searchListPage' => true,
'list' => $data
);
//TODO
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
//渲染模板
$this->_view->display('list',$data);
... ... @@ -73,8 +75,8 @@ class IndexController extends WebAction
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页TODO
$fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
$result = BrandsModel::getBrandByDomain($domain, $fields);
$type = 2;
$result = BrandsModel::getBrandByDomain($domain, $type);
if (!$result) {
$this->go(SITE_MAIN);
}
... ... @@ -112,16 +114,28 @@ class IndexController extends WebAction
if (!$this->isAjax()) {
return;
}
//$uid = $this->post('uid');TODO
$result = array(
'code' => '400',
'message' => 'operation failed'
);
$uid = $this->getUid();
$brandId = $this->post('brandId');
do{
if (!$uid) {
$result = array(
'code' => '403',
'message' => 'uid is null'
);
break;
}
if ($uid && $brandId) {
//调用接口收藏或取消收藏
$result = FavoriteData::changeFavoriteBrand($uid, $brandId);
if (isset($result['code']) && $result['code'] == 200) {
$this ->echoJson($result);
}//TODO
break;
}
}while(false);
$this->echoJson($result);
}
/**
... ...
... ... @@ -26,6 +26,9 @@ class ListController extends WebAction
'productListPage' => true,
'list' => $indexData
);
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
$this->_view->display('list', $data);
}
... ... @@ -45,11 +48,11 @@ class ListController extends WebAction
$newData = NewModel::getNewSearchData($condition, $options);
$data = array(
'productListPage' => true,
'newSale' => $newData,
'title' => '潮流商品搜索 | YOHO!有货',
'keywords' => 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流',
'description' => '潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
'newSale' => $newData
);
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
//渲染模板
$this->_view->display('new-sale', $data);
... ... @@ -75,11 +78,11 @@ class ListController extends WebAction
$data = array(
//初始化js
'productListPage' => true,
'list' => $list,
'title' => '潮流商品搜索 | YOHO!有货',
'keywords' => 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流',
'description' => '潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
'list' => $list
);
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
$this->_view->display('list', $data);
}
... ... @@ -100,7 +103,6 @@ class ListController extends WebAction
}
$productSkn = $this->post('skn');
$uid = $this->getUid();
if (!$productSkn) {
$this ->echoJson($res);
return ;
... ... @@ -143,10 +145,10 @@ class ListController extends WebAction
public function changeFavoriteAction()
{
$result = array(
'code'=>400
'code' => 400,
'message' => 'operation failed'
);
if (!$this->isAjax()) {
$this->echoJson($resut);
return;
}
$productSkn = $this->post('skn');
... ... @@ -154,10 +156,17 @@ class ListController extends WebAction
$uid = $this->getUid();
do {
if (!$productSkn && !$uid) {
if (!$uid) {
$result = array(
'code' => '403',
'message' => 'uid is null'
);
break;
}
if (!isset($productSkn)) {
break;
}
if ($isFavorite) {
if ($isFavorite == 'true') {
$result = FavoriteData::delUidProductFav($uid, $productSkn);
break;
}else{
... ...
... ... @@ -56,6 +56,9 @@ class SaleController extends WebAction
'productListPage' => true,
'newSale' => $saleData
);
$this->setTitle('潮流商品搜索 | YOHO!有货');
$this->setKeywords('Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流');
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
//渲染模板
$this->_view->display('new-sale', $data);
... ...