<!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
<searchSelectWrapper 
    label="园区" 
    placeholder="请选择园区"
    text="{{parkName}}"
    bind:search="onParkFocus"
/>

<searchSelectWrapper 
    label="关键字" 
    placeholder="请输入关键字"
    text="{{meterName}}"
    bind:searchKeyword="onSearchKeyword"
    type="inputSearch"
/>
<view>
    <view wx:if="{{list.length}}">
        <view class="operate" wx:if="{{status === 2}}">
            <view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
                <van-button 
                    type="info" 
                    size="small" 
                    style="margin-right: 30rpx;" 
                    bind:click="handleApprove"
                    data-status="0"
                    disabled="{{!record}}"
                > 同意 </van-button>
                <van-button 
                    size="small" 
                    bind:click="handleClear"  
                    disabled="{{!record}}" 
                    bind:click="handleApprove"
                    data-status="1"
                > 拒绝 </van-button>
            </view>
        </view>
        <view class="tableWrapper">
            <view class="table">
                <view class="thead">
                    <view class="th" style="width: 70rpx">  </view>
                    <view class="th" style="width: 250rpx"> 商户名字 </view>
                    <view class="th" style="width: 150rpx"> 充值金额 </view>
                    <view class="th" style="width: 200rpx"> 操作 </view>
                </view>
                <view class="tbody">
                    <van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
                        <block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
                            <view class="tr">
                                <view class="th" style="width: 70rpx">
                                    <van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
                                </view>
                                <view class="th" style="width: 250rpx"> {{ item.tenement.shortName }} </view>
                                <view class="th" style="width: 150rpx"> {{ item.money }} </view>
                                <view class="th" style="width: 200rpx">
                                    <view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
                                        查看详细
                                    </view>
                                </view>
                            </view>
                        </block>
                    </van-radio-group>
                </view>
            </view>
        </view>
        
        <pagination 
            currentIndex="{{page}}" 
            totalPage="{{totalPage}}" 
            bind:pagingChange="onChangePage"  
        />
        
    </view>
    <empty bind:refresh="init" wx:else />
    
</view>

<search-select 
    show="{{show}}" 
    title="{{title}}" 
    type="{{type}}" 
    park="{{park}}"
    bindconfirm="onConfirm"
    bindcancel="onCancel"
/>

<van-dialog
  use-slot
  title="审核"
  show="{{ approveShow }}"
  show-cancel-button
  bind:close="onApproveClose"
  bind:confirm="onApproveConfirm"
>
    <van-field
        label="拒绝理由"
        value="{{ reason }}"
        placeholder="请输入拒绝理由"
        bind:change="onChangeReason"
    />
</van-dialog>