mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-12-04 05:49:30 +00:00
commit
d3dc3c6e34
@ -253,6 +253,10 @@ struct FolderItemComp {
|
||||
// update selectedFolderData and selectedNoteData
|
||||
this.selectedFolderData = FolderUtil.getFolderData(this.AllFolderArray, SysDefFolderUuid.AllNotes)
|
||||
this.selectedNoteData = NoteUtil.getFirstNoteData(this.AllNoteArray, SysDefFolderUuid.AllNotes)
|
||||
// 刷新web界面
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
})
|
||||
// save continue data
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
@ -482,6 +486,6 @@ export struct FolderListBackGround {
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.backgroundColor($r('app.color.folder_color_d6d6d6'))
|
||||
.blur(60)
|
||||
.backgroundBlurStyle(BlurStyle.Thick)
|
||||
}
|
||||
}
|
@ -372,7 +372,7 @@ export struct NoteContentOverViewComp {
|
||||
}
|
||||
|
||||
build() {
|
||||
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
|
||||
if (this.selectedNoteData) {
|
||||
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
|
||||
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Row() {
|
||||
@ -413,7 +413,7 @@ export struct NoteContentOverViewComp {
|
||||
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(80)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,9 +142,11 @@ export struct NoteContentComp {
|
||||
this.editContentFlag = true
|
||||
}
|
||||
LogUtil.info(TAG, "finish loadurl")
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
})
|
||||
if(this.selectedNoteData){
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
})
|
||||
}
|
||||
// 初次加载为为小屏预览模式
|
||||
if (this.sectionStatus != 1) {
|
||||
this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" })
|
||||
@ -282,7 +284,7 @@ export struct NoteContentOverViewComp {
|
||||
}
|
||||
|
||||
build() {
|
||||
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
|
||||
if (this.selectedNoteData) {
|
||||
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
|
||||
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Row() {
|
||||
@ -329,7 +331,7 @@ export struct NoteContentOverViewComp {
|
||||
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(80)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,7 +444,19 @@ export struct ToolBarComp {
|
||||
.onClick(() => {
|
||||
this.selectedNoteData.is_deleted = Delete.No
|
||||
this.selectedNoteData.deleted_time = 0
|
||||
prompt.showToast({ message: "已恢复", duration: 2000 })
|
||||
let context: any = getContext(this)
|
||||
let resource = {
|
||||
bundleName: "com.ohos.note",
|
||||
moduleName: "tablet",
|
||||
id: $r('app.string.restore').id
|
||||
};
|
||||
context.resourceManager.getString(resource, (error, value) => {
|
||||
if (error != null) {
|
||||
console.log("error is " + error);
|
||||
} else {
|
||||
prompt.showToast({ message: value, duration: 2000 });
|
||||
}
|
||||
});
|
||||
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
|
||||
this.chooseNote = false
|
||||
// update note to db
|
||||
|
@ -216,7 +216,7 @@ export struct NoteContentOverViewComp {
|
||||
}
|
||||
|
||||
build() {
|
||||
// if (this.selectedNoteData && this.selectedNoteData.is_deleted) {
|
||||
if (this.selectedNoteData) {
|
||||
Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap,
|
||||
justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Row() {
|
||||
@ -254,7 +254,7 @@ export struct NoteContentOverViewComp {
|
||||
.opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1)
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(82)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ export struct OperateNoteComp {
|
||||
this.longpress = false
|
||||
NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray)
|
||||
})
|
||||
Image(this.selectedAll ? $r('app.media.check_all1') : $r('app.media.check_all'))
|
||||
Image(this.CheckedNoteArray.length == NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid).length ? $r('app.media.check_all1') : $r('app.media.check_all'))
|
||||
.width(24)
|
||||
.height(24)
|
||||
.onClick(() => {
|
||||
|
@ -72,6 +72,9 @@ export class FolderUtil {
|
||||
}
|
||||
LogUtil.info(TAG, "folderData uuid " + folderData.uuid + " isSelected " + isSelected)
|
||||
if (folderData.folder_type == FolderType.SysDef || folderData.folder_type == FolderType.FeatureDef) {
|
||||
if (folderData.uuid ==SysDefFolderUuid.UnClassified) {
|
||||
return "#FF9516"
|
||||
}
|
||||
return isSelected ? $r("app.color.folder_color_f86d05") : $r("app.color.folder_color_99182431")
|
||||
}
|
||||
return folderData.color
|
||||
|
@ -144,6 +144,9 @@ export class NoteUtil {
|
||||
if (folderData.color == "#ffffff") {
|
||||
return "#FFEBE1"
|
||||
}
|
||||
if (folderData.color == "#e84026") {
|
||||
return "#ffe0b2ac"
|
||||
}
|
||||
LogUtil.info(TAG, "isSelected " + isSelected.toString() + ", folderData.color: " + folderData.color.toString())
|
||||
return isSelected ? selectedNoteBgColorMap[folderData.color] : unSelectedNoteBgColorMap[folderData.color]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user