|
@@ -98,8 +98,8 @@ function submitOrder() { |
|
@@ -98,8 +98,8 @@ function submitOrder() { |
98
|
data: {
|
98
|
data: {
|
99
|
addressId: orderInfo('addressId'),
|
99
|
addressId: orderInfo('addressId'),
|
100
|
cartType: orderInfo('cartType'),
|
100
|
cartType: orderInfo('cartType'),
|
101
|
- deliveryId: orderInfo('deliveryId'),
|
|
|
102
|
- deliveryTimeId: orderInfo('deliveryTimeId'),
|
101
|
+ deliveryId: orderInfo('deliveryId') || 1,
|
|
|
102
|
+ deliveryTimeId: orderInfo('deliveryTimeId') || 1,
|
103
|
invoiceText: orderInfo('invoiceText'),
|
103
|
invoiceText: orderInfo('invoiceText'),
|
104
|
invoiceType: orderInfo('invoiceType'),
|
104
|
invoiceType: orderInfo('invoiceType'),
|
105
|
msg: orderInfo('msg'),
|
105
|
msg: orderInfo('msg'),
|
|
@@ -109,13 +109,24 @@ function submitOrder() { |
|
@@ -109,13 +109,24 @@ function submitOrder() { |
109
|
yohoCoin: orderInfo('yohoCoin')
|
109
|
yohoCoin: orderInfo('yohoCoin')
|
110
|
}
|
110
|
}
|
111
|
}).then(function(res) {
|
111
|
}).then(function(res) {
|
112
|
- console.log(res);
|
112
|
+ if (!res) {
|
|
|
113
|
+ tip.show('网络出错');
|
|
|
114
|
+ }
|
|
|
115
|
+ if (res.code !== 200) {
|
|
|
116
|
+ tip.show(res.message || '网络出错');
|
|
|
117
|
+ } else {
|
|
|
118
|
+ console.log(1);
|
|
|
119
|
+ }
|
113
|
}).fail(function() {
|
120
|
}).fail(function() {
|
114
|
tip.show('网络出错');
|
121
|
tip.show('网络出错');
|
115
|
});
|
122
|
});
|
116
|
}
|
123
|
}
|
117
|
|
124
|
|
118
|
// 界面点击,状态存 cookie
|
125
|
// 界面点击,状态存 cookie
|
|
|
126
|
+if (!orderInfo('addressId')) {
|
|
|
127
|
+ orderInfo('addressId', $('.address-wrap').data('address-id'));
|
|
|
128
|
+}
|
|
|
129
|
+
|
119
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
130
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
120
|
orderInfo('deliveryId', $(this).data('id'));
|
131
|
orderInfo('deliveryId', $(this).data('id'));
|
121
|
orderCompute();
|
132
|
orderCompute();
|