Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/detailFix
Showing
9 changed files
with
84 additions
and
135 deletions
@@ -1250,13 +1250,23 @@ | @@ -1250,13 +1250,23 @@ | ||
1250 | ### 支付中心 | 1250 | ### 支付中心 |
1251 | 1251 | ||
1252 | { | 1252 | { |
1253 | - 'payAppInfo' : { | ||
1254 | - 'appIcon' : 'http://static.yohobuy.com/images/icon.png', | ||
1255 | - 'payLink' : '/weixin/pay/' | ||
1256 | - 'app' : '微信支付', | ||
1257 | - 'hint' : '需下载微信客户端', | ||
1258 | - 'subHint' : '推荐使用' | ||
1259 | - } | 1253 | + 'payAppInfo' : [ |
1254 | + { | ||
1255 | + 'appIcon' : 'http://static.yohobuy.com/images/icon.png', | ||
1256 | + 'payLink' : '/weixin/pay/', | ||
1257 | + 'appId': 'weixin', | ||
1258 | + 'app' : '微信支付', | ||
1259 | + 'hint' : '需下载微信客户端', | ||
1260 | + 'subHint' : '推荐使用' | ||
1261 | + },{ | ||
1262 | + 'appIcon' : 'http://static.yohobuy.com/images/icon.png', | ||
1263 | + 'payLink' : '/weixin/pay/', | ||
1264 | + 'appId': 'baidu', | ||
1265 | + 'app' : '百度支付', | ||
1266 | + 'hint' : '需下载微信客户端', | ||
1267 | + 'subHint' : '推荐使用' | ||
1268 | + } | ||
1269 | + ] | ||
1260 | } | 1270 | } |
1261 | 1271 | ||
1262 | ### 物流详情 | 1272 | ### 物流详情 |
@@ -1266,9 +1276,14 @@ | @@ -1266,9 +1276,14 @@ | ||
1266 | 'logisticUrl' : 'http://www.shunfeng.com', | 1276 | 'logisticUrl' : 'http://www.shunfeng.com', |
1267 | 'logisticCompany' : '顺丰', | 1277 | 'logisticCompany' : '顺丰', |
1268 | 'logisticNumber' : '1231231231', | 1278 | 'logisticNumber' : '1231231231', |
1269 | - 'logisticDetail' : { | ||
1270 | - 'status' : '南京市 派送中', | ||
1271 | - 'date' : '2015-12-03' | ||
1272 | - } | 1279 | + 'logisticDetail' : [ |
1280 | + { | ||
1281 | + 'status' : '南京市 派送中', | ||
1282 | + 'date' : '2015-12-03' | ||
1283 | + }, { | ||
1284 | + 'status' : '南京市 准备中', | ||
1285 | + 'date' : '2015-12-03' | ||
1286 | + } | ||
1287 | + ] | ||
1273 | } | 1288 | } |
1274 | 1289 |
@@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(), | @@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(), | ||
18 | var sizeSwiper, | 18 | var sizeSwiper, |
19 | refSwiper; | 19 | refSwiper; |
20 | 20 | ||
21 | -require('../recommend-for-you.js'); | ||
22 | - | ||
23 | //判断是否要显示向左滑动提示 | 21 | //判断是否要显示向左滑动提示 |
24 | function hiddenTips($ele) { | 22 | function hiddenTips($ele) { |
23 | + var offsetContainer, | ||
24 | + offsetLastColumn; | ||
25 | + | ||
25 | if ($ele.length > 0) { | 26 | if ($ele.length > 0) { |
26 | - var offsetContainer = $ele[0].getBoundingClientRect().right; | ||
27 | - var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | 27 | + offsetContainer = $ele[0].getBoundingClientRect().right; |
28 | + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | ||
28 | 29 | ||
29 | 30 | ||
30 | if (offsetLastColumn - offsetContainer < 0) { | 31 | if (offsetLastColumn - offsetContainer < 0) { |
@@ -19,6 +19,7 @@ var $cart = $('.cart-bar'); | @@ -19,6 +19,7 @@ var $cart = $('.cart-bar'); | ||
19 | 19 | ||
20 | require('./desc'); | 20 | require('./desc'); |
21 | require('./comments-consults'); | 21 | require('./comments-consults'); |
22 | +require('../recommend-for-you-product-desc'); | ||
22 | 23 | ||
23 | //add extra marign-bottom for footer to show the yoho copyright | 24 | //add extra marign-bottom for footer to show the yoho copyright |
24 | function showFooter() { | 25 | function showFooter() { |
static/js/product/detail/loadmore.js
deleted
100644 → 0
1 | -/** | ||
2 | - * 商品详情 --滚动页面加载 | ||
3 | - * @author: Lynnic | ||
4 | - * @date: 2015/11/25 | ||
5 | - */ | ||
6 | - | ||
7 | -// var $ = require('jquery'), | ||
8 | -// loading = require('../../plugin/loading'), | ||
9 | -// tip = require('../../plugin/tip'); | ||
10 | - | ||
11 | -// var loadMoreUrl = $('#loadMoreUrl').val(), | ||
12 | -// $commentsDiv = $('#goods-comments'), | ||
13 | -// $consultsDiv = $('#goods-consults'), | ||
14 | -// winH = $(window).height(), | ||
15 | -// searching = false, | ||
16 | -// end = false; | ||
17 | - | ||
18 | -// var jsonObj; | ||
19 | - | ||
20 | -// //插入评论列表底部 | ||
21 | -// function insertCommentsDiv(json) { | ||
22 | -// var html = ''; | ||
23 | -// var i; | ||
24 | - | ||
25 | - | ||
26 | -// for (i = 0; i < json.length; i++) { | ||
27 | -// html += '<div class="comment-item">'; | ||
28 | -// html += '<span class="user-name">' + json[i].userName + '</span>'; | ||
29 | -// html += '<span class="goods-spec">' + json[i].desc + '</span>'; | ||
30 | -// html += '<span class="goods-spec">' + json[i].content + '</span>'; | ||
31 | -// html += '<span class="goods-spec">' + json[i].time + '</span>'; | ||
32 | -// } | ||
33 | -// $commentsDiv.append(html); | ||
34 | -// } | ||
35 | - | ||
36 | -// //插入咨询列表底部 | ||
37 | -// function insertConsultsDiv(json) { | ||
38 | -// var html = ''; | ||
39 | -// var i; | ||
40 | - | ||
41 | - | ||
42 | -// for (i = 0; i < json.length; i++) { | ||
43 | -// html += '<div class="consult-item"> '; | ||
44 | -// html += '<div class="question"> '; | ||
45 | -// html += '<span class="iconfont"></span> '; | ||
46 | -// html += '<p> '; | ||
47 | -// html += json[i].question + '<br> '; | ||
48 | -// html += '<span class="time">' + json[i].time + '</span> '; | ||
49 | -// html += '</p> '; | ||
50 | -// html += '</div> '; | ||
51 | - | ||
52 | -// html += '<div class="answer"> '; | ||
53 | -// html += '<span class="iconfont"></span> '; | ||
54 | -// html += '<p>' + json[i].answer + '</p> '; | ||
55 | -// html += '</div> '; | ||
56 | -// html += '</div> '; | ||
57 | -// } | ||
58 | -// $consultsDiv.append(html); | ||
59 | -// } | ||
60 | - | ||
61 | -// function search() { | ||
62 | -// if (searching || end) { | ||
63 | -// return; | ||
64 | -// } | ||
65 | -// searching = true; | ||
66 | - | ||
67 | -// loading.showLoadingMask(); | ||
68 | - | ||
69 | -// $.ajax({ | ||
70 | -// type: 'GET', | ||
71 | -// url: loadMoreUrl, | ||
72 | -// success: function(data) { | ||
73 | -// if (data.length > 0) { | ||
74 | -// jsonObj = JSON.parse(data); | ||
75 | -// if ($commentsDiv.length > 0) { | ||
76 | -// insertCommentsDiv(jsonObj); | ||
77 | -// } else if ($consultsDiv.length > 0) { | ||
78 | -// insertConsultsDiv(jsonObj); | ||
79 | -// } | ||
80 | -// } | ||
81 | -// searching = false; | ||
82 | -// end = true; | ||
83 | -// loading.hideLoadingMask(); | ||
84 | -// }, | ||
85 | -// error: function() { | ||
86 | -// tip.show('网络断开连接了~'); | ||
87 | -// searching = false; | ||
88 | -// loading.hideLoadingMask(); | ||
89 | -// } | ||
90 | -// }); | ||
91 | -// } | ||
92 | - | ||
93 | - | ||
94 | -// function scrollHandler() { | ||
95 | -// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) { | ||
96 | -// search(); | ||
97 | -// } | ||
98 | -// } | ||
99 | - | ||
100 | -// //srcoll to load more | ||
101 | -// $(window).scroll(function() { | ||
102 | -// window.requestAnimationFrame(scrollHandler); | ||
103 | -// }); |
@@ -8,6 +8,6 @@ require('./newsale/newarrival'); | @@ -8,6 +8,6 @@ require('./newsale/newarrival'); | ||
8 | require('./newsale/discount'); | 8 | require('./newsale/discount'); |
9 | require('./list'); | 9 | require('./list'); |
10 | require('./detail/detail'); | 10 | require('./detail/detail'); |
11 | -require('./detail/loadmore'); | ||
12 | require('./detail/consultform'); | 11 | require('./detail/consultform'); |
13 | -require('./newsale/hot-rank'); | ||
12 | +require('./newsale/hot-rank'); | ||
13 | + |
1 | +/** | ||
2 | + * 为您优选 | ||
3 | + * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
4 | + * @date: 2015/11/16 | ||
5 | + */ | ||
6 | + | ||
7 | + | ||
8 | +var Swiper = require('yoho.iswiper'), | ||
9 | + $ = require('jquery'); | ||
10 | + | ||
11 | +var recommendSwiper, | ||
12 | + $recommendForYou = $('.recommend-for-you'), | ||
13 | + preferenceUrl = $('#preferenceUrl').val(); | ||
14 | + | ||
15 | +if (preferenceUrl) { | ||
16 | + $.get(preferenceUrl).then(function(html) { | ||
17 | + $recommendForYou.html(html).show(); | ||
18 | + if ($('#swiper-recommend').length) { | ||
19 | + recommendSwiper = new Swiper('#swiper-recommend', { | ||
20 | + slidesPerView: 'auto', | ||
21 | + grabCursor: true, | ||
22 | + slideElement: 'a', | ||
23 | + lazyLoading: true, | ||
24 | + watchSlidesVisibility: true | ||
25 | + }); | ||
26 | + } | ||
27 | + }).fail(function() { | ||
28 | + $recommendForYou.hide(); | ||
29 | + }); | ||
30 | +} |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | width: pxToRem(126px); | 24 | width: pxToRem(126px); |
25 | height: pxToRem(126px); | 25 | height: pxToRem(126px); |
26 | border-radius: 50%; | 26 | border-radius: 50%; |
27 | - border: pxToRem(6px) solid #a7a8a9; | 27 | + border: pxToRem(6px) solid #a7a8a9; |
28 | background-image: image-url("me/index/user-avatar.png"); | 28 | background-image: image-url("me/index/user-avatar.png"); |
29 | background-size: 100%; | 29 | background-size: 100%; |
30 | } | 30 | } |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | } | 46 | } |
47 | 47 | ||
48 | .vip-3 { | 48 | .vip-3 { |
49 | - @include rem-sprite($vip, vip-3); | 49 | + @include rem-sprite($vip, vip-3); |
50 | } | 50 | } |
51 | 51 | ||
52 | .vip-2 { | 52 | .vip-2 { |
@@ -91,7 +91,7 @@ | @@ -91,7 +91,7 @@ | ||
91 | font-size: pxToRem(22px); | 91 | font-size: pxToRem(22px); |
92 | line-height: pxToRem(38px); | 92 | line-height: pxToRem(38px); |
93 | width: pxToRem(213px); | 93 | width: pxToRem(213px); |
94 | - | 94 | + |
95 | &:after { | 95 | &:after { |
96 | content: ''; | 96 | content: ''; |
97 | position: absolute; | 97 | position: absolute; |
@@ -153,16 +153,17 @@ | @@ -153,16 +153,17 @@ | ||
153 | 153 | ||
154 | .num { | 154 | .num { |
155 | position: absolute; | 155 | position: absolute; |
156 | - padding: 0 pxToRem(8px); | ||
157 | - top: 0; | ||
158 | - right: pxToRem(40px); | ||
159 | - min-width: pxToRem(16px); | ||
160 | - font-size: pxToRem(24px); | ||
161 | - line-height: pxToRem(32px); | 156 | + top: pxToRem(-24px); |
157 | + right: pxToRem(36px); | ||
158 | + width: pxToRem(72px); | ||
159 | + height: pxToRem(72px); | ||
160 | + font-size: pxToRem(40px); | ||
161 | + line-height: pxToRem(72px); | ||
162 | color: #fff; | 162 | color: #fff; |
163 | - background: #F03D35; | 163 | + background: #f03d35; |
164 | text-align: center; | 164 | text-align: center; |
165 | - border-radius: pxToRem(20px); | 165 | + border-radius: 50%; |
166 | + @include transform(scale(0.5)); | ||
166 | } | 167 | } |
167 | } | 168 | } |
168 | 169 | ||
@@ -184,7 +185,7 @@ | @@ -184,7 +185,7 @@ | ||
184 | padding: 0 pxToRem(30px); | 185 | padding: 0 pxToRem(30px); |
185 | font-size: pxToRem(32px); | 186 | font-size: pxToRem(32px); |
186 | line-height: pxToRem(88px); | 187 | line-height: pxToRem(88px); |
187 | - | 188 | + |
188 | &.highlight { | 189 | &.highlight { |
189 | background: #eee; | 190 | background: #eee; |
190 | } | 191 | } |
@@ -214,4 +215,4 @@ | @@ -214,4 +215,4 @@ | ||
214 | float: right; | 215 | float: right; |
215 | } | 216 | } |
216 | } | 217 | } |
217 | -} | ||
218 | +} |
@@ -142,6 +142,9 @@ | @@ -142,6 +142,9 @@ | ||
142 | {{#if id}} | 142 | {{#if id}} |
143 | <input id="productId" type="hidden" value="{{id}}"> | 143 | <input id="productId" type="hidden" value="{{id}}"> |
144 | {{/if}} | 144 | {{/if}} |
145 | - | 145 | + {{#if preferenceUrl}} |
146 | + <input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}"> | ||
147 | + {{/if}} | ||
148 | + | ||
146 | </div> | 149 | </div> |
147 | {{> layout/footer}} | 150 | {{> layout/footer}} |
@@ -46,7 +46,8 @@ class HomeController extends AbstractAction | @@ -46,7 +46,8 @@ class HomeController extends AbstractAction | ||
46 | $data = array( | 46 | $data = array( |
47 | 'myIndexPage' => true, | 47 | 'myIndexPage' => true, |
48 | 'showDownloadApp' => true, | 48 | 'showDownloadApp' => true, |
49 | - 'pageFooter' => true | 49 | + 'pageFooter' => true, |
50 | + 'cartUrl' => Helpers::url('/cart/index/index', null), | ||
50 | ); | 51 | ); |
51 | $uid = $this->getUid(true); | 52 | $uid = $this->getUid(true); |
52 | if ($uid) { | 53 | if ($uid) { |
-
Please register or login to post a comment