Commit 1332a74ce17d180a6da7a61c307bc3729a3815ec

Authored by lxf
2 parents b8fa6ad8 a0868f00

Merge branch 'master' into 货源管理

pages/global/search-address.vue
@@ -12,12 +12,12 @@ @@ -12,12 +12,12 @@
12 <template v-if="list.length === 0 && hisList.length > 0"> 12 <template v-if="list.length === 0 && hisList.length > 0">
13 <view class="search-history">历史地址</view> 13 <view class="search-history">历史地址</view>
14 <template v-for="(item, index) in hisList"> 14 <template v-for="(item, index) in hisList">
15 - <zui-cell :key="index" :title="item.address" :label="`${item.cityName}${item.areaName}`" @click="onSelect(item, index)"></zui-cell> 15 + <zui-cell :key="index" :title="item.address" :label="`${item.cityName}${item.areaName}`" @click="onSelect(item)"></zui-cell>
16 </template> 16 </template>
17 </template> 17 </template>
18 <List ref="list" v-model="list" :api="searchAPI"> 18 <List ref="list" v-model="list" :api="searchAPI">
19 <template v-for="(item, index) in list"> 19 <template v-for="(item, index) in list">
20 - <zui-cell :key="index" :title="item.name" :label="`${item.cityName}${item.areaName}${item.address}`" @click="onSelect(item, index)"></zui-cell> 20 + <zui-cell :key="index" :title="item.name" :label="`${item.cityName}${item.areaName}${item.address}`" @click="onSelect(item, true)"></zui-cell>
21 </template> 21 </template>
22 <template #empty> 22 <template #empty>
23 <view v-if="hisList.length > 0"></view> 23 <view v-if="hisList.length > 0"></view>
@@ -109,7 +109,13 @@ export default { @@ -109,7 +109,13 @@ export default {
109 }); 109 });
110 }); 110 });
111 }, 111 },
112 - onSelect(item) { 112 + onSelect(item, append = false) {
  113 + if (append) {
  114 + item = {
  115 + ...item,
  116 + address: (item.provinceName || '') + (item.cityName || '') + (item.areaName || '') + item.address,
  117 + };
  118 + }
113 uni.$emit('select-detail', item); 119 uni.$emit('select-detail', item);
114 uni.navigateBack(); 120 uni.navigateBack();
115 }, 121 },
@@ -139,7 +145,7 @@ export default { @@ -139,7 +145,7 @@ export default {
139 areaName: addressComponent.district, 145 areaName: addressComponent.district,
140 address: addressInfo.address, 146 address: addressInfo.address,
141 }; 147 };
142 - this.onSelect(location); 148 + this.onSelect(location, true);
143 }, 149 },
144 }); 150 });
145 // let location = { 151 // let location = {
pages/order/add.vue
@@ -465,7 +465,7 @@ export default { @@ -465,7 +465,7 @@ export default {
465 cityName: location.cityName, 465 cityName: location.cityName,
466 areaCode: location.areaCode, 466 areaCode: location.areaCode,
467 areaName: location.areaName, 467 areaName: location.areaName,
468 - address: (location.provinceName || '') + (location.cityName || '') + (location.areaName || '') + (location.address || ''), 468 + address: location.address || '',
469 }; 469 };
470 let waypoints = index === 0 ? [station, this.form.waypoints[1]] : [this.form.waypoints[0], station]; 470 let waypoints = index === 0 ? [station, this.form.waypoints[1]] : [this.form.waypoints[0], station];
471 this.form = { 471 this.form = {