Authored by Rock Zhang

Merge branch 'develop' into test

Showing 42 changed files with 224 additions and 74 deletions
@@ -323,7 +323,7 @@ @@ -323,7 +323,7 @@
323 ### 编辑页 323 ### 编辑页
324 324
325 { 325 {
326 - author: { 326 + authorInfo: {
327 avatar: '', 327 avatar: '',
328 name: '', 328 name: '',
329 info: '' 329 info: ''
@@ -747,7 +747,8 @@ @@ -747,7 +747,8 @@
747 brandHome: { 747 brandHome: {
748 id: 0, 748 id: 0,
749 banner: '' 749 banner: ''
750 - intro: '...' 750 + intro: '...',
  751 + collected: true //是否已收藏
751 }, 752 },
752 new: [ 753 new: [
753 { 754 {
framework @ 119c247f
1 -Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2 1 +Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
@@ -17,10 +17,10 @@ use Plugin\Cache; @@ -17,10 +17,10 @@ use Plugin\Cache;
17 class Yohobuy 17 class Yohobuy
18 { 18 {
19 19
20 -// /* 正式环境 */  
21 -// const API_URL = 'http://api2.open.yohobuy.com/';  
22 -// const SERVICE_URL = 'http://service.api.yohobuy.com/';  
23 -// const YOHOBUY_URL = 'http://www.yohobuy.com/'; 20 + // /* 正式环境 */
  21 + // const API_URL = 'http://api2.open.yohobuy.com/';
  22 + // const SERVICE_URL = 'http://service.api.yohobuy.com/';
  23 + // const YOHOBUY_URL = 'http://www.yohobuy.com/';
24 24
25 /* 测试环境 */ 25 /* 测试环境 */
26 const API_URL = 'http://test2.open.yohobuy.com/'; 26 const API_URL = 'http://test2.open.yohobuy.com/';
1 <?php 1 <?php
2 2
3 namespace Plugin\DataProcess; 3 namespace Plugin\DataProcess;
4 -  
5 use Plugin\Helpers; 4 use Plugin\Helpers;
6 5
7 /** 6 /**
@@ -18,9 +17,10 @@ class ListProcess @@ -18,9 +17,10 @@ class ListProcess
18 */ 17 */
19 public static function getListData($data, $returnFilter = true) 18 public static function getListData($data, $returnFilter = true)
20 { 19 {
21 - $result = array('new' => array(), 'filter' => array()); 20 + $result = array();
22 21
23 - if (isset($data['product_list'])) { 22 + if(isset($data['product_list']))
  23 + {
24 $result['new'] = self::getProductData($data['product_list']); 24 $result['new'] = self::getProductData($data['product_list']);
25 } 25 }
26 if ($returnFilter && isset($data['filter'])) { 26 if ($returnFilter && isset($data['filter'])) {
@@ -28,6 +28,7 @@ class ListProcess @@ -28,6 +28,7 @@ class ListProcess
28 } 28 }
29 29
30 return $result; 30 return $result;
  31 +
31 } 32 }
32 33
33 /** 34 /**
@@ -46,34 +47,40 @@ class ListProcess @@ -46,34 +47,40 @@ class ListProcess
46 } 47 }
47 48
48 return $products; 49 return $products;
  50 +
49 } 51 }
50 52
51 /** 53 /**
52 * 处理筛选数据 54 * 处理筛选数据
53 * 55 *
54 * @param $data 56 * @param $data
  57 + * @param string | integer $gender 默认选择的性别,默认1,2,3表示所有
55 * @return array 处理之后的筛选数据 58 * @return array 处理之后的筛选数据
56 */ 59 */
57 - public static function getFilterData($data) 60 + public static function getFilterData($data, $gender = '1,2,3')
58 { 61 {
59 // 过滤条件数据 62 // 过滤条件数据
60 - $filters = array('classify' => array()); 63 + $filters = array('classify'=>array());
  64 +
  65 + // 返回数据中有没有gender时要添加gender
  66 + // $data['gender'] = array('2,3'=>'GIRLS','1,3'=>'BOYS');
61 67
62 $num = 1; 68 $num = 1;
63 - $build = array();  
64 foreach ($data as $key => $val) { 69 foreach ($data as $key => $val) {
65 - if (empty($val)) { 70 + if(empty($val))
  71 + {
66 continue; 72 continue;
67 } 73 }
68 if (!is_callable("self::$key")) { 74 if (!is_callable("self::$key")) {
69 continue; 75 continue;
70 } 76 }
71 - $build = self::$key($val);  
72 - if ($num === 1) { 77 + $build = self::$key($val, $gender);
  78 + if($num === 1)
  79 + {
73 $build['active'] = true; 80 $build['active'] = true;
74 } 81 }
75 82
76 - $num ++; 83 + $num++;
77 $filters['classify'][] = $build; 84 $filters['classify'][] = $build;
78 } 85 }
79 86
@@ -81,6 +88,7 @@ class ListProcess @@ -81,6 +88,7 @@ class ListProcess
81 self::sortArrByField($filters['classify'], 'sort_col'); 88 self::sortArrByField($filters['classify'], 'sort_col');
82 89
83 return $filters; 90 return $filters;
  91 +
84 } 92 }
85 93
86 private static function brand($data) 94 private static function brand($data)
@@ -159,7 +167,7 @@ class ListProcess @@ -159,7 +167,7 @@ class ListProcess
159 foreach ($data as $key => $one) { 167 foreach ($data as $key => $one) {
160 $discount = array(); 168 $discount = array();
161 $discount['dataId'] = $key; 169 $discount['dataId'] = $key;
162 - $discount['name'] = $one['name'] . '折商品'; 170 + $discount['name'] = $one['name'] .'折商品';
163 171
164 $result['subs'][] = $discount; 172 $result['subs'][] = $discount;
165 } 173 }
@@ -167,7 +175,7 @@ class ListProcess @@ -167,7 +175,7 @@ class ListProcess
167 return $result; 175 return $result;
168 } 176 }
169 177
170 - private static function gender($data) 178 + private static function gender($data, $gender)
171 { 179 {
172 $result = array( 180 $result = array(
173 'title' => '性别', 181 'title' => '性别',
@@ -176,8 +184,7 @@ class ListProcess @@ -176,8 +184,7 @@ class ListProcess
176 'dataType' => 'gender', 184 'dataType' => 'gender',
177 'subs' => array( 185 'subs' => array(
178 array( 186 array(
179 - 'chosed' => true,  
180 - 'dataId' => 0, 187 + 'dataId' => '1,2,3',
181 'name' => '所有性别' 188 'name' => '所有性别'
182 ), 189 ),
183 array( 190 array(
@@ -191,6 +198,11 @@ class ListProcess @@ -191,6 +198,11 @@ class ListProcess
191 ) 198 )
192 ); 199 );
193 200
  201 + // 处理选中状态
  202 + foreach ($result['subs'] as &$val) {
  203 + $val['dataId'] === $gender && $val['chosed'] = true;
  204 + }
  205 +
194 return $result; 206 return $result;
195 } 207 }
196 208
@@ -215,7 +227,7 @@ class ListProcess @@ -215,7 +227,7 @@ class ListProcess
215 $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; 227 $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0;
216 $category['name'] = $one['category_name']; 228 $category['name'] = $one['category_name'];
217 229
218 - /* // 子品类(目前h5不支持二级) 230 + /*// 子品类(目前h5不支持二级)
219 if(isset($one['sub'])) 231 if(isset($one['sub']))
220 { 232 {
221 $category['subs'] = array(); 233 $category['subs'] = array();
@@ -226,7 +238,7 @@ class ListProcess @@ -226,7 +238,7 @@ class ListProcess
226 238
227 $category['subs'][] = $subitem; 239 $category['subs'][] = $subitem;
228 } 240 }
229 - } */ 241 + }*/
230 242
231 $result['subs'][] = $category; 243 $result['subs'][] = $category;
232 } 244 }
@@ -295,8 +307,7 @@ class ListProcess @@ -295,8 +307,7 @@ class ListProcess
295 * @param string $field 字段名称 307 * @param string $field 字段名称
296 * @param boolean $desc 时候降序排列,默认为false 308 * @param boolean $desc 时候降序排列,默认为false
297 */ 309 */
298 - private static function sortArrByField(&$array, $field, $desc = false)  
299 - { 310 + private static function sortArrByField(&$array, $field, $desc = false){
300 $fieldArr = array(); 311 $fieldArr = array();
301 foreach ($array as $k => $v) { 312 foreach ($array as $k => $v) {
302 $fieldArr[$k] = $v[$field]; 313 $fieldArr[$k] = $v[$field];
@@ -304,5 +315,4 @@ class ListProcess @@ -304,5 +315,4 @@ class ListProcess
304 $sort = $desc == false ? SORT_ASC : SORT_DESC; 315 $sort = $desc == false ? SORT_ASC : SORT_DESC;
305 array_multisort($fieldArr, $sort, $array); 316 array_multisort($fieldArr, $sort, $array);
306 } 317 }
307 -  
308 } 318 }
@@ -161,7 +161,7 @@ class Helpers @@ -161,7 +161,7 @@ class Helpers
161 break; 161 break;
162 case 'newest': 162 case 'newest':
163 default: 163 default:
164 - $result = ($order == 0) ? 's_t_desc' : 's_t_asc'; 164 + $result = ($order == 1) ? 's_t_desc' : 's_t_asc';
165 break; 165 break;
166 } 166 }
167 167
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Fri Oct 30 10:27:45 2015 5 +Created by FontForge 20120731 at Sun Nov 1 15:22:48 2015
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -149,12 +149,13 @@ d="M459 754h22h23h20h22h22v-191v-191h191h191v-109h-191h-191v-191v-190h-109v190v1 @@ -149,12 +149,13 @@ d="M459 754h22h23h20h22h22v-191v-191h191h191v-109h-191h-191v-191v-190h-109v190v1
149 d="M77 372h873v-109h-873v109z" /> 149 d="M77 372h873v-109h-873v109z" />
150 <glyph glyph-name="uniE626" unicode="&#xe626;" 150 <glyph glyph-name="uniE626" unicode="&#xe626;"
151 d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 115l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" /> 151 d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 115l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" />
  152 + <glyph glyph-name="uniE627" unicode="&#xe627;"
  153 +d="M741 258q-23 9 -22 34q6 114 -8 186q-13 68 -37.5 125.5t-48 89.5t-50.5 57t-38 32t-18 10l-7 3l-7 -3q-7 -3 -18 -10t-38 -32t-50.5 -57t-48 -89.5t-37.5 -125.5q-14 -72 -8 -186q1 -25 -22 -34q-19 -9 -37 -19.5t-39 -29.5t-36 -41.5t-25.5 -56t-10.5 -72.5v-16h198
  154 +q2 -22 17.5 -36.5t37.5 -14.5h248q22 0 37.5 14.5t17.5 36.5h198v16q0 48 -14.5 87.5t-39 65t-47 40.5t-47.5 26zM512 442q-31 0 -53 22t-22 53t22 53t53 22q20 0 37.5 -10t27.5 -27t10 -38q0 -31 -22 -53t-53 -22zM453 -61q-14 0 -23.5 -10t-9.5 -24v-83q0 -10 4.5 -17.5
  155 +t12 -12t16.5 -4.5t17 4.5t12.5 12t4.5 17.5v83q0 9 -4.5 17t-12.5 12.5t-17 4.5zM571 -61q-7 0 -13.5 -2.5t-11 -7t-7 -11t-2.5 -13.5v-83q0 -14 10 -24t24 -10q6 0 12.5 2.5t11 7t7 11t2.5 13.5v83q0 9 -4.5 17t-12 12.5t-16.5 4.5z" />
152 <glyph glyph-name="uniE628" unicode="&#xe628;" 156 <glyph glyph-name="uniE628" unicode="&#xe628;"
153 d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5 157 d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5
154 t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" /> 158 t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" />
155 - <glyph glyph-name="uniE629" unicode="&#xe629;"  
156 -d="M442 274h-84v-76h-230v76h-81q-20 0 -33.5 -12.5t-13.5 -31.5v-395q0 -20 13.5 -33.5t33.5 -13.5h395q19 0 31.5 13.5t12.5 33.5v395q0 13 -5.5 23t-15.5 15.5t-23 5.5zM977 812h-81v-77h-230v77h-84q-10 0 -18 -3.5t-14 -10t-9 -15t-3 -18.5v-395q0 -13 5.5 -23  
157 -t15.5 -15.5t23 -5.5h395q20 0 33.5 12.5t13.5 31.5v395q0 20 -13.5 33.5t-33.5 13.5zM977 274h-81v-76h-230v76h-84q-13 0 -23 -5.5t-15.5 -15.5t-5.5 -23v-395q0 -13 5.5 -23.5t15.5 -17t23 -6.5h395q20 0 33.5 13.5t13.5 33.5v395q0 19 -13.5 31.5t-33.5 12.5z" />  
158 <glyph glyph-name="uniE62A" unicode="&#xe62a;" 159 <glyph glyph-name="uniE62A" unicode="&#xe62a;"
159 d="M497 806l-451 -386q-6 -6 -11 -13t-7 -15t-2 -17v-500q0 -32 22.5 -54.5t53.5 -22.5h256v333h308v-333h256q31 0 53.5 22.5t22.5 54.5v500q0 27 -20 45l-451 386q-15 13 -30 0z" /> 160 d="M497 806l-451 -386q-6 -6 -11 -13t-7 -15t-2 -17v-500q0 -32 22.5 -54.5t53.5 -22.5h256v333h308v-333h256q31 0 53.5 22.5t22.5 54.5v500q0 27 -20 45l-451 386q-15 13 -30 0z" />
160 <glyph glyph-name="uniE62B" unicode="&#xe62b;" 161 <glyph glyph-name="uniE62B" unicode="&#xe62b;"
No preview for this file type
No preview for this file type
@@ -108,7 +108,7 @@ function rePosFooter() { @@ -108,7 +108,7 @@ function rePosFooter() {
108 } 108 }
109 109
110 //页面通用底部位置及status设置 110 //页面通用底部位置及status设置
111 -(function () { 111 +(function() {
112 var $op = $footer.children('.op-row'); 112 var $op = $footer.children('.op-row');
113 113
114 var user = getUser(); 114 var user = getUser();
@@ -135,9 +135,21 @@ function rePosFooter() { @@ -135,9 +135,21 @@ function rePosFooter() {
135 ); 135 );
136 } 136 }
137 137
  138 + $op.find('.back-to-top').on('touchend', function() {
  139 + $(window).scrollTop(0);
  140 + return false;
  141 + });
138 $footer.removeClass('hide'); 142 $footer.removeClass('hide');
139 }()); 143 }());
140 144
  145 +(function() {
  146 + var uid = getUid();
  147 +
  148 + uid = uid === 0 ? '' : uid;
  149 + window._yas(1 * new Date(), '1.0.8', 'yohobuy_m', uid, '');
  150 +}());
  151 +
  152 +
141 //暴露公共接口 153 //暴露公共接口
142 window.cookie = cookie; 154 window.cookie = cookie;
143 155
@@ -73,18 +73,20 @@ navHammer.on('tap', function(e) { @@ -73,18 +73,20 @@ navHammer.on('tap', function(e) {
73 $this.addClass('focus'); 73 $this.addClass('focus');
74 $curNav.removeClass('focus'); 74 $curNav.removeClass('focus');
75 75
76 - $infos.not('.hide').addClass('hide');  
77 -  
78 $content = $infos.eq(index); 76 $content = $infos.eq(index);
79 - $content.removeClass('hide');  
80 77
81 $curNav = $this; 78 $curNav = $this;
82 curType = $this.data('type'); 79 curType = $this.data('type');
83 80
84 //当未加载数据时去请求数据 81 //当未加载数据时去请求数据
85 if (state[curType].page === 1) { 82 if (state[curType].page === 1) {
  83 +
  84 + //无数据时隐藏正在加载和没有更多字样
  85 + $loading.addClass('hide');
  86 + $noMore.addClass('hide');
  87 +
86 loadMore($content, state[curType]); 88 loadMore($content, state[curType]);
87 - } 89 + } else {
88 90
89 //重置当前Tab的load-more 91 //重置当前Tab的load-more
90 if (state[curType].end) { 92 if (state[curType].end) {
@@ -94,6 +96,14 @@ navHammer.on('tap', function(e) { @@ -94,6 +96,14 @@ navHammer.on('tap', function(e) {
94 $loading.removeClass('hide'); 96 $loading.removeClass('hide');
95 $noMore.addClass('hide'); 97 $noMore.addClass('hide');
96 } 98 }
  99 + }
  100 +
  101 + $infos.not('.hide').addClass('hide');
  102 + $content.removeClass('hide');
  103 +
  104 + if (state[curType].page === 1) {
  105 + window.rePosFooter();//进入空内容时重新定位footer位置
  106 + }
97 }); 107 });
98 108
99 $(document).scroll(function() { 109 $(document).scroll(function() {
@@ -128,6 +128,7 @@ function loadMore($container, opt) { @@ -128,6 +128,7 @@ function loadMore($container, opt) {
128 128
129 return; 129 return;
130 } 130 }
  131 +
131 $container.append(data); 132 $container.append(data);
132 133
133 if (num > 0) { 134 if (num > 0) {
@@ -140,6 +141,10 @@ function loadMore($container, opt) { @@ -140,6 +141,10 @@ function loadMore($container, opt) {
140 141
141 if (opt.page === 1) { 142 if (opt.page === 1) {
142 loading.hideLoadingMask(); 143 loading.hideLoadingMask();
  144 +
  145 + $loading.removeClass('hide');//显示空屏加载时hide的隐藏
  146 +
  147 + window.rePosFooter();//插入内容后重新计算底部位置
143 } 148 }
144 149
145 opt.page++; 150 opt.page++;
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 float: left; 2 float: left;
3 width: 276rem / $pxConvertRem; 3 width: 276rem / $pxConvertRem;
4 height: 486rem / $pxConvertRem; 4 height: 486rem / $pxConvertRem;
5 - margin: 0 (15rem / $pxConvertRem) (28rem / $pxConvertRem); 5 + margin: 0 (15rem / $pxConvertRem) (15rem / $pxConvertRem);
6 6
7 .tag-container { 7 .tag-container {
8 height: 28rem / $pxConvertRem; 8 height: 28rem / $pxConvertRem;
1 .loading-mask { 1 .loading-mask {
2 - position: absolute; 2 + position: fixed;
3 background: rgba(0,0,0,.1); 3 background: rgba(0,0,0,.1);
4 top: 0; 4 top: 0;
5 bottom: 0; 5 bottom: 0;
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 .op-row { 5 .op-row {
6 position: relative; 6 position: relative;
7 - padding: 0 30px; 7 + padding: 0 15px;
8 height: 60px; 8 height: 60px;
9 line-height: 60px; 9 line-height: 60px;
10 10
@@ -112,6 +112,8 @@ @@ -112,6 +112,8 @@
112 .goods-container { 112 .goods-container {
113 position: relative; 113 position: relative;
114 min-height: 440px; 114 min-height: 440px;
  115 + padding-left: 0.375rem;
  116 + padding-top: 0.2rem;
115 } 117 }
116 118
117 } 119 }
@@ -73,6 +73,7 @@ @@ -73,6 +73,7 @@
73 > img { 73 > img {
74 display: block; 74 display: block;
75 height: 100%; 75 height: 100%;
  76 + width: 100%;
76 } 77 }
77 } 78 }
78 79
@@ -100,6 +101,18 @@ @@ -100,6 +101,18 @@
100 .iconfont { 101 .iconfont {
101 font-size: 12px; 102 font-size: 12px;
102 } 103 }
  104 +
  105 + &.coled {
  106 + opacity: 0.5;
  107 + }
  108 +
  109 + .txt:after {
  110 + content: '收藏'
  111 + }
  112 +
  113 + &.coled .txt:after {
  114 + content: '已收藏'
  115 + }
103 } 116 }
104 117
105 .brand-intro-box { 118 .brand-intro-box {
@@ -152,6 +165,8 @@ @@ -152,6 +165,8 @@
152 } 165 }
153 166
154 .list-nav { 167 .list-nav {
  168 + border-bottom: 1px solid #e6e6e6;
  169 +
155 > li { 170 > li {
156 float: left; 171 float: left;
157 width: 25%; 172 width: 25%;
@@ -226,5 +241,7 @@ @@ -226,5 +241,7 @@
226 .goods-container { 241 .goods-container {
227 position: relative; 242 position: relative;
228 min-height: 440px; 243 min-height: 440px;
  244 + padding-left: 0.375rem;
  245 + padding-top: 0.2rem;
229 } 246 }
230 } 247 }
@@ -84,6 +84,8 @@ @@ -84,6 +84,8 @@
84 .goods-container { 84 .goods-container {
85 position: relative; 85 position: relative;
86 min-height: 440px; 86 min-height: 440px;
  87 + padding-left: 0.375rem;
  88 + padding-top: 0.2rem;
87 } 89 }
88 90
89 } 91 }
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 12
13 .iconfont { 13 .iconfont {
14 color: #fff; 14 color: #fff;
15 - font-size: 22px; 15 + font-size: 18px;
16 } 16 }
17 17
18 .cart-count { 18 .cart-count {
@@ -83,4 +83,3 @@ @@ -83,4 +83,3 @@
83 </div> 83 </div>
84 </div> 84 </div>
85 {{> layout/footer}} 85 {{> layout/footer}}
86 -{{> layout/download_app}}  
@@ -19,4 +19,3 @@ @@ -19,4 +19,3 @@
19 {{{brandList}}} 19 {{{brandList}}}
20 </script> 20 </script>
21 {{> layout/footer}} 21 {{> layout/footer}}
22 -{{> layout/download_app}}  
@@ -41,4 +41,3 @@ @@ -41,4 +41,3 @@
41 {{/ category}} 41 {{/ category}}
42 </div> 42 </div>
43 {{> layout/footer}} 43 {{> layout/footer}}
44 -{{> layout/download_app}}  
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <div class="swiper-pagination"></div> 15 <div class="swiper-pagination"></div>
16 </div> 16 </div>
17 17
18 - {{# author}} 18 + {{# authorInfo}}
19 <div id="author-infos" class="editor-header clearfix" data-id={{id}}> 19 <div id="author-infos" class="editor-header clearfix" data-id={{id}}>
20 <div class="avatar"> 20 <div class="avatar">
21 <img src="{{avatar}}"> 21 <img src="{{avatar}}">
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <p class="info">{{info}}</p> 25 <p class="info">{{info}}</p>
26 </div> 26 </div>
27 </div> 27 </div>
28 - {{/ author}} 28 + {{/ authorInfo}}
29 29
30 <ul id="guang-nav" class="guang-nav clearfix"> 30 <ul id="guang-nav" class="guang-nav clearfix">
31 {{# navs}} 31 {{# navs}}
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 37
38 <div id="info-list" class="info-list-container"> 38 <div id="info-list" class="info-list-container">
39 {{# infos}} 39 {{# infos}}
40 - <div class="info-list {{^show}}hide{{/show}}"> 40 + <div class="info-list{{^show}} hide{{/show}}">
41 {{# info}} 41 {{# info}}
42 {{> guang/info}} 42 {{> guang/info}}
43 {{/ info}} 43 {{/ info}}
@@ -25,4 +25,3 @@ @@ -25,4 +25,3 @@
25 </div> 25 </div>
26 </div> 26 </div>
27 {{> layout/footer}} 27 {{> layout/footer}}
28 -{{> layout/download_app}}  
@@ -3,4 +3,3 @@ @@ -3,4 +3,3 @@
3 {{> product/list}} 3 {{> product/list}}
4 </div> 4 </div>
5 {{> layout/footer}} 5 {{> layout/footer}}
6 -{{> layout/download_app}}  
@@ -85,4 +85,3 @@ @@ -85,4 +85,3 @@
85 {{> product/suspend-cart}} 85 {{> product/suspend-cart}}
86 </div> 86 </div>
87 {{> layout/footer}} 87 {{> layout/footer}}
88 -{{> layout/download_app}}  
@@ -96,4 +96,3 @@ @@ -96,4 +96,3 @@
96 {{> product/suspend-cart}} 96 {{> product/suspend-cart}}
97 </div> 97 </div>
98 {{> layout/footer}} 98 {{> layout/footer}}
99 -{{> layout/download_app}}  
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 <div class="trend-coll-tail"> 10 <div class="trend-coll-tail">
11 <h3 class="recommend-title">推荐搭配</h3> 11 <h3 class="recommend-title">推荐搭配</h3>
12 <div class="recommend-swiper"> 12 <div class="recommend-swiper">
13 - <ul class="recommend-list clearfix"> 13 + <ul class="recommend-list swiper-wrapper clearfix">
14 {{# recommend_collocation}} 14 {{# recommend_collocation}}
15 <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{img}}" alt="" /></a></li> 15 <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{img}}" alt="" /></a></li>
16 {{/ recommend_collocation}} 16 {{/ recommend_collocation}}
  1 + <!-- Google Tag Manager -->
  2 + <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  3 + <script>
  4 + (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  5 + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  6 + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  7 + '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  8 + })(window,document,'script','dataLayer','GTM-W958MG');
  9 + </script>
  10 + <!-- End Google Tag Manager -->
  11 +
  12 +<script type="text/javascript">
  13 + var _hmt = _hmt || [];
  14 + (function() {
  15 + var hm = document.createElement("script");
  16 + hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
  17 + var s = document.getElementsByTagName("script")[0];
  18 + s.parentNode.insertBefore(hm, s);
  19 + })();
  20 +</script>
  21 +
  22 +<script>
  23 + var _hmt = _hmt || [];
  24 + (function() {
  25 + var hm = document.createElement("script");
  26 + hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
  27 + var s = document.getElementsByTagName("script")[0];
  28 + s.parentNode.insertBefore(hm, s);
  29 + })();
  30 +</script>
  31 +
  32 +<script type="text/javascript">
  33 + (function(w,d,s,j,f){
  34 + w['YohoAcquisitionObject']=f;
  35 + w[f]=function(){w[f].p=arguments;};
  36 + var a=d.createElement(s);
  37 + var m=d.getElementsByTagName(s)[0];
  38 + a.async=1;
  39 + a.src=j;
  40 + m.parentNode.insertBefore(a,m);
  41 + })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js','_yas');
  42 +</script>
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
19 <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> 19 <script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
20 <script>seajs.config({base: 'http://localhost:8000/'});</script> 20 <script>seajs.config({base: 'http://localhost:8000/'});</script>
21 {{/if}} 21 {{/if}}
  22 +
  23 +{{> layout/analysis}}
22 {{> layout/use}} 24 {{> layout/use}}
23 </body> 25 </body>
24 </html> 26 </html>
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <p class="tab-name">分类</p> 9 <p class="tab-name">分类</p>
10 </div> 10 </div>
11 <div class="tab-item {{#if guangHome}}current{{/if}}"> 11 <div class="tab-item {{#if guangHome}}current{{/if}}">
12 - <p class="iconfont tab-icon">&#xe611;</p> 12 + <p class="iconfont tab-icon">&#xe627;</p>
13 <p class="tab-name">逛</p> 13 <p class="tab-name">逛</p>
14 </div> 14 </div>
15 <div class="tab-item {{#if shoppingCartPage}}current{{/if}}"> 15 <div class="tab-item {{#if shoppingCartPage}}current{{/if}}">
@@ -29,9 +29,9 @@ @@ -29,9 +29,9 @@
29 <a class="btn-intro" href="javascript:void(0);"> 29 <a class="btn-intro" href="javascript:void(0);">
30 品牌介绍 30 品牌介绍
31 </a> 31 </a>
32 - <a class="btn-col" href="javascript:void(0);"> 32 + <a class="btn-col{{#if collected}} coled{{/if}}" href="javascript:void(0);">
33 <span class="iconfont">&#xe622;</span> 33 <span class="iconfont">&#xe622;</span>
34 - 收藏 34 + <span class="txt"></span>
35 </a> 35 </a>
36 </div> 36 </div>
37 <div id="intro-box" class="brand-intro-box hide"> 37 <div id="intro-box" class="brand-intro-box hide">
@@ -31,7 +31,7 @@ class BoysController extends AbstractAction @@ -31,7 +31,7 @@ class BoysController extends AbstractAction
31 $this->_view->display('index', array( 31 $this->_view->display('index', array(
32 'boysHomePage' => true, 32 'boysHomePage' => true,
33 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')), 33 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
34 - 'showFooterTab' => false, 34 + 'showFooterTab' => true,
35 'maybeLike' => true, 35 'maybeLike' => true,
36 'content' => Index\HomeModel::getBoysFloor(), 36 'content' => Index\HomeModel::getBoysFloor(),
37 'pageFooter' => true, 37 'pageFooter' => true,
@@ -57,6 +57,8 @@ class BoysController extends AbstractAction @@ -57,6 +57,8 @@ class BoysController extends AbstractAction
57 57
58 $this->echoJson($bottomBanner); 58 $this->echoJson($bottomBanner);
59 } while (false); 59 } while (false);
  60 +
  61 + echo ' ';
60 } 62 }
61 63
62 } 64 }
@@ -26,7 +26,7 @@ class GirlsController extends AbstractAction @@ -26,7 +26,7 @@ class GirlsController extends AbstractAction
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'grilsHomePage' => true, 27 'grilsHomePage' => true,
28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')), 28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 - 'showFooterTab' => false, 29 + 'showFooterTab' => true,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getGirlsFloor(), 31 'content' => Index\HomeModel::getGirlsFloor(),
32 'pageFooter' => true, 32 'pageFooter' => true,
@@ -53,6 +53,8 @@ class GirlsController extends AbstractAction @@ -53,6 +53,8 @@ class GirlsController extends AbstractAction
53 $this->echoJson($bottomBanner); 53 $this->echoJson($bottomBanner);
54 54
55 } while (false); 55 } while (false);
  56 +
  57 + echo ' ';
56 } 58 }
57 59
58 } 60 }
@@ -26,7 +26,7 @@ class KidsController extends AbstractAction @@ -26,7 +26,7 @@ class KidsController extends AbstractAction
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'kidsHomePage' => true, 27 'kidsHomePage' => true,
28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')), 28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 - 'showFooterTab' => false, 29 + 'showFooterTab' => true,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getKidsFloor(), 31 'content' => Index\HomeModel::getKidsFloor(),
32 'pageFooter' => true, 32 'pageFooter' => true,
@@ -26,7 +26,7 @@ class LifestyleController extends AbstractAction @@ -26,7 +26,7 @@ class LifestyleController extends AbstractAction
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'lifestyleHomePage' => true, 27 'lifestyleHomePage' => true,
28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')), 28 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 - 'showFooterTab' => false, 29 + 'showFooterTab' => true,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getLifestyleFloor(), 31 'content' => Index\HomeModel::getLifestyleFloor(),
32 'pageFooter' => true, 32 'pageFooter' => true,
1 <?php 1 <?php
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 -use LibModels\Wap\Product\SearchData; 4 +// use LibModels\Wap\Product\SearchData;
5 use Plugin\DataProcess\ListProcess; 5 use Plugin\DataProcess\ListProcess;
6 use Plugin\Helpers; 6 use Plugin\Helpers;
7 7
@@ -94,8 +94,7 @@ class SearchController extends AbstractAction @@ -94,8 +94,7 @@ class SearchController extends AbstractAction
94 if ($domain !== null) { 94 if ($domain !== null) {
95 $url = Helpers::url('', array( 95 $url = Helpers::url('', array(
96 'from' => 'search', 96 'from' => 'search',
97 - 'query' => $query,  
98 - 'gender' => $condition['gender'] 97 + 'query' => $query
99 ), $domain); 98 ), $domain);
100 $this->go($url); 99 $this->go($url);
101 } 100 }
@@ -271,23 +270,22 @@ class SearchController extends AbstractAction @@ -271,23 +270,22 @@ class SearchController extends AbstractAction
271 'gender' => FILTER_DEFAULT, 270 'gender' => FILTER_DEFAULT,
272 'p_d' => FILTER_DEFAULT,), false); 271 'p_d' => FILTER_DEFAULT,), false);
273 272
  273 + // 转义分类
274 if (isset($condition['sort'])) { 274 if (isset($condition['sort'])) {
275 $condition['sort'] = rawurldecode($condition['sort']); 275 $condition['sort'] = rawurldecode($condition['sort']);
276 } 276 }
  277 + // 转换折扣
277 if (isset($condition['discount'])) { 278 if (isset($condition['discount'])) {
278 $condition['p_d'] = rawurldecode($condition['discount']); 279 $condition['p_d'] = rawurldecode($condition['discount']);
279 unset($condition['discount']); 280 unset($condition['discount']);
280 } 281 }
  282 + // 转义性别
281 if (isset($condition['gender'])) { 283 if (isset($condition['gender'])) {
282 $condition['gender'] = rawurldecode($condition['gender']); 284 $condition['gender'] = rawurldecode($condition['gender']);
283 } 285 }
284 286
285 - $listData = SearchData::searchByCondition($condition);  
286 - // 处理返回的数据  
287 - if (isset($listData['data']) && isset($listData['data']['filter'])) {  
288 - $data['filter'] = ListProcess::getFilterData($listData['data']['filter']);  
289 - }  
290 - $listData = array(); 287 + // 区别各种列表页面的筛选数据
  288 + $data = Product\FilterModel::getFilterData($condition);
291 } 289 }
292 290
293 if (empty($data)) { 291 if (empty($data)) {
@@ -302,7 +300,7 @@ class SearchController extends AbstractAction @@ -302,7 +300,7 @@ class SearchController extends AbstractAction
302 * 300 *
303 * @return array 模糊搜索的结果 301 * @return array 模糊搜索的结果
304 */ 302 */
305 - public function fuzzysearch() 303 + /*public function fuzzysearch()
306 { 304 {
307 if ($this->isAjax()) { 305 if ($this->isAjax()) {
308 $keyword = $this->post('keyword', ''); 306 $keyword = $this->post('keyword', '');
@@ -311,6 +309,6 @@ class SearchController extends AbstractAction @@ -311,6 +309,6 @@ class SearchController extends AbstractAction
311 309
312 $this->echoJson($result); 310 $this->echoJson($result);
313 } 311 }
314 - } 312 + }*/
315 313
316 } 314 }
@@ -65,7 +65,7 @@ class BrandModel @@ -65,7 +65,7 @@ class BrandModel
65 $build = array(); 65 $build = array();
66 foreach ($brand['brandTop'][0]['data'] as $value) { 66 foreach ($brand['brandTop'][0]['data'] as $value) {
67 $build['url'] = Helpers::getFilterUrl($value['url']); 67 $build['url'] = Helpers::getFilterUrl($value['url']);
68 - $build['img'] = Helpers::getImageUrl($value['src'], 640, 300); 68 + $build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
69 $build['title'] = $value['title']; 69 $build['title'] = $value['title'];
70 $result['bannerTop']['list'][] = $build; 70 $result['bannerTop']['list'][] = $build;
71 } 71 }
  1 +<?php
  2 +
  3 +namespace Product;
  4 +
  5 +use Configs\CacheConfig;
  6 +use LibModels\Wap\Product\SearchData;
  7 +use LibModels\Wap\Category\BrandData;
  8 +use LibModels\Wap\Category\ClassData;
  9 +use Plugin\DataProcess\ListProcess;
  10 +
  11 +/**
  12 + * 搜索相关的模板数据模型
  13 + *
  14 + * @name Filter
  15 + * @package Product
  16 + * @copyright yoho.inc
  17 + * @version 1.0 (2015-11-1 17:35:52)
  18 + */
  19 +class FilterModel
  20 +{
  21 +
  22 + /**
  23 + * 获取筛选的数据
  24 + *
  25 + * @param array $condition 查询条件
  26 + * @return array
  27 + */
  28 + public static function getFilterData($condition)
  29 + {
  30 + $result = array();
  31 +
  32 + // 区别各种列表页面的筛选数据
  33 + if (isset($condition['brand'])) {
  34 + $listData = BrandData::filterBrandData($condition);
  35 + } else if(isset($condition['sort'])) {
  36 + $listData = ClassData::filterClassData($condition);
  37 + } else {
  38 + $listData = SearchData::searchByCondition($condition);
  39 + }
  40 +
  41 + if (isset($listData['data']) && isset($listData['data']['filter'])) {
  42 + $result['filter'] = ListProcess::getFilterData($listData['data']['filter']);
  43 + }
  44 +
  45 + return $result;
  46 + }
  47 +
  48 +}
@@ -224,15 +224,16 @@ class NewsaleModel @@ -224,15 +224,16 @@ class NewsaleModel
224 /** 224 /**
225 * 获取筛选数据 225 * 获取筛选数据
226 * @param array $data 接口返回的数据 226 * @param array $data 接口返回的数据
  227 + * @param string $gender 默认选择的性别,默认1,2,3表示所有
227 * @return array 处理之后的数据 228 * @return array 处理之后的数据
228 */ 229 */
229 - public static function filterData($data) 230 + public static function filterData($data, $gender = '1,2,3')
230 { 231 {
231 $result = array(); 232 $result = array();
232 233
233 /* 格式化筛选数据 */ 234 /* 格式化筛选数据 */
234 if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['filter'])) { 235 if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['filter'])) {
235 - $result['filter'] = ListProcess::getFilterData($data['data']['filter']); 236 + $result['filter'] = ListProcess::getFilterData($data['data']['filter'], $gender);
236 } 237 }
237 238
238 return $result; 239 return $result;
@@ -117,6 +117,8 @@ class IndexController extends AbstractAction @@ -117,6 +117,8 @@ class IndexController extends AbstractAction
117 117
118 if (isset($condition['gender'])) { 118 if (isset($condition['gender'])) {
119 $condition['gender'] = rawurldecode($condition['gender']); 119 $condition['gender'] = rawurldecode($condition['gender']);
  120 + } else {
  121 + $condition['gender'] = Helpers::getGenderByCookie();
120 } 122 }
121 123
122 $data = array(); 124 $data = array();
@@ -54,7 +54,7 @@ class NewsaleController extends AbstractAction @@ -54,7 +54,7 @@ class NewsaleController extends AbstractAction
54 // 设置一些默认参数 54 // 设置一些默认参数
55 $data = array( 55 $data = array(
56 'discountPage' => true, 56 'discountPage' => true,
57 - 'headerBanner' => \Product\NewsaleModel::getNewFocus($channel), 57 + 'headerBanner' => \Product\NewsaleModel::getSaleFocus($channel),
58 'showDownloadApp' => true, 58 'showDownloadApp' => true,
59 'pageFooter' => true, 59 'pageFooter' => true,
60 'brand' => '0', 60 'brand' => '0',
@@ -142,7 +142,7 @@ class NewsaleController extends AbstractAction @@ -142,7 +142,7 @@ class NewsaleController extends AbstractAction
142 $data = NewsaleData::selectNewSaleProducts( 142 $data = NewsaleData::selectNewSaleProducts(
143 $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order 143 $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
144 ); 144 );
145 - $result = \Product\NewsaleModel::filterData($data); 145 + $result = \Product\NewsaleModel::filterData($data, $gender);
146 } 146 }
147 147
148 if (empty($result)) { 148 if (empty($result)) {