refactor pages struct

This commit is contained in:
Timi
2026-01-28 14:11:54 +08:00
parent 8adc28ae9c
commit 965743be38
73 changed files with 234 additions and 176 deletions

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"journal-list": "/components/journal-list/index"
},
"navigationBarTitleText": "按列表查找"
}

View File

@@ -0,0 +1,21 @@
page {
height: 100vh;
background: var(--td-bg-color-page);
}
.page-container {
width: 100%;
height: 100%;
display: flex;
overflow: hidden;
flex-direction: column;
.navbar {
flex-shrink: 0;
}
.content {
flex: 1;
overflow: hidden;
}
}

View File

@@ -0,0 +1,19 @@
// pages/main/journal/search/index.ts
import Events from "../../../../utils/Events";
Page({
onLoad() {
Events.reset("JOURNAL_LIST_REFRESH", () => {
const listRef = this.selectComponent('#listRef');
if (listRef) {
listRef.reSearch();
}
});
},
onNavigateItem(e: WechatMiniprogram.CustomEvent) {
const { id } = e.detail;
wx.navigateTo({
url: `/pages/main/journal/editor/index?id=${id}`
});
}
});

View File

@@ -0,0 +1,13 @@
<view class="page-container">
<view class="navbar">
<t-navbar title="列表查找" left-arrow placeholder />
</view>
<view class="content">
<journal-list
id="listRef"
searchable="{{true}}"
mode="navigate"
bind:navigate="onNavigateItem"
/>
</view>
</view>