Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
24 changed files
with
766 additions
and
262 deletions
@@ -11,31 +11,114 @@ class SearchData extends \LibModels\Wap\Product\SearchData | @@ -11,31 +11,114 @@ class SearchData extends \LibModels\Wap\Product\SearchData | ||
11 | * | 11 | * |
12 | * @return string | 12 | * @return string |
13 | */ | 13 | */ |
14 | - private static function getUrl($type = 'search') | 14 | + public static function getUrl($type = 'search') |
15 | { | 15 | { |
16 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); | 16 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); |
17 | switch (APPLICATION_ENV) { | 17 | switch (APPLICATION_ENV) { |
18 | case 'release': | 18 | case 'release': |
19 | - if($type == 'sort'){ | 19 | + if ($type == 'sort') { |
20 | return 'http://100.98.132.63/yohosearch/sortgroup.json'; | 20 | return 'http://100.98.132.63/yohosearch/sortgroup.json'; |
21 | } | 21 | } |
22 | - elseif($type == 'suggest'){ | ||
23 | - return 'http://100.98.132.63/yohosearch/suggest.json'; | 22 | + elseif ($type == 'discount') { |
23 | + return 'http://100.98.132.63/yohosearch/discount.json'; | ||
24 | + } | ||
25 | + elseif ($type == 'recent') { | ||
26 | + return 'http://100.98.132.63/yohosearch/recent.json'; | ||
27 | + } | ||
28 | + elseif ($type == 'shop') { | ||
29 | + return 'http://100.98.132.63/yohosearch/shops.json'; | ||
24 | } | 30 | } |
25 | return 'http://100.98.132.63/yohosearch/search.json'; | 31 | return 'http://100.98.132.63/yohosearch/search.json'; |
26 | case 'test': | 32 | case 'test': |
27 | case 'preview': | 33 | case 'preview': |
28 | case 'developer': | 34 | case 'developer': |
29 | default: | 35 | default: |
30 | - if($type == 'sort'){ | 36 | + if ($type == 'sort') { |
31 | return 'http://101.200.31.165/yohosearch/sortgroup.json'; | 37 | return 'http://101.200.31.165/yohosearch/sortgroup.json'; |
32 | } | 38 | } |
33 | - elseif($type == 'suggest'){ | ||
34 | - return 'http://101.200.31.165/yohosearch/suggest.json'; | 39 | + elseif ($type == 'discount') { |
40 | + return 'http://101.200.31.165/yohosearch/discount.json'; | ||
41 | + } | ||
42 | + elseif ($type == 'recent') { | ||
43 | + return 'http://101.200.31.165/yohosearch/recent.json'; | ||
44 | + } | ||
45 | + elseif ($type == 'shop') { | ||
46 | + return 'http://101.200.31.165/yohosearch/shops.json'; | ||
47 | + } | ||
48 | +// return 'http://101.200.31.165/yohosearch/search.json'; | ||
49 | + return 'http://192.168.10.64:8080/yohosearch/search-once.json'; | ||
50 | + } | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * 根据给定查询数据搜索数据列表 (新的) | ||
55 | + * | ||
56 | + * @param string $query 查询条件, 默认为null | ||
57 | + * @param string $brand 品牌,默认为null | ||
58 | + * @param string $gender 性别,默认为null,"1,3"表示男, "2,3"表示女, "1,2,3"表示全部 | ||
59 | + * @param integer $color 颜色id | ||
60 | + * @param integer $size 尺码id | ||
61 | + * @param integer $price 价格 | ||
62 | + * @param string $p_d 折扣,默认为null | ||
63 | + * @param string $sort 商品所属品类,默认为null | ||
64 | + * @param string $order 排序方式,默认为按照时间倒序排列s_t_desc, | ||
65 | + * s_t_asc表示按时间正序排列, | ||
66 | + * s_p_asc表示按价格正序排列, | ||
67 | + * s_p_desc表示按价格倒序排列, | ||
68 | + * p_d_asc表示按折扣正序排列, | ||
69 | + * p_d_desc表示按折扣倒序排列 | ||
70 | + * @param integer $page 指定查询是多少页,默认为第一页 | ||
71 | + * @param integer $limit 指定查询多少个,默认是60个 | ||
72 | + * @param integer $channel表示哪个频道,1表示男生,2表示女生,3表示潮童,4表示创意生活 | ||
73 | + * @return array 搜索到的数据 | ||
74 | + */ | ||
75 | + public static function searchElasticByCondition($condition, $cache = false) | ||
76 | + { | ||
77 | + // 排序数据映射表 | ||
78 | + $orderMaps = array( | ||
79 | + 's_t_desc' => 'shelve_time:desc', | ||
80 | + 's_t_asc' => 'shelve_time:asc', | ||
81 | + 's_p_asc' => 'sales_price:asc', | ||
82 | + 's_p_desc' => 'sales_price:desc', | ||
83 | + 'p_d_desc' => 'discount:desc', | ||
84 | + 'p_d_asc' => 'discount:asc', | ||
85 | + 'skn_desc' => 'product_skn:desc', | ||
86 | + 'skn_asc' => 'product_skn:asc', | ||
87 | + 'activities_desc' => 'activities.order_by:desc', | ||
88 | + 'activities_asc' => 'activities.order_by:asc', | ||
89 | + 's_n_asc' => 'sales_num:asc', | ||
90 | + 's_n_desc' => 'sales_num:desc', | ||
91 | + 'activities_id_desc' => 'activities.activity_id:desc', | ||
92 | + 'activities_id_asc' => 'activities.activity_id:asc', | ||
93 | + ); | ||
94 | + | ||
95 | + $param = array(); | ||
96 | + $param['status'] = 1; // 是否上架,1表示在架,2表示不在 | ||
97 | + $param['sales'] = 'Y'; // 只搜索销售的产品 | ||
98 | + $param['stocknumber'] = 1; // 过滤掉已售罄的商品 | ||
99 | + // $param['needFilter'] = 1; // 是否需要返回筛选条件 | ||
100 | + if (!isset($condition['order'])) { | ||
101 | + $param['order'] = $orderMaps['s_t_desc']; | ||
102 | + } else { | ||
103 | + $param['order'] = $orderMaps[$condition['order']]; | ||
104 | + } | ||
105 | + if (!isset($condition['page'])) { | ||
106 | + $param['page'] = 1; | ||
35 | } | 107 | } |
36 | 108 | ||
37 | - return 'http://101.200.31.165/yohosearch/search.json'; | 109 | + if(isset($condition['viewNum'])) { |
110 | + $param['viewNum'] = $condition['viewNum']; | ||
111 | + } else if (!isset($condition['limit'])) { | ||
112 | + $param['viewNum'] = 60; | ||
113 | + } else { | ||
114 | + $param['viewNum'] = $condition['limit']; | ||
115 | + unset($condition['limit']); | ||
38 | } | 116 | } |
117 | + if (!empty($condition)) { | ||
118 | + $param += $condition; | ||
119 | + } | ||
120 | + | ||
121 | + return Yohobuy::get(self::getUrl('search'), $param, $cache); | ||
39 | } | 122 | } |
40 | /** | 123 | /** |
41 | * 根据分类列表获取商品信息 | 124 | * 根据分类列表获取商品信息 |
@@ -4,6 +4,7 @@ namespace Plugin; | @@ -4,6 +4,7 @@ namespace Plugin; | ||
4 | 4 | ||
5 | use Plugin\Paging; | 5 | use Plugin\Paging; |
6 | use LibModels\Web\Product\BrandData; | 6 | use LibModels\Web\Product\BrandData; |
7 | +use LibModels\Web\Product\SearchData; | ||
7 | use Api\Yohobuy; | 8 | use Api\Yohobuy; |
8 | use Api\Sign; | 9 | use Api\Sign; |
9 | /** | 10 | /** |
@@ -89,6 +90,10 @@ class HelperSearch | @@ -89,6 +90,10 @@ class HelperSearch | ||
89 | $result['shopEntry'] = isset($data['shop']) && !empty($data['shop']) ? self::shop($data['shop'], $data['sort']['sort']) : array(); | 90 | $result['shopEntry'] = isset($data['shop']) && !empty($data['shop']) ? self::shop($data['shop'], $data['sort']['sort']) : array(); |
90 | //分页 | 91 | //分页 |
91 | $result['pager'] = self::pager($result['totalCount'],$options['viewNum']-1); | 92 | $result['pager'] = self::pager($result['totalCount'],$options['viewNum']-1); |
93 | + //浏览记录 | ||
94 | + if (isset($options['reviewNum']) && !empty($options['reviewNum'])) { | ||
95 | + $result['latestWalk'] = $options['reviewNum']; | ||
96 | + } | ||
92 | //选中条件 | 97 | //选中条件 |
93 | $result['filters']['checkedConditions'] = self::getSelected(); | 98 | $result['filters']['checkedConditions'] = self::getSelected(); |
94 | if (isset($options['controller']) && $options['controller'] == 'Search') { | 99 | if (isset($options['controller']) && $options['controller'] == 'Search') { |
@@ -134,7 +139,7 @@ class HelperSearch | @@ -134,7 +139,7 @@ class HelperSearch | ||
134 | if (!empty($val['default_images'])) { | 139 | if (!empty($val['default_images'])) { |
135 | $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]); | 140 | $val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]); |
136 | } | 141 | } |
137 | - $goods[] = array( | 142 | + $good = array( |
138 | 'tags' => array( | 143 | 'tags' => array( |
139 | 'isNew' => $isNew, | 144 | 'isNew' => $isNew, |
140 | 'isLimit' => $isLimit | 145 | 'isLimit' => $isLimit |
@@ -143,12 +148,16 @@ class HelperSearch | @@ -143,12 +148,16 @@ class HelperSearch | ||
143 | 'thumb' => $val['default_images'], | 148 | 'thumb' => $val['default_images'], |
144 | 'name' => $val['product_name'], | 149 | 'name' => $val['product_name'], |
145 | 'salePrice' => $val['sales_price'], | 150 | 'salePrice' => $val['sales_price'], |
146 | - 'marketPrice' => $val['market_price'], | ||
147 | 'isFew' => $isFew, | 151 | 'isFew' => $isFew, |
148 | 'skn' => $val['product_skn'], | 152 | 'skn' => $val['product_skn'], |
149 | 'showColBtn' => true, | 153 | 'showColBtn' => true, |
150 | 'coled' => true | 154 | 'coled' => true |
151 | ); | 155 | ); |
156 | + //市场价不等于售价时显示 | ||
157 | + if ($val['market_price'] != $val['sales_price']) { | ||
158 | + $good['marketPrice'] = $val['market_price']; | ||
159 | + } | ||
160 | + $goods[] = $good; | ||
152 | } | 161 | } |
153 | return $goods; | 162 | return $goods; |
154 | } | 163 | } |
@@ -343,10 +352,6 @@ class HelperSearch | @@ -343,10 +352,6 @@ class HelperSearch | ||
343 | array( | 352 | array( |
344 | 'index' => 'all', | 353 | 'index' => 'all', |
345 | 'name' => '全部' | 354 | 'name' => '全部' |
346 | - ), | ||
347 | - array( | ||
348 | - 'index' => '0-9', | ||
349 | - 'name' => '0 ~ 9' | ||
350 | ) | 355 | ) |
351 | ), | 356 | ), |
352 | 'brandsShow' => array() | 357 | 'brandsShow' => array() |
@@ -356,17 +361,29 @@ class HelperSearch | @@ -356,17 +361,29 @@ class HelperSearch | ||
356 | $brandIds = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array(); | 361 | $brandIds = isset($params['brand']) && !empty($params['brand']) ? explode(',', $params['brand']) : array(); |
357 | if (isset($filter['brand']) && !empty($filter['brand'])) { | 362 | if (isset($filter['brand']) && !empty($filter['brand'])) { |
358 | $brand = $filter['brand']; | 363 | $brand = $filter['brand']; |
364 | +// print_r($filter); exit; | ||
365 | + //已选中品牌数量 | ||
366 | + $existBrandNum = 0; | ||
367 | + //已选中品牌标签名 | ||
368 | + $existName = ''; | ||
359 | foreach ($brand as $key => $v) { | 369 | foreach ($brand as $key => $v) { |
360 | $selectBrandIds = $brandIds; | 370 | $selectBrandIds = $brandIds; |
361 | - //品牌id在提交的参数中,构造url参数去除该品牌id | 371 | + //品牌已被选中 |
362 | if (in_array($v['id'], $brandIds)) { | 372 | if (in_array($v['id'], $brandIds)) { |
363 | $filterKey = array_search($v['id'], $selectBrandIds); | 373 | $filterKey = array_search($v['id'], $selectBrandIds); |
364 | unset($selectBrandIds[$filterKey]); | 374 | unset($selectBrandIds[$filterKey]); |
365 | $url = self::buildUrl(array_merge($params, array( | 375 | $url = self::buildUrl(array_merge($params, array( |
366 | 'brand' => implode(',', $selectBrandIds) | 376 | 'brand' => implode(',', $selectBrandIds) |
367 | ))); | 377 | ))); |
378 | + if ($existBrandNum === 0) { | ||
379 | + $existName .= $v['brand_name'].'、'; | ||
380 | + } | ||
381 | + if ($existBrandNum === 1){ | ||
382 | + $existName .= substr($v['brand_name'], 0, 3).'...'; | ||
383 | + } | ||
384 | + $existBrandNum++; | ||
368 | } | 385 | } |
369 | - //该品牌url参数中添加该品牌的id | 386 | + //该品牌未被选中 |
370 | else { | 387 | else { |
371 | $selectBrandIds[] = $v['id']; | 388 | $selectBrandIds[] = $v['id']; |
372 | $url = self::buildUrl(array_merge($params, array( | 389 | $url = self::buildUrl(array_merge($params, array( |
@@ -396,25 +413,6 @@ class HelperSearch | @@ -396,25 +413,6 @@ class HelperSearch | ||
396 | } | 413 | } |
397 | //清空品牌参数 | 414 | //清空品牌参数 |
398 | unset($params['brand']); | 415 | unset($params['brand']); |
399 | - //设置已选中的品牌 | ||
400 | - $existBrandNum = 0; | ||
401 | - $existName = ''; | ||
402 | - foreach ($brandIds as $key => $val) { | ||
403 | - if (isset($brandAll[$val])) { | ||
404 | - $brandParam = $brandIds; | ||
405 | - unset($brandParam[$key]); | ||
406 | - if ($existBrandNum === 0) { | ||
407 | - $existName .= $brandAll[$val].'、'; | ||
408 | - } | ||
409 | - if ($existBrandNum === 1){ | ||
410 | - $existName .= substr($brandAll[$val], 0, 3).'...'; | ||
411 | - } | ||
412 | - $existBrandNum++; | ||
413 | - } | ||
414 | - if ($existBrandNum > 1) { | ||
415 | - break; | ||
416 | - } | ||
417 | - } | ||
418 | //设置选中 | 416 | //设置选中 |
419 | if (isset(self::$params['brand']) && !empty(self::$params['brand'])) { | 417 | if (isset(self::$params['brand']) && !empty(self::$params['brand'])) { |
420 | self::$selected['brand'] = array( | 418 | self::$selected['brand'] = array( |
@@ -448,6 +446,7 @@ class HelperSearch | @@ -448,6 +446,7 @@ class HelperSearch | ||
448 | if (count($result['brandsShow']) < 11) { | 446 | if (count($result['brandsShow']) < 11) { |
449 | $result['hideMore'] = true; | 447 | $result['hideMore'] = true; |
450 | } | 448 | } |
449 | +// print_r($result); exit; | ||
451 | return $result; | 450 | return $result; |
452 | } | 451 | } |
453 | /** | 452 | /** |
@@ -459,14 +458,14 @@ class HelperSearch | @@ -459,14 +458,14 @@ class HelperSearch | ||
459 | { | 458 | { |
460 | $params = self::$params; | 459 | $params = self::$params; |
461 | $paramsValue = array_filter($params); | 460 | $paramsValue = array_filter($params); |
462 | - if (!$isAjax && empty($paramsValue)) { | ||
463 | - return array(); | ||
464 | - } | ||
465 | $sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : ''; | 461 | $sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : ''; |
466 | if (isset($params['size'])) { | 462 | if (isset($params['size'])) { |
467 | unset($params['size']); | 463 | unset($params['size']); |
468 | } | 464 | } |
469 | $result = array(); | 465 | $result = array(); |
466 | + if (!$isAjax && empty($paramsValue)) { | ||
467 | + return array(); | ||
468 | + } | ||
470 | if (isset($filter['size']) && !empty($filter['size'])) { | 469 | if (isset($filter['size']) && !empty($filter['size'])) { |
471 | $size = $filter['size']; | 470 | $size = $filter['size']; |
472 | foreach ($size as $k=> $v) { | 471 | foreach ($size as $k=> $v) { |
@@ -485,7 +484,7 @@ class HelperSearch | @@ -485,7 +484,7 @@ class HelperSearch | ||
485 | 'checked' => isset(self::$params['size']) && self::$params['size'] == $v['size_id'] ? true : false | 484 | 'checked' => isset(self::$params['size']) && self::$params['size'] == $v['size_id'] ? true : false |
486 | ); | 485 | ); |
487 | } | 486 | } |
488 | - if (self::checkSearch('size')) { | 487 | + if ( self::checkSearch('size')) { |
489 | return array(); | 488 | return array(); |
490 | } | 489 | } |
491 | } | 490 | } |
@@ -940,8 +939,8 @@ class HelperSearch | @@ -940,8 +939,8 @@ class HelperSearch | ||
940 | } | 939 | } |
941 | if ($data) { | 940 | if ($data) { |
942 | $result['conditions'] = $data; | 941 | $result['conditions'] = $data; |
943 | - } | ||
944 | $result['clearUrl'] = self::current(); | 942 | $result['clearUrl'] = self::current(); |
943 | + } | ||
945 | return $result; | 944 | return $result; |
946 | } | 945 | } |
947 | 946 | ||
@@ -1200,7 +1199,7 @@ class HelperSearch | @@ -1200,7 +1199,7 @@ class HelperSearch | ||
1200 | if (!empty($condition)) { | 1199 | if (!empty($condition)) { |
1201 | $param += $condition; | 1200 | $param += $condition; |
1202 | } | 1201 | } |
1203 | - return Yohobuy::httpBuildQuery(self::getUrl(), $param); | 1202 | + return Yohobuy::httpBuildQuery(SearchData::getUrl(), $param); |
1204 | } | 1203 | } |
1205 | 1204 | ||
1206 | /** | 1205 | /** |
@@ -1213,7 +1212,7 @@ class HelperSearch | @@ -1213,7 +1212,7 @@ class HelperSearch | ||
1213 | $condition['sales'] = 'Y'; //在销售商品分类 | 1212 | $condition['sales'] = 'Y'; //在销售商品分类 |
1214 | $condition['status'] = 1; //上架商品分类 | 1213 | $condition['status'] = 1; //上架商品分类 |
1215 | $condition['stocknumber'] = 1; //过滤掉已售罄 | 1214 | $condition['stocknumber'] = 1; //过滤掉已售罄 |
1216 | - return Yohobuy::httpBuildQuery(self::getUrl('sort'), $condition); | 1215 | + return Yohobuy::httpBuildQuery(SearchData::getUrl('sort'), $condition); |
1217 | } | 1216 | } |
1218 | 1217 | ||
1219 | /** | 1218 | /** |
@@ -1223,7 +1222,7 @@ class HelperSearch | @@ -1223,7 +1222,7 @@ class HelperSearch | ||
1223 | 1222 | ||
1224 | public static function getDiscountUrl($param = array()) | 1223 | public static function getDiscountUrl($param = array()) |
1225 | { | 1224 | { |
1226 | - return Yohobuy::httpBuildQuery(self::getUrl('discount'), $param); | 1225 | + return Yohobuy::httpBuildQuery(SearchData::getUrl('discount'), $param); |
1227 | } | 1226 | } |
1228 | 1227 | ||
1229 | /** | 1228 | /** |
@@ -1231,7 +1230,7 @@ class HelperSearch | @@ -1231,7 +1230,7 @@ class HelperSearch | ||
1231 | */ | 1230 | */ |
1232 | public static function getRecentShelveUrl($param = array()) | 1231 | public static function getRecentShelveUrl($param = array()) |
1233 | { | 1232 | { |
1234 | - return Yohobuy::httpBuildQuery(self::getUrl('recent'), $param); | 1233 | + return Yohobuy::httpBuildQuery(SearchData::getUrl('recent'), $param); |
1235 | } | 1234 | } |
1236 | 1235 | ||
1237 | /** | 1236 | /** |
@@ -1265,73 +1264,13 @@ class HelperSearch | @@ -1265,73 +1264,13 @@ class HelperSearch | ||
1265 | 1264 | ||
1266 | 1265 | ||
1267 | /** | 1266 | /** |
1268 | - * 并行调接口url获取(获取用户浏览记录) | ||
1269 | - */ | ||
1270 | -// public static function getReviewUrl($param = array()) | ||
1271 | -// { | ||
1272 | -// return Yohobuy::httpBuildQuery(self::getUrl('review'), $param); | ||
1273 | -// } | ||
1274 | - | ||
1275 | - | ||
1276 | - /** | ||
1277 | * 获取品牌店铺接口地址 | 1267 | * 获取品牌店铺接口地址 |
1278 | * @param $param | 1268 | * @param $param |
1279 | * @return string | 1269 | * @return string |
1280 | */ | 1270 | */ |
1281 | public static function getShopUrl($param) | 1271 | public static function getShopUrl($param) |
1282 | { | 1272 | { |
1283 | - return Yohobuy::httpBuildQuery(self::getUrl('shop'), $param); | ||
1284 | - } | ||
1285 | - /** | ||
1286 | - * 获取搜索的服务地址 | ||
1287 | - * | ||
1288 | - * 备注:此处是根据环境来确定使用阿里云内网还是外网的URL | ||
1289 | - * | ||
1290 | - * @return string | ||
1291 | - */ | ||
1292 | - private static function getUrl($type = 'search') | ||
1293 | - { | ||
1294 | - defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); | ||
1295 | - switch (APPLICATION_ENV) { | ||
1296 | - case 'release': | ||
1297 | - if ($type == 'sort') { | ||
1298 | - return 'http://100.98.132.63/yohosearch/sortgroup.json'; | ||
1299 | - } | ||
1300 | - elseif ($type == 'discount') { | ||
1301 | - return 'http://100.98.132.63/yohosearch/discount.json'; | ||
1302 | - } | ||
1303 | - elseif ($type == 'recent') { | ||
1304 | - return 'http://100.98.132.63/yohosearch/recent.json'; | ||
1305 | - } | ||
1306 | -// elseif ($type == 'review') { | ||
1307 | -// | ||
1308 | -// } | ||
1309 | - elseif ($type == 'shop') { | ||
1310 | - return 'http://100.98.132.63/yohosearch/shops.json'; | ||
1311 | - } | ||
1312 | - return 'http://100.98.132.63/yohosearch/search.json'; | ||
1313 | - case 'test': | ||
1314 | - case 'preview': | ||
1315 | - case 'developer': | ||
1316 | - default: | ||
1317 | - if ($type == 'sort') { | ||
1318 | - return 'http://101.200.31.165/yohosearch/sortgroup.json'; | ||
1319 | - } | ||
1320 | - elseif ($type == 'discount') { | ||
1321 | - return 'http://101.200.31.165/yohosearch/discount.json'; | ||
1322 | - } | ||
1323 | - elseif ($type == 'recent') { | ||
1324 | - return 'http://101.200.31.165/yohosearch/recent.json'; | ||
1325 | - } | ||
1326 | -// elseif ($type == 'review') { | ||
1327 | -// | ||
1328 | -// } | ||
1329 | - elseif ($type == 'shop') { | ||
1330 | - return 'http://101.200.31.165/yohosearch/shops.json'; | ||
1331 | - } | ||
1332 | -// return 'http://101.200.31.165/yohosearch/search.json'; | ||
1333 | - return 'http://192.168.10.64:8080/yohosearch/search-once.json'; | ||
1334 | - } | 1273 | + return Yohobuy::httpBuildQuery(SearchData::getUrl('shop'), $param); |
1335 | } | 1274 | } |
1336 | 1275 | ||
1337 | /** | 1276 | /** |
1 | -var $ = require('jquery'); | 1 | +var $ = require('jquery'), |
2 | + loading = require('../plugin/loading'); | ||
2 | var page = 1; | 3 | var page = 1; |
3 | 4 | ||
5 | +loading.showLoadingMask(); | ||
6 | + | ||
4 | function ajaxCurrencyDetail(page) { | 7 | function ajaxCurrencyDetail(page) { |
5 | $.ajax({ | 8 | $.ajax({ |
6 | type: 'POST', | 9 | type: 'POST', |
@@ -29,3 +32,5 @@ $(window).scroll(function() { | @@ -29,3 +32,5 @@ $(window).scroll(function() { | ||
29 | }); | 32 | }); |
30 | 33 | ||
31 | ajaxCurrencyDetail(page); | 34 | ajaxCurrencyDetail(page); |
35 | + | ||
36 | +$(document).ready(loading.hideLoadingMask); |
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | <div class="size-list block-list"> | 32 | <div class="size-list block-list"> |
33 | <span>尺码</span> | 33 | <span>尺码</span> |
34 | {{# sizes}} | 34 | {{# sizes}} |
35 | - <ul id="{{sizeName}}" data-index="{{@index}}" class="size-row clearfix {{#unless @first}}hide{{/if}}"> | 35 | + <ul class="size-row clearfix {{#unless @first}}hide{{/if}}"> |
36 | {{# size}} | 36 | {{# size}} |
37 | <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}"> | 37 | <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}"> |
38 | {{name}} | 38 | {{name}} |
@@ -25,7 +25,8 @@ | @@ -25,7 +25,8 @@ | ||
25 | <input name="mobile" id="mobile" type="hidden" value="{{mobile}}"> | 25 | <input name="mobile" id="mobile" type="hidden" value="{{mobile}}"> |
26 | <input name="verifyCode" id="captchaPic" type="hidden" value="{{verifyCode}}"> | 26 | <input name="verifyCode" id="captchaPic" type="hidden" value="{{verifyCode}}"> |
27 | <input name="refer" id="refer" type="hidden" value=""> | 27 | <input name="refer" id="refer" type="hidden" value=""> |
28 | - <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled=""> | 28 | + <a id="next-step" class="btn next-step disable" href="javascript:;">下一步</a> |
29 | + <!-- <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled=""> --> | ||
29 | </li> | 30 | </li> |
30 | </ul> | 31 | </ul> |
31 | </form> | 32 | </form> |
1 | +{{> layout/header}} | ||
2 | +<div class="sale-list-page new-sale-page product-page yoho-page"> | ||
3 | + {{# saleList}} | ||
4 | + | ||
5 | + {{> sale/sale-banner}} | ||
6 | + | ||
7 | + <div class="center-content clearfix"> | ||
8 | + {{#saleTitle}} | ||
9 | + <div class="sale-title"> | ||
10 | + <span class="title">{{title}}</span> | ||
11 | + {{#if discount}} | ||
12 | + <span class="discount">{{discount}}</span> | ||
13 | + {{/if}} | ||
14 | + {{#if up}} | ||
15 | + 起 | ||
16 | + {{/if}} | ||
17 | + <div class="time pull-right"> | ||
18 | + <span class="iconfont"></span>{{time}} | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + {{/saleTitle}} | ||
22 | + <ul class="sort"> | ||
23 | + <li class="title">分类:</li> | ||
24 | + {{#sort}} | ||
25 | + <li class="{{#if active}}active{{/if}}"><a href="#">{{name}}{{#if number}}({{number}}){{/if}}</a></li> | ||
26 | + {{/sort}} | ||
27 | + </ul> | ||
28 | + | ||
29 | + {{> product/standard-content}} | ||
30 | + </div> | ||
31 | + | ||
32 | + {{/ saleList}} | ||
33 | +</div> | ||
34 | +{{> layout/footer}} |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | {{/if}} | 5 | {{/if}} |
6 | {{#if preEnv}} | 6 | {{#if preEnv}} |
7 | <script src="http://cdn.yoho.cn/yohobuy/{{version}}/lib.js"></script> | 7 | <script src="http://cdn.yoho.cn/yohobuy/{{version}}/lib.js"></script> |
8 | - <script src="http://cdn.yoho.cn/yohobuy/{{version}}/index.js"></script> | 8 | + <script src="http://cdn.yoho.cn/yohobuy/{{version}}/index-debug.js"></script> |
9 | {{/if}} | 9 | {{/if}} |
10 | {{#if testEnv}} | 10 | {{#if testEnv}} |
11 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/lib.js"></script> | 11 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/lib.js"></script> |
@@ -83,7 +83,11 @@ | @@ -83,7 +83,11 @@ | ||
83 | <ul class="sub-nav-list"> | 83 | <ul class="sub-nav-list"> |
84 | {{# subnav}} | 84 | {{# subnav}} |
85 | <li class="sub-nav-item"> | 85 | <li class="sub-nav-item"> |
86 | - <a href="{{link}}">{{name}}</a> | 86 | + <a href="{{link}}">{{name}} |
87 | + {{#if is_new}} | ||
88 | + <span class="newlogo"></span> | ||
89 | + {{/if}} | ||
90 | + </a> | ||
87 | {{#if thirdnav}} | 91 | {{#if thirdnav}} |
88 | <div class="third-nav-wrapper"> | 92 | <div class="third-nav-wrapper"> |
89 | <div class="third-nav"> | 93 | <div class="third-nav"> |
@@ -96,7 +100,7 @@ | @@ -96,7 +100,7 @@ | ||
96 | {{#branditems}} | 100 | {{#branditems}} |
97 | <li class="category- | 101 | <li class="category- |
98 | item thirdnavbar"> | 102 | item thirdnavbar"> |
99 | - <a href="{{link}}" hot={{hot}}>{{brandname}}</a> | 103 | + <a href="{{link}}" hot={{hot}} >{{brandname}}</a> |
100 | </li> | 104 | </li> |
101 | {{/branditems}} | 105 | {{/branditems}} |
102 | </ul> | 106 | </ul> |
@@ -75,6 +75,38 @@ | @@ -75,6 +75,38 @@ | ||
75 | </script> | 75 | </script> |
76 | {{/if}} | 76 | {{/if}} |
77 | 77 | ||
78 | +{{!-- sale列表 --}} | ||
79 | +{{#if saleListPage}} | ||
80 | +<script> | ||
81 | + seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) { | ||
82 | + | ||
83 | + product.init(4); | ||
84 | + window.onresize = function () { | ||
85 | + setTimeout(function () { | ||
86 | + product.init(4); | ||
87 | + }, 300); | ||
88 | + }; | ||
89 | + | ||
90 | + }); | ||
91 | +</script> | ||
92 | +{{/if}} | ||
93 | + | ||
94 | +{{!-- sale 分类列表 --}} | ||
95 | +{{#if saleCatPage}} | ||
96 | +<script> | ||
97 | + seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) { | ||
98 | + | ||
99 | + product.init(4); | ||
100 | + window.onresize = function () { | ||
101 | + setTimeout(function () { | ||
102 | + product.init(4); | ||
103 | + }, 300); | ||
104 | + }; | ||
105 | + | ||
106 | + }); | ||
107 | +</script> | ||
108 | +{{/if}} | ||
109 | + | ||
78 | {{!-- 登录注册找回密码--}} | 110 | {{!-- 登录注册找回密码--}} |
79 | {{#if loginPage}} | 111 | {{#if loginPage}} |
80 | <script> | 112 | <script> |
@@ -139,20 +171,3 @@ | @@ -139,20 +171,3 @@ | ||
139 | seajs.use('js/order/save'); | 171 | seajs.use('js/order/save'); |
140 | </script> | 172 | </script> |
141 | {{/if}} | 173 | {{/if}} |
142 | - | ||
143 | - | ||
144 | -{{!-- sale列表 --}} | ||
145 | -{{#if saleListPage}} | ||
146 | -<script> | ||
147 | - seajs.use(['js/product/list', 'js/product/product', 'js/product/banner'], function (list, product) { | ||
148 | - | ||
149 | - product.init(4); | ||
150 | - window.onresize = function () { | ||
151 | - setTimeout(function () { | ||
152 | - product.init(4); | ||
153 | - }, 300); | ||
154 | - }; | ||
155 | - | ||
156 | - }); | ||
157 | -</script> | ||
158 | -{{/if}} |
@@ -179,7 +179,7 @@ | @@ -179,7 +179,7 @@ | ||
179 | </div> | 179 | </div> |
180 | {{/if}} | 180 | {{/if}} |
181 | 181 | ||
182 | - <div class="size section hide"> | 182 | + <div class="size section {{#unless size}}hide{{/unless}}"> |
183 | <span class="title">尺码:</span> | 183 | <span class="title">尺码:</span> |
184 | 184 | ||
185 | <div class="attr-content clearfix"> | 185 | <div class="attr-content clearfix"> |
@@ -159,8 +159,6 @@ var $ = require("jquery"); | @@ -159,8 +159,6 @@ var $ = require("jquery"); | ||
159 | 159 | ||
160 | var $returnTop = $('.return-top'); | 160 | var $returnTop = $('.return-top'); |
161 | 161 | ||
162 | -var apiDomain; | ||
163 | - | ||
164 | /** | 162 | /** |
165 | * 订阅 | 163 | * 订阅 |
166 | * @return {[type]} [description] | 164 | * @return {[type]} [description] |
@@ -170,42 +168,37 @@ function actionSubscription() { | @@ -170,42 +168,37 @@ function actionSubscription() { | ||
170 | $subscriberBtn = $('#subscriber-btn'), | 168 | $subscriberBtn = $('#subscriber-btn'), |
171 | emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/; | 169 | emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/; |
172 | 170 | ||
173 | - var subscribeParam = { | ||
174 | - method: 'open.subscriber.subscriber', | ||
175 | - v: 1, | ||
176 | - return_type: 'jsonp', | ||
177 | - open_key: '12345' | ||
178 | - }; | ||
179 | - | ||
180 | var iconCode = { | 171 | var iconCode = { |
181 | mail: '', | 172 | mail: '', |
182 | tick: '' | 173 | tick: '' |
183 | }; | 174 | }; |
184 | 175 | ||
185 | - var email = $.trim($subscriberBox.val()); | ||
186 | - | ||
187 | - var params = {}; | ||
188 | - | ||
189 | $subscriberBox.focus(function() { | 176 | $subscriberBox.focus(function() { |
190 | $(this).val('').css('color', ''); | 177 | $(this).val('').css('color', ''); |
191 | $subscriberBtn.removeClass('done').html(iconCode.mail); | 178 | $subscriberBtn.removeClass('done').html(iconCode.mail); |
192 | }); | 179 | }); |
193 | 180 | ||
194 | $subscriberBtn.click(function() { | 181 | $subscriberBtn.click(function() { |
182 | + var email = $.trim($subscriberBox.val()); | ||
183 | + | ||
195 | if (email !== '' && emailReg.test(email)) { | 184 | if (email !== '' && emailReg.test(email)) { |
196 | - $.extend(params, subscribeParam, { | 185 | + try { |
186 | + $.ajax({ | ||
187 | + url: 'http://www.yohobuy.com/common/emailsubscriber', | ||
188 | + dataType: 'jsonp', | ||
189 | + data: { | ||
197 | email: email, | 190 | email: email, |
198 | tmp: Math.random(), | 191 | tmp: Math.random(), |
199 | - uid: $.uid('_UID') | ||
200 | - }); | ||
201 | - try { | ||
202 | - $.getJSON('http://test.open.yohobuy.com' + '/?callback=?', params, function(data) { | 192 | + uid: window.getUid() |
193 | + }, | ||
194 | + success: function(data) { | ||
203 | if (data.data.result === 1) { | 195 | if (data.data.result === 1) { |
204 | $subscriberBox.val('已订阅到:' + email); | 196 | $subscriberBox.val('已订阅到:' + email); |
205 | $subscriberBtn.addClass('done').html(iconCode.tick); | 197 | $subscriberBtn.addClass('done').html(iconCode.tick); |
206 | } else { | 198 | } else { |
207 | $subscriberBox.css('color', 'red'); | 199 | $subscriberBox.css('color', 'red'); |
208 | } | 200 | } |
201 | + } | ||
209 | }); | 202 | }); |
210 | } catch (e) { | 203 | } catch (e) { |
211 | console.log(e.message); | 204 | console.log(e.message); |
@@ -241,7 +234,6 @@ function actionhomeFootChange() { | @@ -241,7 +234,6 @@ function actionhomeFootChange() { | ||
241 | var $this = $(this), | 234 | var $this = $(this), |
242 | $li = $this.closest('li'), | 235 | $li = $this.closest('li'), |
243 | index = $li.index(), | 236 | index = $li.index(), |
244 | - params = {}, | ||
245 | _solution = []; | 237 | _solution = []; |
246 | 238 | ||
247 | var _answer = $li.find('.feedback-answer').val(), | 239 | var _answer = $li.find('.feedback-answer').val(), |
@@ -252,18 +244,19 @@ function actionhomeFootChange() { | @@ -252,18 +244,19 @@ function actionhomeFootChange() { | ||
252 | _solution.push($(this).val()); | 244 | _solution.push($(this).val()); |
253 | }); | 245 | }); |
254 | 246 | ||
255 | - params = { | ||
256 | - method: 'open.feedback.submit', | ||
257 | - feedback: _feedback || 0, | ||
258 | - question: _question || 0, | 247 | + $.ajax({ |
248 | + url: 'http://www.yohobuy.com/common/suggestfeedback', | ||
249 | + dataType: 'jsonp', | ||
250 | + data: { | ||
251 | + feedback_id: _feedback || 0, | ||
252 | + question_id: _question || 0, | ||
259 | answer: _answer || '', | 253 | answer: _answer || '', |
260 | solution: _solution.join(',') | 254 | solution: _solution.join(',') |
261 | - }; | ||
262 | - | ||
263 | - $.getData(apiDomain, params, function(data) { | 255 | + }, |
256 | + success: function(data) { | ||
264 | var next = index + 1; | 257 | var next = index + 1; |
265 | 258 | ||
266 | - if (data.result === 1) { | 259 | + if (~~data.data.result === 1) { |
267 | if (index === count - 1) { | 260 | if (index === count - 1) { |
268 | alert('感谢您的参与!'); | 261 | alert('感谢您的参与!'); |
269 | return; | 262 | return; |
@@ -271,9 +264,10 @@ function actionhomeFootChange() { | @@ -271,9 +264,10 @@ function actionhomeFootChange() { | ||
271 | 264 | ||
272 | $li.addClass('hide'); | 265 | $li.addClass('hide'); |
273 | 266 | ||
274 | - $vote.eq(index + 1).removeClass('hide'); | 267 | + $vote.children(':eq(' + (index + 1) + ')').removeClass('hide'); |
275 | $feedBackPage.children('.cur').removeClass('cur'); | 268 | $feedBackPage.children('.cur').removeClass('cur'); |
276 | - $feedBackPage.eq(next).addClass('cur'); | 269 | + $feedBackPage.children(':eq(' + next + ')').addClass('cur'); |
270 | + } | ||
277 | } | 271 | } |
278 | }); | 272 | }); |
279 | }); | 273 | }); |
@@ -338,7 +332,7 @@ var handlebars = require("handlebars"); | @@ -338,7 +332,7 @@ var handlebars = require("handlebars"); | ||
338 | var json2 = require("index"); | 332 | var json2 = require("index"); |
339 | var vipInfoCombine = null; //用户信息编译模板 | 333 | var vipInfoCombine = null; //用户信息编译模板 |
340 | var loginInfoCombine = null; //登录信息编译模板 | 334 | var loginInfoCombine = null; //登录信息编译模板 |
341 | -var apiDomain = 'http://api.open.yohobuy.com'; //获取数据的地址 | 335 | +var apiDomain = 'http://test.open.yohobuy.com/'; //获取数据的地址http://api.open.yohobuy.com |
342 | var cartTpl = ''; //购物车模板 | 336 | var cartTpl = ''; //购物车模板 |
343 | /** | 337 | /** |
344 | * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现) | 338 | * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现) |
@@ -405,7 +399,8 @@ function getSource(column, postition, event) { | @@ -405,7 +399,8 @@ function getSource(column, postition, event) { | ||
405 | } catch (e) {} | 399 | } catch (e) {} |
406 | } | 400 | } |
407 | 401 | ||
408 | -function submitSearch() { | 402 | + |
403 | +window.submitSearch = function() { | ||
409 | var $keywordinput = $('#query_key').val(); | 404 | var $keywordinput = $('#query_key').val(); |
410 | var column = 'Search'; | 405 | var column = 'Search'; |
411 | var postition = 'Head Search'; | 406 | var postition = 'Head Search'; |
@@ -427,6 +422,7 @@ function submitSearch() { | @@ -427,6 +422,7 @@ function submitSearch() { | ||
427 | } | 422 | } |
428 | } | 423 | } |
429 | } | 424 | } |
425 | + | ||
430 | /** | 426 | /** |
431 | * 定义购物车扩展 | 427 | * 定义购物车扩展 |
432 | */ | 428 | */ |
@@ -515,7 +511,7 @@ function actionGoodsCart() { | @@ -515,7 +511,7 @@ function actionGoodsCart() { | ||
515 | listIndex = (listIndex + 1) % queryNum; | 511 | listIndex = (listIndex + 1) % queryNum; |
516 | getText(this); | 512 | getText(this); |
517 | } else if (event.which === 13) { | 513 | } else if (event.which === 13) { |
518 | - submitSearch(); | 514 | + window.submitSearch(); |
519 | } else { | 515 | } else { |
520 | getKeywords(this); | 516 | getKeywords(this); |
521 | } | 517 | } |
@@ -1836,6 +1832,8 @@ require("js/product/filter"); | @@ -1836,6 +1832,8 @@ require("js/product/filter"); | ||
1836 | 1832 | ||
1837 | require("js/product/sort-pager"); | 1833 | require("js/product/sort-pager"); |
1838 | 1834 | ||
1835 | +require("js/product/latest-walk"); | ||
1836 | + | ||
1839 | require("js/product/product"); | 1837 | require("js/product/product"); |
1840 | }); | 1838 | }); |
1841 | define("js/product/filter", ["jquery","handlebars","source-map"], function(require, exports, module){ | 1839 | define("js/product/filter", ["jquery","handlebars","source-map"], function(require, exports, module){ |
@@ -2150,6 +2148,9 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() { | @@ -2150,6 +2148,9 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() { | ||
2150 | var $this = $(this); | 2148 | var $this = $(this); |
2151 | var index = $this.index(); | 2149 | var index = $this.index(); |
2152 | 2150 | ||
2151 | + if ($this.hasClass('no-sub')) { | ||
2152 | + return; | ||
2153 | + } | ||
2153 | $this.addClass('hover').siblings().removeClass('hover'); | 2154 | $this.addClass('hover').siblings().removeClass('hover'); |
2154 | 2155 | ||
2155 | $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide'); | 2156 | $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide'); |
@@ -2157,6 +2158,10 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() { | @@ -2157,6 +2158,10 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() { | ||
2157 | var $this = $(this), | 2158 | var $this = $(this), |
2158 | index = $this.index(); | 2159 | index = $this.index(); |
2159 | 2160 | ||
2161 | + if ($this.hasClass('no-sub')) { | ||
2162 | + return; | ||
2163 | + } | ||
2164 | + | ||
2160 | hoveredIndex = index; | 2165 | hoveredIndex = index; |
2161 | 2166 | ||
2162 | seniorHoverTime = setTimeout(function() { | 2167 | seniorHoverTime = setTimeout(function() { |
@@ -2220,6 +2225,65 @@ $countPerPage.click(function() { | @@ -2220,6 +2225,65 @@ $countPerPage.click(function() { | ||
2220 | } | 2225 | } |
2221 | }); | 2226 | }); |
2222 | }); | 2227 | }); |
2228 | +define("js/product/latest-walk", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){ | ||
2229 | +/** | ||
2230 | + * 最近浏览取接口渲染模板 | ||
2231 | + * @author: xuqi<qi.xu@yoho.cn> | ||
2232 | + 8 @date: 2016/1/20 | ||
2233 | + */ | ||
2234 | + | ||
2235 | +var $ = require("jquery"); | ||
2236 | +var Handlebars = require("handlebars"); | ||
2237 | +var lazyLoad = require("lazyload"); | ||
2238 | + | ||
2239 | +var $latestWalkCount = $('#latest-walk-count'); | ||
2240 | + | ||
2241 | +(function() { | ||
2242 | + var tpl; | ||
2243 | + | ||
2244 | + if ($latestWalkCount.lenght < 0) { | ||
2245 | + return; | ||
2246 | + } | ||
2247 | + | ||
2248 | + tpl = Handlebars.compile($('#latest-walk-tpl').html()); | ||
2249 | + | ||
2250 | + $.ajax({ | ||
2251 | + url: 'http://itemapi.yohobuy.com/item/item/recentreview', | ||
2252 | + dataType: 'jsonp', | ||
2253 | + data: { | ||
2254 | + limit: $latestWalkCount.val() | ||
2255 | + }, | ||
2256 | + success: function(data) { | ||
2257 | + var latestWalk = [], | ||
2258 | + res, i, cur; | ||
2259 | + | ||
2260 | + if (data.code === 200) { | ||
2261 | + res = data.data; | ||
2262 | + | ||
2263 | + for (i = 0; i < res.length; i++) { | ||
2264 | + cur = res[i]; | ||
2265 | + | ||
2266 | + latestWalk.push({ | ||
2267 | + href: cur.url, | ||
2268 | + img: cur.pic_url, | ||
2269 | + name: cur.product_name, | ||
2270 | + salePrice: cur.price, | ||
2271 | + marketPrice: cur.market_price | ||
2272 | + }); | ||
2273 | + } | ||
2274 | + | ||
2275 | + if (latestWalk.length > 0) { | ||
2276 | + $('#latest-walk-goods').html(tpl({ | ||
2277 | + latestWalk: latestWalk | ||
2278 | + })); | ||
2279 | + | ||
2280 | + lazyLoad($('#latest-walk-goods .lazy')); | ||
2281 | + } | ||
2282 | + } | ||
2283 | + } | ||
2284 | + }); | ||
2285 | +}()); | ||
2286 | +}); | ||
2223 | define("js/product/product", ["jquery","lazyload"], function(require, exports, module){ | 2287 | define("js/product/product", ["jquery","lazyload"], function(require, exports, module){ |
2224 | /** | 2288 | /** |
2225 | *Description: 商品列表页 | 2289 | *Description: 商品列表页 |
@@ -5781,11 +5845,10 @@ var $sc = $('#send-captcha'), | @@ -5781,11 +5845,10 @@ var $sc = $('#send-captcha'), | ||
5781 | itime; | 5845 | itime; |
5782 | 5846 | ||
5783 | $sc.click(function() { | 5847 | $sc.click(function() { |
5784 | - $.post('/passport/register/authcode', { | 5848 | + $.post('/passport/back/sendbackmobile', { |
5785 | mobile: $('#mobile').val(), | 5849 | mobile: $('#mobile').val(), |
5786 | area: $('#area').val(), | 5850 | area: $('#area').val(), |
5787 | - captcha: $('#captchaPic').val(), | ||
5788 | - project: 'repassword' | 5851 | + verifyCode: $('#captchaPic').val() |
5789 | }, function(jsonData) { | 5852 | }, function(jsonData) { |
5790 | if (jsonData.code === 200) { | 5853 | if (jsonData.code === 200) { |
5791 | $errTip.hide(); | 5854 | $errTip.hide(); |
@@ -5839,17 +5902,34 @@ itime = setInterval(function() { | @@ -5839,17 +5902,34 @@ itime = setInterval(function() { | ||
5839 | 5902 | ||
5840 | 5903 | ||
5841 | $('#captcha').keyup(function() { | 5904 | $('#captcha').keyup(function() { |
5842 | - var v = $.trim($(this).val()); | 5905 | + var v = $.trim($(this).val()), |
5906 | + that = this; | ||
5843 | 5907 | ||
5844 | - if (v !== '') { | 5908 | + if (v.length === 4) { |
5909 | + $.ajax({ | ||
5910 | + type: 'POST', | ||
5911 | + url: '/passport/back/backmobile', | ||
5912 | + dataType: 'json', | ||
5913 | + data: { | ||
5914 | + code: $('#captcha').val(), | ||
5915 | + verifyCode: $("#captchaPic").val(), | ||
5916 | + area: $('#area').val(), | ||
5917 | + mobile: $('#mobile').val() | ||
5918 | + }, | ||
5919 | + success: function(res) { | ||
5920 | + if (res.code === 200) { | ||
5845 | 5921 | ||
5846 | //添加验证码正确验证 | 5922 | //添加验证码正确验证 |
5847 | - //$next.removeClass('disable').prop('disabled', false); | ||
5848 | $next.removeClass('disable').removeAttr('disabled'); | 5923 | $next.removeClass('disable').removeAttr('disabled'); |
5924 | + $errTip.addClass('hide'); | ||
5925 | + $(that).removeClass('error'); | ||
5849 | } else { | 5926 | } else { |
5850 | - | ||
5851 | - //$next.addClass('disable').prop('disabled', true); | ||
5852 | $next.addClass('disable').attr('disabled', true); | 5927 | $next.addClass('disable').attr('disabled', true); |
5928 | + $errTip.removeClass('hide').find('em').text('验证码输入错误'); | ||
5929 | + $(that).addClass('error'); | ||
5930 | + } | ||
5931 | + } | ||
5932 | + }); | ||
5853 | } | 5933 | } |
5854 | }).blur(function() { | 5934 | }).blur(function() { |
5855 | var v = $.trim($(this).val()); | 5935 | var v = $.trim($(this).val()); |
@@ -5858,10 +5938,7 @@ $('#captcha').keyup(function() { | @@ -5858,10 +5938,7 @@ $('#captcha').keyup(function() { | ||
5858 | 5938 | ||
5859 | //添加验证码正确验证 | 5939 | //添加验证码正确验证 |
5860 | $(this).addClass('error'); | 5940 | $(this).addClass('error'); |
5861 | - $errTip.removeClass('hide'); | ||
5862 | - } else { | ||
5863 | - $(this).removeClass('error'); | ||
5864 | - $errTip.addClass('hide'); | 5941 | + $errTip.removeClass('hide').text('请输入验证码'); |
5865 | } | 5942 | } |
5866 | }).focus(function() { | 5943 | }).focus(function() { |
5867 | $(this).removeClass('error'); | 5944 | $(this).removeClass('error'); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -97,8 +97,35 @@ window.submitSearch = function() { | @@ -97,8 +97,35 @@ window.submitSearch = function() { | ||
97 | return false; | 97 | return false; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | -} | 100 | +}; |
101 | +/** | ||
102 | + * 增加关键字 | ||
103 | + * @return {[type]} [description] | ||
104 | + */ | ||
105 | +function actionAddKeyWords() { | ||
106 | + var keywords = $('#nav_keyword').text(); | ||
107 | + var defaultsearch = 'vans'; | ||
108 | + var $query_key = $('#query_key'); | ||
109 | + if (keywords !== '') { | ||
110 | + $query_key.css({ | ||
111 | + 'color': '#000' | ||
112 | + }); | ||
113 | + $query_key.val(keywords); | ||
114 | + } else { | ||
115 | + $query_key.css({ | ||
116 | + 'color': '#e0e0e0' | ||
117 | + }); | ||
118 | + $query_key.val(defaultsearch); | ||
119 | + $query_key.on('focus', function(e) { | ||
120 | + $query_key.css({ | ||
121 | + 'color': '#000' | ||
122 | + }); | ||
123 | + $query_key.val(''); | ||
124 | + }) | ||
101 | 125 | ||
126 | + } | ||
127 | + | ||
128 | +} | ||
102 | /** | 129 | /** |
103 | * 定义购物车扩展 | 130 | * 定义购物车扩展 |
104 | */ | 131 | */ |
@@ -1316,6 +1343,7 @@ function actionSearch() { | @@ -1316,6 +1343,7 @@ function actionSearch() { | ||
1316 | * @return {[type]} [description] | 1343 | * @return {[type]} [description] |
1317 | */ | 1344 | */ |
1318 | function actionLoginState(_data) { | 1345 | function actionLoginState(_data) { |
1346 | + console.log(_data); | ||
1319 | var timestamp = new Date().getTime(); | 1347 | var timestamp = new Date().getTime(); |
1320 | var noLoginHtml = '<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">' + | 1348 | var noLoginHtml = '<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">' + |
1321 | '请登录</a>] ' + | 1349 | '请登录</a>] ' + |
@@ -1482,6 +1510,7 @@ function init() { | @@ -1482,6 +1510,7 @@ function init() { | ||
1482 | actionListenCartMore(); // | 1510 | actionListenCartMore(); // |
1483 | actionLoginInfo(); //获取登录信息 | 1511 | actionLoginInfo(); //获取登录信息 |
1484 | actionCover(); //初次登录弹框 | 1512 | actionCover(); //初次登录弹框 |
1513 | + actionAddKeyWords();//增加关键字 | ||
1485 | } | 1514 | } |
1486 | 1515 | ||
1487 | init(); | 1516 | init(); |
@@ -80,7 +80,8 @@ $('#captcha').keyup(function() { | @@ -80,7 +80,8 @@ $('#captcha').keyup(function() { | ||
80 | url: '/passport/back/backmobile', | 80 | url: '/passport/back/backmobile', |
81 | dataType: 'json', | 81 | dataType: 'json', |
82 | data: { | 82 | data: { |
83 | - verifyCode: $('#captcha').val(), | 83 | + code: $('#captcha').val(), |
84 | + verifyCode: $("#captchaPic").val(), | ||
84 | area: $('#area').val(), | 85 | area: $('#area').val(), |
85 | mobile: $('#mobile').val() | 86 | mobile: $('#mobile').val() |
86 | }, | 87 | }, |
@@ -88,11 +89,11 @@ $('#captcha').keyup(function() { | @@ -88,11 +89,11 @@ $('#captcha').keyup(function() { | ||
88 | if (res.code === 200) { | 89 | if (res.code === 200) { |
89 | 90 | ||
90 | //添加验证码正确验证 | 91 | //添加验证码正确验证 |
91 | - $next.removeClass('disable').removeAttr('disabled'); | 92 | + $next.removeClass('disable').attr('href', res.data); |
92 | $errTip.addClass('hide'); | 93 | $errTip.addClass('hide'); |
93 | $(that).removeClass('error'); | 94 | $(that).removeClass('error'); |
94 | } else { | 95 | } else { |
95 | - $next.addClass('disable').attr('disabled', true); | 96 | + $next.addClass('disable'); |
96 | $errTip.removeClass('hide').find('em').text('验证码输入错误'); | 97 | $errTip.removeClass('hide').find('em').text('验证码输入错误'); |
97 | $(that).addClass('error'); | 98 | $(that).addClass('error'); |
98 | } | 99 | } |
@@ -161,90 +161,84 @@ | @@ -161,90 +161,84 @@ | ||
161 | background-color: #f5f5f5; | 161 | background-color: #f5f5f5; |
162 | color: #6d6d6d; | 162 | color: #6d6d6d; |
163 | margin-bottom: 10px; | 163 | margin-bottom: 10px; |
164 | - } | ||
165 | - .sale-nav li.active { | 164 | + &.active { |
166 | color: #fff; | 165 | color: #fff; |
167 | background-repeat: no-repeat; | 166 | background-repeat: no-repeat; |
168 | background-size: 100% 100%; | 167 | background-size: 100% 100%; |
169 | } | 168 | } |
170 | - | ||
171 | - .sale-nav li.green.active { | 169 | + &.green { |
170 | + &.active { | ||
172 | color: #fff; | 171 | color: #fff; |
173 | - background-image: image-url('sale/navactive-green-middle.png'); | 172 | + background-image: image-url("sale/navactive-green-middle.png"); |
174 | background-repeat: no-repeat; | 173 | background-repeat: no-repeat; |
175 | background-size: 100% 100%; | 174 | background-size: 100% 100%; |
176 | } | 175 | } |
177 | - | ||
178 | - .sale-nav li.green.first.active { | ||
179 | - background-image: image-url('sale/navactive-green-first.png'); | 176 | + &.first.active { |
177 | + background-image: image-url("sale/navactive-green-first.png"); | ||
180 | } | 178 | } |
181 | - | ||
182 | - .sale-nav li.green.last.active { | ||
183 | - background-image: image-url('sale/navactive-green-last.png'); | 179 | + &.last.active { |
180 | + background-image: image-url("sale/navactive-green-last.png"); | ||
184 | } | 181 | } |
185 | - | ||
186 | - .sale-nav li.yellow.active { | 182 | + } |
183 | + &.yellow { | ||
184 | + &.active { | ||
187 | color: #fff; | 185 | color: #fff; |
188 | - background-image: image-url('sale/navactive-yellow-middle.png'); | 186 | + background-image: image-url("sale/navactive-yellow-middle.png"); |
189 | background-repeat: no-repeat; | 187 | background-repeat: no-repeat; |
190 | background-size: 100% 100%; | 188 | background-size: 100% 100%; |
191 | } | 189 | } |
192 | - | ||
193 | - .sale-nav li.yellow.first.active { | ||
194 | - background-image: image-url('sale/navactive-yellow-first.png'); | 190 | + &.first.active { |
191 | + background-image: image-url("sale/navactive-yellow-first.png"); | ||
195 | } | 192 | } |
196 | - | ||
197 | - .sale-nav li.yellow.last.active { | ||
198 | - background-image: image-url('sale/navactive-yellow-last.png'); | 193 | + &.last.active { |
194 | + background-image: image-url("sale/navactive-yellow-last.png"); | ||
199 | } | 195 | } |
200 | - | ||
201 | - .sale-nav li.red.active { | 196 | + } |
197 | + &.red { | ||
198 | + &.active { | ||
202 | color: #fff; | 199 | color: #fff; |
203 | - background-image: image-url('sale/navactive-red-middle.png'); | 200 | + background-image: image-url("sale/navactive-red-middle.png"); |
204 | background-repeat: no-repeat; | 201 | background-repeat: no-repeat; |
205 | background-size: 100% 100%; | 202 | background-size: 100% 100%; |
206 | } | 203 | } |
207 | - | ||
208 | - .sale-nav li.red.first.active { | ||
209 | - background-image: image-url('sale/navactive-red-first.png'); | 204 | + &.first.active { |
205 | + background-image: image-url("sale/navactive-red-first.png"); | ||
206 | + } | ||
207 | + &.last.active { | ||
208 | + background-image: image-url("sale/navactive-red-last.png"); | ||
209 | + } | ||
210 | } | 210 | } |
211 | - | ||
212 | - .sale-nav li.red.last.active { | ||
213 | - background-image: image-url('sale/navactive-red-last.png'); | ||
214 | } | 211 | } |
215 | 212 | ||
216 | @media screen and (min-width: 1150px) { | 213 | @media screen and (min-width: 1150px) { |
217 | .floor-header { | 214 | .floor-header { |
218 | - margin:80px 0 40px | 215 | + margin: 80px 0 40px; |
216 | + .header-navs li { | ||
217 | + padding: 1px 15px; | ||
219 | } | 218 | } |
220 | - | ||
221 | - .floor-header .header-navs li { | ||
222 | - padding: 1px 15px | ||
223 | } | 219 | } |
224 | } | 220 | } |
225 | 221 | ||
226 | .commodity-list ul { | 222 | .commodity-list ul { |
227 | - width: 1004px | 223 | + width: 1004px; |
228 | } | 224 | } |
229 | 225 | ||
230 | .commodity-item { | 226 | .commodity-item { |
231 | float: left; | 227 | float: left; |
232 | width: 241px; | 228 | width: 241px; |
233 | - margin: 0 10px 0 0 | 229 | + margin: 0 10px 0 0; |
234 | } | 230 | } |
231 | + | ||
235 | .commodity-img { | 232 | .commodity-img { |
236 | position: relative; | 233 | position: relative; |
237 | height: 323px; | 234 | height: 323px; |
238 | - text-align: center | ||
239 | - } | ||
240 | - | ||
241 | - .commodity-img img { | 235 | + text-align: center; |
236 | + img { | ||
242 | width: 100%; | 237 | width: 100%; |
243 | height: 100%; | 238 | height: 100%; |
244 | - vertical-align: middle | 239 | + vertical-align: middle; |
245 | } | 240 | } |
246 | - | ||
247 | - .commodity-img .top-tag { | 241 | + .top-tag { |
248 | position: absolute; | 242 | position: absolute; |
249 | width: 60px; | 243 | width: 60px; |
250 | height: 60px; | 244 | height: 60px; |
@@ -253,10 +247,9 @@ | @@ -253,10 +247,9 @@ | ||
253 | line-height: 60px; | 247 | line-height: 60px; |
254 | background: url('../assets/images/furniture/top-tag-bg.png?1450667948'); | 248 | background: url('../assets/images/furniture/top-tag-bg.png?1450667948'); |
255 | font-size: 20px; | 249 | font-size: 20px; |
256 | - color: #fff | 250 | + color: #fff; |
257 | } | 251 | } |
258 | - | ||
259 | - .commodity-img .few-tag { | 252 | + .few-tag { |
260 | position: absolute; | 253 | position: absolute; |
261 | bottom: 0; | 254 | bottom: 0; |
262 | width: 100%; | 255 | width: 100%; |
@@ -265,83 +258,130 @@ | @@ -265,83 +258,130 @@ | ||
265 | color: #fff; | 258 | color: #fff; |
266 | line-height: 20px; | 259 | line-height: 20px; |
267 | text-align: center; | 260 | text-align: center; |
268 | - font-size: 12px | 261 | + font-size: 12px; |
262 | + } | ||
269 | } | 263 | } |
270 | 264 | ||
271 | .commodity-content { | 265 | .commodity-content { |
272 | padding: 10px 0 0 0; | 266 | padding: 10px 0 0 0; |
273 | height: 69px; | 267 | height: 69px; |
274 | - overflow: hidden | ||
275 | - } | ||
276 | - | ||
277 | - .commodity-content .commodity-name { | 268 | + overflow: hidden; |
269 | + .commodity-name { | ||
278 | font-size: 12px; | 270 | font-size: 12px; |
279 | color: #000; | 271 | color: #000; |
280 | line-height: 18px; | 272 | line-height: 18px; |
281 | - text-align: center | 273 | + text-align: center; |
282 | } | 274 | } |
283 | - | ||
284 | - .commodity-content .commodity-price { | 275 | + .commodity-price { |
285 | position: relative; | 276 | position: relative; |
286 | margin: 3px 0 0 0; | 277 | margin: 3px 0 0 0; |
287 | text-align: center; | 278 | text-align: center; |
288 | line-height: 20px; | 279 | line-height: 20px; |
289 | - color: #000 | ||
290 | - } | ||
291 | - | ||
292 | - .commodity-content .commodity-price span { | 280 | + color: #000; |
281 | + span { | ||
293 | display: inline-block; | 282 | display: inline-block; |
294 | *display: inline; | 283 | *display: inline; |
295 | *zoom: 1; | 284 | *zoom: 1; |
296 | font-size: 12px; | 285 | font-size: 12px; |
297 | padding: 0 15px; | 286 | padding: 0 15px; |
298 | - } | ||
299 | - | ||
300 | - .commodity-content .commodity-price span.origin { | 287 | + &.origin { |
301 | text-decoration: line-through; | 288 | text-decoration: line-through; |
302 | } | 289 | } |
303 | - | ||
304 | - .commodity-content .commodity-price strong { | 290 | + } |
291 | + strong { | ||
305 | font-weight: normal; | 292 | font-weight: normal; |
306 | color: #565656; | 293 | color: #565656; |
307 | font-size: 13px; | 294 | font-size: 13px; |
308 | } | 295 | } |
309 | - | ||
310 | - .commodity-content .commodity-price span.vip-tag { | ||
311 | - background-image: image-url('sale/vip.png'); | 296 | + span.vip-tag { |
297 | + background-image: image-url("sale/vip.png"); | ||
312 | background-repeat: no-repeat; | 298 | background-repeat: no-repeat; |
313 | background-size: 100% 90%; | 299 | background-size: 100% 90%; |
314 | color: #fff; | 300 | color: #fff; |
315 | font-style: italic; | 301 | font-style: italic; |
316 | margin-right: 5px; | 302 | margin-right: 5px; |
317 | } | 303 | } |
318 | - | ||
319 | - .commodity-content .commodity-price .price-sale { | 304 | + .price-sale { |
320 | margin-left: 10px; | 305 | margin-left: 10px; |
321 | padding-left: 10px; | 306 | padding-left: 10px; |
322 | width: 36px; | 307 | width: 36px; |
323 | height: 20px; | 308 | height: 20px; |
324 | line-height: 20px; | 309 | line-height: 20px; |
325 | background: url('../assets/images/furniture/sale-tag-bg.png?1450667948'); | 310 | background: url('../assets/images/furniture/sale-tag-bg.png?1450667948'); |
326 | - color: #fff | 311 | + color: #fff; |
312 | + } | ||
313 | + } | ||
327 | } | 314 | } |
328 | 315 | ||
329 | @media screen and (min-width: 1150px) { | 316 | @media screen and (min-width: 1150px) { |
330 | .commodity-list ul { | 317 | .commodity-list ul { |
331 | - width:1160px | 318 | + width: 1160px; |
332 | } | 319 | } |
333 | - | ||
334 | .commodity-item { | 320 | .commodity-item { |
335 | - width: 280px | 321 | + width: 280px; |
336 | } | 322 | } |
337 | - | ||
338 | .commodity-img { | 323 | .commodity-img { |
339 | - height: 374px | 324 | + height: 374px; |
340 | } | 325 | } |
341 | - | ||
342 | .commodity-content { | 326 | .commodity-content { |
343 | padding: 14px 0 0 0; | 327 | padding: 14px 0 0 0; |
344 | - height: 77px | 328 | + height: 77px; |
329 | + } | ||
330 | + } | ||
331 | + | ||
332 | +} | ||
333 | + | ||
334 | +.sale-list-page { | ||
335 | + | ||
336 | + .sale-title { | ||
337 | + margin: 30px 0; | ||
338 | + font-size: 12px; | ||
339 | + line-height: 26px; | ||
340 | + | ||
341 | + .title { | ||
342 | + margin-right: 20px; | ||
343 | + font-size: 16px; | ||
344 | + } | ||
345 | + | ||
346 | + .discount { | ||
347 | + display: inline-block; | ||
348 | + margin-right: 10px; | ||
349 | + padding: 0 10px; | ||
350 | + font-weight: lighter; | ||
351 | + line-height: 16px; | ||
352 | + vertical-align: text-bottom; | ||
353 | + color: #fff; | ||
354 | + background: #ff575c; | ||
355 | + } | ||
356 | + | ||
357 | + .time { | ||
358 | + .iconfont { | ||
359 | + margin-right: 5px; | ||
360 | + } | ||
361 | + } | ||
362 | + } | ||
363 | + | ||
364 | + .sort { | ||
365 | + padding: 10px; | ||
366 | + border: 1px solid #eaeceb; | ||
367 | + | ||
368 | + li { | ||
369 | + display: inline-block; | ||
370 | + margin-right: 15px; | ||
371 | + padding: 0 10px; | ||
372 | + font-size: 12px; | ||
373 | + line-height: 20px; | ||
374 | + color: #444; | ||
375 | + | ||
376 | + &.title { | ||
377 | + margin-right: 0; | ||
378 | + font-weight: bold; | ||
379 | + } | ||
380 | + | ||
381 | + &.active { | ||
382 | + color: #666; | ||
383 | + border: 1px solid #000; | ||
384 | + } | ||
345 | } | 385 | } |
346 | } | 386 | } |
347 | } | 387 | } |
@@ -159,4 +159,5 @@ class CommonController extends WebAction | @@ -159,4 +159,5 @@ class CommonController extends WebAction | ||
159 | return $this->helpJsonCallbackResult($callback, 403, '意见反馈失败', ''); | 159 | return $this->helpJsonCallbackResult($callback, 403, '意见反馈失败', ''); |
160 | } | 160 | } |
161 | } | 161 | } |
162 | + | ||
162 | } | 163 | } |
1 | +<?php | ||
2 | +use Action\WebAction; | ||
3 | +use Plugin\Cache; | ||
4 | +use Configs\CacheConfig; | ||
5 | +use Plugin\AuthCode; | ||
6 | +class ToolsController extends WebAction | ||
7 | +{ | ||
8 | + public function init() | ||
9 | + { | ||
10 | + $valid_passwords = array ('test' => '123456'); | ||
11 | + $valid_users = array_keys($valid_passwords); | ||
12 | + $user = $pass = ''; | ||
13 | + if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_USER'])) | ||
14 | + { | ||
15 | + $user = $_SERVER['PHP_AUTH_USER']; | ||
16 | + $pass = $_SERVER['PHP_AUTH_PW']; | ||
17 | + } | ||
18 | + $validated = (in_array($user, $valid_users)) && ($pass == $valid_passwords[$user]); | ||
19 | + if (!$validated) { | ||
20 | + header('WWW-Authenticate: Basic realm="www.yohobuy.com"'); | ||
21 | + header('HTTP/1.0 401 Unauthorized'); | ||
22 | + die ("Not authorized"); | ||
23 | + } | ||
24 | + } | ||
25 | + | ||
26 | + /** | ||
27 | + * 缓存html | ||
28 | + * | ||
29 | + */ | ||
30 | + public function cacheAction() | ||
31 | + { | ||
32 | + //频道=>key | ||
33 | + $channels = array( | ||
34 | + '男生首页'=> CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_boys', | ||
35 | + '女生首页'=> CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_girls', | ||
36 | + 'kids首页'=> CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_kids', | ||
37 | + 'lifestyle首页'=> CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_lifestyle', | ||
38 | + ); | ||
39 | + $html = ''; | ||
40 | + foreach ($channels as $key => $val) { | ||
41 | + $url = '/tools/cacheclear?key='.AuthCode::encode($val, 'yohobuy'); | ||
42 | + $html.= sprintf('<li><a href="%s" target="_blank">清除%s缓存</a></li>',$url, $key); | ||
43 | + } | ||
44 | + echo $html; | ||
45 | + } | ||
46 | + | ||
47 | + /** | ||
48 | + * 清除缓存 | ||
49 | + * | ||
50 | + * @return json | ||
51 | + */ | ||
52 | + public function cacheclearAction() | ||
53 | + { | ||
54 | + $key = $this->get('key'); | ||
55 | + if(!empty($key)) { | ||
56 | + AuthCode::decode($key, 'yohobuy'); | ||
57 | + if(!empty($key)) { | ||
58 | + Cache::delete($key); | ||
59 | + echo '清除成功'; | ||
60 | + } | ||
61 | + } | ||
62 | + } | ||
63 | +} | ||
64 | + | ||
65 | +?> |
@@ -154,6 +154,7 @@ class SearchModel | @@ -154,6 +154,7 @@ class SearchModel | ||
154 | //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); | 154 | //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); |
155 | 155 | ||
156 | $result = Yohobuy::getMulti($urlList, array(), true); | 156 | $result = Yohobuy::getMulti($urlList, array(), true); |
157 | + | ||
157 | // 组织模板数据 | 158 | // 组织模板数据 |
158 | $data = HelperSearch::getList($result, $searchCondition['options']); | 159 | $data = HelperSearch::getList($result, $searchCondition['options']); |
159 | return $data; | 160 | return $data; |
@@ -41,16 +41,21 @@ class BackController extends WebAction { | @@ -41,16 +41,21 @@ class BackController extends WebAction { | ||
41 | ); | 41 | ); |
42 | if (PassportModel::verifyCode($verifyCode)) { | 42 | if (PassportModel::verifyCode($verifyCode)) { |
43 | if (Helpers::verifyEmail($phoneNum)) { | 43 | if (Helpers::verifyEmail($phoneNum)) { |
44 | - if (empty(PassportModel::getUserInfoByEmail($phoneNum))) { | 44 | + $ret = PassportModel::getUserInfoByEmail($phoneNum); |
45 | + if (empty($ret)) { | ||
45 | $data['message'] = '该账户不存在'; | 46 | $data['message'] = '该账户不存在'; |
46 | $data['code'] = 400; | 47 | $data['code'] = 400; |
47 | } | 48 | } |
48 | } else if (Helpers::verifyMobile($phoneNum)) { | 49 | } else if (Helpers::verifyMobile($phoneNum)) { |
49 | - if (empty(PassportModel::getUserInfoByMobile($phoneNum, $area))) { | 50 | + $ret = PassportModel::getUserInfoByMobile($area, $phoneNum); |
51 | + if (empty($ret)) { | ||
50 | $data['message'] = '该账户不存在'; | 52 | $data['message'] = '该账户不存在'; |
51 | $data['code'] = 400; | 53 | $data['code'] = 400; |
52 | } | 54 | } |
53 | } | 55 | } |
56 | + } else { | ||
57 | + $data['message'] = '验证失败'; | ||
58 | + $data['code'] = 400; | ||
54 | } | 59 | } |
55 | echo $this->echoJson($data); | 60 | echo $this->echoJson($data); |
56 | } | 61 | } |
@@ -126,7 +131,8 @@ class BackController extends WebAction { | @@ -126,7 +131,8 @@ class BackController extends WebAction { | ||
126 | /** | 131 | /** |
127 | * 重置密码页面 | 132 | * 重置密码页面 |
128 | */ | 133 | */ |
129 | - public function backcodeAction() { | 134 | + public function backcodeAction() |
135 | + { | ||
130 | $code = $this->get('code'); | 136 | $code = $this->get('code'); |
131 | $info = $this->checkCode($code); | 137 | $info = $this->checkCode($code); |
132 | if (empty ( $info )) { | 138 | if (empty ( $info )) { |
@@ -149,7 +155,8 @@ class BackController extends WebAction { | @@ -149,7 +155,8 @@ class BackController extends WebAction { | ||
149 | /** | 155 | /** |
150 | * 更新密码接口 | 156 | * 更新密码接口 |
151 | */ | 157 | */ |
152 | - public function updateAction() { | 158 | + public function updateAction() |
159 | + { | ||
153 | $code = $this->post('code'); | 160 | $code = $this->post('code'); |
154 | $password = $this->post('pwd'); | 161 | $password = $this->post('pwd'); |
155 | $info = $this->checkCode($code); | 162 | $info = $this->checkCode($code); |
@@ -175,7 +182,8 @@ class BackController extends WebAction { | @@ -175,7 +182,8 @@ class BackController extends WebAction { | ||
175 | /** | 182 | /** |
176 | * 重置密码成功 | 183 | * 重置密码成功 |
177 | */ | 184 | */ |
178 | - public function resetSuccessAction() { | 185 | + public function resetSuccessAction() |
186 | + { | ||
179 | $banner = PassportModel::getLeftBanner ( PassportModel::BACK_LFFT_BANNER_CODE ); | 187 | $banner = PassportModel::getLeftBanner ( PassportModel::BACK_LFFT_BANNER_CODE ); |
180 | $data = array ( | 188 | $data = array ( |
181 | 'simpleHeader' => PassportModel::getSimpleHeader ( false ), | 189 | 'simpleHeader' => PassportModel::getSimpleHeader ( false ), |
@@ -191,7 +199,8 @@ class BackController extends WebAction { | @@ -191,7 +199,8 @@ class BackController extends WebAction { | ||
191 | /** | 199 | /** |
192 | * 手机验证页面 | 200 | * 手机验证页面 |
193 | */ | 201 | */ |
194 | - public function verificationAction() { | 202 | + public function verificationAction() |
203 | + { | ||
195 | $mobile = $this->getSession ('mobile'); | 204 | $mobile = $this->getSession ('mobile'); |
196 | $area = $this->getSession ('area'); | 205 | $area = $this->getSession ('area'); |
197 | $verifyCode = $this->getSession ('verifyCode'); | 206 | $verifyCode = $this->getSession ('verifyCode'); |
@@ -217,13 +226,14 @@ class BackController extends WebAction { | @@ -217,13 +226,14 @@ class BackController extends WebAction { | ||
217 | /** | 226 | /** |
218 | * 手机找回密码验证 | 227 | * 手机找回密码验证 |
219 | */ | 228 | */ |
220 | - public function backmobileAction() { | 229 | + public function backmobileAction() |
230 | + { | ||
221 | $mobile = $this->post ( 'mobile' ); | 231 | $mobile = $this->post ( 'mobile' ); |
222 | $area = $this->post ( 'area' ); | 232 | $area = $this->post ( 'area' ); |
223 | $verifyCode = $this->post ( 'verifyCode' ); | 233 | $verifyCode = $this->post ( 'verifyCode' ); |
224 | $code = $this->post ( 'code' ); // code | 234 | $code = $this->post ( 'code' ); // code |
225 | $data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index'); | 235 | $data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index'); |
226 | - if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area) { | 236 | + if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)) { |
227 | $result = BackData::validateMobileCode ( $mobile, $code, $area ); | 237 | $result = BackData::validateMobileCode ( $mobile, $code, $area ); |
228 | if ($result ['code'] == 200) { | 238 | if ($result ['code'] == 200) { |
229 | $str = json_encode ( array ( | 239 | $str = json_encode ( array ( |
@@ -248,7 +258,8 @@ class BackController extends WebAction { | @@ -248,7 +258,8 @@ class BackController extends WebAction { | ||
248 | * @param string $code | 258 | * @param string $code |
249 | * @return boolean | 259 | * @return boolean |
250 | */ | 260 | */ |
251 | - private function checkCode($code) { | 261 | + private function checkCode($code) |
262 | + { | ||
252 | $code = base64_decode ( $code ); | 263 | $code = base64_decode ( $code ); |
253 | $info = json_decode ( AuthCode::decode ( $code, PassportModel::BACK_FIND_SECRET_KEY ), true ); | 264 | $info = json_decode ( AuthCode::decode ( $code, PassportModel::BACK_FIND_SECRET_KEY ), true ); |
254 | if ($info ['create_time'] < 1 || (time () - $info ['create_time']) > 86400) { | 265 | if ($info ['create_time'] < 1 || (time () - $info ['create_time']) > 86400) { |
@@ -50,7 +50,7 @@ class ListController extends WebAction | @@ -50,7 +50,7 @@ class ListController extends WebAction | ||
50 | public function saleAction() | 50 | public function saleAction() |
51 | { | 51 | { |
52 | $condition = array(); | 52 | $condition = array(); |
53 | - $list = SearchModel::getListData($condition); | 53 | + $list = SearchModel::getListData($condition,array('reviewNum'=>6)); |
54 | $data = array( | 54 | $data = array( |
55 | //初始化js | 55 | //初始化js |
56 | 'productListPage' => true, | 56 | 'productListPage' => true, |
@@ -405,6 +405,204 @@ class Sale1Controller extends WebAction | @@ -405,6 +405,204 @@ class Sale1Controller extends WebAction | ||
405 | $this->_view->display('index', $data); | 405 | $this->_view->display('index', $data); |
406 | } | 406 | } |
407 | 407 | ||
408 | + //分类列表页 | ||
409 | + public function saleCatAction() | ||
410 | + { | ||
411 | + $data = array( | ||
412 | + 'saleCatPage' => true, | ||
413 | + 'saleList' => array( | ||
414 | + 'saleBanner' => array( | ||
415 | + 'bannerHeight' => 350, | ||
416 | + 'list' => array( | ||
417 | + array( | ||
418 | + 'bannerHeight' => 350, | ||
419 | + 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg' | ||
420 | + ), | ||
421 | + array( | ||
422 | + 'bannerHeight' => 350, | ||
423 | + 'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg' | ||
424 | + ), | ||
425 | + array( | ||
426 | + 'bannerHeight' => 350, | ||
427 | + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg' | ||
428 | + ), | ||
429 | + array( | ||
430 | + 'bannerHeight' => 350, | ||
431 | + 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg' | ||
432 | + ), | ||
433 | + array( | ||
434 | + 'bannerHeight' => 350, | ||
435 | + 'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg' | ||
436 | + ), | ||
437 | + array( | ||
438 | + 'bannerHeight' => 350, | ||
439 | + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg' | ||
440 | + ) | ||
441 | + ) | ||
442 | + ), | ||
443 | + 'saleTitle' => array( | ||
444 | + 'title' => 'SALE 精品上装专场', | ||
445 | + 'discount' => '8 折', | ||
446 | + 'time' => '1 天 20 小时 16 分 30 秒', | ||
447 | + 'up' => true | ||
448 | + ), | ||
449 | + 'sort' => array( | ||
450 | + array( | ||
451 | + 'id' => '1', | ||
452 | + 'name' => '全部', | ||
453 | + 'number' => 3997, | ||
454 | + 'active' => true | ||
455 | + ), | ||
456 | + array( | ||
457 | + 'id' => '2', | ||
458 | + 'name' => '上衣', | ||
459 | + 'number' => 89 | ||
460 | + ), | ||
461 | + array( | ||
462 | + 'id' => '3', | ||
463 | + 'name' => '裤子', | ||
464 | + 'number' => 29 | ||
465 | + ), | ||
466 | + array( | ||
467 | + 'id' => '4', | ||
468 | + 'name' => '连衣裙', | ||
469 | + 'number' => 399 | ||
470 | + ), | ||
471 | + array( | ||
472 | + 'id' => '5', | ||
473 | + 'name' => '鞋', | ||
474 | + 'number' => 399 | ||
475 | + ) | ||
476 | + ), | ||
477 | + 'opts' => array( | ||
478 | + 'sortType' => array( | ||
479 | + array( | ||
480 | + 'href' => '', | ||
481 | + 'name' => '默认' | ||
482 | + ), | ||
483 | + array( | ||
484 | + 'active' => true, | ||
485 | + 'href' => '', | ||
486 | + 'name' => '最新', | ||
487 | + 'hasSortOrient' => true, | ||
488 | + 'desc' => true | ||
489 | + ), | ||
490 | + array( | ||
491 | + 'href' => '', | ||
492 | + 'name' => '价格', | ||
493 | + 'hasSortOrient' => true | ||
494 | + ), | ||
495 | + array( | ||
496 | + 'href' => '', | ||
497 | + 'name' => '折扣', | ||
498 | + 'hasSortOrient' => true | ||
499 | + ) | ||
500 | + ), | ||
501 | + 'checks' => array( | ||
502 | + array( | ||
503 | + 'name' => '新品', | ||
504 | + 'checked' => true, | ||
505 | + 'href' => '' | ||
506 | + ), | ||
507 | + array( | ||
508 | + 'name' => '打折', | ||
509 | + 'href' => '' | ||
510 | + ), | ||
511 | + array( | ||
512 | + 'name' => '限量', | ||
513 | + 'checked' => true, | ||
514 | + 'href' => '' | ||
515 | + ) | ||
516 | + ), | ||
517 | + 'fivePerLine' => true, | ||
518 | + 'sixPerLineHref' => '', | ||
519 | + 'countPerPage' => '120', | ||
520 | + 'pageCounts' => array( | ||
521 | + array( | ||
522 | + 'href' => '', | ||
523 | + 'count' => 60 | ||
524 | + ), | ||
525 | + array( | ||
526 | + 'href' => '', | ||
527 | + 'count' => 100 | ||
528 | + ), | ||
529 | + array( | ||
530 | + 'href' => '', | ||
531 | + 'count' => 120 | ||
532 | + ) | ||
533 | + ), | ||
534 | + 'curPage' => 1, | ||
535 | + 'pageCount' => 30, | ||
536 | + 'nextHref' => 'hello' | ||
537 | + ), | ||
538 | + 'goods' => array( | ||
539 | + array( | ||
540 | + 'tags' => array( | ||
541 | + 'isNew' => true, | ||
542 | + 'isYearEndPromotion' => true | ||
543 | + ), | ||
544 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
545 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
546 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
547 | + 'salePrice' => '899', | ||
548 | + 'isFew' => true | ||
549 | + ), | ||
550 | + array( | ||
551 | + 'tags' => array( | ||
552 | + 'isNew' => true, | ||
553 | + 'isReNew' => true | ||
554 | + ), | ||
555 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
556 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
557 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
558 | + 'salePrice' => '899', | ||
559 | + 'showColBtn' => true | ||
560 | + ), | ||
561 | + array( | ||
562 | + 'tags' => array( | ||
563 | + 'isNew' => true, | ||
564 | + 'isReNew' => true | ||
565 | + ), | ||
566 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
567 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
568 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
569 | + 'salePrice' => '899' | ||
570 | + ), | ||
571 | + array( | ||
572 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
573 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
574 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
575 | + 'salePrice' => '899' | ||
576 | + ), | ||
577 | + array( | ||
578 | + 'tags' => array( | ||
579 | + 'isNew' => true, | ||
580 | + 'isReNew' => true | ||
581 | + ), | ||
582 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
583 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
584 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
585 | + 'salePrice' => '899' | ||
586 | + ), | ||
587 | + array( | ||
588 | + 'tags' => array( | ||
589 | + 'isNew' => true, | ||
590 | + 'isReNew' => true | ||
591 | + ), | ||
592 | + 'url' => 'http://adidas.yohobuy.com/?gender=1,3', | ||
593 | + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
594 | + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋', | ||
595 | + 'salePrice' => '899' | ||
596 | + ) | ||
597 | + ), | ||
598 | + 'totalCount' => '2259', | ||
599 | + 'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">></span></a>' | ||
600 | + ) | ||
601 | + ); | ||
602 | + $this->setWebNavHeader(); | ||
603 | + $this->_view->display('sale-cat', $data); | ||
604 | + } | ||
605 | + | ||
408 | //列表页 | 606 | //列表页 |
409 | public function saleListAction() | 607 | public function saleListAction() |
410 | { | 608 | { |
-
Please register or login to post a comment