Authored by OF1706

n

@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <p class="price"> 7 <p class="price">
8 <span class="sale-price">8888{{salePrice}}</span> 8 <span class="sale-price">8888{{salePrice}}</span>
9 </p> 9 </p>
10 - <a class="btn-add-cart">加入购物车</a> 10 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
11 </li> 11 </li>
12 <li class="good img-item"> 12 <li class="good img-item">
13 <span class="hide goods-id">{{goods_id}}</span> 13 <span class="hide goods-id">{{goods_id}}</span>
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <p class="price"> 18 <p class="price">
19 <span class="sale-price">8888{{salePrice}}</span> 19 <span class="sale-price">8888{{salePrice}}</span>
20 </p> 20 </p>
21 - <a class="btn-add-cart">加入购物车</a> 21 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
22 </li> 22 </li>
23 <li class="good img-item"> 23 <li class="good img-item">
24 <span class="hide goods-id">{{goods_id}}</span> 24 <span class="hide goods-id">{{goods_id}}</span>
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <span class="sale-price sale-price-new">8888{{salePrice}}</span> 30 <span class="sale-price sale-price-new">8888{{salePrice}}</span>
31 <span class="market-price">7777{{marketPrice}}</span> 31 <span class="market-price">7777{{marketPrice}}</span>
32 </p> 32 </p>
33 - <a class="btn-add-cart">加入购物车</a> 33 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
34 </li> 34 </li>
35 <li class="good img-item"> 35 <li class="good img-item">
36 <span class="hide goods-id">{{goods_id}}</span> 36 <span class="hide goods-id">{{goods_id}}</span>
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <p class="price"> 41 <p class="price">
42 <span class="sale-price">8888{{salePrice}}</span> 42 <span class="sale-price">8888{{salePrice}}</span>
43 </p> 43 </p>
44 - <a class="btn-add-cart">加入购物车</a> 44 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
45 </li> 45 </li>
46 <li class="good img-item"> 46 <li class="good img-item">
47 <span class="hide goods-id">{{goods_id}}</span> 47 <span class="hide goods-id">{{goods_id}}</span>
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <p class="price"> 52 <p class="price">
53 <span class="sale-price">8888{{salePrice}}</span> 53 <span class="sale-price">8888{{salePrice}}</span>
54 </p> 54 </p>
55 - <a class="btn-add-cart">加入购物车</a> 55 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
56 </li> 56 </li>
57 <li class="good img-item"> 57 <li class="good img-item">
58 <span class="hide goods-id">{{goods_id}}</span> 58 <span class="hide goods-id">{{goods_id}}</span>
@@ -63,6 +63,6 @@ @@ -63,6 +63,6 @@
63 <p class="price"> 63 <p class="price">
64 <span class="sale-price">8888{{salePrice}}</span> 64 <span class="sale-price">8888{{salePrice}}</span>
65 </p> 65 </p>
66 - <a class="btn-add-cart">加入购物车</a> 66 + <a class="btn-add-cart" data-together-id=" " >加入购物车</a>
67 </li> 67 </li>
68 68
1 <!-- 凑单 --> 1 <!-- 凑单 -->
2 <div class="detail-body" id="goodsTogetherDetail"> 2 <div class="detail-body" id="goodsTogetherDetail">
3 - <div class="slide-img">  
4 - <p>选赠品:<em><span  
5 - class="active">1元加价购</span><code>|</code><span>59元加价购</span><code>|</code><span>99元加价购</span></em></p>  
6 - <div class="side-img-dd">  
7 - <ul class="img-list">  
8 - <li class="img-item">  
9 - <span class="hide goods-id">{{goods_id}}</span>  
10 - <div class="good">  
11 - <a href="{{url}}" target="_blank">  
12 - <img class="lazy" src="{{pic_url}}"/>  
13 - </a>  
14 - </div>  
15 - </li>  
16 - <li class="img-item">  
17 - <span class="hide goods-id">{{goods_id}}</span>  
18 - <div class="good">  
19 - <a href="{{url}}" target="_blank">  
20 - <img class="lazy" src="{{pic_url}}"/>  
21 - </a>  
22 - </div>  
23 - </li>  
24 - <li class="img-item">  
25 - <span class="hide goods-id">{{goods_id}}</span>  
26 - <div class="good">  
27 - <a href="{{url}}" target="_blank">  
28 - <img class="lazy" src="{{pic_url}}"/>  
29 - </a>  
30 - </div>  
31 - <i class="iconfont checked">&#xe6cb;</i>  
32 - </li>  
33 - <li class="img-item">  
34 - <span class="hide goods-id">{{goods_id}}</span>  
35 - <div class="good">  
36 - <a href="{{url}}" target="_blank">  
37 - <img class="lazy" src="{{pic_url}}"/>  
38 - </a>  
39 - </div>  
40 - </li>  
41 - <li class="img-item">  
42 - <span class="hide goods-id">{{goods_id}}</span>  
43 - <div class="good">  
44 - <a href="{{url}}" target="_blank">  
45 - <img class="lazy" src="{{pic_url}}"/>  
46 - </a>  
47 - </div>  
48 - </li>  
49 - <li class="img-item">  
50 - <span class="hide goods-id">{{goods_id}}</span>  
51 - <div class="good">  
52 - <a href="{{url}}" target="_blank">  
53 - <img class="lazy" src="{{pic_url}}"/>  
54 - </a>  
55 - </div>  
56 - </li>  
57 - <li class="img-item">  
58 - <span class="hide goods-id">{{goods_id}}</span>  
59 - <div class="good">  
60 - <a href="{{url}}" target="_blank">  
61 - <img class="lazy" src="{{pic_url}}"/>  
62 - </a>  
63 - </div>  
64 - </li>  
65 - <li class="img-item">  
66 - <span class="hide goods-id">{{goods_id}}</span>  
67 - <div class="good">  
68 - <a href="{{url}}" target="_blank">  
69 - <img class="lazy" src="{{pic_url}}"/>  
70 - </a>  
71 - </div>  
72 - </li>  
73 - <li class="img-item">  
74 - <span class="hide goods-id">{{goods_id}}</span>  
75 - <div class="good">  
76 - <a href="{{url}}" target="_blank">  
77 - <img class="lazy" src="{{pic_url}}"/>  
78 - </a>  
79 - </div>  
80 - </li>  
81 - <li class="img-item">  
82 - <span class="hide goods-id">{{goods_id}}</span>  
83 - <div class="good">  
84 - <a href="{{url}}" target="_blank">  
85 - <img class="lazy" src="{{pic_url}}"/>  
86 - </a>  
87 - </div>  
88 - </li>  
89 - <li class="img-item">  
90 - <span class="hide goods-id">{{goods_id}}</span>  
91 - <div class="good">  
92 - <a href="{{url}}" target="_blank">  
93 - <img class="lazy" src="{{pic_url}}"/>  
94 - </a>  
95 - </div>  
96 - </li>  
97 - </ul>  
98 - </div>  
99 - </div>  
100 <div class="detail-goods"> 3 <div class="detail-goods">
101 <div class="detail-bigpic"> 4 <div class="detail-bigpic">
102 <div class="bigpic"> 5 <div class="bigpic">
@@ -201,7 +104,7 @@ @@ -201,7 +104,7 @@
201 <span data-sku="{{sku}}" data-num="{{num}}">40码{{name}}</span> 104 <span data-sku="{{sku}}" data-num="{{num}}">40码{{name}}</span>
202 <span data-sku="{{sku}}" data-num="{{num}}">40码{{name}}</span> 105 <span data-sku="{{sku}}" data-num="{{num}}">40码{{name}}</span>
203 </div> 106 </div>
204 - <p>内长&nbsp;25.5com</p> 107 + <p class="size-p">内长&nbsp;25.5com</p>
205 </dt> 108 </dt>
206 </dl> 109 </dl>
207 <dl> 110 <dl>
@@ -222,7 +125,7 @@ @@ -222,7 +125,7 @@
222 </div> 125 </div>
223 <div class="detail-size"> 126 <div class="detail-size">
224 <h3>尺码信息(单位:厘米)</h3> 127 <h3>尺码信息(单位:厘米)</h3>
225 - <table> 128 + <table style="margin-bottom:100px;">
226 <thead> 129 <thead>
227 <tr> 130 <tr>
228 <th width="{{width}}">吊牌吃吗</th> 131 <th width="{{width}}">吊牌吃吗</th>
@@ -998,3 +998,10 @@ $('.shop-cart').on('click', giftBtn.join(','), function() { @@ -998,3 +998,10 @@ $('.shop-cart').on('click', giftBtn.join(','), function() {
998 $('.shop-cart').on('click', '[data-role="cart-gift-win"] .close', function() { 998 $('.shop-cart').on('click', '[data-role="cart-gift-win"] .close', function() {
999 $(this).closest('[data-role="cart-gift-win"]').hide(); 999 $(this).closest('[data-role="cart-gift-win"]').hide();
1000 });*/ 1000 });*/
  1001 +
  1002 +var request = new XMLHttpRequest();
  1003 +request.open('GET','http://www.mozilla.org/',false);
  1004 +request.send(null);
  1005 +if (request.status === 200){
  1006 + console.log(request.responseText);
  1007 +}
@@ -20,26 +20,32 @@ var Dialog = dialog.Dialog, @@ -20,26 +20,32 @@ var Dialog = dialog.Dialog,
20 RConfirm = rDialog.RConfirm, 20 RConfirm = rDialog.RConfirm,
21 RAlert = rDialog.RAlert; 21 RAlert = rDialog.RAlert;
22 22
  23 +var dialogTpl = require('hbs/cart/cart-togetherGoods.hbs');
  24 +
23 var $cartGoodsDetail = $('#goodsTogetherDetail'), 25 var $cartGoodsDetail = $('#goodsTogetherDetail'),
  26 + $goodsDetail = $('.detail-goods'),
24 $payWapper = $('.pay-wapper'), 27 $payWapper = $('.pay-wapper'),
25 $goodsChoose = $('#goodsChoose'), 28 $goodsChoose = $('#goodsChoose'),
26 $goodsItem = $('.cart-table li'), 29 $goodsItem = $('.cart-table li'),
27 $paySum = $('#pay-sum'), 30 $paySum = $('#pay-sum'),
28 pacList = 0, 31 pacList = 0,
29 shopNum = 1, 32 shopNum = 1,
30 - productId,  
31 - promotionId,  
32 - productnum,  
33 - understock,  
34 - shopname,  
35 - delUrl,  
36 - dataJSON,  
37 - countJSON,  
38 - selectArray,  
39 - shopNumAll, 33 + // promotionId,
  34 + // productnum,
  35 + // understock,
  36 + // shopname,
  37 + // delUrl,
  38 + // dataJSON,
  39 + // countJSON,
  40 + // selectArray,
  41 + // shopNumAll,
40 confirm, 42 confirm,
41 hasPromotion = false; 43 hasPromotion = false;
42 44
  45 +var $togetherGoods = $('.individual-item-togetherGoods'),
  46 + $recommendGoods = $('.individual-item-recommendGoods'),
  47 + $latestWalk = $('.individual-item-latestWalk');
  48 +
43 // 优惠券 显示和隐藏 49 // 优惠券 显示和隐藏
44 $('.sale-info').mouseenter(function() { 50 $('.sale-info').mouseenter(function() {
45 $(this).addClass('active').children('ul').removeClass('none'); 51 $(this).addClass('active').children('ul').removeClass('none');
@@ -105,21 +111,10 @@ function cartDel(data, delUrl, cookieList) { @@ -105,21 +111,10 @@ function cartDel(data, delUrl, cookieList) {
105 ); 111 );
106 });*/ 112 });*/
107 113
108 -// 凑单图片懒加载  
109 -var togetherDialog = {};  
110 -  
111 -// var dialogTpl = require('hbs/cart/cart-togetherGoods.hbs');  
112 -  
113 -lazyLoad($('#details-html img'));  
114 -  
115 -  
116 // ----------------底部 为你优选,最近浏览 begin-------------- 114 // ----------------底部 为你优选,最近浏览 begin--------------
117 115
118 // 推荐、优选、浏览切换 116 // 推荐、优选、浏览切换
119 $(function() { 117 $(function() {
120 - var $togetherGoods = $('.individual-item-togetherGoods'),  
121 - $recommendGoods = $('.individual-item-recommendGoods'),  
122 - $latestWalk = $('.individual-item-latestWalk');  
123 118
124 if ($togetherGoods.hasClass('none')) { 119 if ($togetherGoods.hasClass('none')) {
125 $recommendGoods.show(); 120 $recommendGoods.show();
@@ -165,7 +160,6 @@ $(function() { @@ -165,7 +160,6 @@ $(function() {
165 }); 160 });
166 }); 161 });
167 162
168 -  
169 // 凑单 底部 轮播 163 // 凑单 底部 轮播
170 function loadSlideGoods() { 164 function loadSlideGoods() {
171 $.ajax({ 165 $.ajax({
@@ -188,7 +182,7 @@ function loadSlideGoods() { @@ -188,7 +182,7 @@ function loadSlideGoods() {
188 182
189 $('.individual-item ').slider2({ 183 $('.individual-item ').slider2({
190 shownum: 5, 184 shownum: 5,
191 - isCircle: true 185 + isCircle: false
192 }); 186 });
193 187
194 // } else { 188 // } else {
@@ -205,6 +199,82 @@ $(function() { @@ -205,6 +199,82 @@ $(function() {
205 }); 199 });
206 200
207 // ----------------底部 为你优选,最近浏览 end-------------- 201 // ----------------底部 为你优选,最近浏览 end--------------
  202 +
  203 +// ----------------底部 凑单 begin --------------
  204 +// 凑单图片懒加载
  205 +var togetherDialog = {};
  206 +
  207 +lazyLoad($('#details-html img'));
  208 +
  209 +// 凑单弹框 显示
  210 +$('.shop-cart').on('click', '.btn-add-cart', function() {
  211 +
  212 + var tid = $(this).attr('data-together-id');
  213 + showPromotion(tid);
  214 +
  215 +});
  216 +function showPromotion(id) {
  217 +
  218 + if (!id) {
  219 + return;
  220 + }
  221 +
  222 + var d = new Dialog({
  223 + content: dialogTpl(),
  224 + className: 'cart-togetherGoods'
  225 + }).show();
  226 +
  227 + d.$el.on('click', '.cut, .add',function() {
  228 + count = $(this).hasClass('minus') ? 'decreaseNum' : 'increaseNum';
  229 + // if (promotionId) {
  230 + if ($(this).hasClass('cut')) {
  231 + new Alert('-_-,已经是最后一件,不能再减了!').show();
  232 + } else {
  233 + new Alert('最多只能购买一件,您好像购买的太多了!').show();
  234 + }
  235 + // } else {
  236 + if ($(this).hasClass('add')) {
  237 + shopNum++;
  238 + } else {
  239 + shopNum--;
  240 + }
  241 + if (shopNum < 1) {
  242 + new Alert('-_-,已经是最后一件,不能在减了!').show();
  243 + shopNum = 1;
  244 + return false;
  245 + }
  246 +
  247 + $('#num').val(shopNum);
  248 + // }
  249 +
  250 + })
  251 +}
  252 +
  253 +// $('body').on('click', '.cut, .add', function() {
  254 +// count = $(this).hasClass('minus') ? 'decreaseNum' : 'increaseNum';
  255 +// // if (promotionId) {
  256 +// if ($(this).hasClass('cut')) {
  257 +// new Alert('-_-,已经是最后一件,不能再减了!').show();
  258 +// } else {
  259 +// new Alert('最多只能购买一件,您好像购买的太多了!').show();
  260 +// }
  261 +// // } else {
  262 +// if ($(this).hasClass('add')) {
  263 +// shopNum++;
  264 +// } else {
  265 +// shopNum--;
  266 +// }
  267 +// if (shopNum < 1) {
  268 +// new Alert('-_-,已经是最后一件,不能在减了!').show();
  269 +// shopNum = 1;
  270 +// return false;
  271 +// }
  272 +//
  273 +// $('#num').val(shopNum);
  274 +// // }
  275 +//
  276 +// })
  277 +
208 // 凑单弹框 详情切换 278 // 凑单弹框 详情切换
209 /* $('body').on('click', '.piclist li', function() { 279 /* $('body').on('click', '.piclist li', function() {
210 pacList = $(this).index(); 280 pacList = $(this).index();
@@ -267,31 +337,6 @@ $('body').on('click', '.showSizeBox span', function() { @@ -267,31 +337,6 @@ $('body').on('click', '.showSizeBox span', function() {
267 } 337 }
268 }); 338 });
269 339
270 -$('body').on('click', '.cut, .add', function() {  
271 - count = $(this).hasClass('minus') ? 'decreaseNum' : 'increaseNum';  
272 - if (promotionId) {  
273 - if ($(this).hasClass('cut')) {  
274 - new Alert('-_-,已经是最后一件,不能再减了!').show();  
275 - } else {  
276 - new Alert('最多只能购买一件,您好像购买的太多了!').show();  
277 - }  
278 - } else {  
279 - if ($(this).hasClass('add')) {  
280 - shopNum++;  
281 - } else {  
282 - shopNum--;  
283 - }  
284 - if (shopNum < 1) {  
285 - new Alert('-_-,已经是最后一件,不能在减了!').show();  
286 - shopNum = 1;  
287 - return false;  
288 - }  
289 -  
290 - $('#num').val(shopNum);  
291 - }  
292 -  
293 -});*/  
294 -  
295 // 凑单弹框 商品信息弹出框,加入收藏夹 340 // 凑单弹框 商品信息弹出框,加入收藏夹
296 $cartGoodsDetail.on('click', '.btn-favCount', function() { 341 $cartGoodsDetail.on('click', '.btn-favCount', function() {
297 $.ajax({ 342 $.ajax({
@@ -299,7 +344,7 @@ $cartGoodsDetail.on('click', '.btn-favCount', function() { @@ -299,7 +344,7 @@ $cartGoodsDetail.on('click', '.btn-favCount', function() {
299 dataType: 'json', 344 dataType: 'json',
300 url: '', 345 url: '',
301 data: { 346 data: {
302 - productId: productId, 347 + // productId: productId,
303 type: 'add' 348 type: 'add'
304 } 349 }
305 }).then(function(d) { 350 }).then(function(d) {
@@ -452,6 +497,9 @@ $goodsChoose.on('click', '.choose-color .dt', function() { @@ -452,6 +497,9 @@ $goodsChoose.on('click', '.choose-color .dt', function() {
452 }); 497 });
453 */ 498 */
454 499
  500 +
  501 +// ----------------底部 凑单 end --------------
  502 +
455 // 结算 503 // 结算
456 $paySum.on('click', '.btn-account', function() { 504 $paySum.on('click', '.btn-account', function() {
457 // 结算 505 // 结算
@@ -513,3 +561,5 @@ $('.shop-cart').on('click', '[data-role="cart-gift-win"] .close', function() { @@ -513,3 +561,5 @@ $('.shop-cart').on('click', '[data-role="cart-gift-win"] .close', function() {
513 }); 561 });
514 562
515 require('./cart-action'); 563 require('./cart-action');
  564 +
  565 +
@@ -326,6 +326,7 @@ @@ -326,6 +326,7 @@
326 326
327 .submit { 327 .submit {
328 text-align: left; 328 text-align: left;
  329 + margin-top: 15px;
329 button { 330 button {
330 float: none; 331 float: none;
331 line-height:40px; 332 line-height:40px;
@@ -334,6 +335,7 @@ @@ -334,6 +335,7 @@
334 font-size: 15px; 335 font-size: 15px;
335 color: #444; 336 color: #444;
336 margin-right: 20px; 337 margin-right: 20px;
  338 + padding: 0;
337 border: 1px solid #b0b0b0; 339 border: 1px solid #b0b0b0;
338 background-color: #fff; 340 background-color: #fff;
339 box-sizing: border-box; 341 box-sizing: border-box;
@@ -1408,9 +1408,15 @@ @@ -1408,9 +1408,15 @@
1408 float: left; 1408 float: left;
1409 margin-right: 10px; 1409 margin-right: 10px;
1410 width: 190px; 1410 width: 190px;
1411 - &:nth-child(5n) { 1411 + &:nth-child(5n) {
1412 margin-right: 0; 1412 margin-right: 0;
1413 } 1413 }
  1414 + &:hover {
  1415 + .name {
  1416 + color: #000;
  1417 + font-weight: 500;
  1418 + }
  1419 + }
1414 } 1420 }
1415 1421
1416 img { 1422 img {