feat: 增加时间轴功能

This commit is contained in:
2026-09-10 16:27:19 +08:00
parent 5f270b05d6
commit d1edbd52bd
5 changed files with 25 additions and 8 deletions

View File

@@ -33,11 +33,11 @@
</wd-form-item> </wd-form-item>
<wd-form-item title="内容"> <wd-form-item title="内容">
<wd-input <wd-textarea
v-model="patchStore.recordForm.content" v-model="patchStore.recordForm.content"
:maxlength="20" :maxlength="50" auto-height
show-word-limit show-word-limit
placeholder="请输入菜地地点" placeholder="请输入内容"
/> />
</wd-form-item> </wd-form-item>

View File

@@ -13,9 +13,17 @@
</view> </view>
</view> </view>
<view class="p-3">
<wd-search v-model="patchStore.patchSearch"
:maxlength="20" :placeholder-left="true" :hide-cancel="true"
placeholder="请输入菜地名称或者菜地地点"
@change="patchStore.queryPatchList()"
@clear="patchStore.queryPatchList()"/>
</view>
<wd-card v-for="(item, index) in patchStore.patchList" :key="item.id"> <wd-card v-for="(item, index) in patchStore.patchList" :key="item.id">
<template #title> <template #title>
<view class="wd-card__title-text flex items-center justify-between"> <view class="wd-card__title-text flex items-center justify-between" @click="editPatchClick(item)">
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
<text v-if="item.location" class="text-sm text-[#999]">{{ item.location }}</text> <text v-if="item.location" class="text-sm text-[#999]">{{ item.location }}</text>
</view> </view>
@@ -44,7 +52,6 @@
<wd-text v-else text="暂无作物 请先添加"/> <wd-text v-else text="暂无作物 请先添加"/>
<view class="flex gap-1"> <view class="flex gap-1">
<wd-button icon="edit" round @click="editPatchClick(item)"></wd-button>
<wd-button icon="list" round @click="viewDetailClick(item)"></wd-button> <wd-button icon="list" round @click="viewDetailClick(item)"></wd-button>
</view> </view>
</view> </view>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,12 @@
<template> <template>
<view class="min-h-screen flex flex-col"> <view class="min-h-screen flex flex-col" style="background-image: linear-gradient(180deg, #4CAF50 0%, #8BC34A 42%, #E8F5E9 100%)">
<wd-text text="我的"/> <view class="self-center py-3 flex items-center gap-2 text-gray-800">
<view class="flex min-w-0 flex-col">
<text class="truncate text-lg text-white font-semibold">
正在开发中
</text>
</view>
</view>
</view> </view>
</template> </template>

View File

@@ -6,6 +6,7 @@ export const usePatchStore = defineStore('patch', {
state: () => ({ state: () => ({
baseUrl: 'https://cxx0822.s.3q.hair', baseUrl: 'https://cxx0822.s.3q.hair',
showPatchFab: true, showPatchFab: true,
patchSearch: '',
patchList: [] as IPatch[], patchList: [] as IPatch[],
patchApiType: 'ADD' as 'ADD' | 'UPDATE' | 'DELETE', patchApiType: 'ADD' as 'ADD' | 'UPDATE' | 'DELETE',
patchForm: { patchForm: {
@@ -51,6 +52,9 @@ export const usePatchStore = defineStore('patch', {
url: `${this.baseUrl}/patch-api/patches`, url: `${this.baseUrl}/patch-api/patches`,
method: 'GET', method: 'GET',
header: { 'Content-Type': 'application/json' }, header: { 'Content-Type': 'application/json' },
data: {
keyword: this.patchSearch
},
success: (res) => { success: (res) => {
if (res.statusCode >= 200 && res.statusCode < 300) { if (res.statusCode >= 200 && res.statusCode < 300) {
resolve(res.data as IPatch[]) resolve(res.data as IPatch[])