update style

This commit is contained in:
Timi
2025-12-17 16:16:10 +08:00
parent 423775c255
commit 369cfe2bf2
40 changed files with 375 additions and 507 deletions

View File

@ -66,7 +66,7 @@
}
.meta {
gap: 16rpx;
gap: 32rpx;
display: flex;
flex-wrap: wrap;

View File

@ -2,13 +2,13 @@
import Time from "../../../utils/Time";
import { TravelApi } from "../../../api/TravelApi";
import { Travel, TravelPage, TravelStatus, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel } from "../../../types/Travel";
import { Travel, TravelPage, TravelStatus, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TransportationTypeIcon } from "../../../types/Travel";
import { OrderType } from "../../../types/Model";
interface TravelData {
/** 分页参数 */
page: TravelPage;
/** 行列表 */
/** 行列表 */
list: Travel[];
/** 当前筛选状态 */
currentStatus: TravelStatus | "ALL";
@ -27,6 +27,8 @@ interface TravelData {
statusIcons: typeof TravelStatusIcon;
/** 交通类型标签映射 */
transportLabels: typeof TransportationTypeLabel;
/** 交通类型图标映射 */
transportIcons: typeof TransportationTypeIcon;
}
Page({
@ -47,7 +49,8 @@ Page({
menuLeft: 0,
statusLabels: TravelStatusLabel,
statusIcons: TravelStatusIcon,
transportLabels: TransportationTypeLabel
transportLabels: TransportationTypeLabel,
transportIcons: TransportationTypeIcon
},
onLoad() {
this.resetAndFetch();
@ -89,7 +92,7 @@ Page({
});
this.fetch();
},
/** 获取行列表 */
/** 获取行列表 */
async fetch() {
if (this.data.isFetching || this.data.isFinished) {
return;
@ -123,7 +126,7 @@ Page({
isFinished: list.length < this.data.page.size
});
} catch (error) {
console.error("获取行列表失败:", error);
console.error("获取行列表失败:", error);
} finally {
this.setData({ isFetching: false });
}
@ -164,7 +167,7 @@ Page({
});
this.resetAndFetch();
},
/** 新建行 */
/** 新建行 */
toCreate() {
wx.navigateTo({
url: "/pages/main/travel-editor/index"

View File

@ -1,6 +1,6 @@
<!--pages/main/travel/index.wxml-->
<view class="custom-navbar">
<t-navbar title="行计划">
<t-navbar title="行计划">
<view slot="left" class="filter-btn" bind:tap="toggleFilterMenu">
<t-icon name="filter" size="24px" />
</view>
@ -46,13 +46,13 @@
</t-cell-group>
</view>
<!-- 行列表 -->
<!-- 行列表 -->
<view class="travels">
<!-- 空状态 -->
<t-empty
wx:if="{{!isFetching && list.length === 0}}"
icon="travel"
description="暂无行计划"
description="暂无行计划"
/>
<!-- 列表内容 -->
<view
@ -74,19 +74,19 @@
</t-tag>
</view>
<view class="body">
<view class="title">{{travel.title || '未命名行'}}</view>
<view class="title">{{travel.title || '未命名行'}}</view>
<view wx:if="{{travel.content}}" class="content">{{travel.content}}</view>
<view class="meta">
<view class="item">
<view wx:if="{{travel.travelDate}}" class="item">
<t-icon name="time" size="16px" class="icon" />
<text class="text">{{travel.travelDate}} {{travel.travelTime}}</text>
<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="{{travel.transportationType === 'PLANE' ? 'flight-takeoff' : travel.transportationType === 'TRAIN' ? 'map-route' : travel.transportationType === 'SELF_DRIVING' ? 'control-platform' : 'location'}}" size="16px" class="icon" />
<t-icon name="{{transportIcons[travel.transportationType]}}" size="16px" class="icon" />
<text class="text">{{transportLabels[travel.transportationType]}}</text>
</view>
</view>