Files
JayuCloud/JC-Salon-WeChat/pages/export/index.wxml
T

46 lines
2.5 KiB
Plaintext

<view class="page no-tab">
<view class="card form-card">
<view class="field"><text class="field-label">导出类型</text><picker range="{{types}}" bindchange="onTypeChange"><view class="field-value">{{type}}</view></picker></view>
<view class="field"><text class="field-label">开始日期</text><picker mode="date" value="{{startDate}}" bindchange="onStartDate"><view class="field-value">{{startDate}}</view></picker></view>
<view class="field"><text class="field-label">结束日期</text><picker mode="date" value="{{endDate}}" bindchange="onEndDate"><view class="field-value">{{endDate}}</view></picker></view>
</view>
<view class="card preview-card">
<view class="preview-head">
<text class="preview-title">数据预览</text>
<text class="preview-sub">最多展示 10 条</text>
</view>
<view wx:if="{{previewLoading}}" class="preview-empty">预览加载中...</view>
<view wx:elif="{{previewError}}" class="preview-empty error">{{previewError}}</view>
<view wx:elif="{{previewRows.length === 0}}" class="preview-empty">暂无可预览数据</view>
<scroll-view wx:else class="preview-scroll" scroll-x>
<view class="preview-table">
<view class="preview-row preview-row-head">
<text wx:for="{{previewColumns}}" wx:key="*this" class="preview-cell">{{item}}</text>
</view>
<view wx:for="{{previewRows}}" wx:key="key" class="preview-row">
<block wx:if="{{type === '订单数据'}}">
<text class="preview-cell">{{item.date}}</text>
<text class="preview-cell">{{item.customer}}</text>
<text class="preview-cell">{{item.product}}</text>
<text class="preview-cell">{{item.artist}}</text>
<text class="preview-cell">{{item.time}}</text>
<text class="preview-cell">{{item.status}}</text>
</block>
<block wx:elif="{{type === '客户数据'}}">
<text class="preview-cell">{{item.name}}</text>
<text class="preview-cell">{{item.phone}}</text>
<text class="preview-cell">{{item.lastTime}}</text>
</block>
<block wx:else>
<text class="preview-cell">{{item.name}}</text>
<text class="preview-cell">{{item.phone}}</text>
<text class="preview-cell">{{item.schedule}}</text>
<text class="preview-cell">{{item.status}}</text>
</block>
</view>
</view>
</scroll-view>
</view>
<view class="fixed-bottom"><button class="primary-btn" bindtap="exportExcel">导出 Excel</button></view>
</view>