|
|
@ -198,7 +198,20 @@ Page({ |
|
|
'goodsInfo.quantity': 1 |
|
|
'goodsInfo.quantity': 1 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 不再自动设置出发地为商品所在地
|
|
|
// 设置出发地为商品所在地
|
|
|
|
|
|
const regionToUse = goodsData.fullRegion || goodsData.region; |
|
|
|
|
|
if (regionToUse) { |
|
|
|
|
|
console.log('商品所在地原始地址:', regionToUse); |
|
|
|
|
|
const regionInfo = this.parseRegion(regionToUse); |
|
|
|
|
|
console.log('解析后的地址:', regionInfo); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
'origin.province': regionInfo.province || '', |
|
|
|
|
|
'origin.city': regionInfo.city || '', |
|
|
|
|
|
'origin.district': regionInfo.district || '', |
|
|
|
|
|
'origin.detail': regionInfo.detail || '' |
|
|
|
|
|
}); |
|
|
|
|
|
console.log('已设置出发地为商品所在地:', regionInfo); |
|
|
|
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.error('解析货源信息失败:', e); |
|
|
console.error('解析货源信息失败:', e); |
|
|
} |
|
|
} |
|
|
@ -234,7 +247,19 @@ Page({ |
|
|
selectedGoods: goodsItem |
|
|
selectedGoods: goodsItem |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 不再自动设置出发地为商品所在地
|
|
|
// 设置出发地为商品所在地
|
|
|
|
|
|
if (goodsItem.region) { |
|
|
|
|
|
console.log('商品所在地原始地址:', goodsItem.region); |
|
|
|
|
|
const regionInfo = this.parseRegion(goodsItem.region); |
|
|
|
|
|
console.log('解析后的地址:', regionInfo); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
'origin.province': regionInfo.province || '', |
|
|
|
|
|
'origin.city': regionInfo.city || '', |
|
|
|
|
|
'origin.district': regionInfo.district || '', |
|
|
|
|
|
'origin.detail': regionInfo.detail || '' |
|
|
|
|
|
}); |
|
|
|
|
|
console.log('已设置出发地为商品所在地:', regionInfo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 设置货物重量(如果有)
|
|
|
// 设置货物重量(如果有)
|
|
|
if (goodsItem.grossWeight) { |
|
|
if (goodsItem.grossWeight) { |
|
|
|