hku-class/miniprogram/pages/fund-detail/index.wxml
2026-05-15 20:22:12 +08:00

136 lines
5.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<view class="page" wx:if="{{record}}">
<view class="hero fund-detail-hero {{record.type_class}}">
<view class="eyebrow">FUND LEDGER</view>
<view class="hero-title">{{record.signed_amount_text}}</view>
<view class="hero-subtitle">{{record.category}} · {{record.record_date}}</view>
<view class="fund-proof-pill">{{record.image_count_text}}</view>
<view wx:if="{{canManage}}" class="fund-action-bar">
<view class="fund-action-button" bindtap="openEdit">编辑</view>
<view class="fund-action-button danger" bindtap="deleteRecord">{{deleting ? "删除中..." : "删除"}}</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title">账目摘要</view>
<view class="section-action">{{record.type_text}}</view>
</view>
<view class="card">
<view class="fund-detail-row">
<view class="row-mark">类</view>
<view class="row-body">
<view class="card-title">分类</view>
<view class="muted">{{record.category}}</view>
</view>
</view>
<view class="fund-detail-row">
<view class="row-mark">日</view>
<view class="row-body">
<view class="card-title">发生日期</view>
<view class="muted">{{record.record_date}}</view>
</view>
</view>
<view class="fund-detail-row">
<view class="row-mark">录</view>
<view class="row-body">
<view class="card-title">录入人</view>
<view class="muted">{{record.recorder_name}}</view>
</view>
</view>
<view class="fund-detail-row last">
<view class="row-mark">时</view>
<view class="row-body">
<view class="card-title">录入时间</view>
<view class="muted">{{record.created_at_text}}</view>
</view>
</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title">备注</view>
</view>
<view class="card">
<view class="fund-note">{{record.description || "暂无备注"}}</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title">小票凭证</view>
<view class="section-action">{{record.image_count_text}}</view>
</view>
<view wx:if="{{record.image_urls.length}}" class="fund-proof-grid">
<image wx:for="{{record.image_urls}}" wx:key="*this" src="{{item}}" mode="aspectFill" data-src="{{item}}" bindtap="previewImage" />
</view>
<view wx:else class="card">
<view class="muted">这条记录没有上传小票图片</view>
</view>
</view>
</view>
<view class="page" wx:elif="{{!loading}}">
<view class="empty">
<view class="muted">未找到班费记录</view>
</view>
</view>
<view wx:if="{{editOpen}}" class="edit-mask" catchtap="closeEdit">
<view class="edit-panel" catchtap="noop">
<view class="edit-head">
<view>
<view class="edit-kicker">FUND RECORD</view>
<view class="edit-title">修改班费记录</view>
</view>
<view class="edit-close" bindtap="closeEdit">×</view>
</view>
<view class="form-field">
<view class="form-label">收支类型</view>
<view class="fund-type-switch">
<view class="fund-type {{editIncomeClass}}" data-type="income" bindtap="setEditFundType">入账</view>
<view class="fund-type {{editExpenseClass}}" data-type="expense" bindtap="setEditFundType">出账</view>
</view>
</view>
<view class="form-field">
<view class="form-label">金额</view>
<input class="form-input" type="digit" value="{{editForm.amount}}" data-field="amount" bindinput="onEditInput" placeholder="0.00" />
</view>
<view class="form-field">
<view class="form-label">小类型</view>
<picker mode="selector" range="{{editCategories}}" bindchange="onEditCategoryChange">
<view class="form-select">{{editForm.category}}</view>
</picker>
</view>
<view class="form-field">
<view class="form-label">日期</view>
<picker mode="date" value="{{editForm.record_date}}" bindchange="onEditDateChange">
<view class="form-select">{{editForm.record_date}}</view>
</picker>
</view>
<view class="form-field">
<view class="form-label">备注</view>
<textarea class="form-textarea" value="{{editForm.description}}" data-field="description" bindinput="onEditInput" placeholder="补充说明,可不填" />
</view>
<view class="form-field">
<view class="edit-label-row">
<view class="form-label">小票图片</view>
<view class="section-action" bindtap="chooseEditImages">{{uploadingImages ? "上传中..." : "添加图片"}}</view>
</view>
<view class="form-hint">最多 6 张,可拍照或从相册选择。</view>
<view wx:if="{{editImageUrls.length}}" class="edit-image-grid">
<view wx:for="{{editImageUrls}}" wx:key="*this" class="edit-image-cell">
<image src="{{item}}" mode="aspectFill" />
<view class="edit-image-remove" data-index="{{index}}" bindtap="removeEditImage">×</view>
</view>
</view>
</view>
<view class="edit-submit-row">
<button class="button secondary" bindtap="closeEdit" disabled="{{saving || uploadingImages}}">取消</button>
<button class="button" loading="{{saving}}" bindtap="saveEdit">保存修改</button>
</view>
</view>
</view>