hku-class/miniprogram/pages/manage/index.wxml

128 lines
5.6 KiB
Plaintext
Raw Permalink 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 form-page">
<view class="form-header">
<view class="form-kicker">CLASS MANAGEMENT</view>
<view class="form-title">{{title}}</view>
<view class="form-subtitle">填写必要信息后保存,内容会同步到当前班级。</view>
</view>
<view wx:if="{{!isFund}}" class="form-card">
<view class="form-field">
<view class="form-label">标题</view>
<input class="form-input" value="{{form.title}}" data-field="title" bindinput="onInput" placeholder="请输入标题" />
</view>
</view>
<view wx:if="{{isAnnouncements}}" class="form-card">
<view class="form-field">
<view class="form-label">内容</view>
<textarea class="form-textarea" value="{{form.content}}" data-field="content" bindinput="onInput" placeholder="请输入公告内容" />
</view>
<view class="form-field form-switch-row">
<view>
<view class="form-label">置顶公告</view>
<view class="form-hint">开启后会优先显示在首页</view>
</view>
<switch checked="{{form.is_pinned}}" data-field="is_pinned" bindchange="onSwitch" />
</view>
</view>
<view wx:if="{{isVotes}}" class="form-card">
<view class="form-field">
<view class="form-label">说明</view>
<textarea class="form-textarea" value="{{form.description}}" data-field="description" bindinput="onInput" placeholder="请输入投票说明" />
</view>
<view class="form-field">
<view class="form-label">
<text>选项</text>
<text class="form-hint">每行一个</text>
</view>
<textarea class="form-textarea" value="{{form.options_text}}" data-field="options_text" bindinput="onInput" placeholder="选项 A&#10;选项 B" />
</view>
<view class="form-field form-switch-row">
<view>
<view class="form-label">匿名投票</view>
<view class="form-hint">同学参与后不展示个人选择</view>
</view>
<switch checked="{{form.is_anonymous}}" data-field="is_anonymous" bindchange="onSwitch" />
</view>
</view>
<view wx:if="{{isSchedule}}" class="form-card">
<view class="form-field">
<view class="form-label">类型</view>
<picker mode="selector" range="{{scheduleTypes}}" bindchange="onScheduleTypeChange">
<view class="form-select">{{scheduleTypeLabel}}</view>
</picker>
</view>
<view class="form-field">
<view class="form-label">
<text>{{scheduleTimeLabel}}</text>
<text class="form-hint">格式2026-05-07T09:00:00</text>
</view>
<input class="form-input" value="{{form.start_time}}" data-field="start_time" bindinput="onInput" placeholder="2026-05-07T09:00:00" />
</view>
<view wx:if="{{!isScheduleDeadline}}" class="form-field">
<view class="form-label">
<text>结束时间</text>
<text class="form-hint">课程/活动必填</text>
</view>
<input class="form-input" value="{{form.end_time}}" data-field="end_time" bindinput="onInput" placeholder="2026-05-07T12:00:00" />
</view>
<view class="form-field">
<view class="form-label">地点</view>
<input class="form-input" value="{{form.location}}" data-field="location" bindinput="onInput" placeholder="地点" />
</view>
<view class="form-field">
<view class="form-label">说明</view>
<textarea class="form-textarea" value="{{form.description}}" data-field="description" bindinput="onInput" placeholder="说明" />
</view>
</view>
<view wx:if="{{isFund}}" class="form-card">
<view class="form-field">
<view class="form-label">收支类型</view>
<view class="fund-type-switch">
<view class="fund-type {{fundIncomeClass}}" data-type="income" bindtap="setFundType">入账</view>
<view class="fund-type {{fundExpenseClass}}" data-type="expense" bindtap="setFundType">出账</view>
</view>
</view>
<view class="form-field">
<view class="form-label">金额</view>
<input class="form-input" type="digit" value="{{form.amount}}" data-field="amount" bindinput="onInput" placeholder="0.00" />
</view>
<view class="form-field">
<view class="form-label">小类型</view>
<picker mode="selector" range="{{fundCategories}}" bindchange="onFundCategoryChange">
<view class="form-select">{{form.category}}</view>
</picker>
</view>
<view class="form-field">
<view class="form-label">日期</view>
<picker mode="date" value="{{form.record_date}}" bindchange="onDateChange">
<view class="form-select">{{form.record_date}}</view>
</picker>
</view>
<view class="form-field">
<view class="form-label">备注</view>
<textarea class="form-textarea" value="{{form.description}}" data-field="description" bindinput="onInput" placeholder="补充说明,可不填" />
</view>
<view class="form-field">
<view class="form-label-row">
<view class="form-label">小票图片</view>
<view class="section-action" bindtap="chooseFundImages">{{uploadingImages ? "上传中..." : "添加图片"}}</view>
</view>
<view class="form-hint">最多 6 张,可拍照或从相册选择。</view>
<view wx:if="{{fundImageUrls.length}}" class="image-grid fund-image-grid">
<view wx:for="{{fundImageUrls}}" wx:key="*this" class="image-cell">
<image src="{{item}}" mode="aspectFill" />
<view class="image-remove" data-index="{{index}}" bindtap="removeFundImage">×</view>
</view>
</view>
</view>
</view>
<view class="form-submit-bar">
<button class="button" loading="{{loading}}" bindtap="submit">保存</button>
</view>
</view>