|
@@ -9,6 +9,19 @@ var address = require('./address'); |
|
@@ -9,6 +9,19 @@ var address = require('./address'); |
9
|
|
9
|
|
10
|
var dialog = require('../common/dialog');
|
10
|
var dialog = require('../common/dialog');
|
11
|
|
11
|
|
|
|
12
|
+var accMul = function (arg1, arg2){
|
|
|
13
|
+ var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
|
|
|
14
|
+ try {
|
|
|
15
|
+ m += s1.split(".")[1].length
|
|
|
16
|
+ } catch (e) {
|
|
|
17
|
+ }
|
|
|
18
|
+ try {
|
|
|
19
|
+ m += s2.split(".")[1].length
|
|
|
20
|
+ } catch (e) {
|
|
|
21
|
+ }
|
|
|
22
|
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
|
|
|
23
|
+}
|
|
|
24
|
+
|
12
|
var Order = {
|
25
|
var Order = {
|
13
|
/*业务数据(人民币)*/
|
26
|
/*业务数据(人民币)*/
|
14
|
Data: {
|
27
|
Data: {
|
|
@@ -29,7 +42,6 @@ var Order = { |
|
@@ -29,7 +42,6 @@ var Order = { |
29
|
$cancel: $('.cancel', '.btn-group'),
|
42
|
$cancel: $('.cancel', '.btn-group'),
|
30
|
$total: $('em', '.to-play'),
|
43
|
$total: $('em', '.to-play'),
|
31
|
$tbody: $('table tbody', '.pay-wapper'),
|
44
|
$tbody: $('table tbody', '.pay-wapper'),
|
32
|
-
|
|
|
33
|
//请填写并核对一下信息
|
45
|
//请填写并核对一下信息
|
34
|
$orderSelectionSave: $('.address-list h2 span'),
|
46
|
$orderSelectionSave: $('.address-list h2 span'),
|
35
|
$addAddress: $('.add-address'),
|
47
|
$addAddress: $('.add-address'),
|
|
@@ -44,19 +56,18 @@ var Order = { |
|
@@ -44,19 +56,18 @@ var Order = { |
44
|
$modityPayInfo: $('.modity-pay-info'),
|
56
|
$modityPayInfo: $('.modity-pay-info'),
|
45
|
$payTotal: $('.play-total'),
|
57
|
$payTotal: $('.play-total'),
|
46
|
$toPay: $('.to-play em'),
|
58
|
$toPay: $('.to-play em'),
|
47
|
-
|
|
|
48
|
$redEnvelopes: $('.red-envelopes'),
|
59
|
$redEnvelopes: $('.red-envelopes'),
|
49
|
$useEnvelopes: $('.use-envelopes'),
|
60
|
$useEnvelopes: $('.use-envelopes'),
|
50
|
$hasEnvelopes: $('.has-envelopes span'),
|
61
|
$hasEnvelopes: $('.has-envelopes span'),
|
51
|
$useEnvelopesInput: $('.use-envelopes').find('input')
|
62
|
$useEnvelopesInput: $('.use-envelopes').find('input')
|
52
|
},
|
63
|
},
|
53
|
- init: function() {
|
64
|
+ init: function () {
|
54
|
var e = this.e,
|
65
|
var e = this.e,
|
55
|
- d = Order.Data,
|
|
|
56
|
- c = Order.Common;
|
66
|
+ d = Order.Data,
|
|
|
67
|
+ c = Order.Common;
|
57
|
|
68
|
|
58
|
//初始化产品价格(表格中的价格)
|
69
|
//初始化产品价格(表格中的价格)
|
59
|
- e.$tbody.find('tr').each(function(index) {
|
70
|
+ e.$tbody.find('tr').each(function (index) {
|
60
|
|
71
|
|
61
|
var td = $(this).find('td');
|
72
|
var td = $(this).find('td');
|
62
|
var len = e.$tbody.find('tr').length;
|
73
|
var len = e.$tbody.find('tr').length;
|
|
@@ -82,7 +93,7 @@ var Order = { |
|
@@ -82,7 +93,7 @@ var Order = { |
82
|
});
|
93
|
});
|
83
|
|
94
|
|
84
|
// 使用优惠券、使用yoho币点击展开
|
95
|
// 使用优惠券、使用yoho币点击展开
|
85
|
- e.$pan.find('dt').click(function() {
|
96
|
+ e.$pan.find('dt').click(function () {
|
86
|
|
97
|
|
87
|
var pan = $(this).parent('dl.pan');
|
98
|
var pan = $(this).parent('dl.pan');
|
88
|
|
99
|
|
|
@@ -99,11 +110,11 @@ var Order = { |
|
@@ -99,11 +110,11 @@ var Order = { |
99
|
});
|
110
|
});
|
100
|
|
111
|
|
101
|
//请填写并核对一下信息
|
112
|
//请填写并核对一下信息
|
102
|
- e.$orderSelectionSave.click(function() {
|
113
|
+ e.$orderSelectionSave.click(function () {
|
103
|
var i = 0,
|
114
|
var i = 0,
|
104
|
- $addressLi = $('.exist-address-list li'),
|
|
|
105
|
- liLen = $addressLi.length,
|
|
|
106
|
- notSelect = 0;
|
115
|
+ $addressLi = $('.exist-address-list li'),
|
|
|
116
|
+ liLen = $addressLi.length,
|
|
|
117
|
+ notSelect = 0;
|
107
|
|
118
|
|
108
|
if (!$(this).attr('expand')) {
|
119
|
if (!$(this).attr('expand')) {
|
109
|
|
120
|
|
|
@@ -155,7 +166,7 @@ var Order = { |
|
@@ -155,7 +166,7 @@ var Order = { |
155
|
|
166
|
|
156
|
|
167
|
|
157
|
//支付及送货时间
|
168
|
//支付及送货时间
|
158
|
- e.$switchPayModify.click(function() {
|
169
|
+ e.$switchPayModify.click(function () {
|
159
|
|
170
|
|
160
|
if (e.$payTimeModify.hasClass('hide')) {
|
171
|
if (e.$payTimeModify.hasClass('hide')) {
|
161
|
e.$payTimeModify.removeClass('hide');
|
172
|
e.$payTimeModify.removeClass('hide');
|
|
@@ -172,13 +183,13 @@ var Order = { |
|
@@ -172,13 +183,13 @@ var Order = { |
172
|
}
|
183
|
}
|
173
|
});
|
184
|
});
|
174
|
|
185
|
|
175
|
- e.$spanPayTypeLegend.click(function() {
|
186
|
+ e.$spanPayTypeLegend.click(function () {
|
176
|
$(this).toggleClass('active');
|
187
|
$(this).toggleClass('active');
|
177
|
|
188
|
|
178
|
e.$supportType.toggleClass('hide');
|
189
|
e.$supportType.toggleClass('hide');
|
179
|
});
|
190
|
});
|
180
|
|
191
|
|
181
|
- $(document).on('click', '.exist-address-list li', function() {
|
192
|
+ $(document).on('click', '.exist-address-list li', function () {
|
182
|
|
193
|
|
183
|
$('.exist-address-list li').removeClass('active');
|
194
|
$('.exist-address-list li').removeClass('active');
|
184
|
|
195
|
|
|
@@ -198,16 +209,15 @@ var Order = { |
|
@@ -198,16 +209,15 @@ var Order = { |
198
|
}
|
209
|
}
|
199
|
});
|
210
|
});
|
200
|
},
|
211
|
},
|
201
|
-
|
|
|
202
|
//渲染价格明细
|
212
|
//渲染价格明细
|
203
|
- render: function(data, tips) {
|
213
|
+ render: function (data, tips) {
|
204
|
|
214
|
|
205
|
// 下面这段是在服务端算价格
|
215
|
// 下面这段是在服务端算价格
|
206
|
var e = this.e,
|
216
|
var e = this.e,
|
207
|
- i,
|
|
|
208
|
- dArr = data.promotion_formula_list,
|
|
|
209
|
- str = '',
|
|
|
210
|
- isExpress = '';
|
217
|
+ i,
|
|
|
218
|
+ dArr = data.promotion_formula_list,
|
|
|
219
|
+ str = '',
|
|
|
220
|
+ isExpress = '';
|
211
|
|
221
|
|
212
|
var tipsStr;
|
222
|
var tipsStr;
|
213
|
|
223
|
|
|
@@ -236,16 +246,16 @@ var Order = { |
|
@@ -236,16 +246,16 @@ var Order = { |
236
|
}
|
246
|
}
|
237
|
|
247
|
|
238
|
str += '<li class="' + isExpress + '">' +
|
248
|
str += '<li class="' + isExpress + '">' +
|
239
|
- '<label>' + dArr[i].promotion + '</label>' +
|
|
|
240
|
- '<em>' + dArr[i].promotion_amount + '</em>' +
|
|
|
241
|
- '</li>';
|
249
|
+ '<label>' + dArr[i].promotion + '</label>' +
|
|
|
250
|
+ '<em>' + dArr[i].promotion_amount + '</em>' +
|
|
|
251
|
+ '</li>';
|
242
|
}
|
252
|
}
|
243
|
|
253
|
|
244
|
e.$payTotal.html(str);
|
254
|
e.$payTotal.html(str);
|
245
|
e.$toPay.html((data.last_order_amount).toFixed(2));
|
255
|
e.$toPay.html((data.last_order_amount).toFixed(2));
|
246
|
|
256
|
|
247
|
//有货币清零状态更新
|
257
|
//有货币清零状态更新
|
248
|
- $('#biprice').val(100 * data.use_yoho_coin);
|
258
|
+ $('#biprice').val(accMul(100,data.use_yoho_coin));
|
249
|
if (~~data.use_yoho_coin === 0) {
|
259
|
if (~~data.use_yoho_coin === 0) {
|
250
|
$('.errbitip').text('');
|
260
|
$('.errbitip').text('');
|
251
|
} else {
|
261
|
} else {
|
|
@@ -268,7 +278,7 @@ var Order = { |
|
@@ -268,7 +278,7 @@ var Order = { |
268
|
},
|
278
|
},
|
269
|
/*公共方法*/
|
279
|
/*公共方法*/
|
270
|
Common: {
|
280
|
Common: {
|
271
|
- enterNUM: function(str1, str2) {
|
281
|
+ enterNUM: function (str1, str2) {
|
272
|
str1 = str1.replace(/[^\d]/g, '');
|
282
|
str1 = str1.replace(/[^\d]/g, '');
|
273
|
if (str1 && str2) {
|
283
|
if (str1 && str2) {
|
274
|
str1 = parseInt(str1);
|
284
|
str1 = parseInt(str1);
|
|
@@ -279,34 +289,34 @@ var Order = { |
|
@@ -279,34 +289,34 @@ var Order = { |
279
|
}
|
289
|
}
|
280
|
return str1;
|
290
|
return str1;
|
281
|
},
|
291
|
},
|
282
|
- calucate: function() {
|
292
|
+ calucate: function () {
|
283
|
var p = Order.Data;
|
293
|
var p = Order.Data;
|
284
|
|
294
|
|
285
|
- $.each(Order.Data, function(key, index) {
|
295
|
+ $.each(Order.Data, function (key, index) {
|
286
|
p[key] = parseFloat(Order.Data[key]);
|
296
|
p[key] = parseFloat(Order.Data[key]);
|
287
|
});
|
297
|
});
|
288
|
return p.product - p.activity + p.carriage - p.juan - p.yohocoin;
|
298
|
return p.product - p.activity + p.carriage - p.juan - p.yohocoin;
|
289
|
},
|
299
|
},
|
290
|
- winShow: function(pan) {
|
300
|
+ winShow: function (pan) {
|
291
|
pan.find('dt').show();
|
301
|
pan.find('dt').show();
|
292
|
pan.find('dd').show();
|
302
|
pan.find('dd').show();
|
293
|
if (pan.attr('class').match(/(-bi-)|(-juan-)/g)) {
|
303
|
if (pan.attr('class').match(/(-bi-)|(-juan-)/g)) {
|
294
|
pan.find('dt').hide();
|
304
|
pan.find('dt').hide();
|
295
|
}
|
305
|
}
|
296
|
},
|
306
|
},
|
297
|
- winHide: function(pan) {
|
307
|
+ winHide: function (pan) {
|
298
|
pan.find('dt').show();
|
308
|
pan.find('dt').show();
|
299
|
pan.find('dd').hide();
|
309
|
pan.find('dd').hide();
|
300
|
|
310
|
|
301
|
/*if (pan.hasClass('play-juan-pan') && $('.juan-modify').length > 0) {
|
311
|
/*if (pan.hasClass('play-juan-pan') && $('.juan-modify').length > 0) {
|
302
|
- pan.find('dt').hide();
|
|
|
303
|
- }
|
|
|
304
|
-
|
|
|
305
|
- if (pan.hasClass('play-bi-pan') && $('.bi-modify').length > 0) {
|
|
|
306
|
- pan.find('dt').hide();
|
|
|
307
|
- }*/
|
312
|
+ pan.find('dt').hide();
|
|
|
313
|
+ }
|
|
|
314
|
+
|
|
|
315
|
+ if (pan.hasClass('play-bi-pan') && $('.bi-modify').length > 0) {
|
|
|
316
|
+ pan.find('dt').hide();
|
|
|
317
|
+ }*/
|
308
|
},
|
318
|
},
|
309
|
- strFixed: function(str) {
|
319
|
+ strFixed: function (str) {
|
310
|
return parseFloat(str).toFixed(2);
|
320
|
return parseFloat(str).toFixed(2);
|
311
|
}
|
321
|
}
|
312
|
},
|
322
|
},
|
|
@@ -326,12 +336,12 @@ var Order = { |
|
@@ -326,12 +336,12 @@ var Order = { |
326
|
$redEnvelopes: $('.red-envelopes'),
|
336
|
$redEnvelopes: $('.red-envelopes'),
|
327
|
$loading: $('.loading')
|
337
|
$loading: $('.loading')
|
328
|
},
|
338
|
},
|
329
|
- init: function() {
|
339
|
+ init: function () {
|
330
|
var e = this.e,
|
340
|
var e = this.e,
|
331
|
- u = Order.UI,
|
|
|
332
|
- options,
|
|
|
333
|
- c = Order.Common,
|
|
|
334
|
- envelopesVal;
|
341
|
+ u = Order.UI,
|
|
|
342
|
+ options,
|
|
|
343
|
+ c = Order.Common,
|
|
|
344
|
+ envelopesVal;
|
335
|
|
345
|
|
336
|
function getSelectData(callback) {
|
346
|
function getSelectData(callback) {
|
337
|
|
347
|
|
|
@@ -351,7 +361,7 @@ var Order = { |
|
@@ -351,7 +361,7 @@ var Order = { |
351
|
couponCode: codeVal,
|
361
|
couponCode: codeVal,
|
352
|
yohoCoin: biVal
|
362
|
yohoCoin: biVal
|
353
|
|
363
|
|
354
|
- //redEnvelopes: e.$useEnvelopesInput.length > 0 ? ~~e.$hasEnvelopes.text().substring(1) : '0'
|
364
|
+ //redEnvelopes: e.$useEnvelopesInput.length > 0 ? ~~e.$hasEnvelopes.text().substring(1) : '0'
|
355
|
};
|
365
|
};
|
356
|
|
366
|
|
357
|
if (!!redEnvelopes) {
|
367
|
if (!!redEnvelopes) {
|
|
@@ -363,13 +373,13 @@ var Order = { |
|
@@ -363,13 +373,13 @@ var Order = { |
363
|
}
|
373
|
}
|
364
|
|
374
|
|
365
|
// 选择快递
|
375
|
// 选择快递
|
366
|
- e.$selectExpress.click(function() {
|
376
|
+ e.$selectExpress.click(function () {
|
367
|
|
377
|
|
368
|
var expressId = $(this).val();
|
378
|
var expressId = $(this).val();
|
369
|
|
379
|
|
370
|
e.$loading.show();
|
380
|
e.$loading.show();
|
371
|
|
381
|
|
372
|
- getSelectData(function(d) {
|
382
|
+ getSelectData(function (d) {
|
373
|
|
383
|
|
374
|
d.deliveryWay = expressId;
|
384
|
d.deliveryWay = expressId;
|
375
|
|
385
|
|
|
@@ -377,7 +387,7 @@ var Order = { |
|
@@ -377,7 +387,7 @@ var Order = { |
377
|
type: 'POST',
|
387
|
type: 'POST',
|
378
|
url: '/cart/index/orderCompute',
|
388
|
url: '/cart/index/orderCompute',
|
379
|
data: d,
|
389
|
data: d,
|
380
|
- success: function(data) {
|
390
|
+ success: function (data) {
|
381
|
e.$loading.hide();
|
391
|
e.$loading.hide();
|
382
|
|
392
|
|
383
|
if (data.code === 200) {
|
393
|
if (data.code === 200) {
|
|
@@ -400,7 +410,7 @@ var Order = { |
|
@@ -400,7 +410,7 @@ var Order = { |
400
|
});
|
410
|
});
|
401
|
|
411
|
|
402
|
//点击 优惠卷支付 确认按钮
|
412
|
//点击 优惠卷支付 确认按钮
|
403
|
- e.$juanok.click(function() {
|
413
|
+ e.$juanok.click(function () {
|
404
|
|
414
|
|
405
|
var pan = $(this).parents('dl.pan');
|
415
|
var pan = $(this).parents('dl.pan');
|
406
|
|
416
|
|
|
@@ -408,7 +418,7 @@ var Order = { |
|
@@ -408,7 +418,7 @@ var Order = { |
408
|
|
418
|
|
409
|
$('.play-juan').addClass('is-select');
|
419
|
$('.play-juan').addClass('is-select');
|
410
|
|
420
|
|
411
|
- getSelectData(function(d) {
|
421
|
+ getSelectData(function (d) {
|
412
|
|
422
|
|
413
|
var code = d.couponCode;
|
423
|
var code = d.couponCode;
|
414
|
|
424
|
|
|
@@ -425,7 +435,7 @@ var Order = { |
|
@@ -425,7 +435,7 @@ var Order = { |
425
|
type: 'POST',
|
435
|
type: 'POST',
|
426
|
url: '/cart/index/orderCompute',
|
436
|
url: '/cart/index/orderCompute',
|
427
|
data: d,
|
437
|
data: d,
|
428
|
- success: function(data) {
|
438
|
+ success: function (data) {
|
429
|
|
439
|
|
430
|
e.$loading.hide();
|
440
|
e.$loading.hide();
|
431
|
|
441
|
|
|
@@ -455,7 +465,7 @@ var Order = { |
|
@@ -455,7 +465,7 @@ var Order = { |
455
|
});
|
465
|
});
|
456
|
|
466
|
|
457
|
// 优惠券修改
|
467
|
// 优惠券修改
|
458
|
- $(document).on('click', '.juan-modify', function() {
|
468
|
+ $(document).on('click', '.juan-modify', function () {
|
459
|
|
469
|
|
460
|
|
470
|
|
461
|
var $pan = $('.play-juan-pan');
|
471
|
var $pan = $('.play-juan-pan');
|
|
@@ -463,14 +473,14 @@ var Order = { |
|
@@ -463,14 +473,14 @@ var Order = { |
463
|
c.winShow($pan);
|
473
|
c.winShow($pan);
|
464
|
});
|
474
|
});
|
465
|
|
475
|
|
466
|
- e.$biok.click(function() {
|
476
|
+ e.$biok.click(function () {
|
467
|
|
477
|
|
468
|
var pan = $(this).parents('dl.pan');
|
478
|
var pan = $(this).parents('dl.pan');
|
469
|
var juanText;
|
479
|
var juanText;
|
470
|
|
480
|
|
471
|
$('#biprice').addClass('is-select');
|
481
|
$('#biprice').addClass('is-select');
|
472
|
|
482
|
|
473
|
- getSelectData(function(d) {
|
483
|
+ getSelectData(function (d) {
|
474
|
|
484
|
|
475
|
if (!!d.couponCode) {
|
485
|
if (!!d.couponCode) {
|
476
|
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
|
486
|
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
|
|
@@ -493,7 +503,7 @@ var Order = { |
|
@@ -493,7 +503,7 @@ var Order = { |
493
|
type: 'POST',
|
503
|
type: 'POST',
|
494
|
url: '/cart/index/orderCompute',
|
504
|
url: '/cart/index/orderCompute',
|
495
|
data: d,
|
505
|
data: d,
|
496
|
- success: function(data) {
|
506
|
+ success: function (data) {
|
497
|
|
507
|
|
498
|
e.$loading.hide();
|
508
|
e.$loading.hide();
|
499
|
|
509
|
|
|
@@ -518,7 +528,7 @@ var Order = { |
|
@@ -518,7 +528,7 @@ var Order = { |
518
|
});
|
528
|
});
|
519
|
|
529
|
|
520
|
// 修改yoho币
|
530
|
// 修改yoho币
|
521
|
- $(document).on('click', '.bi-modify', function() {
|
531
|
+ $(document).on('click', '.bi-modify', function () {
|
522
|
|
532
|
|
523
|
|
533
|
|
524
|
var $pan = $('.play-bi-pan');
|
534
|
var $pan = $('.play-bi-pan');
|
|
@@ -526,7 +536,7 @@ var Order = { |
|
@@ -526,7 +536,7 @@ var Order = { |
526
|
c.winShow($pan);
|
536
|
c.winShow($pan);
|
527
|
});
|
537
|
});
|
528
|
|
538
|
|
529
|
- e.$bp.keyup(function() {
|
539
|
+ e.$bp.keyup(function () {
|
530
|
|
540
|
|
531
|
var val = $(this).val();
|
541
|
var val = $(this).val();
|
532
|
|
542
|
|
|
@@ -541,7 +551,7 @@ var Order = { |
|
@@ -541,7 +551,7 @@ var Order = { |
541
|
});
|
551
|
});
|
542
|
|
552
|
|
543
|
// 取消yoho 币
|
553
|
// 取消yoho 币
|
544
|
- $('.cancel-bi').click(function() {
|
554
|
+ $('.cancel-bi').click(function () {
|
545
|
|
555
|
|
546
|
|
556
|
|
547
|
var $pan = $('.play-bi-pan');
|
557
|
var $pan = $('.play-bi-pan');
|
|
@@ -553,7 +563,7 @@ var Order = { |
|
@@ -553,7 +563,7 @@ var Order = { |
553
|
|
563
|
|
554
|
e.$loading.show();
|
564
|
e.$loading.show();
|
555
|
|
565
|
|
556
|
- getSelectData(function(d) {
|
566
|
+ getSelectData(function (d) {
|
557
|
|
567
|
|
558
|
d.yohoCoin = 0;
|
568
|
d.yohoCoin = 0;
|
559
|
|
569
|
|
|
@@ -565,7 +575,7 @@ var Order = { |
|
@@ -565,7 +575,7 @@ var Order = { |
565
|
type: 'POST',
|
575
|
type: 'POST',
|
566
|
url: '/cart/index/orderCompute',
|
576
|
url: '/cart/index/orderCompute',
|
567
|
data: d,
|
577
|
data: d,
|
568
|
- success: function(data) {
|
578
|
+ success: function (data) {
|
569
|
|
579
|
|
570
|
e.$loading.hide();
|
580
|
e.$loading.hide();
|
571
|
|
581
|
|
|
@@ -600,7 +610,7 @@ var Order = { |
|
@@ -600,7 +610,7 @@ var Order = { |
600
|
});
|
610
|
});
|
601
|
|
611
|
|
602
|
// 取消优惠券
|
612
|
// 取消优惠券
|
603
|
- $('.cancel-code').click(function() {
|
613
|
+ $('.cancel-code').click(function () {
|
604
|
|
614
|
|
605
|
var $pan = $('.play-juan-pan');
|
615
|
var $pan = $('.play-juan-pan');
|
606
|
|
616
|
|
|
@@ -608,7 +618,7 @@ var Order = { |
|
@@ -608,7 +618,7 @@ var Order = { |
608
|
|
618
|
|
609
|
e.$loading.show();
|
619
|
e.$loading.show();
|
610
|
|
620
|
|
611
|
- getSelectData(function(d) {
|
621
|
+ getSelectData(function (d) {
|
612
|
|
622
|
|
613
|
d.couponCode = '';
|
623
|
d.couponCode = '';
|
614
|
|
624
|
|
|
@@ -616,7 +626,7 @@ var Order = { |
|
@@ -616,7 +626,7 @@ var Order = { |
616
|
type: 'POST',
|
626
|
type: 'POST',
|
617
|
url: '/cart/index/orderCompute',
|
627
|
url: '/cart/index/orderCompute',
|
618
|
data: d,
|
628
|
data: d,
|
619
|
- success: function(data) {
|
629
|
+ success: function (data) {
|
620
|
|
630
|
|
621
|
e.$loading.hide();
|
631
|
e.$loading.hide();
|
622
|
|
632
|
|
|
@@ -627,7 +637,7 @@ var Order = { |
|
@@ -627,7 +637,7 @@ var Order = { |
627
|
$('.play-juan').removeClass('is-select');
|
637
|
$('.play-juan').removeClass('is-select');
|
628
|
|
638
|
|
629
|
$('#juancode').val('')
|
639
|
$('#juancode').val('')
|
630
|
- .siblings('input[name="juangroup"]').attr('checked', 'checked');
|
640
|
+ .siblings('input[name="juangroup"]').attr('checked', 'checked');
|
631
|
|
641
|
|
632
|
// $('.use-envelopes input').attr('checked', 'checked');
|
642
|
// $('.use-envelopes input').attr('checked', 'checked');
|
633
|
// $('.red-envelopes').addClass('active');
|
643
|
// $('.red-envelopes').addClass('active');
|
|
@@ -649,16 +659,16 @@ var Order = { |
|
@@ -649,16 +659,16 @@ var Order = { |
649
|
// 红包
|
659
|
// 红包
|
650
|
envelopesVal = e.$useEnvelopesInput.data('all') - e.$useEnvelopesInput.data('use'); // 剩余的红包
|
660
|
envelopesVal = e.$useEnvelopesInput.data('all') - e.$useEnvelopesInput.data('use'); // 剩余的红包
|
651
|
e.$hasEnvelopes.text('¥' + envelopesVal.toFixed(2));
|
661
|
e.$hasEnvelopes.text('¥' + envelopesVal.toFixed(2));
|
652
|
- e.$useEnvelopes.find('input').click(function() {
|
662
|
+ e.$useEnvelopes.find('input').click(function () {
|
653
|
|
663
|
|
654
|
var $this = $(this),
|
664
|
var $this = $(this),
|
655
|
- juanText;
|
665
|
+ juanText;
|
656
|
|
666
|
|
657
|
e.$loading.show();
|
667
|
e.$loading.show();
|
658
|
|
668
|
|
659
|
$this.attr('disabled', 'disabled');
|
669
|
$this.attr('disabled', 'disabled');
|
660
|
|
670
|
|
661
|
- getSelectData(function(d) {
|
671
|
+ getSelectData(function (d) {
|
662
|
|
672
|
|
663
|
if (!!$this.attr('checked')) {
|
673
|
if (!!$this.attr('checked')) {
|
664
|
|
674
|
|
|
@@ -676,7 +686,7 @@ var Order = { |
|
@@ -676,7 +686,7 @@ var Order = { |
676
|
type: 'POST',
|
686
|
type: 'POST',
|
677
|
url: '/cart/index/orderCompute',
|
687
|
url: '/cart/index/orderCompute',
|
678
|
data: d,
|
688
|
data: d,
|
679
|
- success: function(data) {
|
689
|
+ success: function (data) {
|
680
|
e.$loading.hide();
|
690
|
e.$loading.hide();
|
681
|
|
691
|
|
682
|
if (data.code === 200) {
|
692
|
if (data.code === 200) {
|
|
@@ -709,7 +719,7 @@ var Order = { |
|
@@ -709,7 +719,7 @@ var Order = { |
709
|
|
719
|
|
710
|
var $this = $obj;
|
720
|
var $this = $obj;
|
711
|
|
721
|
|
712
|
- $this.keyup(function() {
|
722
|
+ $this.keyup(function () {
|
713
|
|
723
|
|
714
|
if ($this.val().length > len) {
|
724
|
if ($this.val().length > len) {
|
715
|
|
725
|
|
|
@@ -740,27 +750,27 @@ address.saveAddress(); |
|
@@ -740,27 +750,27 @@ address.saveAddress(); |
740
|
|
750
|
|
741
|
//不同订单包裹提示
|
751
|
//不同订单包裹提示
|
742
|
|
752
|
|
743
|
-$('.why').click(function() {
|
753
|
+$('.why').click(function () {
|
744
|
$('#differentBag').show();
|
754
|
$('#differentBag').show();
|
745
|
return false;
|
755
|
return false;
|
746
|
|
756
|
|
747
|
});
|
757
|
});
|
748
|
-$('#differentBag').click(function() {
|
758
|
+$('#differentBag').click(function () {
|
749
|
return false;
|
759
|
return false;
|
750
|
});
|
760
|
});
|
751
|
-$(document).click(function() {
|
761
|
+$(document).click(function () {
|
752
|
$('#differentBag').hide();
|
762
|
$('#differentBag').hide();
|
753
|
});
|
763
|
});
|
754
|
|
764
|
|
755
|
//订单包裹左右切换
|
765
|
//订单包裹左右切换
|
756
|
function lunBo($pre, $next, $ul, $iWidth) {
|
766
|
function lunBo($pre, $next, $ul, $iWidth) {
|
757
|
var i = 1,
|
767
|
var i = 1,
|
758
|
- j = 1;
|
768
|
+ j = 1;
|
759
|
|
769
|
|
760
|
var iSpeed = 0,
|
770
|
var iSpeed = 0,
|
761
|
- isMoving = false;
|
771
|
+ isMoving = false;
|
762
|
|
772
|
|
763
|
- $pre.click(function() {
|
773
|
+ $pre.click(function () {
|
764
|
if (isMoving) {
|
774
|
if (isMoving) {
|
765
|
return;
|
775
|
return;
|
766
|
}
|
776
|
}
|
|
@@ -774,11 +784,11 @@ function lunBo($pre, $next, $ul, $iWidth) { |
|
@@ -774,11 +784,11 @@ function lunBo($pre, $next, $ul, $iWidth) { |
774
|
}
|
784
|
}
|
775
|
$ul.stop().animate({
|
785
|
$ul.stop().animate({
|
776
|
left: iSpeed
|
786
|
left: iSpeed
|
777
|
- }, 300, function() {
|
787
|
+ }, 300, function () {
|
778
|
isMoving = false;
|
788
|
isMoving = false;
|
779
|
});
|
789
|
});
|
780
|
});
|
790
|
});
|
781
|
- $next.click(function() {
|
791
|
+ $next.click(function () {
|
782
|
var $largeLeft = $ul.parent().width() - $ul.width() + 'px';
|
792
|
var $largeLeft = $ul.parent().width() - $ul.width() + 'px';
|
783
|
|
793
|
|
784
|
if (isMoving) {
|
794
|
if (isMoving) {
|
|
@@ -794,7 +804,7 @@ function lunBo($pre, $next, $ul, $iWidth) { |
|
@@ -794,7 +804,7 @@ function lunBo($pre, $next, $ul, $iWidth) { |
794
|
|
804
|
|
795
|
$ul.stop().animate({
|
805
|
$ul.stop().animate({
|
796
|
left: iSpeed
|
806
|
left: iSpeed
|
797
|
- }, 300, function() {
|
807
|
+ }, 300, function () {
|
798
|
isMoving = false;
|
808
|
isMoving = false;
|
799
|
});
|
809
|
});
|
800
|
});
|
810
|
});
|
|
@@ -803,7 +813,7 @@ function lunBo($pre, $next, $ul, $iWidth) { |
|
@@ -803,7 +813,7 @@ function lunBo($pre, $next, $ul, $iWidth) { |
803
|
|
813
|
|
804
|
|
814
|
|
805
|
//订单分类
|
815
|
//订单分类
|
806
|
-$('.bag').find('ul').each(function() {
|
816
|
+$('.bag').find('ul').each(function () {
|
807
|
var $pre = $(this).parent().parent().find('.pre');
|
817
|
var $pre = $(this).parent().parent().find('.pre');
|
808
|
var $next = $(this).parent().parent().find('.next');
|
818
|
var $next = $(this).parent().parent().find('.next');
|
809
|
|
819
|
|