Authored by 梁志锋

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -80,9 +80,6 @@ function loadData($parent, url, page) { @@ -80,9 +80,6 @@ function loadData($parent, url, page) {
80 page: page 80 page: page
81 }, 81 },
82 success: function(data) { 82 success: function(data) {
83 -  
84 - //setTimeout(function() { //模拟延时  
85 -  
86 if (url === 'favBrand') { 83 if (url === 'favBrand') {
87 $brandLoadMore.addClass('hide'); 84 $brandLoadMore.addClass('hide');
88 } else { 85 } else {
@@ -95,7 +92,6 @@ function loadData($parent, url, page) { @@ -95,7 +92,6 @@ function loadData($parent, url, page) {
95 } else if (data === 'end') { 92 } else if (data === 'end') {
96 $parent.closest('.fav-type').find('.fav-load-background') 93 $parent.closest('.fav-type').find('.fav-load-background')
97 .removeClass('fav-load-background').html('没有更多了'); 94 .removeClass('fav-load-background').html('没有更多了');
98 -  
99 } else if (data.length > 10) { 95 } else if (data.length > 10) {
100 $parent.append(data); 96 $parent.append(data);
101 $parent.closest('.fav-type').find('.fav-content-loading').remove(); 97 $parent.closest('.fav-type').find('.fav-content-loading').remove();
@@ -106,14 +102,8 @@ function loadData($parent, url, page) { @@ -106,14 +102,8 @@ function loadData($parent, url, page) {
106 } else { 102 } else {
107 lockId = false;//请求成功后解锁商品收藏page++ 103 lockId = false;//请求成功后解锁商品收藏page++
108 } 104 }
109 -  
110 - window.rePosFooter();  
111 -  
112 - } else {  
113 - return;  
114 } 105 }
115 -  
116 - //},1000); 106 + window.rePosFooter();
117 } 107 }
118 }); 108 });
119 } 109 }
@@ -243,6 +233,10 @@ function scrollHandler() { @@ -243,6 +233,10 @@ function scrollHandler() {
243 } 233 }
244 234
245 //srcoll to load more 235 //srcoll to load more
246 -$(window).scroll(function() {  
247 - window.requestAnimationFrame(scrollHandler);  
248 -});  
  236 +$(window).scroll(scrollHandler);
  237 +
  238 +$(document).on('touchend', '.swiper-header', function() {
  239 + var url = $(this).find('.fav-more').attr('href');
  240 +
  241 + window.location.href = url;
  242 +});
@@ -19,9 +19,9 @@ myImage.onload = function() { @@ -19,9 +19,9 @@ myImage.onload = function() {
19 $userAvatar.css('background-image', 'url(' + avatar + ')'); 19 $userAvatar.css('background-image', 'url(' + avatar + ')');
20 }; 20 };
21 21
22 -$('.yoho-page').on('touchstart', '.list-item, .type-item', function() { 22 +$('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', function() {
23 $listItem.removeClass('highlight'); 23 $listItem.removeClass('highlight');
24 $(this).addClass('highlight'); 24 $(this).addClass('highlight');
25 -}).on('touchend touchcancel', '.list-item, .type-item', function() { 25 +}).on('touchend touchcancel', '.list-item, .type-item, .order-title', function() {
26 $(this).removeClass('highlight'); 26 $(this).removeClass('highlight');
27 }); 27 });
@@ -37,19 +37,32 @@ function hiddenTips($ele) { @@ -37,19 +37,32 @@ function hiddenTips($ele) {
37 } 37 }
38 } 38 }
39 39
40 -function isFlexSupport() {  
41 - var flex = document.createElement('p').style.flex,  
42 - webkitFlex = document.createElement('p').style.webkitFlex,  
43 - flexWrap = document.createElement('p').style.flexWrap;  
44 -  
45 - if ((flex === '' || webkitFlex === '') && flexWrap === '') {  
46 - return true;  
47 - } else {  
48 - return false;  
49 - } 40 +//function isFlexSupport() {
  41 +// var flex = document.createElement('p').style.flex,
  42 +// webkitFlex = document.createElement('p').style.webkitFlex,
  43 +// flexWrap = document.createElement('p').style.flexWrap;
  44 +//
  45 +// if ((flex === '' || webkitFlex === '') && flexWrap === '') {
  46 +// return true;
  47 +// } else {
  48 +// return false;
  49 +// }
  50 +//}
  51 +
  52 +function wrapElements(selector, count) {
  53 + var elArr = null;
  54 +
  55 + $(selector).each(function(idx, el) {
  56 + elArr = $(selector).slice(idx, idx + count);
  57 +
  58 + if (elArr.length === count && idx % count === 0) {
  59 + $(elArr).wrapAll($('<div class="js-wraper"></div>'));
  60 + }
  61 + });
50 } 62 }
51 63
52 64
  65 +
53 function search() { 66 function search() {
54 if (searching || end) { 67 if (searching || end) {
55 return; 68 return;
@@ -84,9 +97,10 @@ function search() { @@ -84,9 +97,10 @@ function search() {
84 hiddenTips($('#size-swiper-container')); 97 hiddenTips($('#size-swiper-container'));
85 hiddenTips($('#reference-swiper-container')); 98 hiddenTips($('#reference-swiper-container'));
86 99
87 - if (!isFlexSupport()) {  
88 - $('.detail .column').removeClass('column').addClass('oldbox');  
89 - } 100 + //if (!isFlexSupport()) {
  101 + // $('.detail .column').removeClass('column').addClass('oldbox');
  102 + //}
  103 + wrapElements('.detail .column', 2);
90 searching = false; 104 searching = false;
91 end = true; 105 end = true;
92 loading.hideLoadingMask(); 106 loading.hideLoadingMask();
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 width: pxToRem(472px); 72 width: pxToRem(472px);
73 height: pxToRem(88px); 73 height: pxToRem(88px);
74 line-height: pxToRem(88px); 74 line-height: pxToRem(88px);
75 - margin: pxToRem(125px) auto 0 auto; 75 + margin: pxToRem(80px) auto 0 auto;
76 background: #444; 76 background: #444;
77 text-align: center; 77 text-align: center;
78 color: #fff; 78 color: #fff;
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 &.no-login { 114 &.no-login {
115 padding: 0; 115 padding: 0;
116 height: pxToRem(88px); 116 height: pxToRem(88px);
117 - .link-item { 117 + .link-item p {
118 font-size: pxToRem(32px); 118 font-size: pxToRem(32px);
119 line-height: pxToRem(88px); 119 line-height: pxToRem(88px);
120 } 120 }
@@ -136,6 +136,10 @@ @@ -136,6 +136,10 @@
136 color: #e0e0e0; 136 color: #e0e0e0;
137 float: right; 137 float: right;
138 } 138 }
  139 +
  140 + &.highlight {
  141 + background: #eee;
  142 + }
139 } 143 }
140 144
141 .order-type { 145 .order-type {
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
23 overflow: hidden; 23 overflow: hidden;
24 } 24 }
25 .user-name { 25 .user-name {
  26 + float: left;
26 max-width: 240rem / $pxConvertRem; 27 max-width: 240rem / $pxConvertRem;
27 text-overflow:ellipsis; 28 text-overflow:ellipsis;
28 white-space:nowrap; 29 white-space:nowrap;
@@ -47,50 +47,53 @@ $basicBtnC:#eb0313; @@ -47,50 +47,53 @@ $basicBtnC:#eb0313;
47 } 47 }
48 48
49 &.table { 49 &.table {
50 - @include flexbox(( 50 + .js-wraper {
  51 + @include flexbox((
51 display: box, 52 display: box,
52 box-lines: multiple, 53 box-lines: multiple,
53 box-pack: start 54 box-pack: start
54 - ), $version: 1);  
55 - @include flexbox((  
56 - display: flex,  
57 - flex-wrap: wrap,  
58 - justify-content: flex-start  
59 - ));  
60 - width: 100%;  
61 - .column {  
62 - box-sizing: border-box;  
63 - //padding: pxToRem(20px) pxToRem(12px);  
64 - padding: pxToRem(6px) 3%;  
65 - width: 49.9%;  
66 - border: 1px solid #fff;  
67 - font-size: pxToRem(24px);  
68 - background-color: $tableCellC;  
69 - word-wrap: break-word;  
70 - @include flexbox((  
71 - box-flex: 1.0,  
72 - display: box,  
73 - box-align: center  
74 - ), $version: 1);  
75 - @include flexbox((  
76 - display: flex,  
77 - align-items: center,  
78 - flex-basis: 49.9%  
79 - ))  
80 - }  
81 - .oldbox{  
82 - padding: pxToRem(6px) 3%;  
83 - width: 49.9%;  
84 - background-color: $tableCellC;  
85 - box-sizing: border-box;  
86 - border: 1px solid #fff;  
87 - width: 49.9%;  
88 - height: 100%;  
89 - float: left;  
90 - text-overflow:ellipsis;  
91 - white-space:nowrap;  
92 - overflow:hidden;  
93 - } 55 + ), $version: 1);
  56 + @include flexbox((
  57 + display: flex,
  58 + flex-wrap: wrap,
  59 + justify-content: flex-start
  60 + ));
  61 + }
  62 + width: 100%;
  63 + .column {
  64 + box-sizing: border-box;
  65 + //padding: pxToRem(20px) pxToRem(12px);
  66 + padding: pxToRem(6px) 3%;
  67 + width: 49.9%;
  68 + border: 1px solid #fff;
  69 + font-size: pxToRem(24px);
  70 + background-color: $tableCellC;
  71 + word-wrap: break-word;
  72 + @include flexbox((
  73 + box-flex: 1.0,
  74 + display: box,
  75 + box-align: center
  76 + ), $version: 1);
  77 + @include flexbox((
  78 + display: flex,
  79 + align-items: center,
  80 + flex-basis: 49.9%
  81 + ))
  82 + }
  83 + .oldbox{
  84 + padding: pxToRem(6px) 3%;
  85 + width: 49.9%;
  86 + background-color: $tableCellC;
  87 + box-sizing: border-box;
  88 + border: 1px solid #fff;
  89 + width: 49.9%;
  90 + height: 100%;
  91 + float: left;
  92 + text-overflow:ellipsis;
  93 + white-space:nowrap;
  94 + overflow:hidden;
  95 + }
  96 +
94 } 97 }
95 } 98 }
96 } 99 }
@@ -187,10 +187,14 @@ class UserModel @@ -187,10 +187,14 @@ class UserModel
187 $datas = array(); 187 $datas = array();
188 $product = array(); 188 $product = array();
189 foreach ($favProduct['data']['product_list'] as $val) { 189 foreach ($favProduct['data']['product_list'] as $val) {
  190 + if (empty($val['product_skn'])) {
  191 + continue;
  192 + }
  193 +
190 $product = array(); 194 $product = array();
191 $product['fav_id'] = $val['product_id']; 195 $product['fav_id'] = $val['product_id'];
192 - $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';  
193 - $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); 196 + $product['link'] = isset($val['goodsId'], $val['cnAlphabet']) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
  197 + $product['imgUrl'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
194 ; 198 ;
195 $product['title'] = $val['product_name']; 199 $product['title'] = $val['product_name'];
196 $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; 200 $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
@@ -247,8 +251,12 @@ class UserModel @@ -247,8 +251,12 @@ class UserModel
247 // 处理品牌产品 251 // 处理品牌产品
248 $product = array(); 252 $product = array();
249 foreach ($val['new_product'] as $one) { 253 foreach ($val['new_product'] as $one) {
  254 + if (empty($one['product_skn'])) {
  255 + continue;
  256 + }
  257 +
250 $product = array(); 258 $product = array();
251 - $product['link'] = isset($one['goods'][0]) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : ''; 259 + $product['link'] = isset($one['goods'][0], $one['cnAlphabet']) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : '';
252 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; 260 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
253 $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; 261 $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
254 $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . $one['sales_price'] : false; 262 $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . $one['sales_price'] : false;
@@ -177,7 +177,7 @@ class NewsaleController extends AbstractAction @@ -177,7 +177,7 @@ class NewsaleController extends AbstractAction
177 $color = $this->get('color', null); 177 $color = $this->get('color', null);
178 $size = $this->get('size', null); 178 $size = $this->get('size', null);
179 $price = $this->get('price', null); 179 $price = $this->get('price', null);
180 - $p_d = '0.1,0.3'; 180 + $p_d = $this->get('discount', null);
181 $dayLimit = $this->get('dayLimit', null); 181 $dayLimit = $this->get('dayLimit', null);
182 $limit = $this->get('limit', 60); 182 $limit = $this->get('limit', 60);
183 $page = $this->get('page', 1); 183 $page = $this->get('page', 1);