diff --git a/README_zh.md b/README_zh.md index fb11933..b4acd1a 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,12 +1,10 @@ # 备忘录部件 -## 简介 + +## 1. 项目介绍 + 备忘录应用是OpenHarmony中预置的应用,为用户提供文本编辑以及保存功能。 -**架构图** - -![](./figures/note.png) - -## 目录 +## 2. 目录结构 ``` /applications/standard/note ├─common @@ -47,10 +45,20 @@ └─resources # 资源文件 ``` +### 整体架构 + +![](./figures/note.png) + +## 3. 签名打包 -## 编译构建/使用方法 ### 签名 + +#### 签名文件的获取 + +1.生成签名文件可参考https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/hapsigntool-overview.md + #### 签名文件的配置 + 打开项目工程,选择 File → Project Structure ![](./figures/signature_1.png) @@ -74,6 +82,7 @@ ![](./figures/ds_ohosbuild_output_dir_release.png) +## 4. 安装、调试 ### 应用安装 @@ -81,9 +90,6 @@ ![](./figures/install.png) - - - ### 应用调试 #### log打印 diff --git a/common/resources/src/main/resources/rawfile/editor.html b/common/resources/src/main/resources/rawfile/editor.html index 74bfa98..67cd2a0 100644 --- a/common/resources/src/main/resources/rawfile/editor.html +++ b/common/resources/src/main/resources/rawfile/editor.html @@ -16,9 +16,7 @@
-
- -
+
diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index b896641..5a4fd93 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -428,7 +428,7 @@ RICH_EDITOR.insertImageHtml = function (contents) { selection.getRangeAt(0).insertNode(img); }; -document.getElementById('addToDo').addEventListener('click', (e) => { +document.addEventListener('click', (e) => { console.info(`lsq: e is ${JSON.stringify(e)}`) if (e.id !== 'editorjs') { e.preventDefault() @@ -444,7 +444,6 @@ document.getElementById('chooseStyle').addEventListener('click', () => { }) document.getElementById('openAlbum').addEventListener('click', () => { - RICH_EDITOR.getFocus() callBackToApp.openAlbum() }) diff --git a/features/src/main/ets/components/CusDialogComp.ets b/features/src/main/ets/components/CusDialogComp.ets index 2914636..7c67f13 100644 --- a/features/src/main/ets/components/CusDialogComp.ets +++ b/features/src/main/ets/components/CusDialogComp.ets @@ -99,7 +99,6 @@ export struct NewOrEditFolderDialog { .width('48%') .onClick(() => { this.newOrEditFolderDialogCtl.close() - // @ts-ignore inputMethod.getController().stopInputSession(); }) Divider() @@ -123,7 +122,6 @@ export struct NewOrEditFolderDialog { .onClick(() => { this.newOrEditFolderDialogCtl.close() this.confirm(this.selectedColor, this.inputName) - // @ts-ignore inputMethod.getController().stopInputSession(); }) }.width('100%') @@ -697,7 +695,6 @@ export struct EditTitleDialog { .width('48%') .onClick(() => { this.editTitleDialog.close() - // @ts-ignore inputMethod.getController().stopInputSession(); }) Divider() @@ -714,7 +711,6 @@ export struct EditTitleDialog { .width('48%') .onClick(() => { this.editTitleDialog.close() - // @ts-ignore inputMethod.getController().stopInputSession(); if (this.inputName.replace(/\s+/g, '') == '') { return diff --git a/features/src/main/ets/components/NoteContent.ets b/features/src/main/ets/components/NoteContent.ets index f98a558..8d821e0 100644 --- a/features/src/main/ets/components/NoteContent.ets +++ b/features/src/main/ets/components/NoteContent.ets @@ -252,8 +252,8 @@ export struct NoteContent { } aboutToDisappear(): void { - NoteUtil.refreshAll() AppStorage.Set("refreshCurrentNote", true) + NoteUtil.refreshAll() clearInterval(timeID) LogUtil.info(TAG, "aboutToDisappear") } diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index 137838f..7c4d77b 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -228,10 +228,10 @@ export struct NoteContentCompPortrait { alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { Column() { ToolBarComp({ controllerShow: this.controllerShow }) + NoteContentOverViewComp() } Column() { - NoteContentOverViewComp() Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) .javaScriptAccess(true) .javaScriptProxy({ @@ -272,7 +272,6 @@ export struct NoteContentCompPortrait { this.storeScrollTop(event.yOffset) }) } - .enabled(this.selectedNoteData && this.selectedNoteData.is_deleted == Delete.Yes ? false : true) .flexShrink(1) .onClick(() => { if (time_id) { @@ -464,7 +463,6 @@ export struct ToolBarComp { .width(24) .responseRegion({ width: 54, height: 54 }) .onClick(() => { - inputMethod.getController().stopInputSession() this.controllerShow.runJavaScript({ script: "getHtmlContent()" }) // 清除定时器 if (time_id != undefined) { @@ -534,7 +532,6 @@ export struct ToolBarComp { Button({ type: ButtonType.Normal, stateEffect: true }) { Image($r('app.media.tick_thin')).height(24).width(24) .onClick(() => { - inputMethod.getController().stopInputSession() // 保存笔记信息到数据库 this.controllerShow.runJavaScript({ script: "getHtmlContent()" }) this.editModel = false diff --git a/product/default/src/main/ets/pages/NoteHomePortrait.ets b/product/default/src/main/ets/pages/NoteHomePortrait.ets index 042273b..e5ab098 100644 --- a/product/default/src/main/ets/pages/NoteHomePortrait.ets +++ b/product/default/src/main/ets/pages/NoteHomePortrait.ets @@ -60,23 +60,13 @@ export struct NoteHomePortraitComp { .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) //Folder list display area - Row() { - Stack() { - FolderListBackGround() - FolderListComp() - } - .width(200) - .height(StyleConstants.PERCENTAGE_100) - .visibility(this.expandStatus == false ? Visibility.None : Visibility.Visible) - - Column() { - } - .height("100%") - .width("100%") - .backgroundColor("#18181A") - .opacity(0.2) - .visibility(this.expandStatus ? Visibility.Visible : Visibility.None) + Stack() { + FolderListBackGround() + FolderListComp() } + .width(200) + .height(StyleConstants.PERCENTAGE_100) + .visibility(this.expandStatus == false ? Visibility.None : Visibility.Visible) } .width(StyleConstants.PERCENTAGE_100).height(StyleConstants.PERCENTAGE_100) }