Commit 92311869 by chenwq

fix(购物车): 修复地址显示不完整和空值处理问题

修改购物车组件中地址显示逻辑,现在会完整显示省市区和详细地址
在地址组件中添加对空值的处理,防止未选择区域时出现undefined
1 parent a18de181
......@@ -139,8 +139,8 @@ export default {
this.editForm.provinceName = nodesInfo[0].pathNodes[0].label
this.editForm.cityId = nodesInfo[0].pathNodes[1].value
this.editForm.cityName = nodesInfo[0].pathNodes[1].label
this.editForm.areaId = nodesInfo[0].pathNodes[2].value
this.editForm.areaName = nodesInfo[0].pathNodes[2].label
this.editForm.areaId = nodesInfo[0].pathNodes[2]?.value || ''
this.editForm.areaName = nodesInfo[0].pathNodes[2]?.label || ''
},
submit() {
console.log(this.editForm.provincesAndCities)
......
......@@ -102,7 +102,7 @@
</span>
<span class="address">
收货地址:
<span class="label">{{ addressInfo.contactAddress }}</span>
<span class="label">{{ addressInfo.provinceName || '' }}{{ addressInfo.cityName || '' }}{{ addressInfo.areaName || '' }}{{ addressInfo.contactAddress }}</span>
</span>
</div>
<!-- <div class="info">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!