You've already forked SmartisanNote.Remake
调整了编辑器的样式;
调整了头部的按钮;
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ion-page>
|
||||
<div class="container">
|
||||
<Header :title="isEditing ? '编辑便签' : '新建便签'" :onBack="handleCancel" :onAction="handleSave" actionText="保存" />
|
||||
<Header :onBack="handleCancel" :onAction="handleSave" actionIcon="save" />
|
||||
|
||||
<!-- 富文本编辑器 -->
|
||||
<div class="editor-container">
|
||||
@@ -64,25 +64,23 @@ const showAlert = ref(false)
|
||||
|
||||
// 计算属性
|
||||
const formattedTime = computed(() => {
|
||||
if (!isEditing) return '新建便签'
|
||||
|
||||
const date = new Date(existingNote.updatedAt)
|
||||
const now = new Date()
|
||||
const date = existingNote?.updatedAt ? new Date(existingNote.updatedAt) : now
|
||||
|
||||
// 如果是今天
|
||||
if (date.toDateString() === now.toDateString()) {
|
||||
return `编辑于 今天 ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`
|
||||
return `今天 ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
// 如果是昨天
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
if (date.toDateString() === yesterday.toDateString()) {
|
||||
return `编辑于 昨天 ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`
|
||||
return `昨天 ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
// 其他情况显示月日
|
||||
return `编辑于 ${date.getMonth() + 1}月${date.getDate()}日`
|
||||
return `${date.getMonth() + 1}月${date.getDate()}日`
|
||||
})
|
||||
|
||||
const wordCount = computed(() => {
|
||||
@@ -140,31 +138,6 @@ const setShowAlert = value => {
|
||||
background-color: var(--background);
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background-color: var(--background-card);
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
padding: 8px;
|
||||
margin-right: 8px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.toolbar-btn:hover {
|
||||
background-color: var(--background-hover);
|
||||
}
|
||||
|
||||
.toolbar-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.editor-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -35,24 +35,23 @@
|
||||
<!-- 点击外部区域收起文件夹列表的覆盖层 -->
|
||||
<div v-if="isFolderExpanded" @click="() => setIsFolderExpanded(false)" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: transparent; z-index: 99"></div>
|
||||
|
||||
<div style="padding: 0.8rem 0.5rem; margin-top: -2.8rem">
|
||||
<div style="padding: 0.8rem 0.5rem">
|
||||
<SearchBar v-model="searchQuery" @search="handleSearch" @clear="handleClearSearch" @focus="handleSearchFocus" @blur="handleSearchBlur" />
|
||||
</div>
|
||||
|
||||
<div style="flex: 1">
|
||||
<div v-for="note in filteredAndSortedNotes" :key="note.id" style="margin: 0.4rem 0">
|
||||
<NoteItem
|
||||
:title="note.title"
|
||||
:content="note.content"
|
||||
:date="formatDate(note.updatedAt)"
|
||||
:isStarred="note.isStarred"
|
||||
:isTop="note.isTop || false"
|
||||
:hasImage="note.hasImage || false"
|
||||
:onPress="() => handleNotePress(note.id)"
|
||||
:onStarToggle="() => handleStarToggle(note.id)"
|
||||
:onTopToggle="() => handleTopToggle(note.id)"
|
||||
:onDelete="() => handleDeleteNote(note.id)"
|
||||
/>
|
||||
<NoteItem
|
||||
:title="note.title"
|
||||
:content="note.content"
|
||||
:date="formatDate(note.updatedAt)"
|
||||
:isStarred="note.isStarred"
|
||||
:isTop="note.isTop || false"
|
||||
:hasImage="note.hasImage || false"
|
||||
:onPress="() => handleNotePress(note.id)"
|
||||
:onStarToggle="() => handleStarToggle(note.id)"
|
||||
:onTopToggle="() => handleTopToggle(note.id)"
|
||||
:onDelete="() => handleDeleteNote(note.id)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user