地图订单修改
This commit is contained in:
@@ -571,24 +571,21 @@ Page({
|
||||
// 获取仓库信息
|
||||
const warehouse = warehouses[warehouseIndex];
|
||||
|
||||
// 模拟终点坐标(实际应用中应该通过地图选择或搜索获取)
|
||||
// 从已有仓库中获取一个坐标作为参考点
|
||||
const referenceWarehouse = this.data.warehouses[0];
|
||||
const endPoint = {
|
||||
name: endName,
|
||||
longitude: referenceWarehouse.address ? 102.715 + (Math.random() - 0.5) * 0.1 : 102.715,
|
||||
latitude: referenceWarehouse.address ? 25.045 + (Math.random() - 0.5) * 0.1 : 25.045
|
||||
};
|
||||
|
||||
// 创建订单数据
|
||||
const newOrder: Omit<Order, 'id' | 'createTime'> = {
|
||||
startPoint: {
|
||||
id: warehouse.id,
|
||||
name: warehouse.name,
|
||||
longitude: 102.715, // 临时使用固定坐标
|
||||
latitude: 25.045 // 临时使用固定坐标
|
||||
longitude: warehouse.longitude || 0,
|
||||
latitude: warehouse.latitude || 0
|
||||
},
|
||||
endPoint: {
|
||||
name: endName,
|
||||
// 后端服务器应该根据地址名称进行地理编码
|
||||
// 这里只提供地址名称,由后端处理坐标获取
|
||||
longitude: 0,
|
||||
latitude: 0
|
||||
},
|
||||
endPoint,
|
||||
status: 'pending',
|
||||
goodsType,
|
||||
goodsWeight
|
||||
|
||||
Reference in New Issue
Block a user