Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
6 changed files
with
88 additions
and
90 deletions
@@ -182,17 +182,19 @@ class Images | @@ -182,17 +182,19 @@ class Images | ||
182 | $result = json_decode(file_get_contents('http://upload.static.yohobuy.com', false, $context), true); | 182 | $result = json_decode(file_get_contents('http://upload.static.yohobuy.com', false, $context), true); |
183 | if(!empty($result['data']['imagesList'])) | 183 | if(!empty($result['data']['imagesList'])) |
184 | { | 184 | { |
185 | + $imgExtra = '?imageMogr2/thumbnail/130x130/extent/130x130/background/d2hpdGU=/position/center/quality/90'; | ||
185 | $imgList = array('imgList'=>array()); | 186 | $imgList = array('imgList'=>array()); |
187 | + | ||
186 | if(count($file) == 1 || !is_array($file)) | 188 | if(count($file) == 1 || !is_array($file)) |
187 | { | 189 | { |
188 | - $imgList['imgList'][] = array('imgUrl' => self::getSourceUrl(current($result['data']['imagesList']), 'suggest')); | 190 | + $imgList['imgList'][] = array('imgUrl' => self::getSourceUrl(current($result['data']['imagesList']), 'suggest') . $imgExtra); |
189 | } | 191 | } |
190 | else | 192 | else |
191 | { | 193 | { |
192 | $img = array(); | 194 | $img = array(); |
193 | foreach ($result['data']['imagesList'] as $val) { | 195 | foreach ($result['data']['imagesList'] as $val) { |
194 | $img = array(); | 196 | $img = array(); |
195 | - $img['imgUrl'] = self::getSourceUrl($val, 'suggest'); | 197 | + $img['imgUrl'] = self::getSourceUrl($val, 'suggest') . $imgExtra; |
196 | $imgList['imgList'][] = $img; | 198 | $imgList['imgList'][] = $img; |
197 | } | 199 | } |
198 | } | 200 | } |
1 | -///** | ||
2 | -// * 商品详情 | ||
3 | -// * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
4 | -// * @date: 2015/11/18 | ||
5 | -// */ | ||
6 | -//var $ = require('jquery'), | ||
7 | -// Hammer = require('yoho.hammer'), | ||
8 | -// lazyLoad = require('yoho.lazyload'); | ||
9 | -// | ||
10 | -//var loading = require('../../plugin/loading'); | ||
11 | -// | ||
12 | -//var navHammer, | ||
13 | -// winH = $(window).height(), | ||
14 | -// searching = false, | ||
15 | -// num, | ||
16 | -// url; | ||
17 | -// | ||
18 | -//function scrollHandler() { | ||
19 | -// if ($(window).scrollTop() + winH >= $(document).height() - 50) { | ||
20 | -// //search(); | ||
21 | -// } | ||
22 | -//} | ||
23 | -// | ||
24 | -//function search() { | ||
25 | -// if (searching) { | ||
26 | -// return; | ||
27 | -// } | ||
28 | -// searching = true; | ||
29 | -// | ||
30 | -// loading.showLoadingMask(); | ||
31 | -// | ||
32 | -// //num = $goodList.find('.good-info').length; | ||
33 | -// $.ajax({ | ||
34 | -// type: 'GET', | ||
35 | -// url: url, | ||
36 | -// data: { | ||
37 | -// page: page + 1 | ||
38 | -// }, | ||
39 | -// success: function(data) { | ||
40 | -// | ||
41 | -// num = $goodList.find('.good-info').length; | ||
42 | -// | ||
43 | -// $goodList.append(data); | ||
44 | -// | ||
45 | -// // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题 | ||
46 | -// if (num === 0) { | ||
47 | -// lazyLoad($goodList.find('.good-info').find('img.lazy')); | ||
48 | -// } else { | ||
49 | -// lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); | ||
50 | -// } | ||
51 | -// | ||
52 | -// searching = false; | ||
53 | -// loading.hideLoadingMask(); | ||
54 | -// page++; | ||
55 | -// }, | ||
56 | -// error: function() { | ||
57 | -// tip.show('网络断开连接了~'); | ||
58 | -// searching = false; | ||
59 | -// loading.hideLoadingMask(); | ||
60 | -// } | ||
61 | -// }); | ||
62 | -//} | ||
63 | -// | ||
64 | -////srcoll to load more | ||
65 | -//$(window).scroll(function () { | ||
66 | -// window.requestAnimationFrame(scrollHandler); | ||
67 | -//}); | ||
68 | -// | 1 | +/** |
2 | + * 商品详情 | ||
3 | + * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
4 | + * @date: 2015/11/18 | ||
5 | + */ | ||
6 | +var $ = require('jquery'), | ||
7 | + lazyLoad = require('yoho.lazyload'); | ||
8 | + | ||
9 | +var loading = require('../../plugin/loading'), | ||
10 | + tip = require('../../plugin/tip'); | ||
11 | + | ||
12 | +var introUrl = $('#introUrl').val(), | ||
13 | + winH = $(window).height(), | ||
14 | + $productDesc, | ||
15 | + searching = false, | ||
16 | + end = false; | ||
17 | + | ||
18 | +function search() { | ||
19 | + if (searching || end) { | ||
20 | + return; | ||
21 | + } | ||
22 | + searching = true; | ||
23 | + | ||
24 | + loading.showLoadingMask(); | ||
25 | + | ||
26 | + $.ajax({ | ||
27 | + type: 'GET', | ||
28 | + url: introUrl, | ||
29 | + success: function(data) { | ||
30 | + $productDesc = $('#productDesc'); | ||
31 | + $productDesc.append(data); | ||
32 | + | ||
33 | + lazyLoad($productDesc.find('img.lazy')); | ||
34 | + | ||
35 | + searching = false; | ||
36 | + end = true; | ||
37 | + loading.hideLoadingMask(); | ||
38 | + }, | ||
39 | + error: function() { | ||
40 | + tip.show('网络断开连接了~'); | ||
41 | + searching = false; | ||
42 | + loading.hideLoadingMask(); | ||
43 | + } | ||
44 | + }); | ||
45 | +} | ||
46 | + | ||
47 | +function scrollHandler() { | ||
48 | + if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) { | ||
49 | + search(); | ||
50 | + } | ||
51 | +} | ||
52 | + | ||
53 | +//srcoll to load more | ||
54 | +$(window).scroll(function() { | ||
55 | + window.requestAnimationFrame(scrollHandler); | ||
56 | +}); | ||
57 | + |
@@ -5,6 +5,11 @@ | @@ -5,6 +5,11 @@ | ||
5 | height: pxToRem(28px); | 5 | height: pxToRem(28px); |
6 | margin-top: pxToRem(22px); | 6 | margin-top: pxToRem(22px); |
7 | } | 7 | } |
8 | + .detail{ | ||
9 | + &.table .inner-container{ | ||
10 | + background-color: $tableCellC; | ||
11 | + } | ||
12 | + } | ||
8 | .desc-text { | 13 | .desc-text { |
9 | font-size: pxToRem(24px); | 14 | font-size: pxToRem(24px); |
10 | margin-bottom: pxToRem(20px); | 15 | margin-bottom: pxToRem(20px); |
@@ -51,10 +56,10 @@ | @@ -51,10 +56,10 @@ | ||
51 | padding-right: pxToRem(15px); | 56 | padding-right: pxToRem(15px); |
52 | } | 57 | } |
53 | // padding-bottom:pxToRem(18px); | 58 | // padding-bottom:pxToRem(18px); |
54 | - .tip{ | ||
55 | - // width: pxToRem(73px); | ||
56 | - width: 16.666%; | 59 | + .tip{ |
57 | display: inline-block; | 60 | display: inline-block; |
61 | + width: 16.6%; | ||
62 | + float:left; | ||
58 | // margin-right: pxToRem(24px); | 63 | // margin-right: pxToRem(24px); |
59 | img{ | 64 | img{ |
60 | width: pxToRem(48px); | 65 | width: pxToRem(48px); |
@@ -63,11 +68,13 @@ | @@ -63,11 +68,13 @@ | ||
63 | } | 68 | } |
64 | .caption{ | 69 | .caption{ |
65 | display: block; | 70 | display: block; |
71 | + padding: 0 pxToRem(13px); | ||
66 | font-size: pxToRem(18px); | 72 | font-size: pxToRem(18px); |
67 | line-height: pxToRem(22px); | 73 | line-height: pxToRem(22px); |
68 | margin-bottom: pxToRem(18px); | 74 | margin-bottom: pxToRem(18px); |
69 | } | 75 | } |
70 | } | 76 | } |
77 | + | ||
71 | } | 78 | } |
72 | .product-detail { | 79 | .product-detail { |
73 | .detail { | 80 | .detail { |
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
76 | <div class="gap-block"></div> | 76 | <div class="gap-block"></div> |
77 | 77 | ||
78 | {{# enterStore}} | 78 | {{# enterStore}} |
79 | - <div class="enter-store page-block"> | 79 | + <div id="enter-store" class="enter-store page-block"> |
80 | <a class="store-logo" href="{{url}}" style=""> | 80 | <a class="store-logo" href="{{url}}" style=""> |
81 | <img class="lazy" data-original="{{img}}" alt="{{storeName}}"> | 81 | <img class="lazy" data-original="{{img}}" alt="{{storeName}}"> |
82 | </a> | 82 | </a> |
@@ -87,6 +87,10 @@ | @@ -87,6 +87,10 @@ | ||
87 | 87 | ||
88 | <div class="gap-block"></div> | 88 | <div class="gap-block"></div> |
89 | 89 | ||
90 | + | ||
91 | + <div id="productDesc"></div> | ||
92 | + | ||
93 | + | ||
90 | {{#cartInfo}} | 94 | {{#cartInfo}} |
91 | <div class="cart-bar"> | 95 | <div class="cart-bar"> |
92 | <span class="num-tag">{{numInCart}}</span> | 96 | <span class="num-tag">{{numInCart}}</span> |
@@ -100,5 +104,9 @@ | @@ -100,5 +104,9 @@ | ||
100 | </div> | 104 | </div> |
101 | {{/cartInfo}} | 105 | {{/cartInfo}} |
102 | 106 | ||
107 | + {{#if introUrl}} | ||
108 | + <input id="introUrl" type="hidden" value={{introUrl}}> | ||
109 | + {{/if}} | ||
110 | + | ||
103 | </div> | 111 | </div> |
104 | {{> layout/footer}} | 112 | {{> layout/footer}} |
@@ -7,11 +7,9 @@ | @@ -7,11 +7,9 @@ | ||
7 | </h1> | 7 | </h1> |
8 | {{#detail}} | 8 | {{#detail}} |
9 | <ul class="detail table clearfix"> | 9 | <ul class="detail table clearfix"> |
10 | - <!-- <li class="row"> --> | ||
11 | {{#list}} | 10 | {{#list}} |
12 | <div class="column">{{param}}</div> | 11 | <div class="column">{{param}}</div> |
13 | {{/list}} | 12 | {{/list}} |
14 | - <!-- </li> --> | ||
15 | </ul> | 13 | </ul> |
16 | {{/detail}} | 14 | {{/detail}} |
17 | <div class="desc-text">{{desc}}</div> | 15 | <div class="desc-text">{{desc}}</div> |
@@ -114,34 +112,26 @@ | @@ -114,34 +112,26 @@ | ||
114 | {{/materials}} | 112 | {{/materials}} |
115 | 113 | ||
116 | <div class="wash-tips page-block"> | 114 | <div class="wash-tips page-block"> |
115 | + <div class="detail table clearfix"> | ||
117 | {{#washTips}} | 116 | {{#washTips}} |
118 | <div class="tip"> | 117 | <div class="tip"> |
119 | <img src="{{img}}" alt=""> | 118 | <img src="{{img}}" alt=""> |
120 | <span class="caption">{{caption}}</span> | 119 | <span class="caption">{{caption}}</span> |
121 | </div> | 120 | </div> |
122 | {{/washTips}} | 121 | {{/washTips}} |
122 | + </div> | ||
123 | </div> | 123 | </div> |
124 | 124 | ||
125 | -<!-- {{#washTips}} | ||
126 | -<div class="icons-wrapper washTips page-block"> | ||
127 | - <ul class="icons-list clearfix"> | ||
128 | - {{#list}} | ||
129 | - <li class="icons-item"><a href="{{url}}" class="imagebar"><img src="{{img}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> | ||
130 | - {{/list}} | ||
131 | - </ul> | ||
132 | -</div> | ||
133 | -{{/washTips}} --> | ||
134 | - | ||
135 | <div class="gap-block"></div> | 125 | <div class="gap-block"></div> |
136 | 126 | ||
137 | {{#productDetail}} | 127 | {{#productDetail}} |
138 | <div class="product-detail page-block"> | 128 | <div class="product-detail page-block"> |
139 | <h1 class="title"> | 129 | <h1 class="title"> |
140 | - {{title}} | ||
141 | - <span class="en-title">{{enTitle}}</span> | 130 | + {{{title}}} |
131 | + <span class="en-title">{{{enTitle}}}</span> | ||
142 | </h1> | 132 | </h1> |
143 | <div class="detail"> | 133 | <div class="detail"> |
144 | - <p>{{desc}}</p> | 134 | + <p>{{{desc}}}</p> |
145 | {{#list}} | 135 | {{#list}} |
146 | <img class="lazy" data-original="{{img}}" alt=""> | 136 | <img class="lazy" data-original="{{img}}" alt=""> |
147 | {{/list}} | 137 | {{/list}} |
@@ -83,7 +83,9 @@ class HomeController extends AbstractAction | @@ -83,7 +83,9 @@ class HomeController extends AbstractAction | ||
83 | 'pageFooter' => true, | 83 | 'pageFooter' => true, |
84 | 'favorite' => true, | 84 | 'favorite' => true, |
85 | 'hasFavProduct' => $favProducts, | 85 | 'hasFavProduct' => $favProducts, |
86 | - 'hasFavBrand' => $favBrands | 86 | + 'productUrl' => '/product/new', |
87 | + 'hasFavBrand' => $favBrands, | ||
88 | + 'brandUrl' => '/product/new' | ||
87 | ); | 89 | ); |
88 | // 判断是否为品牌收藏页 | 90 | // 判断是否为品牌收藏页 |
89 | if ($tab === 'brand') { | 91 | if ($tab === 'brand') { |
-
Please register or login to post a comment