<view class="main_look">
    <view class="look_content">
        <view class="pay_look">
            <view data-type="count" class="inline_box font_large">
                账户余额<t-icon bind:tap="showDialog" name="edit"/>
            </view>
        </view>
        <view class="pay_look">
            <text class="center_look font_large">{{ currentMoneyText }}</text>
        </view>
    </view>
</view>
<view class="space_box_no_padding font_big">
    <text class="t-color-EXPEND">支出{{expendBalance}}</text>
    <text class="t-color-INCOME">收入{{incomeBalance}}</text>
</view>
<view class="padding_box">
    <t-divider content="{{dateRangeText}}" bind:tap="handleCalendar"/>
</view>
<t-collapse theme="card" defaultValue="{{[0]}}" expandMutex expandIcon>
    <t-collapse-panel header="收入" value="{{0}}">
        <view wx:if="{{incomeList != null && incomeList.length > 0}}">
            <t-cell wx:for="{{incomeList}}" wx:key="index"
                    title="{{item.moneyName}}"
                    description="{{item.date}}"
                    align="top"
                    image="{{item.moneyIcon}}"
                    note="{{item.money}}"
                    class="t-cell-{{item.billType}}"
                    url="{{'/pages/bill/index?id=' + item.id}}"
            />
        </view>
    </t-collapse-panel>
    <t-collapse-panel header="支出" value="{{1}}">
        <t-cell wx:for="{{payList}}" wx:key="index"
                title="{{item.moneyName}}"
                description="{{item.date}}"
                align="top"
                image="{{item.moneyIcon}}"
                note="{{item.money}}"
                class="t-cell-{{item.billType}}"
                url="{{'/pages/bill/index?id=' + item.id}}"
        />
    </t-collapse-panel>
</t-collapse>
<t-calendar visible="{{visible}}" bind:confirm="handleConfirm" value="{{dateRange}}" type="range" max-date="{{maxDate}}" min-date="{{minDate}}" />
<t-dialog
        visible="{{showSetMoney}}"
        title="修改余额"
        content="请慎重，可能无法收支平衡！"
        confirm-btn="{{ { content: '确定', variant: 'base'} }}"
        cancel-btn="取消"
        bind:confirm="onConfirm"
        bind:cancel="closeDialog"
>
    <t-input bindchange="onPriceInput" value="{{currentMoney}}" tips="{{priceError ? '请输入正确金额' : ''}}" slot="content" type="number" placeholder="0.00"/>
</t-dialog>
