Showing
1 changed file
with
18 additions
and
2 deletions
@@ -180,8 +180,24 @@ $('.me-orders, .order-detail').on('click', '.cancel-order', function(e) { | @@ -180,8 +180,24 @@ $('.me-orders, .order-detail').on('click', '.cancel-order', function(e) { | ||
180 | active = editOrder($(this).closest('.order, .order-detail').data('id')) | 180 | active = editOrder($(this).closest('.order, .order-detail').data('id')) |
181 | active.show(); | 181 | active.show(); |
182 | newAddress(0); | 182 | newAddress(0); |
183 | +}).on('click', '.rebuy', function() { | ||
184 | + var id = $(this).closest('.order, .order-detail').data('id'); | ||
185 | + buyAgain(id); | ||
183 | }); | 186 | }); |
184 | - | 187 | +//再次购买 |
188 | +function buyAgain(id){ | ||
189 | + $.ajax({ | ||
190 | + type: 'post', | ||
191 | + url: '/home/orders/reAdd', | ||
192 | + data: {orderCode: id} | ||
193 | + }).then(function(d) { | ||
194 | + if (d.code === 200) { | ||
195 | + location.href = ''; | ||
196 | + } else { | ||
197 | + new dialog.Alert(d.message).show(); | ||
198 | + } | ||
199 | + }) | ||
200 | +} | ||
185 | // 地址操作 | 201 | // 地址操作 |
186 | function newAddress(id) { | 202 | function newAddress(id) { |
187 | var code, codeId; | 203 | var code, codeId; |
@@ -403,7 +419,7 @@ function saveAddress(id) { | @@ -403,7 +419,7 @@ function saveAddress(id) { | ||
403 | 419 | ||
404 | $.ajax({ | 420 | $.ajax({ |
405 | type: 'post', | 421 | type: 'post', |
406 | - url: '/home/orders/modifyAddress', | 422 | + url: '/home/orders/modifyAddress', |
407 | data: postData | 423 | data: postData |
408 | }).then(function(d) { | 424 | }).then(function(d) { |
409 | if (d.code === 200) { | 425 | if (d.code === 200) { |
-
Please register or login to post a comment