<view class="flex-col page">
  <text wx:if="{{ isUpdate }}" class="self-center font text">更改银行卡信息</text>
  <text wx:else="{{ isUpdate }}" class="self-center font text">绑定银行卡信息</text>
  <text class="self-center font_2 text_2">请绑定持卡人本人的银行卡</text>

  <view class="flex-col self-stretch group">
    <!-- 持卡人 -->
    <view class="self-start group_2">
      <text class="font_2">持卡人</text>
      <text class="font_3">*</text>
    </view>
    <view class="flex-col justify-start items-start self-stretch text-wrapper mt-11">
      <input 
        class="text_3 font" 
        placeholder="请输入持卡人" 
        data-field="cardHolder"
        bindinput="handleInputChange"
        value="{{ cardHolder }}"
      />
    </view>

    <!-- 身份证号 -->
    <view class="self-start group_3 mt-11">
      <text class="font_2 text_4">身份证号</text>
      <text class="font_3">*</text>
    </view>
    <view class="flex-col justify-start items-start self-stretch text-wrapper_2 mt-11">
      <input 
        class="text_12 font_4" 
        placeholder="请输入持卡人身份证号" 
        data-field="idCardNumber"
        bindinput="handleInputChange"
        type="idcard"
        value="{{ idCardNumber }}"
      />
    </view>

    <!-- 手机号 -->
    <view class="self-start group_4 mt-11">
      <text class="font_2">手机号</text>
      <text class="font_3">*</text>
    </view>
    <view class="flex-col justify-start items-start self-stretch text-wrapper_2 mt-11">
      <input 
        class="text_1 font_4" 
        placeholder="请输入持卡人绑定的手机号" 
        data-field="phoneNumber"
        bindinput="handleInputChange"
        value="{{ phoneNumber }}"
      />
    </view>

    <!-- 银行卡号 -->
    <view class="self-start group_5 mt-11">
      <text class="font_2 text_6">银行卡号</text>
      <text class="font_3">*</text>
    </view>
    <view class="flex-col justify-start items-start self-stretch text-wrapper_2 mt-11">
      <input 
        class="text_5 font_4" 
        placeholder="请输入持卡人银行卡号" 
        data-field="bankCardNumber"
        bindinput="handleInputChange"
        type="number"
        value="{{ bankCardNumber }}"
      />
    </view>
    <view class="self-start group_6 mt-11">
      <text class="font_2 text_7">开户银行</text>
      <text class="font_3">*</text>
    </view>
    <view class="flex-col justify-start items-start self-stretch text-wrapper_2 mt-11">
      <input 
        class="text_1 font_4" 
        placeholder="请输入开户银行" 
        data-field="bankName"
        bindinput="handleInputChange"
        value="{{ bankName }}"
      />
    </view>
  </view>

  <!-- 保存按钮 -->
  <view wx:if="{{ isUpdate }}" class="flex-col justify-start items-center self-center text-wrapper_3"  bindtap="updateInfo">
    <text class="font_2 text_8">更新</text>
  </view>
  <view wx:else="{{ isUpdate }}" class="flex-col justify-start items-center self-center text-wrapper_3">
    <text class="font_2 text_8" bindtap="saveInfo" >保存</text>
  </view>
</view>
