refactor pages struct
This commit is contained in:
101
miniprogram/pages/main/tabs/travel/index.wxml
Normal file
101
miniprogram/pages/main/tabs/travel/index.wxml
Normal file
@ -0,0 +1,101 @@
|
||||
<!--pages/main/travel/index.wxml-->
|
||||
<view class="custom-navbar">
|
||||
<t-navbar title="出行计划" placeholder>
|
||||
<view slot="left" class="filter-btn" bind:tap="toggleFilterMenu">
|
||||
<t-icon name="filter" size="24px" />
|
||||
</view>
|
||||
</t-navbar>
|
||||
</view>
|
||||
|
||||
<!-- 筛选菜单 -->
|
||||
<view wx:if="{{isShowFilterMenu}}" class="filter-menu" catchtap="toggleFilterMenu">
|
||||
<t-cell-group
|
||||
class="content"
|
||||
theme="card"
|
||||
style="top: {{menuTop}}px; left: {{menuLeft}}px;"
|
||||
catchtap="stopPropagation"
|
||||
>
|
||||
<t-cell
|
||||
title="全部"
|
||||
leftIcon="bulletpoint"
|
||||
bind:tap="filterByStatus"
|
||||
data-status="ALL"
|
||||
rightIcon="{{currentStatus === 'ALL' ? 'check' : ''}}"
|
||||
/>
|
||||
<t-cell
|
||||
title="计划中"
|
||||
leftIcon="calendar"
|
||||
bind:tap="filterByStatus"
|
||||
data-status="PLANNING"
|
||||
rightIcon="{{currentStatus === 'PLANNING' ? 'check' : ''}}"
|
||||
/>
|
||||
<t-cell
|
||||
title="进行中"
|
||||
leftIcon="play-circle"
|
||||
bind:tap="filterByStatus"
|
||||
data-status="ONGOING"
|
||||
rightIcon="{{currentStatus === 'ONGOING' ? 'check' : ''}}"
|
||||
/>
|
||||
<t-cell
|
||||
title="已完成"
|
||||
leftIcon="check-circle"
|
||||
bind:tap="filterByStatus"
|
||||
data-status="COMPLETED"
|
||||
rightIcon="{{currentStatus === 'COMPLETED' ? 'check' : ''}}"
|
||||
/>
|
||||
</t-cell-group>
|
||||
</view>
|
||||
|
||||
<!-- 出行列表 -->
|
||||
<view class="travels">
|
||||
<!-- 空状态 -->
|
||||
<t-empty
|
||||
wx:if="{{!isFetching && list.length === 0}}"
|
||||
icon="travel"
|
||||
description="暂无出行计划"
|
||||
/>
|
||||
<!-- 列表内容 -->
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:for-item="travel"
|
||||
wx:for-index="travelIndex"
|
||||
wx:key="id"
|
||||
class="travel"
|
||||
bind:tap="toDetail"
|
||||
data-id="{{travel.id}}"
|
||||
>
|
||||
<view class="header">
|
||||
<t-tag
|
||||
theme="{{travel.status === 'PLANNING' ? 'default' : travel.status === 'ONGOING' ? 'warning' : 'success'}}"
|
||||
variant="light"
|
||||
icon="{{statusIcons[travel.status]}}"
|
||||
>
|
||||
{{statusLabels[travel.status]}}
|
||||
</t-tag>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="title">{{travel.title || '未命名出行'}}</view>
|
||||
<view wx:if="{{travel.content}}" class="content">{{travel.content}}</view>
|
||||
<view class="meta">
|
||||
<view wx:if="{{travel.travelDate}}" class="item">
|
||||
<t-icon name="time" size="16px" class="icon" />
|
||||
<text class="text">{{travel.travelDate}}</text>
|
||||
</view>
|
||||
<view wx:if="{{travel.days}}" class="item">
|
||||
<t-icon name="calendar" size="16px" class="icon" />
|
||||
<text class="text">{{travel.days}} 天</text>
|
||||
</view>
|
||||
<view wx:if="{{travel.transportationType}}" class="item">
|
||||
<t-icon name="{{transportIcons[travel.transportationType]}}" size="16px" class="icon" />
|
||||
<text class="text">{{transportLabels[travel.transportationType]}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 加载完成提示 -->
|
||||
<view wx:if="{{isFinished && 0 < list.length}}" class="finished">没有更多了</view>
|
||||
</view>
|
||||
<!-- 新建按钮 -->
|
||||
<view class="fab" bind:tap="toCreate">
|
||||
<t-icon name="add" size="24px" color="#fff" />
|
||||
</view>
|
||||
Reference in New Issue
Block a user