Authored by yangyang

ajax请求商品图片修改

@@ -133,7 +133,7 @@ class BrandsModel @@ -133,7 +133,7 @@ class BrandsModel
133 $urlList['brand'] = SearchData::getBrandUrl($customOptions); 133 $urlList['brand'] = SearchData::getBrandUrl($customOptions);
134 134
135 //批量调接口 135 //批量调接口
136 - $result = Yohobuy::getMulti($urlList, array(), true); 136 + $result = Yohobuy::getMulti($urlList);
137 137
138 //组织模板数据格式 138 //组织模板数据格式
139 $data = HelperSearch::getList($result, $searchCondition['options']); 139 $data = HelperSearch::getList($result, $searchCondition['options']);
@@ -26,7 +26,7 @@ class IndexModel @@ -26,7 +26,7 @@ class IndexModel
26 $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']); 26 $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
27 27
28 //批量调接口获取数据 28 //批量调接口获取数据
29 - $result = Yohobuy::getMulti($urlList, array(), true); 29 + $result = Yohobuy::getMulti($urlList);
30 30
31 // 组织模板数据 31 // 组织模板数据
32 $data = HelperSearch::getList($result, $searchCondition['options']); 32 $data = HelperSearch::getList($result, $searchCondition['options']);
@@ -25,7 +25,7 @@ class NewModel @@ -25,7 +25,7 @@ class NewModel
25 // 组合搜索最新上架url 25 // 组合搜索最新上架url
26 $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']); 26 $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);
27 27
28 - $result = Yohobuy::getMulti($urlList, array(), true); 28 + $result = Yohobuy::getMulti($urlList);
29 // 组织模板数据 29 // 组织模板数据
30 $data = HelperSearch::getList($result, $searchCondition['options']); 30 $data = HelperSearch::getList($result, $searchCondition['options']);
31 31
@@ -27,7 +27,7 @@ class SaleModel @@ -27,7 +27,7 @@ class SaleModel
27 $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']); 27 $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
28 28
29 //批量调接口 29 //批量调接口
30 - $result = Yohobuy::getMulti($urlList, array(), true); 30 + $result = Yohobuy::getMulti($urlList);
31 31
32 //组织模板数据格式 32 //组织模板数据格式
33 $data = HelperSearch::getList($result, $searchCondition['options']); 33 $data = HelperSearch::getList($result, $searchCondition['options']);
@@ -33,8 +33,8 @@ class SearchModel @@ -33,8 +33,8 @@ class SearchModel
33 'query' => FILTER_SANITIZE_STRING, 33 'query' => FILTER_SANITIZE_STRING,
34 'brand' => FILTER_SANITIZE_STRING, 34 'brand' => FILTER_SANITIZE_STRING,
35 'sort' => FILTER_VALIDATE_INT, 35 'sort' => FILTER_VALIDATE_INT,
36 - 'msort' => FILTER_VALIDATE_INT,  
37 - 'misort' => FILTER_VALIDATE_INT, 36 + 'msort' => FILTER_SANITIZE_STRING,
  37 + 'misort' => FILTER_SANITIZE_STRING,
38 'color' => FILTER_VALIDATE_INT, 38 'color' => FILTER_VALIDATE_INT,
39 'size' => FILTER_DEFAULT, 39 'size' => FILTER_DEFAULT,
40 'style' => FILTER_DEFAULT, 40 'style' => FILTER_DEFAULT,
@@ -156,7 +156,7 @@ class SearchModel @@ -156,7 +156,7 @@ class SearchModel
156 // 组合搜索折扣区间url 156 // 组合搜索折扣区间url
157 $urlList['discount'] = SearchData::getDiscountUrl($searchCondition['condition']); 157 $urlList['discount'] = SearchData::getDiscountUrl($searchCondition['condition']);
158 158
159 - $result = Yohobuy::getMulti($urlList, array(), true); 159 + $result = Yohobuy::getMulti($urlList);
160 // 组织模板数据 160 // 组织模板数据
161 $data = HelperSearch::getList($result, $searchCondition['options']); 161 $data = HelperSearch::getList($result, $searchCondition['options']);
162 return $data; 162 return $data;
@@ -238,7 +238,7 @@ class SearchModel @@ -238,7 +238,7 @@ class SearchModel
238 'pics'=>$data, 238 'pics'=>$data,
239 'isFavorite'=>$options['isFavorite'] 239 'isFavorite'=>$options['isFavorite']
240 ); 240 );
241 - echo json_encode($res); 241 + return $res;
242 } 242 }
243 243
244 /** 244 /**
@@ -45,7 +45,10 @@ class ListController extends WebAction @@ -45,7 +45,10 @@ class ListController extends WebAction
45 $newData = NewModel::getNewSearchData($condition, $options); 45 $newData = NewModel::getNewSearchData($condition, $options);
46 $data = array( 46 $data = array(
47 'productListPage' => true, 47 'productListPage' => true,
48 - 'newSale' => $newData 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,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
49 ); 52 );
50 $this->setWebNavHeader(); 53 $this->setWebNavHeader();
51 //渲染模板 54 //渲染模板
@@ -72,7 +75,10 @@ class ListController extends WebAction @@ -72,7 +75,10 @@ class ListController extends WebAction
72 $data = array( 75 $data = array(
73 //初始化js 76 //初始化js
74 'productListPage' => true, 77 'productListPage' => true,
75 - 'list' => $list 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,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
76 ); 82 );
77 $this->setWebNavHeader(); 83 $this->setWebNavHeader();
78 $this->_view->display('list', $data); 84 $this->_view->display('list', $data);
@@ -85,13 +91,18 @@ class ListController extends WebAction @@ -85,13 +91,18 @@ class ListController extends WebAction
85 */ 91 */
86 public function getProductPicAction() 92 public function getProductPicAction()
87 { 93 {
  94 + $res = array(
  95 + 'code' => 400
  96 + );
88 if (!$this->isAjax()) { 97 if (!$this->isAjax()) {
  98 + $this ->echoJson($res);
89 return; 99 return;
90 } 100 }
91 - $product_skn = $this->post('skn');//TODO 101 + $productSkn = $this->post('skn');
92 $uid = $this->getUid(); 102 $uid = $this->getUid();
93 103
94 - if (!$product_skn) { 104 + if (!$productSkn) {
  105 + $this ->echoJson($res);
95 return ; 106 return ;
96 } 107 }
97 //大图 108 //大图
@@ -114,43 +125,46 @@ class ListController extends WebAction @@ -114,43 +125,46 @@ class ListController extends WebAction
114 125
115 $isFavorite = false; 126 $isFavorite = false;
116 if ($uid) { 127 if ($uid) {
117 - $favorite = FavoriteData::getUidProductFav($uid, $product_skn); 128 + $favorite = FavoriteData::getUidProductFav($uid, $productSkn);
118 if (isset($favorite['code']) && $favorite['code'] == 200) { 129 if (isset($favorite['code']) && $favorite['code'] == 200) {
119 $isFavorite = true; 130 $isFavorite = true;
120 } 131 }
121 } 132 }
122 $options['isFavorite'] = $isFavorite; 133 $options['isFavorite'] = $isFavorite;
123 - SearchModel::getProductPic($product_skn, $options);//TODO 134 + $res = SearchModel::getProductPic($productSkn, $options);
  135 + $this ->echoJson($res);
124 } 136 }
125 137
126 /** 138 /**
127 - * 根据product_skn收藏 139 + * 根据productSkn收藏
128 * @author 140 * @author
129 * @return json 141 * @return json
130 */ 142 */
131 public function changeFavoriteAction() 143 public function changeFavoriteAction()
132 { 144 {
  145 + $result = array(
  146 + 'code'=>400
  147 + );
133 if (!$this->isAjax()) { 148 if (!$this->isAjax()) {
  149 + $this->echoJson($resut);
134 return; 150 return;
135 } 151 }
136 - $product_skn = $this->post('skn'); 152 + $productSkn = $this->post('skn');
137 $isFavorite = $this->post('isFavorite'); 153 $isFavorite = $this->post('isFavorite');
138 $uid = $this->getUid(); 154 $uid = $this->getUid();
139 155
140 do { 156 do {
141 - if (!$product_skn && !$uid) {  
142 - break;//TODO 157 + if (!$productSkn && !$uid) {
  158 + break;
143 } 159 }
144 if ($isFavorite) { 160 if ($isFavorite) {
145 - $result = FavoriteData::delUidProductFav($uid, $product_skn);  
146 - $this->echoJson($result); 161 + $result = FavoriteData::delUidProductFav($uid, $productSkn);
147 break; 162 break;
148 }else{ 163 }else{
149 - $result = FavoriteData::addUidProductFav($uid, $product_skn);  
150 - $this->echoJson($result); 164 + $result = FavoriteData::addUidProductFav($uid, $productSkn);
151 break; 165 break;
152 } 166 }
153 } while(false); 167 } while(false);
154 - 168 + $this->echoJson($result);
155 } 169 }
156 } 170 }