<!--pages/locationAdd/locationAdd.wxml-->
<view class='container'>
  <view class="top-card-box">
    <view class="current-location">当前定位</view>
    <view class="location-box">
      <view class="location-address">
        <van-icon name="location" />
        <view class="address-text">{{address||'未授权定位'}}</view>
      </view>
      <view bindtap="getLocation" class="reset-location">
        <image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" src="/images/icon/location.png" mode="" />
        <view>重新定位</view>
      </view>
    </view>
  </view>
  <view class="address-card-box">
    <view class="my-address">
      <view class="address-title">我的收货地址</view>
      <view class="address-edit" bindtap="editAddress" wx:if="{{addressList.length}}">管理</view>
    </view>
    <van-empty description="暂无地址" wx:if="{{!addressList.length}}" />
    <block wx:else>
      <view class="address-list-box" catchtap="setDefault" data-item="{{item}}" wx:for="{{addressList}}">
      <view class="address-check">
        <van-icon wx:if="{{item.commonAddr==1}}" name="success" color="#04358D"/>
      </view>
      <view class="address-list">
        <view>{{item.address}}{{item.addressName}}{{item.addrDetail}}</view>
        <view>{{item.receiver}} {{item.mobile}}</view>
      </view>
    </view>
    </block>
  </view>
  <view class="add-address-btn" bindtap="onAddAddr">新建地址</view>
</view>