<!--packageH/newDraw/components/yz_addressList/yz_addressList.wxml-->
<van-popup bind:click-overlay="addresclosebtn" close-on-click-overlay="{{false}}" round show="{{show}}" position="bottom" overlay="{{true}}" closeable bind:close="onCloseAdd">
  <view class="add-info">
    <view class="ul" style="text-align:center;font-size: 16px;padding-bottom: 30px;" wx:if="{{addressData.length <= 0}}">当前暂无地址记录！</view>
    <view class="ul">
      <view class="li" wx:key="{{addressindex}}" wx:for="{{addressData}}" wx:for-item="item" wx:for-index="addressindex"
        catchtap="selectAddress" data-addr="{{item}}">
        <view class="liia">
          <view class="span name">{{item.username+" "+item.mobile}} <text class="isdefault" wx:if="{{item.isdefault === 1}}">默认</text></view>
          <view class="p address" wx:if="{{item.street}}">
            {{item.province+" "+item.city+" "+item.district+" "+item.street}} {{item.address}}
          </view>
          <view class="p address" wx:else>
            {{item.province+" "+item.city+" "+item.district}} {{item.address}}
          </view>
        </view>
        <view class="p edit_btn" catchtap="editAddress" data-item="{{item}}">编辑</view>
      </view>
    </view>
  </view>
  <view class="button address-plus" catchtap="addAddress">新增地址</view>
</van-popup>
<van-popup custom-style="width:100%;height:80%;" show="{{popAddAddress}}" position="bottom" overlay="{{false}}">
  <view class="addcontent">
    <van-nav-bar title="添加地址" left-text="" right-text="" left-arrow bind:click-left="popAddressClose" />
    <view class="address_a">
      <view class="ul">
        <view class="li">
          <view class="span">收件人：</view>
          <input type="text" value="{{form.username}}" maxlength="{{20}}" placeholder="请输入收件人"
            bindinput="usernameinp" />
        </view>
        <view class="li">
          <view class="span">联系电话：</view>
          <input type="number" value="{{form.mobile}}" maxlength="{{15}}" placeholder="请输入联系电话" bindinput="mobileinp" />
        </view>
      </view>
    </view>
    <view class="defaultAdd">
      <view class="left">设置默认地址：</view>
      <view class="right">
        <van-switch active-color="#f15353" checked="{{form.isDefault}}" bind:change="isDefaultChange" />
      </view>
    </view>
    <view class="addName">
      <van-cell title="所在地区：" value="{{addressName?addressName:'请选择收货地址'}}" is-link bind:click="openDateLwtbtn" />
    </view>
    <view class="addstreet" wx:if="{{strShow}}">
      <van-cell title="街道：" value="{{form.street?form.street:'请选择街道'}}" is-link bind:click="streetChoose" />
    </view>
    <view class="text_adderss">
      <input placeholder="请输入详细地址" bindinput="addressinp" value="{{form.address}}" maxLength="100" />
    </view>
    <view class="getLocation" catchtap='goLocation_ro' wx:if='{{(delivery_status == 1 && selected == 3 && form.city)||need_lat==1 && form.city}}'>
      <view class="left">
        <icon class="iconfont icon-icon_location"></icon>
        <view wx:if="{{is_point.lng || is_point.lat}}">获取经纬度:({{is_point.lng}} , {{is_point.lat}}) <text catchtap='showLocation' wx:if="{{is_point.lng}}" style="font-size: 12px;color: #f15353;">修改</text> </view>
        <view wx:else>获取位置</view>
      </view>
      <view class="right">
        <icon class="iconfont icon-member_right"></icon>
      </view>
    </view>
    <view class="adderss_btn" wx:if="{{create}}" data-apptype="" catchtap="appendAddress">
      <view class="button">
        <view class="plus_circle">
          <van-icon name="add-o" />
        </view>
        <view class="text">保存</view>
      </view>
    </view>
    <view class="adderss_btn" wx:if="{{!create}}" catchtap="appendAddress" data-apptype="update">
      <view class="button">编辑</view>
    </view>
  </view>
</van-popup>
<van-popup custom-style="width:100%;height:100%;" show="{{mapshow}}" position="bottom" overlay="{{false}}">
  <yz-wapmap wx:if="{{mapshow}}" polygons="{{polygons}}" bind:confirm="confirmSelect" local_city="{{form.city}}"></yz-wapmap>
</van-popup>
<view class="b-mask {{openDateLw}}" bindtap="_closeDateLw"></view>
<view class="dateBe {{openDateLw}}">
  <view class="head">
    <view class="ll" bindtap="_closeDateLw">取消</view>
    <view class="rr" bindtap="_okAddress">确定</view>
  </view>
  <view class="main">
    <picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;"
      value="{{[pickerValue[0],pickerValue[1],pickerValue[2]]}}" bindchange="bindChange">
      <picker-view-column id="provinceData">
        <view wx:for="{{provinceData}}" wx:key="index" style="line-height: 50px">
          {{item.areaname}}
        </view>
      </picker-view-column>
      <picker-view-column id="cityData">
        <view wx:for="{{cityData}}" wx:key="index" style="line-height: 50px">
          {{item.areaname}}
        </view>
      </picker-view-column>
      <picker-view-column id="districtData">
        <view wx:for="{{districtData}}" wx:key="index" style="line-height: 50px">
          {{item.areaname}}
        </view>
      </picker-view-column>
    </picker-view>
  </view>
</view>
<van-popup custom-style="width:100%;height:80%;overflow:auto;" show="{{streetShow}}" position="bottom"
  overlay="{{false}}">
  <view class="streetContent">
    <van-nav-bar title="选择街道" left-text="" right-text="" left-arrow bind:click-left="streetClose" />
    <van-cell-group>
      <van-cell wx:for="{{districtVal}}" wx:for-index="districtValindex" wx:key="{{districtValindex}}"
        title="{{item.areaname}}" data-strname="{{item.areaname}}" is-link bindtap="streetConfirm" />
    </van-cell-group>
  </view>
</van-popup>