Files
quantulr 5bbe958729 deploy
2023-08-31 16:24:37 +08:00

71 lines
3.6 KiB
Plaintext

<!--pages/index/index.wxml-->
<t-message id="t-message" />
<wxs module="times" src="../../utils/time.wxs" />
<wxs module="dict" src="../../utils/dict.wxs" />
<wxs module="utils" src="../../utils/utils.wxs" />
<view class="home-page">
<t-fab wx:if="{{utils.hasPermission('finance:detail:add', permissions)}}" class="float-button" icon="add" aria-label="增加" bind:click="handleAddAffairs" />
<statistics-card statistics-data="{{statistics}}" />
<view class="divider"></view>
<view wx:if="{{authToken}}" class="finance-list">
<t-cell-group theme="card">
<t-swipe-cell wx:for="{{list}}" wx:key="account" data-finance-id="{{item.financeId}}">
<t-cell bind:tap="handleUpdateFinance" data-finance-id="{{item.financeId}}" title="{{item.event}}" hover>
<view class="left-icon" slot="left-icon" style="background: {{item.type=='finance_type_income'?'#38a169':item.type=='finance_type_expenditure'?'#dd6b20':'transparent'}};">
<text>{{item.type=='finance_type_income'?'入':item.type=='finance_type_expenditure'?'出':''}}</text>
</view>
<view slot="description">{{times.formatDate(item.date) || "-"}} | {{item.oppositeCompany}}</view>
<view slot="note" style="color: {{item.type=='finance_type_income'?'#38a169':item.type=='finance_type_expenditure'?'#dd6b20':'transparent'}};">{{item.type=='finance_type_income'?'+':item.type=='finance_type_expenditure'?'-':''}}{{item.amount}}</view>
</t-cell>
<view slot="right" class="btn-wrapper" data-finance-id="{{item.financeId}}" bind:tap="showDeleteDialog">
<view class="btn delete-btn">删除</view>
</view>
</t-swipe-cell>
</t-cell-group>
</view>
<!-- <view wx:if="{{authToken}}" class="list">
<view wx:for="{{list}}" wx:key="account" data-finance-id="{{item.financeId}}" bind:longpress="handleLongTap" data-index="{{index}}" bind:tap="handleUpdateFinance" class="{{ index === deleteIndex ? 'card shake' : 'card' }}">
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">事项</text>
<text class="value">{{item.event}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">类别</text>
<text class="value">{{dict.getDictLabel(item.type, types)}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">时间</text>
<text class="value">{{times.formatDate(item.date) || "-"}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">对方账户</text>
<text class="value">{{item.oppositeCompany}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">金额</text>
<text class="value">{{item.amount}}</text>
</view>
</view>
<t-icon wx:if="{{index === deleteIndex}}" name="close-circle-filled" color="red" size="56rpx" data-finance-id="{{item.financeId}}" data-index="{{index}}" catchtap="handleDeleteFinance" class="close-button"></t-icon>
</view>
</view> -->
<view wx:else class="to-login">
<t-button icon="login" theme="primary" bind:tap="toLogin">前往登录</t-button>
</view>
<t-dialog visible="{{showConfirmDelete}}" title="确认删除" confirm-btn="确认" cancel-btn="取消" bind:confirm="handleDeleteFinance" bind:cancel="closeDialog" />
</view>