...
|
...
|
@@ -26,6 +26,8 @@ var inAjax = false; |
|
|
|
|
|
var loading = require('../plugin/loading');
|
|
|
|
|
|
var dialog = require('./dialog');
|
|
|
|
|
|
var orderHammer;
|
|
|
|
|
|
//加载订单
|
...
|
...
|
@@ -110,36 +112,52 @@ orderHammer.on('tap', function(e) { |
|
|
if ($cur.closest('.del').length > 0) {
|
|
|
|
|
|
//Order delete
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/delOrder',
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
//删除订单页面刷新
|
|
|
location.href = location.href;
|
|
|
}
|
|
|
dialog.showDialog({
|
|
|
dialogText: '确定删除订单吗?',
|
|
|
hasFooter: {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '确定'
|
|
|
}
|
|
|
}, function() {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/delOrder',
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
//删除订单页面刷新
|
|
|
location.href = location.href;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else if ($cur.closest('.cancel').length > 0) {
|
|
|
|
|
|
//Order cancel
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/cancelOrder',
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
//取消订单页面刷新
|
|
|
location.href = location.href;
|
|
|
}
|
|
|
dialog.showDialog({
|
|
|
dialogText: '确定取消订单吗?',
|
|
|
hasFooter: {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '确定'
|
|
|
}
|
|
|
}, function() {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/cancelOrder',
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
//取消订单页面刷新
|
|
|
location.href = location.href;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
|
...
|
...
|
|