readd-order.js
496 Bytes
var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
module.exports = function(code) {
$.ajax({
url: '/me/reAdd',
data: {
orderCode: code
}
}).done(function(result) {
if (result.code === 200) {
location.href = '/shopping/cart';
} else {
new _alert(result.message).show();
}
}).fail(function(err) {
console.log(err);
new _alert('出错了!').show();
});
};