Commit 6107e0550a6aabcbfcba5db5c88cc861a126986a

Authored by guzijian
1 parent 4d0f0f59

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

garbage-removal/src/pages/home/address/addSite.vue
... ... @@ -2,20 +2,20 @@
2 2 <view class="wrap">
3 3 <view class="wrap-from-container">
4 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 6 ref="addressFrom">
7 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 9 <u--input border="none" readonly style="pointer-events:none" type="text" v-model="addressInfo.addressArea"
10 10 placeholder-class="line" placeholder="省市区县、乡镇等"></u--input>
11 11 </view>
12 12 </u-form-item>
13 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 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 19 </view>
20 20 </u-form-item>
21 21 <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom>
... ... @@ -169,10 +169,12 @@ const chooseAddressDetail = () =&gt; {
169 169 uni.chooseLocation({
170 170 type: coordinate,
171 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 211 </script>
210 212  
211 213 <style lang="scss" scoped>
  214 +::v-deep .u-input--square {
  215 + // width: 100%;
  216 +}
  217 +
212 218 .wrap {
213 219 box-sizing: border-box;
214 220 padding: 15rpx;
... ... @@ -296,8 +302,6 @@ const reset = () =&gt; {
296 302 align-items: center;
297 303 justify-content: center;
298 304 }
299   -
300   -
301 305 }
302 306 }
303 307 }
... ...