Authored by hf

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

@@ -144,6 +144,7 @@ class SearchData @@ -144,6 +144,7 @@ class SearchData
144 $param = array(); 144 $param = array();
145 $param['status'] = 1; // 是否上架,1表示在架,2表示不在 145 $param['status'] = 1; // 是否上架,1表示在架,2表示不在
146 $param['sales'] = 'Y'; // 只搜索销售的产品 146 $param['sales'] = 'Y'; // 只搜索销售的产品
  147 + $param['stocknumber'] = 1; // 过滤掉已售罄的商品
147 // $param['needFilter'] = 1; // 是否需要返回筛选条件 148 // $param['needFilter'] = 1; // 是否需要返回筛选条件
148 if (!isset($condition['order'])) { 149 if (!isset($condition['order'])) {
149 $param['order'] = $orderMaps['s_t_desc']; 150 $param['order'] = $orderMaps['s_t_desc'];
@@ -129,10 +129,10 @@ function searchResult() { @@ -129,10 +129,10 @@ function searchResult() {
129 129
130 brandHtml.push('<p><a href="' + brand.url + '">' + brand.name); 130 brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
131 if (brand.isNew) { 131 if (brand.isNew) {
132 - brandHtml.push('<i class="icon-hot">HOT</i>'); 132 + brandHtml.push('<i class="icon-new">NEW</i>');
133 } 133 }
134 if (brand.isHot) { 134 if (brand.isHot) {
135 - brandHtml.push('<i class="icon-new">NEW</i>'); 135 + brandHtml.push('<i class="icon-hot">HOT</i>');
136 } 136 }
137 brandHtml.push('</a></p>'); 137 brandHtml.push('</a></p>');
138 }); 138 });
@@ -95,11 +95,15 @@ function getShoppingKey() { @@ -95,11 +95,15 @@ function getShoppingKey() {
95 95
96 //根据页面内容重新设置通用底部的显示 96 //根据页面内容重新设置通用底部的显示
97 function rePosFooter() { 97 function rePosFooter() {
  98 + var winH;
  99 +
98 if ($footer.length === 0) { 100 if ($footer.length === 0) {
99 return; 101 return;
100 } 102 }
101 103
102 - if ($('body').height() <= $(window).height() - parseInt($footer.css('height'), 0)) { 104 + winH = Math.min($(window).height(), window.screen.availHeight);
  105 +
  106 + if ($('body').height() <= winH - parseInt($footer.css('height'), 0)) {
103 $footer.addClass('bottom'); 107 $footer.addClass('bottom');
104 } else { 108 } else {
105 $footer.removeClass('bottom'); 109 $footer.removeClass('bottom');
@@ -31,6 +31,8 @@ chHammer.on('tap', function() { @@ -31,6 +31,8 @@ chHammer.on('tap', function() {
31 localStorage.removeItem('historys'); 31 localStorage.removeItem('historys');
32 32
33 $history.html(''); 33 $history.html('');
  34 +
  35 + window.rePosFooter();
34 }); 36 });
35 37
36 $input.on('input', function() { 38 $input.on('input', function() {
@@ -78,6 +80,8 @@ $('#search').on('touchend', function() { @@ -78,6 +80,8 @@ $('#search').on('touchend', function() {
78 80
79 $history.html(html); 81 $history.html(html);
80 $clearHistory.removeClass('hide'); 82 $clearHistory.removeClass('hide');
  83 +
  84 + window.rePosFooter();
81 } 85 }
82 } 86 }
83 }()); 87 }());
@@ -103,7 +103,7 @@ function hideWeChatPay() { @@ -103,7 +103,7 @@ function hideWeChatPay() {
103 var $payApps = $('.app'); 103 var $payApps = $('.app');
104 104
105 $payApps.each(function(idx, app) { 105 $payApps.each(function(idx, app) {
106 - if ($(app).attr('id') === 'weixin') { 106 + if ($(app).parent().attr('id') === 'weixin') {
107 $(app).parent().css('display', 'none'); 107 $(app).parent().css('display', 'none');
108 return false; 108 return false;
109 } 109 }
@@ -16,7 +16,9 @@ var consultFooterEle = document.getElementById('consult-content-footer'), @@ -16,7 +16,9 @@ var consultFooterEle = document.getElementById('consult-content-footer'),
16 navtabHammer = navtabEle && new Hammer(navtabEle), 16 navtabHammer = navtabEle && new Hammer(navtabEle),
17 17
18 gotoConsultEle = document.getElementById('goto-consult'), 18 gotoConsultEle = document.getElementById('goto-consult'),
19 - gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle); 19 + gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
  20 +
  21 + $gotoConsult = $('#goto-consult');
20 22
21 23
22 24
@@ -77,4 +79,22 @@ if (gotoConsultHammer) { @@ -77,4 +79,22 @@ if (gotoConsultHammer) {
77 gotoConsultHammer.on('tap', function() { 79 gotoConsultHammer.on('tap', function() {
78 location.href = $(gotoConsultEle).find('a').attr('href'); 80 location.href = $(gotoConsultEle).find('a').attr('href');
79 }); 81 });
80 -}  
  82 +}
  83 +
  84 +function fixConsultBar() {
  85 + if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {
  86 + $gotoConsult.css('position', 'fixed');
  87 + $gotoConsult.css('top', '0');
  88 + } else {
  89 + $gotoConsult.css('position', 'static');
  90 + }
  91 +}
  92 +
  93 +//滚动时顶部固定 我要咨询
  94 +function scrollHandler() {
  95 + fixConsultBar();
  96 +}
  97 +
  98 +$(window).scroll(function() {
  99 + window.requestAnimationFrame(scrollHandler);
  100 +});
@@ -15,7 +15,10 @@ var goodsSwiper, @@ -15,7 +15,10 @@ var goodsSwiper,
15 var goodsDiscountEl = document.getElementById('goodsDiscount'), 15 var goodsDiscountEl = document.getElementById('goodsDiscount'),
16 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); 16 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
17 17
18 -var $cart = $('.cart-bar'); 18 +var $cart = $('.cart-bar'),
  19 + $goodsSubtitle = $('.goodsSubtitle'),
  20 + divH,
  21 + $goodsSubtitleSpan;
19 22
20 require('./desc'); 23 require('./desc');
21 require('./comments-consults'); 24 require('./comments-consults');
@@ -82,4 +85,12 @@ $.ajax({ @@ -82,4 +85,12 @@ $.ajax({
82 } 85 }
83 }); 86 });
84 87
  88 +//限制goodsSubtitle为两行
  89 +if ($goodsSubtitle[0]) {
  90 + divH = $goodsSubtitle.height();
  91 + $goodsSubtitleSpan = $goodsSubtitle.find('span');
  92 + while ($goodsSubtitleSpan.outerHeight() > divH) {
  93 + $goodsSubtitleSpan.text($goodsSubtitleSpan.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, '...'));
  94 + }
  95 +}
85 require('./like'); 96 require('./like');
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 display: block; 84 display: block;
85 color: #b0b0b0; 85 color: #b0b0b0;
86 font-size: 24rem / $pxConvertRem; 86 font-size: 24rem / $pxConvertRem;
87 - margin: 30rem / $pxConvertRem 0 110rem / $pxConvertRem; 87 + margin: 30rem / $pxConvertRem 0 80rem / $pxConvertRem;
88 } 88 }
89 89
90 .walk-way { 90 .walk-way {
@@ -185,6 +185,12 @@ @@ -185,6 +185,12 @@
185 .name { 185 .name {
186 font-size: 28rem / $pxConvertRem; 186 font-size: 28rem / $pxConvertRem;
187 max-width: 70%; 187 max-width: 70%;
  188 + text-overflow: -o-ellipsis-lastline;
  189 + overflow: hidden;
  190 + text-overflow: ellipsis;
  191 + display: -webkit-box;
  192 + -webkit-line-clamp: 2;
  193 + -webkit-box-orient: vertical;
188 } 194 }
189 195
190 .row:nth-child(2) { 196 .row:nth-child(2) {
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 > div { 36 > div {
37 width: 60rem / $pxConvertRem; 37 width: 60rem / $pxConvertRem;
38 height: 60rem / $pxConvertRem; 38 height: 60rem / $pxConvertRem;
39 - background-image: url(http://localhost:8000/img/layout/pay-icon.png); 39 + background-image: image-url("/img/layout/pay-icon.png");
40 background-size: 90%; 40 background-size: 90%;
41 background-position-y: 8rem / $pxConvertRem; 41 background-position-y: 8rem / $pxConvertRem;
42 background-position-x: center; 42 background-position-x: center;
@@ -20,10 +20,10 @@ @@ -20,10 +20,10 @@
20 display: block; 20 display: block;
21 } 21 }
22 span{ 22 span{
23 - float: left;  
24 overflow: hidden; 23 overflow: hidden;
25 } 24 }
26 .user-name { 25 .user-name {
  26 + float: left;
27 max-width: 240rem / $pxConvertRem; 27 max-width: 240rem / $pxConvertRem;
28 text-overflow:ellipsis; 28 text-overflow:ellipsis;
29 white-space:nowrap; 29 white-space:nowrap;
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 } 32 }
33 33
34 .vip-icon { 34 .vip-icon {
  35 + float: left;
35 width: pxToRem(72px); 36 width: pxToRem(72px);
36 height: pxToRem(32px); 37 height: pxToRem(32px);
37 line-height: 36rem / $pxConvertRem; 38 line-height: 36rem / $pxConvertRem;
@@ -41,6 +41,8 @@ @@ -41,6 +41,8 @@
41 .goods-consults-page { 41 .goods-consults-page {
42 background-color: #f0f0f0; 42 background-color: #f0f0f0;
43 .goto-consult { 43 .goto-consult {
  44 + width: 100%;
  45 + box-sizing:border-box;
44 padding: 0 pxToRem(28px); 46 padding: 0 pxToRem(28px);
45 height: pxToRem(120px); 47 height: pxToRem(120px);
46 background-color: #ffffff; 48 background-color: #ffffff;
@@ -211,14 +211,19 @@ $basicBtnC:#eb0313; @@ -211,14 +211,19 @@ $basicBtnC:#eb0313;
211 background-color: #515150; 211 background-color: #515150;
212 } 212 }
213 .goodsSubtitle { 213 .goodsSubtitle {
214 - min-height: pxToRem(87px); 214 + height: pxToRem(88px);
215 font-size: pxToRem(24px); 215 font-size: pxToRem(24px);
216 - line-height: pxToRem(36px);  
217 color: $subFontC; 216 color: $subFontC;
218 padding-left: pxToRem(28px); 217 padding-left: pxToRem(28px);
219 padding-right: pxToRem(28px); 218 padding-right: pxToRem(28px);
  219 + padding-top: pxToRem(14px);
220 border-bottom: 1px solid $borderC; 220 border-bottom: 1px solid $borderC;
221 background-color: #f4f4f4; 221 background-color: #f4f4f4;
  222 + span{
  223 + display: block;
  224 + line-height: pxToRem(36px);
  225 + margin: 0;
  226 + }
222 } 227 }
223 .price-date { 228 .price-date {
224 // width: 100%; 229 // width: 100%;
@@ -253,8 +258,7 @@ $basicBtnC:#eb0313; @@ -253,8 +258,7 @@ $basicBtnC:#eb0313;
253 line-height: pxToRem(88px); 258 line-height: pxToRem(88px);
254 } 259 }
255 } 260 }
256 - .goodsName,  
257 - .goodsSubtitle { 261 + .goodsName {
258 // width: 100%; 262 // width: 100%;
259 display: table; 263 display: table;
260 span { 264 span {
@@ -43,6 +43,7 @@ class ClassModel @@ -43,6 +43,7 @@ class ClassModel
43 break; 43 break;
44 } 44 }
45 45
  46 + $genderArr = array('boy' => '1,3', 'girl' => '2,3', 'kids' => '1,2,3', 'lifestyle' => '1,2,3');
46 $oneClass = array(); 47 $oneClass = array();
47 $item = array(); 48 $item = array();
48 foreach ($data['data'] as $k => $v) { 49 foreach ($data['data'] as $k => $v) {
@@ -59,7 +60,8 @@ class ClassModel @@ -59,7 +60,8 @@ class ClassModel
59 'id' => $item['id'], 60 'id' => $item['id'],
60 'url' => Helpers::url('/', array( 61 'url' => Helpers::url('/', array(
61 'sort' => $item['id'], 62 'sort' => $item['id'],
62 - 'sort_name' => $item['name']), 'list') 63 + 'sort_name' => $item['name'],
  64 + 'gender' => $genderArr[$k]), 'list')
63 ); 65 );
64 66
65 $subitem = array(); 67 $subitem = array();
@@ -69,7 +71,8 @@ class ClassModel @@ -69,7 +71,8 @@ class ClassModel
69 $subitem['id'] = $value['relation_parameter']['sort']; 71 $subitem['id'] = $value['relation_parameter']['sort'];
70 $subitem['url'] = Helpers::url('/', array( 72 $subitem['url'] = Helpers::url('/', array(
71 'sort' => $value['relation_parameter']['sort'], 73 'sort' => $value['relation_parameter']['sort'],
72 - 'sort_name' => $value['category_name'] 74 + 'sort_name' => $value['category_name'],
  75 + 'gender' => $genderArr[$k]
73 ), 'list'); 76 ), 'list');
74 $item['sub'][] = $subitem; 77 $item['sub'][] = $subitem;
75 } 78 }
@@ -179,6 +179,9 @@ class IndexModel @@ -179,6 +179,9 @@ class IndexModel
179 } 179 }
180 } 180 }
181 181
  182 + // 分页需要参数
  183 + $data['guang']['gender'] = $gender;
  184 +
182 // 显示底部 185 // 显示底部
183 $data['pageFooter'] = true; 186 $data['pageFooter'] = true;
184 187
@@ -102,7 +102,7 @@ class DetailModel @@ -102,7 +102,7 @@ class DetailModel
102 if (isset($baseInfo['promotionBoList'])) { 102 if (isset($baseInfo['promotionBoList'])) {
103 $build = array(); 103 $build = array();
104 foreach ($baseInfo['promotionBoList'] as $value) { 104 foreach ($baseInfo['promotionBoList'] as $value) {
105 - $build['text'] = $value['promotionTitle']; 105 + $build['text'] = '【' . $value['promotionType'] . '】' . $value['promotionTitle'];
106 $result['goodsDiscount']['list'][] = $build; 106 $result['goodsDiscount']['list'][] = $build;
107 } 107 }
108 } 108 }
@@ -165,26 +165,31 @@ class DetailModel @@ -165,26 +165,31 @@ class DetailModel
165 foreach ($baseInfo['goodsList'] as $value) { 165 foreach ($baseInfo['goodsList'] as $value) {
166 $colorId = intval($value['colorId']); 166 $colorId = intval($value['colorId']);
167 // 商品按颜色进行分类分组 167 // 商品按颜色进行分类分组
168 - foreach ($value['goodsImagesList'] as $goods) {  
169 - $goodsList[$goods['goodsId']] = $colorId;  
170 - $goodsGroup[$colorId][] = array(  
171 - 'goodsId' => $goods['goodsId'],  
172 - 'img' => $goods['imageUrl'],  
173 - );  
174 - $colorGroup[$colorId] = array(  
175 - 'colorId' => $colorId,  
176 - 'colorName' => $value['colorName'],  
177 - 'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),  
178 - );  
179 - } 168 + if (isset($value['goodsImagesList'])) {
  169 + foreach ($value['goodsImagesList'] as $goods) {
  170 + $goodsList[$goods['goodsId']] = $colorId;
  171 + $goodsGroup[$colorId][] = array(
  172 + 'goodsId' => $goods['goodsId'],
  173 + 'img' => $goods['imageUrl'],
  174 + );
  175 + $colorGroup[$colorId] = array(
  176 + 'colorId' => $colorId,
  177 + 'colorName' => $value['colorName'],
  178 + 'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
  179 + );
  180 + }
  181 + }
  182 +
180 // 商品的尺码列表 183 // 商品的尺码列表
181 - foreach ($value['goodsSizeBoList'] as $size) {  
182 - $sizeGroup[$colorId] = array(  
183 - 'sizeName' => $size['sizeName'],  
184 - 'sizeSku' => $size['goodsSizeSkuId'],  
185 - 'sizeStorage' => $size['goodsSizeStorageNum'],  
186 - );  
187 - } 184 + if (isset($value['goodsSizeBoList'])) {
  185 + foreach ($value['goodsSizeBoList'] as $size) {
  186 + $sizeGroup[$colorId] = array(
  187 + 'sizeName' => $size['sizeName'],
  188 + 'sizeSku' => $size['goodsSizeSkuId'],
  189 + 'sizeStorage' => $size['goodsSizeStorageNum'],
  190 + );
  191 + }
  192 + }
188 } 193 }
189 194
190 // 商品图 195 // 商品图