<view class="add-address">
  <view class="add-form">
    <view class="form-item">
      <label>姓名</label>
      <input class="input" bindinput="bindinputUserName" placeholder="姓名" value="{{address.userName}}" auto-focus/>
    </view>
    <view class="form-item">
      <label>手机号码</label>
      <input class="input" bindinput="bindinputTelNumber" value="{{address.telNumber}}" placeholder="手机号码" />
    </view>
    <view class="form-item">
      <label>选择区域</label>
      <input class="input" value="{{address.full_region}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县" />
    </view>
    <view class="form-item">
      <label>详细地址</label>
      <input class="input" style="width: 480rpx;" bindinput="bindinputDetailInfo" value="{{address.detailInfo}}" placeholder="详细地址, 如街道、楼盘号等" />
      <image src="/static/images/location.png" bindtap="bingAddressTap" class="location"></image>
    </view>
    <view class="form-default">
      <text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
    </view>
  </view>

  <view class="btns">
    <button class="cannel" bindtap="cancelAddress">取消</button>
    <button class="save" bindtap="saveAddress">保存</button>
  </view>

  <view class="region-select" wx:if="{{openSelectRegion}}">
    <view class="hd">
      <view class="region-selected">
        <view class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}" bindtap="selectRegionType" data-region-type-index="{{index}}" wx:for="{{selectRegionList}}" wx:key="{{item.id}}">{{item.name}}</view>
      </view>
      <view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
    </view>
    <view class="bd">
      <view class="region-list" scroll-y="true" style="height: 100%;">
        <view class="item {{item.selected ? 'selected' : ''}}" bindtap="selectRegion" data-region-index="{{index}}" wx:for="{{regionList}}" wx:key="{{item.id}}">{{item.name}}</view>
      </view>
    </view>
  </view>
</view>
<view class="bg-mask" bindtap="cancelSelectRegion" wx:if="{{openSelectRegion}}"></view>