add button store diary list

This commit is contained in:
Timi
2026-09-02 13:21:54 +08:00
parent f3602f232d
commit ddbb7e57af
2 changed files with 45 additions and 28 deletions
+39 -19
View File
@@ -1,12 +1,13 @@
<template>
<div v-can="permissionCodes.storeDiary.read" class="store-diary-list">
<t-pull-down-refresh
class="list-wrapper"
v-model="isRefreshing"
:refresh-timeout="30000"
@refresh="refresh"
@scrolltolower="loadMore"
>
<t-pull-down-refresh
v-can="permissionCodes.storeDiary.read"
class="store-diary-list"
v-model="isRefreshing"
:refresh-timeout="30000"
@refresh="refresh"
@scrolltolower="loadMore"
>
<div class="content">
<section class="calendar" v-entrance-transition>
<t-calendar
:key="calendarRenderKey"
@@ -20,6 +21,15 @@
@select="selectCalendarDate"
/>
</section>
<t-button
v-if="canCreate"
class="cell-button"
theme="primary"
block
@click="toCreateToday"
>
新增今天日记
</t-button>
<t-cell-group v-if="pageResult.list.length" class="items fix-last-cell-line" theme="card">
<t-swipe-cell
v-for="(item, index) in pageResult.list"
@@ -41,8 +51,8 @@
</t-swipe-cell>
</t-cell-group>
<div class="center-tips" v-text="loadStateText" />
</t-pull-down-refresh>
</div>
</div>
</t-pull-down-refresh>
<nav-bar-action-menu v-if="canShowActionMenu" :actions="actionList" />
<bottom-popup
v-model="diaryPopupVisible"
@@ -343,6 +353,13 @@ async function toCreate(): Promise<void> {
await router.push({ name: "StoreDiaryCreate" });
}
async function toCreateToday(): Promise<void> {
await router.push({
name: "StoreDiaryCreate",
query: { title: Time.formatDate(new Date()) }
});
}
async function toDetail(item: StoreDiary): Promise<void> {
if (!item.id) {
return;
@@ -417,12 +434,15 @@ onUnmounted(() => navBarStore.clearRight());
<style scoped lang="less">
.store-diary-list {
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
min-height: 70vh;
.list-wrapper {
min-height: 70vh;
.content {
gap: 1rem;
display: flex;
flex-direction: column;
.calendar {
margin: 0 1rem 1rem;
margin: 0 1rem;
overflow: hidden;
background: var(--td-bg-color-container);
box-shadow: var(--td-shadow-1);
@@ -460,13 +480,13 @@ onUnmounted(() => navBarStore.clearRight());
.items {
overflow: hidden;
}
}
.center-tips {
padding: 1rem;
color: var(--td-text-color-placeholder);
font-size: .8125rem;
text-align: center;
.center-tips {
padding: 1rem;
color: var(--td-text-color-placeholder);
font-size: .8125rem;
text-align: center;
}
}
}