Showing
1 changed file
with
17 additions
and
1 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; |
-
Please register or login to post a comment