<view class="page" style="background:#fff;min-height:100vh">
  <view class="input-group">
    <view class="input-item">
      <text class="input-label">收件人</text>
      <input class="input-field" placeholder="请输入收件人姓名" value="{{name}}" bindinput="onNameInput" />
    </view>
    <view class="input-item">
      <text class="input-label">手机号</text>
      <input class="input-field" type="text" placeholder="请输入手机号" maxlength="11" value="{{phone}}" bindinput="onPhoneInput" />
    </view>
    <view class="input-item" bindtap="onRegionPicker">
      <text class="input-label">所在地区</text>
      <text class="input-field {{regionText ? '' : 'placeholder'}}">{{regionText || '请选择省/市/区'}}</text>
    </view>
    <view class="input-item">
      <text class="input-label">详细地址</text>
      <input class="input-field" placeholder="街道、门牌号等" value="{{detail}}" bindinput="onDetailInput" />
    </view>
    <view class="input-item">
      <text class="input-label">邮政编码</text>
      <input class="input-field" placeholder="选填" value="{{zipCode}}" bindinput="onZipInput" />
    </view>
  </view>

  <view class="default-switch flex-between" style="padding:24rpx">
    <text>设为默认地址</text>
    <switch checked="{{isDefault}}" bindchange="onDefaultChange" color="#4A7CF7" />
  </view>

  <view style="padding:48rpx 24rpx">
    <button class="btn-primary btn-block" style="height:88rpx;border-radius:44rpx;font-size:30rpx;line-height:88rpx" loading="{{saving}}" bindtap="onSave">保存地址</button>
  </view>
</view>
