地图订单修改

This commit is contained in:
2025-12-10 22:49:22 +08:00
parent 271b88232c
commit 528e4757dd
17 changed files with 325 additions and 183 deletions

View File

@@ -260,8 +260,10 @@ Page({
},
endPoint: {
name: endName,
longitude: 102.715 + (Math.random() - 0.5) * 0.1,
latitude: 25.045 + (Math.random() - 0.5) * 0.1
// 后端服务器应该根据地址名称进行地理编码
// 这里只提供地址名称,由后端处理坐标获取
longitude: 0,
latitude: 0
},
status: 'pending',
goodsType,
@@ -316,21 +318,17 @@ Page({
success: (res) => {
if (res.confirm) {
// 调用删除订单接口
// orderService.deleteOrder(orderId).then(() => {
// this.showSuccess('订单删除成功');
// this.refreshData();
// }).catch(error => {
// console.error('删除订单失败:', error);
// this.showError('删除订单失败');
// });
// 暂时使用模拟删除
const orders = this.data.orders.filter(order => order.id !== orderId);
this.setData({
orders
orderService.deleteOrder(orderId).then((result) => {
if (result.success) {
this.showSuccess('订单删除成功');
this.refreshData();
} else {
this.showError(result.message || '删除失败');
}
}).catch(error => {
console.error('删除订单失败:', error);
this.showError('删除订单失败');
});
this.filterOrders();
this.showSuccess('订单删除成功');
}
}
});
@@ -426,6 +424,11 @@ Page({
});
},
// 阻止事件冒泡
stopPropagation(e: any) {
// 阻止事件冒泡,不执行任何操作
},
// 返回上一页
goBack() {
wx.navigateBack();