<!-- mode2 自动打款 - 参考逍遥梦样式（仅微信零钱） -->
<view class="ref-page">
  <!-- 提现方式：仅微信 -->
  <view class="method-card">
    <view class="method-tab method-tab--active">
      <image class="method-tab-icon" src="{{imgUrls.iconWechat}}" mode="aspectFit" />
      <text class="method-tab-text">微信零钱</text>
      <view class="method-tab-line"></view>
    </view>
  </view>

  <!-- 选择提现账户（多身份时展示） -->
  <view class="account-card" wx:if="{{displayAssetList.length > 0}}">
    <scroll-view scroll-x enable-flex class="account-scroll" show-scrollbar="{{false}}">
      <view
        wx:for="{{displayAssetList}}"
        wx:key="type"
        class="account-chip {{selectedAsset.type === item.type ? 'account-chip--active' : ''}} {{item.amount <= 0 ? 'account-chip--disabled' : ''}}"
        bindtap="onSelectAsset"
        data-index="{{index}}"
      >
        <text class="chip-label">{{item.label}}</text>
        <text class="chip-amount">¥{{item.amount}}</text>
      </view>
    </scroll-view>
    <text wx:if="{{!selectedAsset}}" class="account-warn">请先选择上方提现账户</text>
    <text wx:else class="account-ok">当前：{{selectedAsset.label}}</text>
  </view>

  <!-- 金额输入区 -->
  <view class="amount-card">
    <view class="avail-row">
      <text class="avail-label">当前可提现：</text>
      <text class="avail-symbol">¥</text>
      <text class="avail-amount">{{selectedAsset ? selectedAsset.amount : totalAmount}}</text>
    </view>
    <view class="input-row">
      <text class="input-symbol">¥</text>
      <input
        class="amount-input"
        type="digit"
        placeholder="请输入金额"
        placeholder-class="amount-placeholder"
        value="{{tixianjine}}"
        bindinput="onJineInput"
      />
      <text class="withdraw-all" bindtap="onWithdrawAll">全部提现</text>
    </view>
    <view class="input-divider"></view>
    <view class="fee-tip">
      <text>提示：提现手续费</text>
      <text class="fee-highlight">{{feeRateText}}</text>
      <text>。</text>
    </view>
  </view>

  <!-- 确认按钮 -->
  <view class="submit-wrap">
    <view
      class="confirm-btn {{canWithdraw && !submitting ? '' : 'confirm-btn--disabled'}}"
      bindtap="onTapWithdraw"
    >
      <text wx:if="{{submitting}}">处理中...</text>
      <text wx:else>确认提现</text>
    </view>
  </view>

  <!-- 提现须知 -->
  <view class="notice-box">
    <view class="notice-title">📢 提现须知</view>
    <view class="notice-item">🕒 提交后需等待后台审核，请耐心等待</view>
    <view class="notice-item">📌 审核通过后，请前往「提现记录」点击「收款」确认到账</view>
    <view class="notice-item">💰 每笔只能从单个账户提现，请先选择对应账户再填写金额</view>
    <view class="notice-item">✅ 提现方式仅支持微信零钱，暂不支持支付宝</view>
    <view class="notice-item">🎧 运营账户不足时暂时无法提现，请稍后再试或联系客服</view>
  </view>
</view>

<!-- 确认提现弹窗 -->
<view wx:if="{{showTixian}}" class="modal-mask" bindtap="onCloseTixian">
  <view class="modal-dialog" catchtap="stopPropagation">
    <view class="modal-header">确认提现</view>
    <view class="modal-body">
      <view class="auto-tip">提交后需等待审核，审核通过后请在「提现记录」中点击「收款」确认到账</view>
      <view class="info-row"><text>身份</text><text>{{selectedAsset.label}}</text></view>
      <view class="info-row"><text>可提</text><text>¥{{selectedAsset.amount}}</text></view>
      <view class="info-row"><text>费率</text><text>{{currentRate}}</text></view>
      <view class="info-row"><text>提现金额</text><text>¥{{tixianjine}}</text></view>
      <view class="fee-row">
        <text>手续费 ¥{{shouxufei}}</text>
        <text>到账 ¥{{shijidaozhang}}</text>
      </view>
    </view>
    <view class="modal-footer">
      <view class="modal-btn cancel" bindtap="onCloseTixian">取消</view>
      <view class="modal-btn confirm" bindtap="onConfirmTixian">{{submitting ? '处理中' : '提交申请'}}</view>
    </view>
  </view>
</view>

<global-notification id="global-notification" />
<popup-notice id="popupNotice" />
