|
@@ -30,6 +30,35 @@ function dispacthTapEvt(e) { |
|
@@ -30,6 +30,35 @@ function dispacthTapEvt(e) { |
30
|
$cur.addClass('chosed');
|
30
|
$cur.addClass('chosed');
|
31
|
}
|
31
|
}
|
32
|
|
32
|
|
|
|
33
|
+dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
|
|
|
34
|
+dispatchModeHammer.on('tap', dispacthTapEvt);
|
|
|
35
|
+
|
|
|
36
|
+dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
|
|
|
37
|
+dispatchTimeHammer.on('tap', dispacthTapEvt);
|
|
|
38
|
+
|
|
|
39
|
+$('.checkbox').on('touchstart', function() {
|
|
|
40
|
+ var $this = $(this);
|
|
|
41
|
+
|
|
|
42
|
+ if ($this.hasClass('icon-cb-checked')) {
|
|
|
43
|
+ $this.removeClass('icon-cb-checked').addClass('icon-checkbox');
|
|
|
44
|
+ return;
|
|
|
45
|
+ }
|
|
|
46
|
+ if ($this.hasClass('icon-checkbox')) {
|
|
|
47
|
+ $this.removeClass('icon-checkbox').addClass('icon-cb-checked');
|
|
|
48
|
+ }
|
|
|
49
|
+});
|
|
|
50
|
+
|
|
|
51
|
+$('.invoice').on('touchend', '.checkbox', function() {
|
|
|
52
|
+ var $this = $(this);
|
|
|
53
|
+
|
|
|
54
|
+ if ($this.hasClass('icon-cb-checked')) {
|
|
|
55
|
+ $('.invoice').addClass('focus');
|
|
|
56
|
+ }
|
|
|
57
|
+ if ($this.hasClass('icon-checkbox')) {
|
|
|
58
|
+ $('.invoice').removeClass('focus');
|
|
|
59
|
+ }
|
|
|
60
|
+});
|
|
|
61
|
+
|
33
|
function orderCompute() {
|
62
|
function orderCompute() {
|
34
|
$.ajax({
|
63
|
$.ajax({
|
35
|
method: 'POST',
|
64
|
method: 'POST',
|
|
@@ -62,34 +91,29 @@ function orderCompute() { |
|
@@ -62,34 +91,29 @@ function orderCompute() { |
62
|
});
|
91
|
});
|
63
|
}
|
92
|
}
|
64
|
|
93
|
|
65
|
-dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
|
|
|
66
|
-dispatchModeHammer.on('tap', dispacthTapEvt);
|
|
|
67
|
-
|
|
|
68
|
-dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
|
|
|
69
|
-dispatchTimeHammer.on('tap', dispacthTapEvt);
|
|
|
70
|
-
|
|
|
71
|
-$('.checkbox').on('touchstart', function() {
|
|
|
72
|
- var $this = $(this);
|
|
|
73
|
-
|
|
|
74
|
- if ($this.hasClass('icon-cb-checked')) {
|
|
|
75
|
- $this.removeClass('icon-cb-checked').addClass('icon-checkbox');
|
|
|
76
|
- return;
|
|
|
77
|
- }
|
|
|
78
|
- if ($this.hasClass('icon-checkbox')) {
|
|
|
79
|
- $this.removeClass('icon-checkbox').addClass('icon-cb-checked');
|
|
|
80
|
- }
|
|
|
81
|
-});
|
|
|
82
|
-
|
|
|
83
|
-$('.invoice').on('touchend', '.checkbox', function() {
|
|
|
84
|
- var $this = $(this);
|
|
|
85
|
-
|
|
|
86
|
- if ($this.hasClass('icon-cb-checked')) {
|
|
|
87
|
- $('.invoice').addClass('focus');
|
|
|
88
|
- }
|
|
|
89
|
- if ($this.hasClass('icon-checkbox')) {
|
|
|
90
|
- $('.invoice').removeClass('focus');
|
|
|
91
|
- }
|
|
|
92
|
-});
|
94
|
+function submitOrder() {
|
|
|
95
|
+ $.ajax({
|
|
|
96
|
+ method: 'POST',
|
|
|
97
|
+ url: '/shoppingCart/orderSub',
|
|
|
98
|
+ data: {
|
|
|
99
|
+ addressId: orderInfo('addressId'),
|
|
|
100
|
+ cartType: orderInfo('cartType'),
|
|
|
101
|
+ deliveryId: orderInfo('deliveryId'),
|
|
|
102
|
+ deliveryTimeId: orderInfo('deliveryTimeId'),
|
|
|
103
|
+ invoiceText: orderInfo('invoiceText'),
|
|
|
104
|
+ invoiceType: orderInfo('invoiceType'),
|
|
|
105
|
+ msg: orderInfo('msg'),
|
|
|
106
|
+ paymentTypeId: orderInfo('paymentTypeId'),
|
|
|
107
|
+ paymentType: orderInfo('paymentType'), //支付方式
|
|
|
108
|
+ couponCode: orderInfo('couponCode'),
|
|
|
109
|
+ yohoCoin: orderInfo('yohoCoin')
|
|
|
110
|
+ }
|
|
|
111
|
+ }).then(function(res) {
|
|
|
112
|
+ console.log(res);
|
|
|
113
|
+ }).fail(function() {
|
|
|
114
|
+ tip.show('网络出错');
|
|
|
115
|
+ });
|
|
|
116
|
+}
|
93
|
|
117
|
|
94
|
// 界面点击,状态存 cookie
|
118
|
// 界面点击,状态存 cookie
|
95
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
119
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
|
@@ -132,4 +156,6 @@ $('#msg').find('input').on('blur', function() { |
|
@@ -132,4 +156,6 @@ $('#msg').find('input').on('blur', function() { |
132
|
|
156
|
|
133
|
$('.pay-mode').on('click', 'li', function() {
|
157
|
$('.pay-mode').on('click', 'li', function() {
|
134
|
orderInfo('paymentTypeId', $(this).data('pay-id'));
|
158
|
orderInfo('paymentTypeId', $(this).data('pay-id'));
|
|
|
159
|
+ orderInfo('paymentType', $(this).data('pay-type'));
|
|
|
160
|
+ submitOrder();
|
135
|
}); |
161
|
}); |