Commit 6107e0550a6aabcbfcba5db5c88cc861a126986a

Authored by guzijian
1 parent 4d0f0f59

fix: 修复新增地址时地址信息显示不全问题

garbage-removal/src/pages/home/address/addSite.vue
@@ -2,20 +2,20 @@ @@ -2,20 +2,20 @@
2 <view class="wrap"> 2 <view class="wrap">
3 <view class="wrap-from-container"> 3 <view class="wrap-from-container">
4 <city-select v-model="cityPikerShowFlag" @city-change="handleCityChange"></city-select> 4 <city-select v-model="cityPikerShowFlag" @city-change="handleCityChange"></city-select>
5 - <u--form :labelStyle="{ color: '#909399' }" labelPosition="left" labelWidth="140" :model="addressInfo" 5 + <u--form :labelStyle="{ color: '#909399' }" labelWidth="140" labelPosition="left" :model="addressInfo"
6 ref="addressFrom"> 6 ref="addressFrom">
7 <u-form-item :required="true" label="所在地区" prop="addressArea" borderBottom> 7 <u-form-item :required="true" label="所在地区" prop="addressArea" borderBottom>
8 - <view @click.stop="showRegionPicker" hover-class="click-box"> 8 + <view @click.stop="showRegionPicker" hover-class="click-box" style="width: 100%;">
9 <u--input border="none" readonly style="pointer-events:none" type="text" v-model="addressInfo.addressArea" 9 <u--input border="none" readonly style="pointer-events:none" type="text" v-model="addressInfo.addressArea"
10 placeholder-class="line" placeholder="省市区县、乡镇等"></u--input> 10 placeholder-class="line" placeholder="省市区县、乡镇等"></u--input>
11 </view> 11 </view>
12 </u-form-item> 12 </u-form-item>
13 <u-form-item :required="true" label="详细地址" prop="addressDetail" borderBottom> 13 <u-form-item :required="true" label="详细地址" prop="addressDetail" borderBottom>
14 - <view @click.stop="chooseAddressDetail" class="wrap-from-container-address-details" style="display: flex;"  
15 - hover-class="click-box"> 14 + <view @click.stop="chooseAddressDetail" class="wrap-from-container-address-details"
  15 + style="width: 100%;overflow:hidden; text-overflow: ellipsis;" hover-class="click-box">
16 <u--input border="none" readonly type="text" style="pointer-events:none" v-model="addressInfo.addressDetail" 16 <u--input border="none" readonly type="text" style="pointer-events:none" v-model="addressInfo.addressDetail"
17 - placeholder-class="line" placeholder="请先选着地址,在输入补充"></u--input>  
18 - <u-icon name="map" size="40"></u-icon> 17 + placeholder-class="line" placeholder="请选着所在地址" suffixIcon="map-fill"
  18 + suffixIconStyle="font-size: 28rpx;color: #909399"></u--input>
19 </view> 19 </view>
20 </u-form-item> 20 </u-form-item>
21 <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom> 21 <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom>
@@ -169,10 +169,12 @@ const chooseAddressDetail = () =&gt; { @@ -169,10 +169,12 @@ const chooseAddressDetail = () =&gt; {
169 uni.chooseLocation({ 169 uni.chooseLocation({
170 type: coordinate, 170 type: coordinate,
171 success: function (res) { 171 success: function (res) {
172 - addressInfo.addressDetail = res.address + res.name;  
173 - addressInfo.garLongitude = res.longitude  
174 - addressInfo.garLatitude = res.latitude  
175 - addressInfo.garCoordinate = coordinate 172 + if (res.address) {
  173 + addressInfo.addressDetail = res.address + res.name;
  174 + addressInfo.garLongitude = res.longitude
  175 + addressInfo.garLatitude = res.latitude
  176 + addressInfo.garCoordinate = coordinate
  177 + }
176 } 178 }
177 }); 179 });
178 } 180 }
@@ -209,6 +211,10 @@ const reset = () =&gt; { @@ -209,6 +211,10 @@ const reset = () =&gt; {
209 </script> 211 </script>
210 212
211 <style lang="scss" scoped> 213 <style lang="scss" scoped>
  214 +::v-deep .u-input--square {
  215 + // width: 100%;
  216 +}
  217 +
212 .wrap { 218 .wrap {
213 box-sizing: border-box; 219 box-sizing: border-box;
214 padding: 15rpx; 220 padding: 15rpx;
@@ -296,8 +302,6 @@ const reset = () =&gt; { @@ -296,8 +302,6 @@ const reset = () =&gt; {
296 align-items: center; 302 align-items: center;
297 justify-content: center; 303 justify-content: center;
298 } 304 }
299 -  
300 -  
301 } 305 }
302 } 306 }
303 } 307 }