Files
persionalBrand/packages/template-acheng-campus-food/miniapp/pages/inquiry/index.wxml
T

36 lines
3.6 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 booking-page">
<view class="sub-tabs"><view class="sub-tab {{subView === 'form' ? 'active' : ''}}" data-view="form" bindtap="switchView">▤ 新建咨询 / 预订</view><view class="sub-tab {{subView === 'history' ? 'active' : ''}}" data-view="history" bindtap="switchView">▣ 我的咨询记录 ({{records.length}})</view></view>
<block wx:if="{{subView === 'form'}}">
<view class="form-card">
<text class="form-title">{{presentation.title || '咨询 / 预订'}}</text>
<text wx:if="{{presentation.subtitle}}" class="form-desc">{{presentation.subtitle}}</text>
<view class="form-fields">
<view wx:for="{{fields}}" wx:key="key" class="field {{item.halfWidth ? 'field-half' : ''}}">
<text class="label">{{item.label}} <text wx:if="{{item.required}}" class="required">*</text></text>
<view wx:if="{{item.useChips}}" class="type-grid"><view wx:for="{{item.options}}" wx:for-item="option" wx:key="value" class="type-option {{values[item.key] === option.value ? 'selected' : ''}}" data-key="{{item.key}}" data-value="{{option.value}}" bindtap="chooseChip">{{option.label}}</view></view>
<picker wx:elif="{{item.type === 'select' || item.type === 'radio'}}" range="{{item.options}}" range-key="label" data-key="{{item.key}}" bindchange="choose"><view class="picker">{{displayValues[item.key] || '请选择' + item.label}}</view></picker>
<picker wx:elif="{{item.type === 'date'}}" mode="date" value="{{values[item.key]}}" data-key="{{item.key}}" bindchange="input"><view class="picker">{{values[item.key] || '请选择日期'}}</view></picker>
<textarea wx:elif="{{item.type === 'textarea'}}" value="{{values[item.key]}}" data-key="{{item.key}}" bindinput="input" placeholder="{{item.placeholder || '请填写' + item.label}}" />
<checkbox-group wx:elif="{{item.type === 'multi-select' || item.type === 'checkbox'}}" data-key="{{item.key}}" bindchange="checkboxChange"><label wx:for="{{item.options}}" wx:for-item="option" wx:key="value"><checkbox value="{{option.value}}" />{{option.label}}</label></checkbox-group>
<input wx:else type="{{item.type === 'number' || item.type === 'phone' || item.type === 'tel' ? 'number' : 'text'}}" value="{{values[item.key]}}" data-key="{{item.key}}" bindinput="input" placeholder="{{item.placeholder || '请填写' + item.label}}" />
</view>
</view>
<view wx:if="{{formError}}" class="error">! {{formError}}</view>
<view wx:if="{{presentation.promise}}" class="promise"><text>{{presentation.promise}}</text></view>
<button class="submit" loading="{{submitting}}" bindtap="submit">{{presentation.submitLabel || '提交咨询'}}</button>
</view>
</block>
<block wx:else>
<view wx:if="{{!records.length}}" class="empty"><text class="empty-icon">▣</text><text class="empty-title">暂无咨询记录</text><text>提交需求后,可以在这里查看处理进度。</text><button bindtap="switchToForm">新建咨询</button></view>
<view wx:else class="history-list">
<view wx:for="{{records}}" wx:key="id" class="history-card">
<view class="history-head"><text class="record-id">单号 #{{item.id}}</text><text class="record-status">{{item.status}}</text></view>
<text class="history-title">{{item.title}}</text>
<text wx:for="{{item.summary}}" wx:for-item="line" wx:key="key">{{line.label}}:{{line.value}}</text>
<view wx:if="{{item.replyNote}}" class="reply"><text class="reply-label">处理回复:</text>{{item.replyNote}}</view>
<view class="history-foot">提交时间:{{item.createdAt}}</view>
</view>
</view>
</block>
</view>