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

@ -3,22 +3,22 @@ import { Travel } from "../types/Travel";
import { QueryPage, QueryPageResult } from "../types/Model"; import { QueryPage, QueryPageResult } from "../types/Model";
/** /**
* Travel 行计划 API * Travel 行计划 API
* *
* 按业务模块封装网络请求,使代码更清晰、可维护 * 按业务模块封装网络请求,使代码更清晰、可维护
*/ */
export class TravelApi { export class TravelApi {
/** /**
* 获取行详情 * 获取行详情
* *
* @param id - 行 ID * @param id - 行 ID
*/ */
static getDetail(id: number | string): Promise<Travel> { static getDetail(id: number | string): Promise<Travel> {
return Network.get<Travel>(`/journal/travel/${id}`); return Network.get<Travel>(`/journal/travel/${id}`);
} }
/** /**
* 行分页列表 * 行分页列表
* *
* @param pageParams - 分页参数 * @param pageParams - 分页参数
*/ */
@ -27,9 +27,9 @@ export class TravelApi {
} }
/** /**
* 创建 * 创建
* *
* @param data - 行数据 * @param data - 行数据
*/ */
static create(data: Partial<Travel>): Promise<Travel> { static create(data: Partial<Travel>): Promise<Travel> {
return Network.post<Travel>("/journal/travel/create", data, { return Network.post<Travel>("/journal/travel/create", data, {
@ -39,9 +39,9 @@ export class TravelApi {
} }
/** /**
* 更新 * 更新
* *
* @param data - 行数据(必须包含 id * @param data - 行数据(必须包含 id
*/ */
static update(data: Partial<Travel> & { id: number }): Promise<Travel> { static update(data: Partial<Travel> & { id: number }): Promise<Travel> {
return Network.post<Travel>("/journal/travel/update", data, { return Network.post<Travel>("/journal/travel/update", data, {
@ -51,9 +51,9 @@ export class TravelApi {
} }
/** /**
* 删除 * 删除
* *
* @param id - 行 ID * @param id - 行 ID
*/ */
static delete(id: number): Promise<void> { static delete(id: number): Promise<void> {
return Network.post<void>("/journal/travel/delete", { id }); return Network.post<void>("/journal/travel/delete", { id });

View File

@ -3,13 +3,13 @@ import { TravelLocation } from "../types/Travel";
import { QueryPage, QueryPageResult } from "../types/Model"; import { QueryPage, QueryPageResult } from "../types/Model";
/** /**
* TravelLocation 行地点 API * TravelLocation 行地点 API
* *
* 按业务模块封装网络请求,使代码更清晰、可维护 * 按业务模块封装网络请求,使代码更清晰、可维护
*/ */
export class TravelLocationApi { export class TravelLocationApi {
/** /**
* 获取行地点详情 * 获取行地点详情
* *
* @param id - 地点 ID * @param id - 地点 ID
*/ */
@ -18,7 +18,7 @@ export class TravelLocationApi {
} }
/** /**
* 获取行地点分页列表 * 获取行地点分页列表
* *
* @param pageParams - 分页参数(通常包含 travelId 筛选) * @param pageParams - 分页参数(通常包含 travelId 筛选)
*/ */
@ -27,7 +27,7 @@ export class TravelLocationApi {
} }
/** /**
* 创建行地点 * 创建行地点
* *
* @param data - 地点数据 * @param data - 地点数据
*/ */
@ -39,7 +39,7 @@ export class TravelLocationApi {
} }
/** /**
* 更新行地点 * 更新行地点
* *
* @param data - 地点数据(必须包含 id * @param data - 地点数据(必须包含 id
*/ */
@ -51,7 +51,7 @@ export class TravelLocationApi {
} }
/** /**
* 删除行地点 * 删除行地点
* *
* @param id - 地点 ID * @param id - 地点 ID
*/ */
@ -60,7 +60,7 @@ export class TravelLocationApi {
} }
/** /**
* 批量获取行地点 * 批量获取行地点
* *
* @param ids - 地点 ID 数组 * @param ids - 地点 ID 数组
*/ */

View File

@ -49,7 +49,7 @@
"selectedIconPath": "@tabBarIconMomentActive" "selectedIconPath": "@tabBarIconMomentActive"
}, },
{ {
"text": "行", "text": "行",
"pagePath": "pages/main/travel/index", "pagePath": "pages/main/travel/index",
"iconPath": "@tabBarIconTravel", "iconPath": "@tabBarIconTravel",
"selectedIconPath": "@tabBarIconTravelActive" "selectedIconPath": "@tabBarIconTravelActive"

View File

@ -1,4 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"t-icon": "tdesign-miniprogram/icon/icon"
}
} }

View File

@ -23,31 +23,9 @@ page {
} }
.snowflake { .snowflake {
width: 10px; color: var(--theme-brand-gao);
height: 10px;
display: block; display: block;
position: absolute; position: absolute;
animation: snowflakeFall linear infinite; animation: snowflakeFall linear infinite;
&::before,
&::after {
content: '';
position: absolute;
background: var(--theme-brand-gao);
opacity: .8;
}
&::before {
top: 45%;
left: 0;
width: 100%;
height: 10%;
}
&::after {
left: 45%;
width: 10%;
height: 100%;
}
} }
} }

View File

@ -20,7 +20,7 @@ Component({
createSnowflake() { createSnowflake() {
const snowflake = { const snowflake = {
x: Toolkit.random(0, this.data.docWidth), x: Toolkit.random(0, this.data.docWidth),
s: Toolkit.random(6, 20), s: Toolkit.random(16, 64),
speed: Toolkit.random(14, 26) speed: Toolkit.random(14, 26)
}; };
this.setData({ this.setData({

View File

@ -1,9 +1,10 @@
<!--components/background/snow/index.wxml--> <!--components/background/snow/index.wxml-->
<view class="snowflakes" style="width: {{docWidth}}px; height: {{docHeight}}px;"> <view class="snowflakes" style="width: {{docWidth}}px; height: {{docHeight}}px;">
<view <t-icon
class="snowflake" class="snowflake"
wx:for="{{snowflakes}}" wx:for="{{snowflakes}}"
wx:key="index" wx:key="index"
style="left: {{item.x}}px; width: {{item.s}}px; height: {{item.s}}px; animation-duration: {{item.speed}}s;" style="left: {{item.x}}px; font-size: {{item.s}}rpx; animation-duration: {{item.speed}}s;"
></view> name="snowflake"
/>
</view> </view>

View File

@ -57,7 +57,7 @@
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: bold; font-weight: bold;
background: var(--theme-bg-journal); background: var(--theme-bg-card);
border-radius: 12rpx; border-radius: 12rpx;
} }
} }

View File

@ -81,7 +81,7 @@
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: bold; font-weight: bold;
background: var(--theme-bg-journal); background: var(--theme-bg-card);
border-radius: 12rpx; border-radius: 12rpx;
} }
} }

View File

@ -43,9 +43,6 @@
<t-tag wx:if="{{item.importance}}" theme="success" variant="outline"> <t-tag wx:if="{{item.importance}}" theme="success" variant="outline">
重要性 {{item.importance}} 重要性 {{item.importance}}
</t-tag> </t-tag>
<t-tag wx:if="{{item.travelCount > 0}}" theme="default" variant="outline">
已出行 {{item.travelCount}} 次
</t-tag>
<t-tag wx:if="{{item.requireIdCard}}" theme="danger" variant="outline"> <t-tag wx:if="{{item.requireIdCard}}" theme="danger" variant="outline">
需要身份证 需要身份证
</t-tag> </t-tag>

View File

@ -26,6 +26,7 @@
display: flex; display: flex;
.radio { .radio {
background: transparent;
margin-right: 1em; margin-right: 1em;
} }
} }

View File

@ -77,7 +77,7 @@ Page({
async onLoad(options: any) { async onLoad(options: any) {
// 授权定位 // 授权定位
const setting = await wx.getSetting(); const setting = await wx.getSetting();
wx.setStorageSync("isAuthLocation", setting.authSetting["scope.userLocation"]); wx.setStorageSync("isAuthLocation", setting.authSetting["scope.userLocation"] || false);
let isAuthLocation = JSON.parse(wx.getStorageSync("isAuthLocation")); let isAuthLocation = JSON.parse(wx.getStorageSync("isAuthLocation"));
this.setData({ isAuthLocation }); this.setData({ isAuthLocation });
if (!isAuthLocation) { if (!isAuthLocation) {
@ -293,7 +293,7 @@ Page({
// 创建模式:只有 mediaList // 创建模式:只有 mediaList
const sources = (this.data.mediaList as WechatMediaItem[]).map(item => ({ const sources = (this.data.mediaList as WechatMediaItem[]).map(item => ({
url: item.path, url: item.path,
type: MediaItemType[item.type].toLowerCase() type: item.type.toLowerCase()
})); }));
const total = sources.length; const total = sources.length;

View File

@ -14,7 +14,7 @@
width: fit-content; width: fit-content;
min-width: 350rpx; min-width: 350rpx;
max-width: 450rpx; max-width: 450rpx;
background: #fff; background: var(--theme-bg-card-secondary);
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
border-radius: 6rpx; border-radius: 6rpx;
@ -56,7 +56,7 @@
flex-direction: column; flex-direction: column;
.location { .location {
color: #333; color: var(--theme-text-primary);
overflow: hidden; overflow: hidden;
font-size: 30rpx; font-size: 30rpx;
white-space: nowrap; white-space: nowrap;
@ -68,7 +68,7 @@
display: flex; display: flex;
.date { .date {
color: #999; color: var(--theme-text-secondary);
font-size: 24rpx; font-size: 24rpx;
margin-right: 16rpx; margin-right: 16rpx;
} }

View File

@ -3,19 +3,7 @@ import config from "../../../config/index";
import Time from "../../../utils/Time"; import Time from "../../../utils/Time";
import { Journal, JournalPageType } from "../../../types/Journal"; import { Journal, JournalPageType } from "../../../types/Journal";
import Toolkit from "../../../utils/Toolkit"; import Toolkit from "../../../utils/Toolkit";
import { MapMarker } from "../../../types/UI";
interface MapMarker {
id: number;
latitude: number;
longitude: number;
width: number;
height: number;
customCallout: {
anchorY: number;
anchorX: number;
display: string;
};
}
interface LocationMarker { interface LocationMarker {
locationKey: string; // 位置键 "lat,lng" locationKey: string; // 位置键 "lat,lng"

View File

@ -41,7 +41,7 @@
<view wx:for="{{journal.columnedItems}}" wx:for-item="column" wx:for-index="columnIndex" wx:key="columnIndex" class="column"> <view wx:for="{{journal.columnedItems}}" wx:for-item="column" wx:for-index="columnIndex" wx:key="columnIndex" class="column">
<block wx:for="{{column}}" wx:for-item="item" wx:for-index="itemIndex" wx:key="attachmentId"> <block wx:for="{{column}}" wx:for-item="item" wx:for-index="itemIndex" wx:key="attachmentId">
<image <image
class="item thumbnail {{item.type === 0 ? 'image' : 'video'}}" class="item thumbnail {{item.type}}"
src="{{item.thumbURL}}" src="{{item.thumbURL}}"
mode="widthFix" mode="widthFix"
bindtap="preview" bindtap="preview"

View File

@ -4,22 +4,17 @@ import Events from "../../../utils/Events";
import IOSize, { Unit } from "../../../utils/IOSize"; import IOSize, { Unit } from "../../../utils/IOSize";
import Time from "../../../utils/Time"; import Time from "../../../utils/Time";
import Toolkit from "../../../utils/Toolkit"; import Toolkit from "../../../utils/Toolkit";
import type { Location } from "../../../types/UI"; import { Location, MediaItemType } from "../../../types/UI";
import { MediaAttachExt } from "../../../types/Attachment";
type Item = { type Item = {
id: number; id: number;
type: ItemType; type: MediaItemType;
mongoId: string; thumbURL: string;
thumbUrl: string; sourceURL: string;
sourceMongoId: string;
checked: boolean; checked: boolean;
} }
enum ItemType {
IMAGE,
VIDEO
}
type MD5Result = { type MD5Result = {
path: string; path: string;
md5: string; md5: string;
@ -73,7 +68,7 @@ Page({
// 授权定位 // 授权定位
const setting = await wx.getSetting(); const setting = await wx.getSetting();
wx.setStorageSync("isAuthLocation", setting.authSetting["scope.userLocation"]); wx.setStorageSync("isAuthLocation", setting.authSetting["scope.userLocation"] || false);
let isAuthLocation = JSON.parse(wx.getStorageSync("isAuthLocation")); let isAuthLocation = JSON.parse(wx.getStorageSync("isAuthLocation"));
this.setData({ isAuthLocation }); this.setData({ isAuthLocation });
if (!isAuthLocation) { if (!isAuthLocation) {
@ -142,13 +137,14 @@ Page({
} }
this.setData({ this.setData({
list: list.map((item: any) => { list: list.map((item: any) => {
const extData = JSON.parse(item.ext); const ext = JSON.parse(item.ext) as MediaAttachExt;
const thumbURL = `${config.url}/attachment/read/${item.mongoId}`;
const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`;
return { return {
id: item.id, id: item.id,
type: extData.isImage ? ItemType.IMAGE : ItemType.VIDEO, type: ext.isImage ? MediaItemType.IMAGE : MediaItemType.VIDEO,
mongoId: item.mongoId, thumbURL,
thumbUrl: `${config.url}/attachment/read/${item.mongoId}`, sourceURL,
sourceMongoId: extData.sourceMongoId,
checked: false checked: false
} as Item; } as Item;
}) })
@ -176,8 +172,8 @@ Page({
const sources = this.data.list.slice(startIndex, endIndex).map((item: Item) => { const sources = this.data.list.slice(startIndex, endIndex).map((item: Item) => {
return { return {
url: `${config.url}/attachment/read/${item.sourceMongoId}`, url: item.sourceURL,
type: item.type === 0 ? "image" : "video" type: item.type.toLowerCase()
} }
}) as any; }) as any;
wx.previewMedia({ wx.previewMedia({
@ -347,13 +343,14 @@ Page({
wx.showToast({ title: "上传成功", icon: "success" }); wx.showToast({ title: "上传成功", icon: "success" });
const list = resp.data.data; const list = resp.data.data;
const added = list.map((item: any) => { const added = list.map((item: any) => {
const extData = JSON.parse(item.ext); const ext = JSON.parse(item.ext) as MediaAttachExt;
const thumbURL = `${config.url}/attachment/read/${item.mongoId}`;
const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`;
return { return {
id: item.id, id: item.id,
type: extData.isImage ? ItemType.IMAGE : ItemType.VIDEO, type: ext.isImage ? MediaItemType.IMAGE : MediaItemType.VIDEO,
mongoId: item.mongoId, thumbURL,
thumbUrl: `${config.url}/attachment/read/${item.mongoId}`, sourceURL,
sourceMongoId: extData.sourceMongoId,
checked: false checked: false
} as Item; } as Item;
}); });

View File

@ -63,8 +63,8 @@
<view class="items"> <view class="items">
<view class="item" wx:for="{{list}}" wx:key="mongoId"> <view class="item" wx:for="{{list}}" wx:key="mongoId">
<image <image
class="thumbnail {{item.type === 0 ? 'image' : 'video'}}" class="thumbnail {{item.type}}"
src="{{item.thumbUrl}}" src="{{item.thumbURL}}"
mode="widthFix" mode="widthFix"
bind:tap="preview" bind:tap="preview"
data-index="{{index}}" data-index="{{index}}"

View File

@ -18,7 +18,7 @@
<view wx:for="{{journal.columnedItems}}" wx:for-item="column" wx:for-index="columnIndex" wx:key="columnIndex" class="column"> <view wx:for="{{journal.columnedItems}}" wx:for-item="column" wx:for-index="columnIndex" wx:key="columnIndex" class="column">
<block wx:for="{{column}}" wx:for-item="item" wx:for-index="itemIndex" wx:key="attachmentId"> <block wx:for="{{column}}" wx:for-item="item" wx:for-index="itemIndex" wx:key="attachmentId">
<image <image
class="item thumbnail {{item.type === 0 ? 'image' : 'video'}}" class="item thumbnail {{item.type.toLowerCase()}}"
src="{{item.thumbURL}}" src="{{item.thumbURL}}"
mode="widthFix" mode="widthFix"
bindtap="preview" bindtap="preview"

View File

@ -40,9 +40,8 @@
&.locations { &.locations {
.action { .header {
gap: 32rpx; padding: 16rpx 32rpx;
display: flex;
} }
.location { .location {

View File

@ -6,9 +6,9 @@ import { TravelLocationApi } from "../../../api/TravelLocationApi";
import { Travel, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon } from "../../../types/Travel"; import { Travel, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon } from "../../../types/Travel";
interface TravelDetailData { interface TravelDetailData {
/** 行详情 */ /** 行详情 */
travel: Travel | null; travel: Travel | null;
/** 行 ID */ /** 行 ID */
travelId: string; travelId: string;
/** 是否正在加载 */ /** 是否正在加载 */
isLoading: boolean; isLoading: boolean;
@ -71,7 +71,7 @@ Page({
} }
}, },
/** 获取行详情 */ /** 获取行详情 */
async fetchDetail(id: string) { async fetchDetail(id: string) {
this.setData({ isLoading: true }); this.setData({ isLoading: true });
@ -88,7 +88,7 @@ Page({
// 获取地点列表 // 获取地点列表
this.fetchLocations(id); this.fetchLocations(id);
} catch (error) { } catch (error) {
console.error("获取行详情失败:", error); console.error("获取行详情失败:", error);
wx.showToast({ wx.showToast({
title: "加载失败", title: "加载失败",
icon: "error" icon: "error"
@ -122,7 +122,7 @@ Page({
} }
}, },
/** 编辑行 */ /** 编辑行 */
toEdit() { toEdit() {
const { travel } = this.data; const { travel } = this.data;
if (travel && travel.id) { if (travel && travel.id) {
@ -163,7 +163,7 @@ Page({
} }
}, },
/** 删除行 */ /** 删除行 */
deleteTravel() { deleteTravel() {
this.setData({ this.setData({
deleteDialogVisible: true, deleteDialogVisible: true,

View File

@ -1,6 +1,6 @@
<!--pages/main/travel-detail/index.wxml--> <!--pages/main/travel-detail/index.wxml-->
<view class="custom-navbar"> <view class="custom-navbar">
<t-navbar title="行详情" leftArrow bind:go-back="goBack"> <t-navbar title="行详情" leftArrow bind:go-back="goBack">
<view slot="right" class="edit-btn" bind:tap="toEdit"> <view slot="right" class="edit-btn" bind:tap="toEdit">
<t-icon name="edit" size="24px" /> <t-icon name="edit" size="24px" />
</view> </view>
@ -24,7 +24,7 @@
</t-tag> </t-tag>
</view> </view>
<!-- 标题 --> <!-- 标题 -->
<view class="section title">{{travel.title || '未命名行'}}</view> <view class="section title">{{travel.title || '未命名行'}}</view>
<!-- 基本信息 --> <!-- 基本信息 -->
<t-cell-group class="section info"> <t-cell-group class="section info">
<view slot="title" class="title">基本信息</view> <view slot="title" class="title">基本信息</view>
@ -34,7 +34,7 @@
<text wx:else class="undecided-value">未定</text> <text wx:else class="undecided-value">未定</text>
</view> </view>
</t-cell> </t-cell>
<t-cell left-icon="calendar" title="行天数"> <t-cell left-icon="calendar" title="行天数">
<view slot="note"> <view slot="note">
<text wx:if="{{travel.days}}">{{travel.days}} 天</text> <text wx:if="{{travel.days}}">{{travel.days}} 天</text>
<text wx:else class="undecided-value">未定</text> <text wx:else class="undecided-value">未定</text>
@ -44,18 +44,16 @@
<view slot="note">{{transportLabels[travel.transportationType]}}</view> <view slot="note">{{transportLabels[travel.transportationType]}}</view>
</t-cell> </t-cell>
</t-cell-group> </t-cell-group>
<!-- 行内容 --> <!-- 行内容 -->
<t-cell-group class="section"> <t-cell-group wx:if="{{travel.content}}" class="section">
<view slot="title" class="title">详细说明</view> <view slot="title" class="title">详细说明</view>
<t-cell title="{{travel.content || '暂无'}}" /> <t-cell title="{{travel.content}}" />
</t-cell-group> </t-cell-group>
<t-cell-group class="section locations"> <t-cell-group class="section locations">
<view slot="title" class="title">地点列表</view> <view slot="title" class="title">地点列表</view>
<t-cell> <t-cell class="header">
<view slot="right-icon" class="action"> <t-button slot="left-icon" theme="primary" icon="map" size="small" bind:tap="toMap">地图浏览</t-button>
<t-icon name="map" size="20px" color="var(--theme-wx)" bind:tap="toMap" /> <t-icon slot="right-icon" name="add" size="20px" color="var(--theme-wx)" bind:tap="toAddLocation" />
<t-icon name="add" size="20px" color="var(--theme-wx)" bind:tap="toAddLocation" />
</view>
</t-cell> </t-cell>
<t-cell wx:if="{{isLoadingLocations}}" class="loading"> <t-cell wx:if="{{isLoadingLocations}}" class="loading">
<t-loading slot="title" theme="dots" size="40rpx" /> <t-loading slot="title" theme="dots" size="40rpx" />
@ -73,14 +71,18 @@
> >
<view slot="note" class="note">{{locationTypeLabels[item.type]}}</view> <view slot="note" class="note">{{locationTypeLabels[item.type]}}</view>
<view slot="description" class="description"> <view slot="description" class="description">
<view wx:if="{{item.amount}}" class="item">
<t-icon name="money" size="14px" />
<text>¥{{item.amount}}</text>
</view>
<view wx:if="{{item.requireIdCard}}" class="item"> <view wx:if="{{item.requireIdCard}}" class="item">
<t-icon name="user" size="14px" /> <t-icon name="user" size="14px" />
<text>需要身份证</text> <text>需要身份证</text>
</view> </view>
<view wx:if="{{item.requireAppointment}}" class="item">
<t-icon name="user" size="14px" />
<text>需要预约</text>
</view>
<view wx:if="{{item.amount}}" class="item">
<t-icon name="money" size="14px" />
<text>¥{{item.amount}}</text>
</view>
<view wx:if="{{item.importance}}" class="item"> <view wx:if="{{item.importance}}" class="item">
<t-icon name="chart-bubble" size="14px" /> <t-icon name="chart-bubble" size="14px" />
<text>重要程度</text> <text>重要程度</text>
@ -97,8 +99,7 @@
</view> </view>
</t-cell> </t-cell>
</block> </block>
<t-cell wx:else class="empty-state" description="暂无地点信息"> <t-cell wx:else class="empty-state" description="暂无地点信息" />
</t-cell>
</t-cell-group> </t-cell-group>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view class="section action"> <view class="section action">
@ -119,7 +120,7 @@
t-class="edit" t-class="edit"
bind:tap="toEdit" bind:tap="toEdit"
> >
编辑行计划 编辑行计划
</t-button> </t-button>
</view> </view>
</view> </view>
@ -128,7 +129,7 @@
<!-- 删除确认对话框 --> <!-- 删除确认对话框 -->
<t-dialog <t-dialog
visible="{{deleteDialogVisible}}" visible="{{deleteDialogVisible}}"
title="删除行计划" title="删除行计划"
confirm-btn="{{ {content: '删除', variant: 'text', theme: 'danger'} }}" confirm-btn="{{ {content: '删除', variant: 'text', theme: 'danger'} }}"
cancel-btn="取消" cancel-btn="取消"
bind:confirm="confirmDelete" bind:confirm="confirmDelete"

View File

@ -23,12 +23,23 @@
.section { .section {
margin-top: 48rpx; margin-top: 48rpx;
> .title {
color: var(--theme-text-secondary);
padding: 0 32rpx;
font-size: 28rpx;
line-height: 64rpx;
}
.picker .slot { .picker .slot {
gap: 16rpx; gap: 16rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.note {
color: var(--theme-text-primary);
}
.travel-at-content, .travel-at-content,
.days-content { .days-content {
gap: 16rpx; gap: 16rpx;
@ -54,9 +65,16 @@
} }
} }
.days-stepper { .days {
display: flex;
align-items: center; &.decided {
--td-cell-vertical-padding: 24rpx;
.t-cell__title {
display: flex;
align-items: center;
}
}
} }
} }

View File

@ -7,7 +7,7 @@ import { TravelStatus, TransportationType } from "../../../types/Travel";
interface TravelEditorData { interface TravelEditorData {
/** 模式create 或 edit */ /** 模式create 或 edit */
mode: "create" | "edit"; mode: "create" | "edit";
/** 行 ID编辑模式 */ /** 行 ID编辑模式 */
id?: number; id?: number;
/** 标题 */ /** 标题 */
title: string; title: string;
@ -105,7 +105,7 @@ Page({
}); });
} }
}, },
/** 加载行详情(编辑模式) */ /** 加载行详情(编辑模式) */
async loadTravelDetail(id: number) { async loadTravelDetail(id: number) {
wx.showLoading({ title: "加载中...", mask: true }); wx.showLoading({ title: "加载中...", mask: true });
try { try {
@ -230,7 +230,7 @@ Page({
this.updateTravel(); this.updateTravel();
} }
}, },
/** 创建行 */ /** 创建行 */
async createTravel() { async createTravel() {
this.setData({ isSaving: true }); this.setData({ isSaving: true });
@ -238,9 +238,7 @@ Page({
await TravelApi.create({ await TravelApi.create({
title: this.data.title.trim(), title: this.data.title.trim(),
content: this.data.content.trim(), content: this.data.content.trim(),
travelAt: this.data.travelAtUndecided travelAt: this.data.travelAtUndecided ? null : Time.now(),
? null
: new Date(`${this.data.date}T${this.data.time}:00`).getTime(),
days: this.data.daysUndecided ? null : this.data.days, days: this.data.daysUndecided ? null : this.data.days,
transportationType: this.data.transportationType, transportationType: this.data.transportationType,
status: this.data.status status: this.data.status
@ -256,7 +254,7 @@ Page({
this.setData({ isSaving: false }); this.setData({ isSaving: false });
} }
}, },
/** 更新行 */ /** 更新行 */
async updateTravel() { async updateTravel() {
this.setData({ isSaving: true }); this.setData({ isSaving: true });
try { try {
@ -283,7 +281,7 @@ Page({
this.setData({ isSaving: false }); this.setData({ isSaving: false });
} }
}, },
/** 删除行 */ /** 删除行 */
deleteTravel() { deleteTravel() {
this.setData({ this.setData({
deleteDialogVisible: true, deleteDialogVisible: true,

View File

@ -1,5 +1,5 @@
<!--pages/main/travel-editor/index.wxml--> <!--pages/main/travel-editor/index.wxml-->
<t-navbar title="{{mode === 'create' ? '新建行' : '编辑行'}}"> <t-navbar title="{{mode === 'create' ? '新建行' : '编辑行'}}">
<text slot="left" bindtap="cancel">取消</text> <text slot="left" bindtap="cancel">取消</text>
</t-navbar> </t-navbar>
@ -11,12 +11,12 @@
</view> </view>
<block wx:else> <block wx:else>
<t-cell-group class="section"> <t-cell-group class="section">
<view slot="title" class="title">基本信息</view>
<t-input <t-input
class="input" class="input"
placeholder="请输入行标题" placeholder="请输入行标题"
model:value="{{title}}" model:value="{{title}}"
maxlength="50" maxlength="50"
borderless
> >
<text slot="label">标题</text> <text slot="label">标题</text>
</t-input> </t-input>
@ -31,6 +31,7 @@
</t-textarea> </t-textarea>
</t-cell-group> </t-cell-group>
<t-cell-group class="section"> <t-cell-group class="section">
<view slot="title" class="title">详细信息</view>
<t-cell class="travel-at" title="出行时间"> <t-cell class="travel-at" title="出行时间">
<view slot="right-icon" class="travel-at-content"> <view slot="right-icon" class="travel-at-content">
<picker wx:if="{{!travelAtUndecided}}" class="picker" mode="date" model:value="{{date}}"> <picker wx:if="{{!travelAtUndecided}}" class="picker" mode="date" model:value="{{date}}">
@ -51,13 +52,13 @@
/> />
</view> </view>
</t-cell> </t-cell>
<t-cell title="行天数" t-class="days-cell"> <t-cell title="行天数" class="days {{daysUndecided ? 'undecided' : 'decided'}}">
<view slot="right-icon" class="days-content"> <view slot="right-icon" class="days-content">
<t-stepper <t-stepper
wx:if="{{!daysUndecided}}" wx:if="{{!daysUndecided}}"
theme="filled" theme="filled"
model:value="{{days}}" model:value="{{days}}"
size="medium" size="large"
min="{{1}}" min="{{1}}"
max="{{999}}" max="{{999}}"
t-class="stepper" t-class="stepper"
@ -74,40 +75,28 @@
/> />
</view> </view>
</t-cell> </t-cell>
<t-cell title="交通方式"> <picker
<view slot="right-icon"> mode="selector"
<picker range="{{transportationTypes}}"
class="picker" range-key="label"
mode="selector" value="{{transportationTypeIndex}}"
range="{{transportationTypes}}" bindchange="onChangeTransportationType"
range-key="label" >
value="{{transportationTypeIndex}}" <t-cell title="交通方式" arrow>
bindchange="onChangeTransportationType" <view slot="note" class="note">{{transportationTypes[transportationTypeIndex].label}}</view>
> </t-cell>
<view class="slot"> </picker>
<text>{{transportationTypes[transportationTypeIndex].label}}</text> <picker
<t-icon name="chevron-right" size="20px" class="icon" /> mode="selector"
</view> range="{{statuses}}"
</picker> range-key="label"
</view> value="{{statusIndex}}"
</t-cell> bindchange="onChangeStatus"
<t-cell title="状态"> >
<view slot="right-icon"> <t-cell title="状态" arrow>
<picker <view slot="note" class="note">{{statuses[statusIndex].label}}</view>
class="picker" </t-cell>
mode="selector" </picker>
range="{{statuses}}"
range-key="label"
value="{{statusIndex}}"
bindchange="onChangeStatus"
>
<view class="slot">
<text>{{statuses[statusIndex].label}}</text>
<t-icon name="chevron-right" size="20px" class="icon" />
</view>
</picker>
</view>
</t-cell>
</t-cell-group> </t-cell-group>
<view wx:if="{{mode === 'create'}}" class="submit-section"> <view wx:if="{{mode === 'create'}}" class="submit-section">
<t-button <t-button
@ -117,7 +106,7 @@
bind:tap="submit" bind:tap="submit"
disabled="{{isSaving}}" disabled="{{isSaving}}"
> >
创建 创建
</t-button> </t-button>
</view> </view>
<view wx:else class="submit-section horizontal"> <view wx:else class="submit-section horizontal">
@ -148,7 +137,7 @@
<!-- 删除确认对话框 --> <!-- 删除确认对话框 -->
<t-dialog <t-dialog
visible="{{deleteDialogVisible}}" visible="{{deleteDialogVisible}}"
title="删除行计划" title="删除行计划"
confirm-btn="{{ {content: '删除', variant: 'text', theme: 'danger'} }}" confirm-btn="{{ {content: '删除', variant: 'text', theme: 'danger'} }}"
cancel-btn="取消" cancel-btn="取消"
bind:confirm="confirmDelete" bind:confirm="confirmDelete"

View File

@ -1,7 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"t-tag": "tdesign-miniprogram/tag/tag",
"t-cell": "tdesign-miniprogram/cell/cell", "t-cell": "tdesign-miniprogram/cell/cell",
"t-rate": "tdesign-miniprogram/rate/rate", "t-rate": "tdesign-miniprogram/rate/rate",
"t-icon": "tdesign-miniprogram/icon/icon", "t-icon": "tdesign-miniprogram/icon/icon",

View File

@ -24,12 +24,6 @@
line-height: 64rpx; line-height: 64rpx;
} }
&.status {
display: flex;
margin-top: 24rpx;
justify-content: center;
}
&.title { &.title {
color: var(--theme-text-primary); color: var(--theme-text-primary);
padding: 24rpx; padding: 24rpx;
@ -67,6 +61,26 @@
width: 100%; width: 100%;
height: 520rpx; height: 520rpx;
} }
.custom-callout {
width: fit-content;
max-width: 400rpx;
background: var(--theme-bg-card-secondary);
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
border-radius: 8rpx;
.callout-content {
padding: 12rpx 20rpx;
.callout-text {
color: var(--theme-text-primary);
overflow: hidden;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
} }
&.media { &.media {
@ -112,12 +126,13 @@
&.navigate { &.navigate {
padding: 0 16rpx; padding: 0 16rpx;
margin-top: 90rpx;
} }
&.action { &.action {
gap: 24rpx; gap: 24rpx;
display: flex; display: flex;
padding: 24rpx 16rpx 0 16rpx; padding: 0 16rpx;
.edit { .edit {
flex: 2; flex: 2;

View File

@ -1,18 +1,13 @@
// pages/main/travel-location-detail/index.ts // pages/main/travel-location-detail/index.ts
import Time from "../../../utils/Time";
import config from "../../../config/index"; import config from "../../../config/index";
import { TravelLocationApi } from "../../../api/TravelLocationApi"; import { TravelLocationApi } from "../../../api/TravelLocationApi";
import { TravelLocation, TravelLocationTypeIcon, TravelLocationTypeLabel } from "../../../types/Travel"; import { TravelLocation, TravelLocationTypeIcon, TravelLocationTypeLabel } from "../../../types/Travel";
import { MediaAttachExt, MediaAttachType } from "../../../types/Attachment"; import { MediaAttachExt, MediaAttachType } from "../../../types/Attachment";
import { MediaItem, MediaItemType } from "../../../types/UI"; import { MapMarker, MediaItem, MediaItemType } from "../../../types/UI";
import Toolkit from "../../../utils/Toolkit"; import Toolkit from "../../../utils/Toolkit";
interface TravelLocationView extends TravelLocation { interface TravelLocationView extends TravelLocation {
/** 首次出行时间 */
firstTravelTime?: string;
/** 最近出行时间 */
lastTravelTime?: string;
/** 媒体列表 */ /** 媒体列表 */
mediaItems?: MediaItem[]; mediaItems?: MediaItem[];
} }
@ -22,7 +17,7 @@ interface TravelLocationDetailData {
location: TravelLocationView | null; location: TravelLocationView | null;
/** 地点 ID */ /** 地点 ID */
locationId: string; locationId: string;
/** 行 ID */ /** 行 ID */
travelId: string; travelId: string;
/** 是否正在加载 */ /** 是否正在加载 */
isLoading: boolean; isLoading: boolean;
@ -35,7 +30,7 @@ interface TravelLocationDetailData {
/** 媒体类型枚举 */ /** 媒体类型枚举 */
mediaItemTypeEnum: typeof MediaItemType; mediaItemTypeEnum: typeof MediaItemType;
/** 地图标记 */ /** 地图标记 */
mapMarkers: WechatMiniprogram.MapMarker[]; mapMarkers: MapMarker[];
/** 删除对话框可见性 */ /** 删除对话框可见性 */
deleteDialogVisible: boolean; deleteDialogVisible: boolean;
/** 删除确认文本 */ /** 删除确认文本 */
@ -100,11 +95,7 @@ Page({
thumbItems.forEach((thumbItem) => { thumbItems.forEach((thumbItem) => {
try { try {
const extStr = thumbItem.ext ? thumbItem.ext.toString() : ""; const ext = JSON.parse(thumbItem.ext!.toString()) as MediaAttachExt;
if (!extStr) {
return;
}
const ext = JSON.parse(extStr) as MediaAttachExt;
const thumbURL = `${config.url}/attachment/read/${thumbItem.mongoId}`; const thumbURL = `${config.url}/attachment/read/${thumbItem.mongoId}`;
const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`; const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`;
mediaItems.push({ mediaItems.push({
@ -120,35 +111,28 @@ Page({
}); });
// 构建地图标记 // 构建地图标记
const mapMarkers: WechatMiniprogram.MapMarker[] = []; const mapMarkers: MapMarker[] = [];
if (location.lat !== undefined && location.lng !== undefined) { if (location.lat !== undefined && location.lng !== undefined) {
mapMarkers.push({ mapMarkers.push({
id: 0, id: 0,
latitude: location.lat, latitude: location.lat,
longitude: location.lng, longitude: location.lng,
width: 30, width: 24,
height: 30, height: 30,
callout: { customCallout: {
content: location.title || "地点", anchorY: 0,
display: "ALWAYS", anchorX: 0,
padding: 10, display: "ALWAYS"
borderRadius: 5,
bgColor: "#FFFFFF",
color: "#333333",
fontSize: 12,
textAlign: "center"
} }
}); });
} }
console.log(mediaItems); console.log(mediaItems);
this.setData({ this.setData({
location: { location: {
...location, ...location,
mediaItems, mediaItems
firstTravelTime: location.firstTraveledAt ? Time.toDateTime(location.firstTraveledAt) : "",
lastTravelTime: location.lastTraveledAt ? Time.toDateTime(location.lastTraveledAt) : ""
}, },
travelId: location.travelId ? String(location.travelId) : this.data.travelId, travelId: location.travelId ? String(location.travelId) : this.data.travelId,
mapMarkers mapMarkers

View File

@ -20,12 +20,6 @@
<t-empty icon="location" description="暂无地点信息" /> <t-empty icon="location" description="暂无地点信息" />
</view> </view>
<view wx:else class="content"> <view wx:else class="content">
<!-- 类型标签 -->
<view class="section status">
<t-tag size="large" theme="primary" variant="light" icon="{{locationTypeIcons[location.type]}}">
{{locationTypeLabels[location.type]}}
</t-tag>
</view>
<!-- 标题 --> <!-- 标题 -->
<view class="section title"> <view class="section title">
<text class="title-text">{{location.title || '未命名地点'}}</text> <text class="title-text">{{location.title || '未命名地点'}}</text>
@ -33,6 +27,11 @@
<!-- 位置信息 --> <!-- 位置信息 -->
<t-cell-group wx:if="{{location.lat !== undefined && location.lng !== undefined}}" class="section location"> <t-cell-group wx:if="{{location.lat !== undefined && location.lng !== undefined}}" class="section location">
<view slot="title" class="title">位置信息</view> <view slot="title" class="title">位置信息</view>
<t-cell
left-icon="{{locationTypeIcons[location.type]}}"
title="类型"
note="{{locationTypeLabels[location.type]}}"
/>
<t-cell class="map"> <t-cell class="map">
<map <map
slot="description" slot="description"
@ -42,7 +41,15 @@
markers="{{mapMarkers}}" markers="{{mapMarkers}}"
scale="15" scale="15"
show-location show-location
></map> >
<cover-view slot="callout">
<cover-view class="custom-callout" marker-id="0">
<cover-view class="callout-content">
<cover-view class="callout-text">{{location.title || '地点'}}</cover-view>
</cover-view>
</cover-view>
</cover-view>
</map>
</t-cell> </t-cell>
<t-cell <t-cell
left-icon="location" left-icon="location"
@ -57,13 +64,13 @@
<t-cell wx:if="{{location.amount !== undefined && location.amount !== null}}" left-icon="money" title="费用"> <t-cell wx:if="{{location.amount !== undefined && location.amount !== null}}" left-icon="money" title="费用">
<view slot="note">¥{{location.amount}}</view> <view slot="note">¥{{location.amount}}</view>
</t-cell> </t-cell>
<t-cell left-icon="verify" title="需要身份证"> <t-cell left-icon="verify" title="身份证">
<view slot="note" class="{{location.requireIdCard ? 'red' : ''}}"> <view slot="note" class="{{location.requireIdCard ? 'red' : ''}}">
{{location.requireIdCard ? '需要' : '无需'}} {{location.requireIdCard ? '需要' : '无需'}}
</view> </view>
</t-cell> </t-cell>
<t-cell left-icon="calendar" title="需要预约"> <t-cell left-icon="calendar" title="预约">
<view slot="note" class="{{location.requireAppointment ? 'warning' : ''}}"> <view slot="note" class="{{location.requireAppointment ? 'red' : ''}}">
{{location.requireAppointment ? '需要' : '无需'}} {{location.requireAppointment ? '需要' : '无需'}}
</view> </view>
</t-cell> </t-cell>
@ -78,19 +85,6 @@
</view> </view>
</t-cell> </t-cell>
</t-cell-group> </t-cell-group>
<!-- 出行记录 -->
<t-cell-group class="section">
<view slot="title" class="title">出行记录</view>
<t-cell left-icon="flag" title="首次出行">
<view slot="note">{{location.firstTravelTime || '未记录'}}</view>
</t-cell>
<t-cell left-icon="calendar-1" title="最近出行">
<view slot="note">{{location.lastTravelTime || '未记录'}}</view>
</t-cell>
<t-cell left-icon="chart" title="累计次数">
<view slot="note">{{location.travelCount || 0}} 次</view>
</t-cell>
</t-cell-group>
<!-- 详细说明 --> <!-- 详细说明 -->
<t-cell-group wx:if="{{location.description}}" class="section"> <t-cell-group wx:if="{{location.description}}" class="section">
<view slot="title" class="title">详细说明</view> <view slot="title" class="title">详细说明</view>

View File

@ -30,17 +30,18 @@
line-height: 64rpx; line-height: 64rpx;
} }
.location { &.location {
.title { .note {
width: 2em; color: var(--theme-text-primary);
} }
}
.picker .slot { .value {
gap: 16rpx;
display: flex; .title {
align-items: center; width: 2em;
}
}
} }
&.media { &.media {
@ -127,103 +128,36 @@
} }
} }
} }
}
.media-section { &.upload {
margin-top: 48rpx; gap: 16rpx;
padding: 32rpx; display: flex;
background: var(--theme-bg-card); padding: 24rpx 32rpx;
margin-top: 24rpx;
align-items: center;
border-radius: 12rpx;
background: var(--theme-bg-card);
.section-title { .text {
color: var(--theme-text-primary); color: var(--theme-text-secondary);
margin-bottom: 24rpx; font-size: 28rpx;
font-size: 32rpx; }
font-weight: bold;
} }
.media-grid { &.action {
gap: 24rpx; gap: 24rpx;
display: grid; display: flex;
grid-template-columns: repeat(3, 1fr); padding: 24rpx 16rpx 48rpx 16rpx;
.media-item { .delete-btn {
width: 100%; flex: .6;
height: 200rpx;
overflow: hidden;
position: relative;
border-radius: 12rpx;
.media-img {
width: 100%;
height: 100%;
}
.video-badge {
top: 50%;
left: 50%;
display: flex;
position: absolute;
transform: translate(-50%, -50%);
align-items: center;
justify-content: center;
}
.media-delete {
top: 8rpx;
right: 8rpx;
width: 48rpx;
height: 48rpx;
display: flex;
position: absolute;
background: rgba(0, 0, 0, .5);
align-items: center;
border-radius: 50%;
justify-content: center;
}
} }
.media-add { .submit-btn {
width: 100%; flex: 1;
height: 200rpx;
display: flex;
align-items: center;
border-radius: 12rpx;
justify-content: center;
background: var(--theme-bg-page);
border: 2rpx dashed var(--theme-border);
} }
} }
} }
.upload-info {
gap: 16rpx;
display: flex;
padding: 24rpx 32rpx;
margin-top: 24rpx;
align-items: center;
border-radius: 12rpx;
background: var(--theme-bg-card);
.upload-text {
color: var(--theme-text-secondary);
font-size: 28rpx;
}
}
.submit-section {
gap: 24rpx;
display: flex;
padding: 24rpx 16rpx 48rpx 16rpx;
margin-top: 64rpx;
.delete-btn {
flex: .6;
}
.submit-btn {
flex: 1;
}
}
} }
} }

View File

@ -10,9 +10,9 @@ import { MediaItem, MediaItemType } from "../../../types/UI";
interface TravelLocationEditorData { interface TravelLocationEditorData {
/** 模式create 或 edit */ /** 模式create 或 edit */
mode: "create" | "edit"; mode: "create" | "edit";
/** 行地点 ID编辑模式 */ /** 行地点 ID编辑模式 */
id?: number; id?: number;
/** 关联的行计划 ID */ /** 关联的行计划 ID */
travelId: number; travelId: number;
/** 地点类型 */ /** 地点类型 */
type: TravelLocationType; type: TravelLocationType;
@ -32,12 +32,6 @@ interface TravelLocationEditorData {
requireIdCard: boolean; requireIdCard: boolean;
/** 是否需要预约 */ /** 是否需要预约 */
requireAppointment: boolean; requireAppointment: boolean;
/** 首次出行时间戳 */
firstTraveledAt: number;
/** 上次出行时间戳 */
lastTraveledAt: number;
/** 出行次数 */
travelCount: number;
/** 评分 */ /** 评分 */
score: number; score: number;
/** 重要程度 */ /** 重要程度 */
@ -55,11 +49,11 @@ interface TravelLocationEditorData {
/** 上传进度信息 */ /** 上传进度信息 */
uploadInfo: string; uploadInfo: string;
/** 地点类型选项 */ /** 地点类型选项 */
locationTypes: { label: string; value: TravelLocationType }[]; locationTypes: string[];
/** 地点类型值数组 */
locationTypeValues: TravelLocationType[];
/** 地点类型选中索引 */ /** 地点类型选中索引 */
locationTypeIndex: number; locationTypeIndex: number;
/** 地点类型选择器可见性 */
locationTypePickerVisible: boolean;
/** 删除对话框可见性 */ /** 删除对话框可见性 */
deleteDialogVisible: boolean; deleteDialogVisible: boolean;
/** 删除确认文本 */ /** 删除确认文本 */
@ -82,9 +76,6 @@ Page({
amount: 0, amount: 0,
requireIdCard: false, requireIdCard: false,
requireAppointment: false, requireAppointment: false,
firstTraveledAt: 0,
lastTraveledAt: 0,
travelCount: 0,
score: 3, score: 3,
importance: 1, importance: 1,
mediaList: [], mediaList: [],
@ -96,16 +87,17 @@ Page({
mediaItemTypeEnum: { mediaItemTypeEnum: {
...MediaItemType ...MediaItemType
}, },
locationTypes: [ locationTypes: ["美食", "酒店", "交通", "景点", "购物", "玩乐", "生活"],
{ label: "景点", value: TravelLocationType.ATTRACTION }, locationTypeValues: [
{ label: "酒店", value: TravelLocationType.HOTEL }, TravelLocationType.FOOD,
{ label: "餐厅", value: TravelLocationType.RESTAURANT }, TravelLocationType.HOTEL,
{ label: "交通站点", value: TravelLocationType.TRANSPORT }, TravelLocationType.TRANSPORT,
{ label: "购物", value: TravelLocationType.SHOPPING }, TravelLocationType.ATTRACTION,
{ label: "其他", value: TravelLocationType.OTHER } TravelLocationType.SHOPPING,
TravelLocationType.PLAY,
TravelLocationType.LIFE
], ],
locationTypeIndex: 0, locationTypeIndex: 0,
locationTypePickerVisible: false,
deleteDialogVisible: false, deleteDialogVisible: false,
deleteConfirmText: "" deleteConfirmText: ""
}, },
@ -115,7 +107,7 @@ Page({
const travelId = options.travelId ? parseInt(options.travelId) : 0; const travelId = options.travelId ? parseInt(options.travelId) : 0;
if (!travelId) { if (!travelId) {
wx.showToast({ wx.showToast({
title: "缺少行计划 ID", title: "缺少行计划 ID",
icon: "error" icon: "error"
}); });
setTimeout(() => { setTimeout(() => {
@ -155,8 +147,8 @@ Page({
// 计算地点类型索引 // 计算地点类型索引
const type = location.type || TravelLocationType.ATTRACTION; const type = location.type || TravelLocationType.ATTRACTION;
const locationTypeIndex = this.data.locationTypes.findIndex( const locationTypeIndex = this.data.locationTypeValues.findIndex(
item => item.value === type item => item === type
); );
const items = location.items || []; const items = location.items || [];
@ -186,9 +178,6 @@ Page({
amount: location.amount || 0, amount: location.amount || 0,
requireIdCard: location.requireIdCard || false, requireIdCard: location.requireIdCard || false,
requireAppointment: location.requireAppointment || false, requireAppointment: location.requireAppointment || false,
firstTraveledAt: location.firstTraveledAt || 0,
lastTraveledAt: location.lastTraveledAt || 0,
travelCount: location.travelCount || 0,
score: location.score !== undefined ? location.score : 3, score: location.score !== undefined ? location.score : 3,
importance: location.importance !== undefined ? location.importance : 1, importance: location.importance !== undefined ? location.importance : 1,
mediaList, mediaList,
@ -212,30 +201,10 @@ Page({
const index = e.detail.value; const index = e.detail.value;
this.setData({ this.setData({
locationTypeIndex: index, locationTypeIndex: index,
type: this.data.locationTypes[index].value type: this.data.locationTypeValues[index]
}); });
}, },
/** 显示地点类型选择器 */
showLocationTypePicker() {
this.setData({ locationTypePickerVisible: true });
},
/** Picker 确认 */
onPickerConfirm(e: any) {
const index = e.detail.value;
this.setData({
locationTypeIndex: index,
type: this.data.locationTypes[index].value,
locationTypePickerVisible: false
});
},
/** Picker 取消 */
onPickerCancel() {
this.setData({ locationTypePickerVisible: false });
},
/** 改变是否需要身份证 */ /** 改变是否需要身份证 */
onChangeRequireIdCard(e: any) { onChangeRequireIdCard(e: any) {
this.setData({ requireIdCard: e.detail.value }); this.setData({ requireIdCard: e.detail.value });
@ -355,7 +324,7 @@ Page({
// 创建模式:只有 mediaList // 创建模式:只有 mediaList
const sources = (this.data.mediaList as WechatMediaItem[]).map(item => ({ const sources = (this.data.mediaList as WechatMediaItem[]).map(item => ({
url: item.path, url: item.path,
type: MediaItemType[item.type].toLowerCase() type: item.type!.toLowerCase()
})); }));
const total = sources.length; const total = sources.length;
@ -371,11 +340,11 @@ Page({
// 编辑模式mediaList + newMediaList // 编辑模式mediaList + newMediaList
const sources = (this.data.mediaList as MediaItem[]).map(item => ({ const sources = (this.data.mediaList as MediaItem[]).map(item => ({
url: item.sourceURL, url: item.sourceURL,
type: MediaItemType[item.type].toLowerCase() type: item.type.toLowerCase()
})); }));
const newSources = this.data.newMediaList.map(item => ({ const newSources = this.data.newMediaList.map(item => ({
url: item.path, url: item.path,
type: MediaItemType[item.type].toLowerCase() type: item.type!.toLowerCase()
})); }));
const allSources = [...sources, ...newSources]; const allSources = [...sources, ...newSources];
const itemIndex = isNewMedia ? this.data.mediaList.length + index : index; const itemIndex = isNewMedia ? this.data.mediaList.length + index : index;
@ -514,9 +483,6 @@ Page({
amount: this.data.amount, amount: this.data.amount,
requireIdCard: this.data.requireIdCard, requireIdCard: this.data.requireIdCard,
requireAppointment: this.data.requireAppointment, requireAppointment: this.data.requireAppointment,
firstTraveledAt: this.data.firstTraveledAt,
lastTraveledAt: this.data.lastTraveledAt,
travelCount: this.data.travelCount,
score: this.data.score, score: this.data.score,
importance: this.data.importance, importance: this.data.importance,
tempFileIds tempFileIds
@ -573,9 +539,6 @@ Page({
amount: this.data.amount, amount: this.data.amount,
requireIdCard: this.data.requireIdCard, requireIdCard: this.data.requireIdCard,
requireAppointment: this.data.requireAppointment, requireAppointment: this.data.requireAppointment,
firstTraveledAt: this.data.firstTraveledAt,
lastTraveledAt: this.data.lastTraveledAt,
travelCount: this.data.travelCount,
score: this.data.score, score: this.data.score,
importance: this.data.importance, importance: this.data.importance,
attachmentIds, attachmentIds,

View File

@ -10,14 +10,16 @@
<text class="text">加载中...</text> <text class="text">加载中...</text>
</view> </view>
<block wx:else> <block wx:else>
<t-cell-group class="section"> <t-cell-group class="section location">
<view slot="title" class="title">位置信息</view> <view slot="title" class="title">位置信息</view>
<t-cell title="地点类型" arrow bind:click="showLocationTypePicker"> <picker mode="selector" range="{{locationTypes}}" value="{{locationTypeIndex}}" bindchange="onChangeLocationType">
<view slot="note" class="black">{{locationTypes[locationTypeIndex].label}}</view> <t-cell title="地点类型" arrow>
</t-cell> <view slot="note" class="note">{{locationTypes[locationTypeIndex]}}</view>
<t-cell class="location" required arrow bind:click="chooseLocation"> </t-cell>
</picker>
<t-cell class="value" required arrow bind:click="chooseLocation">
<view slot="title" class="title">位置</view> <view slot="title" class="title">位置</view>
<view slot="note" class="black">{{location}}</view> <view slot="note" class="note">{{location}}</view>
</t-cell> </t-cell>
</t-cell-group> </t-cell-group>
<t-cell-group class="section"> <t-cell-group class="section">
@ -46,6 +48,7 @@
placeholder="0" placeholder="0"
label="费用" label="费用"
suffix="元" suffix="元"
type="digit"
align="right" align="right"
/> />
<t-cell title="需要身份证"> <t-cell title="需要身份证">
@ -207,16 +210,16 @@
</view> </view>
<!-- 上传进度提示 --> <!-- 上传进度提示 -->
<view wx:if="{{isUploading}}" class="upload-info"> <view wx:if="{{isUploading}}" class="section upload">
<t-loading theme="circular" size="32rpx" /> <t-loading theme="circular" size="32rpx" />
<text class="upload-text">{{uploadInfo}}</text> <text class="text">{{uploadInfo}}</text>
</view> </view>
<!-- 按钮 --> <!-- 按钮 -->
<view class="submit-section"> <view class="section action">
<t-button <t-button
wx:if="{{mode === 'edit'}}" wx:if="{{mode === 'edit'}}"
class="delete-btn" class="delete"
theme="danger" theme="danger"
variant="outline" variant="outline"
size="large" size="large"
@ -226,7 +229,7 @@
删除 删除
</t-button> </t-button>
<t-button <t-button
class="submit-btn" class="submit"
theme="primary" theme="primary"
size="large" size="large"
bind:tap="submit" bind:tap="submit"
@ -240,18 +243,6 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 地点类型选择器 -->
<t-picker
visible="{{locationTypePickerVisible}}"
value="{{locationTypeIndex}}"
cancelBtn="取消"
confirmBtn="确认"
bind:confirm="onPickerConfirm"
bind:cancel="onPickerCancel"
>
<t-picker-item options="{{locationTypes}}" />
</t-picker>
<!-- 删除确认对话框 --> <!-- 删除确认对话框 -->
<t-dialog <t-dialog
visible="{{deleteDialogVisible}}" visible="{{deleteDialogVisible}}"

View File

@ -8,46 +8,42 @@
.map { .map {
width: 100%; width: 100%;
height: 100%; height: 100%;
}
.custom-callout { .custom-callout {
width: fit-content; width: fit-content;
padding: 12rpx 16rpx; padding: 12rpx 16rpx;
display: flex;
min-width: 300rpx;
max-width: 400rpx;
background: #fff;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
border-radius: 6rpx;
flex-direction: column;
.location-item {
display: flex; display: flex;
padding: 6rpx 0; min-width: 300rpx;
align-items: center; max-width: 400rpx;
background: var(--theme-bg-card-secondary);
&:not(:last-child) { box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
border-bottom: 1px solid #eee; border-radius: 6rpx;
} flex-direction: column;
.type { .location-item {
color: #fff; display: flex;
padding: 2rpx 8rpx; padding: 6rpx 0;
font-size: 24rpx; align-items: center;
flex-shrink: 0;
background: var(--theme-wx, #07c160); .type {
margin-right: 12rpx; color: #fff;
border-radius: 4rpx; padding: 4rpx 12rpx 6rpx 12rpx;
} font-size: 28rpx;
flex-shrink: 0;
.title { background: var(--theme-wx, #07c160);
flex: 1; margin-right: 12rpx;
color: #333; border-radius: 4rpx;
overflow: hidden; }
font-size: 28rpx;
font-weight: bold; .title {
white-space: nowrap; flex: 1;
text-overflow: ellipsis; color: var(--theme-text-primary, #333);
overflow: hidden;
font-size: 28rpx;
font-weight: bold;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
} }
} }
@ -60,9 +56,9 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
.loading-text { .loading-text {
color: #666; color: var(--theme-text-secondary, #666);
padding: 24rpx 48rpx; padding: 24rpx 48rpx;
background: #FFF; background: var(--theme-bg-card, #fff);
border-radius: 8rpx; border-radius: 8rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
} }

View File

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

View File

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

View File

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

View File

@ -256,10 +256,10 @@ page {
--td-font-size-l: var(--td-font-size-title-large); --td-font-size-l: var(--td-font-size-title-large);
--td-font-size-xl: var(--td-font-size-title-extra-large); --td-font-size-xl: var(--td-font-size-title-extra-large);
--td-font-size-xxl: var(--td-font-size-headline-large); --td-font-size-xxl: var(--td-font-size-headline-large);
--td-radius-small: 2px; --td-radius-small: 8rpx;
--td-radius-default: 4px; --td-radius-default: 16rpx;
--td-radius-large: 6px; --td-radius-large: 24px;
--td-radius-extraLarge: 7px; --td-radius-extraLarge: 32rpx;
--td-radius-round: 999px; --td-radius-round: 9999rpx;
--td-radius-circle: 50%; --td-radius-circle: 50%;
} }

View File

@ -13,6 +13,7 @@ page {
--theme-bg-primary: #FFF; --theme-bg-primary: #FFF;
--theme-bg-secondary: #F5F5F5; --theme-bg-secondary: #F5F5F5;
--theme-bg-card: #FFF; --theme-bg-card: #FFF;
--theme-bg-card-secondary: #F4F4F4;
--theme-bg-journal: #FFF2C8; --theme-bg-journal: #FFF2C8;
--theme-bg-overlay: rgba(0, 0, 0, .1); --theme-bg-overlay: rgba(0, 0, 0, .1);
--theme-bg-menu: rgba(255, 255, 255, .95); --theme-bg-menu: rgba(255, 255, 255, .95);
@ -68,7 +69,8 @@ page {
--theme-bg-primary: #1A1A1A; --theme-bg-primary: #1A1A1A;
--theme-bg-secondary: #2A2A2A; --theme-bg-secondary: #2A2A2A;
--theme-bg-card: #2C2C2C; --theme-bg-card: #2C2C2C;
--theme-bg-journal: #3A3A2E; --theme-bg-card-secondary: #404040;
--theme-bg-journal: #404040;
--theme-bg-overlay: rgba(0, 0, 0, .3); --theme-bg-overlay: rgba(0, 0, 0, .3);
--theme-bg-menu: rgba(40, 40, 40, .95); --theme-bg-menu: rgba(40, 40, 40, .95);

View File

@ -22,28 +22,38 @@ export const TransportationTypeLabel: Record<TransportationType, string> = {
[TransportationType.OTHER]: "其他" [TransportationType.OTHER]: "其他"
}; };
/** 旅行状态 */ /** 交通类型图标映射 */
export const TransportationTypeIcon: Record<TransportationType, string> = {
[TransportationType.PLANE]: "flight-takeoff",
[TransportationType.TRAIN]: "map-route",
[TransportationType.CAR]: "vehicle",
[TransportationType.SHIP]: "anchor",
[TransportationType.SELF_DRIVING]: "vehicle",
[TransportationType.OTHER]: "compass"
};
/** 出行状态 */
export enum TravelStatus { export enum TravelStatus {
PLANNING = "PLANNING", PLANNING = "PLANNING",
ONGOING = "ONGOING", ONGOING = "ONGOING",
COMPLETED = "COMPLETED" COMPLETED = "COMPLETED"
} }
/** 行状态中文映射 */ /** 行状态中文映射 */
export const TravelStatusLabel: Record<TravelStatus, string> = { export const TravelStatusLabel: Record<TravelStatus, string> = {
[TravelStatus.PLANNING]: "计划中", [TravelStatus.PLANNING]: "计划中",
[TravelStatus.ONGOING]: "进行中", [TravelStatus.ONGOING]: "进行中",
[TravelStatus.COMPLETED]: "已完成" [TravelStatus.COMPLETED]: "已完成"
}; };
/** 行状态图标映射 */ /** 行状态图标映射 */
export const TravelStatusIcon: Record<TravelStatus, string> = { export const TravelStatusIcon: Record<TravelStatus, string> = {
[TravelStatus.PLANNING]: "calendar", [TravelStatus.PLANNING]: "calendar",
[TravelStatus.ONGOING]: "play-circle", [TravelStatus.ONGOING]: "play-circle",
[TravelStatus.COMPLETED]: "check-circle" [TravelStatus.COMPLETED]: "check-circle"
}; };
/** 行计划实体 */ /** 行计划实体 */
export interface Travel extends Model { export interface Travel extends Model {
/** 交通类型 */ /** 交通类型 */
transportationType?: TransportationType; transportationType?: TransportationType;
@ -55,10 +65,10 @@ export interface Travel extends Model {
content?: string; content?: string;
/** 出行时间戳 */ /** 出行时间戳 */
travelAt?: number; travelAt?: number | null;
/** 天数 */ /** 天数 */
days?: number; days?: number | null;
/** 状态 */ /** 状态 */
status?: TravelStatus; status?: TravelStatus;
@ -70,7 +80,7 @@ export interface Travel extends Model {
travelTime?: string; travelTime?: string;
} }
/** 行分页查询 */ /** 行分页查询 */
export interface TravelPage extends QueryPage { export interface TravelPage extends QueryPage {
/** 条件过滤 */ /** 条件过滤 */
equalsExample?: { equalsExample?: {
@ -80,37 +90,40 @@ export interface TravelPage extends QueryPage {
/** 地点类型 */ /** 地点类型 */
export enum TravelLocationType { export enum TravelLocationType {
ATTRACTION = "ATTRACTION", FOOD = "FOOD",
HOTEL = "HOTEL", HOTEL = "HOTEL",
RESTAURANT = "RESTAURANT",
TRANSPORT = "TRANSPORT", TRANSPORT = "TRANSPORT",
ATTRACTION = "ATTRACTION",
SHOPPING = "SHOPPING", SHOPPING = "SHOPPING",
OTHER = "OTHER" PLAY = "PLAY",
LIFE = "LEFE"
} }
/** 地点类型中文映射 */ /** 地点类型中文映射 */
export const TravelLocationTypeLabel: Record<TravelLocationType, string> = { export const TravelLocationTypeLabel: Record<TravelLocationType, string> = {
[TravelLocationType.ATTRACTION]: "景点", [TravelLocationType.FOOD]: "美食",
[TravelLocationType.HOTEL]: "酒店", [TravelLocationType.HOTEL]: "酒店",
[TravelLocationType.RESTAURANT]: "餐厅", [TravelLocationType.TRANSPORT]: "交通",
[TravelLocationType.TRANSPORT]: "交通站点", [TravelLocationType.ATTRACTION]: "点",
[TravelLocationType.SHOPPING]: "购物", [TravelLocationType.SHOPPING]: "购物",
[TravelLocationType.OTHER]: "其他" [TravelLocationType.PLAY]: "玩乐",
[TravelLocationType.LIFE]: "生活"
}; };
/** 地点类型图标映射 */ /** 地点类型图标映射 */
export const TravelLocationTypeIcon: Record<TravelLocationType, string> = { export const TravelLocationTypeIcon: Record<TravelLocationType, string> = {
[TravelLocationType.ATTRACTION]: "location", [TravelLocationType.FOOD]: "chicken",
[TravelLocationType.HOTEL]: "home", [TravelLocationType.HOTEL]: "city-8",
[TravelLocationType.RESTAURANT]: "shop", [TravelLocationType.TRANSPORT]: "map-route-planning",
[TravelLocationType.TRANSPORT]: "map-route", [TravelLocationType.ATTRACTION]: "image-1",
[TravelLocationType.SHOPPING]: "cart", [TravelLocationType.SHOPPING]: "shop",
[TravelLocationType.OTHER]: "ellipsis" [TravelLocationType.PLAY]: "ferris-wheel",
[TravelLocationType.LIFE]: "cart"
}; };
/** 行地点实体 */ /** 行地点实体 */
export interface TravelLocation extends Model { export interface TravelLocation extends Model {
/** 关联的行计划 ID */ /** 关联的行计划 ID */
travelId?: number; travelId?: number;
/** 地点类型 */ /** 地点类型 */
@ -140,15 +153,6 @@ export interface TravelLocation extends Model {
/** 是否需要预约 */ /** 是否需要预约 */
requireAppointment?: boolean; requireAppointment?: boolean;
/** 首次出行时间戳 */
firstTraveledAt?: number;
/** 上次出行时间戳 */
lastTraveledAt?: number;
/** 出行次数 */
travelCount?: number;
/** 评分 */ /** 评分 */
score?: number; score?: number;

View File

@ -55,10 +55,10 @@ export type WechatMediaItem = {
export enum MediaItemType { export enum MediaItemType {
/** 图片 */ /** 图片 */
IMAGE, IMAGE = "image",
/** 视频 */ /** 视频 */
VIDEO VIDEO = "video"
} }
/** 位置 */ /** 位置 */
@ -79,4 +79,17 @@ export enum JournalDetailType {
DATE = "DATE", DATE = "DATE",
LOCATION = "LOCATION" LOCATION = "LOCATION"
} }
export interface MapMarker {
id: number;
latitude: number;
longitude: number;
width: number;
height: number;
customCallout: {
anchorY: number;
anchorX: number;
display: string;
};
}

View File

@ -1,5 +1,6 @@
import config from "../config/index"; import config from "../config/index";
import { Response, QueryPage, QueryPageResult, TempFileResponse } from "../types/Model"; import { Response, QueryPage, QueryPageResult, TempFileResponse } from "../types/Model";
import { MediaItemType } from "../types/UI";
/** 微信媒体项(用于上传) */ /** 微信媒体项(用于上传) */
export interface WechatMediaItem { export interface WechatMediaItem {
@ -13,7 +14,7 @@ export interface WechatMediaItem {
size?: number; size?: number;
/** 媒体类型 */ /** 媒体类型 */
type?: string; type?: MediaItemType;
} }
/** 请求选项 */ /** 请求选项 */