瀏覽代碼

首页差best弹窗

XUYangWei 2 月之前
當前提交
2f81b521f8
共有 81 個文件被更改,包括 2895 次插入0 次删除
  1. 12 0
      .gitignore
  2. 10 0
      AppScope/app.json5
  3. 8 0
      AppScope/resources/base/element/string.json
  4. 二進制
      AppScope/resources/base/media/app_background.png
  5. 二進制
      AppScope/resources/base/media/app_foreground.png
  6. 7 0
      AppScope/resources/base/media/app_layered_image.json
  7. 42 0
      build-profile.json5
  8. 32 0
      code-linter.json5
  9. 6 0
      entry/.gitignore
  10. 28 0
      entry/build-profile.json5
  11. 6 0
      entry/hvigorfile.ts
  12. 23 0
      entry/obfuscation-rules.txt
  13. 10 0
      entry/oh-package.json5
  14. 33 0
      entry/src/main/ets/components/ReNameInput.ets
  15. 7 0
      entry/src/main/ets/constants/index.ets
  16. 87 0
      entry/src/main/ets/database/NoteDB.ets
  17. 108 0
      entry/src/main/ets/database/TaskCategoryDataBase.ets
  18. 114 0
      entry/src/main/ets/database/TaskDataBase.ets
  19. 346 0
      entry/src/main/ets/dialog/TaskItemDialog.ets
  20. 53 0
      entry/src/main/ets/entryability/EntryAbility.ets
  21. 41 0
      entry/src/main/ets/entryability/EntryAbility.ts
  22. 16 0
      entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
  23. 9 0
      entry/src/main/ets/models/Note.ets
  24. 142 0
      entry/src/main/ets/models/Task.ets
  25. 14 0
      entry/src/main/ets/models/TaskCategory.ets
  26. 69 0
      entry/src/main/ets/pages/Index.ets
  27. 48 0
      entry/src/main/ets/pages/PrivacyPage.ets
  28. 48 0
      entry/src/main/ets/pages/UserAgreementPage.ets
  29. 162 0
      entry/src/main/ets/test/index.ets
  30. 55 0
      entry/src/main/ets/utils/YTAvoid.ets
  31. 10 0
      entry/src/main/ets/utils/YTLog.ets
  32. 136 0
      entry/src/main/ets/views/About.ets
  33. 168 0
      entry/src/main/ets/views/DueTime.ets
  34. 354 0
      entry/src/main/ets/views/Main.ets
  35. 259 0
      entry/src/main/ets/views/Note.ets
  36. 105 0
      entry/src/main/ets/views/Time.ets
  37. 58 0
      entry/src/main/module.json5
  38. 8 0
      entry/src/main/resources/base/element/color.json
  39. 8 0
      entry/src/main/resources/base/element/float.json
  40. 16 0
      entry/src/main/resources/base/element/string.json
  41. 二進制
      entry/src/main/resources/base/media/background.png
  42. 二進制
      entry/src/main/resources/base/media/backimg.png
  43. 二進制
      entry/src/main/resources/base/media/book.png
  44. 二進制
      entry/src/main/resources/base/media/c_book.png
  45. 二進制
      entry/src/main/resources/base/media/c_my.png
  46. 二進制
      entry/src/main/resources/base/media/confim.png
  47. 二進制
      entry/src/main/resources/base/media/foreground.png
  48. 二進制
      entry/src/main/resources/base/media/half.png
  49. 二進制
      entry/src/main/resources/base/media/home_add.png
  50. 二進制
      entry/src/main/resources/base/media/icon.png
  51. 7 0
      entry/src/main/resources/base/media/layered_image.json
  52. 二進制
      entry/src/main/resources/base/media/my.png
  53. 二進制
      entry/src/main/resources/base/media/my_app_icon.png
  54. 二進制
      entry/src/main/resources/base/media/note.png
  55. 二進制
      entry/src/main/resources/base/media/notesel.png
  56. 二進制
      entry/src/main/resources/base/media/startIcon.png
  57. 二進制
      entry/src/main/resources/base/media/timeselect.png
  58. 二進制
      entry/src/main/resources/base/media/timeunselect.png
  59. 3 0
      entry/src/main/resources/base/profile/backup_config.json
  60. 7 0
      entry/src/main/resources/base/profile/main_pages.json
  61. 8 0
      entry/src/main/resources/dark/element/color.json
  62. 16 0
      entry/src/main/resources/en_US/element/string.json
  63. 二進制
      entry/src/main/resources/rawfile/my_app_icon.png
  64. 二進制
      entry/src/main/resources/rawfile/oobe/o1.png
  65. 二進制
      entry/src/main/resources/rawfile/oobe/o2.png
  66. 二進制
      entry/src/main/resources/rawfile/oobe/o3.png
  67. 二進制
      entry/src/main/resources/rawfile/oobe/o4.png
  68. 二進制
      entry/src/main/resources/rawfile/oobe/o5.png
  69. 二進制
      entry/src/main/resources/rawfile/oobe/o6.png
  70. 二進制
      entry/src/main/resources/rawfile/sr_my_app_icon.png
  71. 16 0
      entry/src/main/resources/zh_CN/element/string.json
  72. 2 0
      entry/src/mock/mock-config.json5
  73. 35 0
      entry/src/ohosTest/ets/test/Ability.test.ets
  74. 5 0
      entry/src/ohosTest/ets/test/List.test.ets
  75. 14 0
      entry/src/ohosTest/module.json5
  76. 5 0
      entry/src/test/List.test.ets
  77. 33 0
      entry/src/test/LocalUnit.test.ets
  78. 22 0
      hvigor/hvigor-config.json5
  79. 6 0
      hvigorfile.ts
  80. 45 0
      oh-package-lock.json5
  81. 13 0
      oh-package.json5

+ 12 - 0
.gitignore

@@ -0,0 +1,12 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test
+/.appanalyzer

+ 10 - 0
AppScope/app.json5

@@ -0,0 +1,10 @@
+{
+  "app": {
+    "bundleName": "com.example.list",
+    "vendor": "example",
+    "versionCode": 1000000,
+    "versionName": "1.0.0",
+    "icon": "$media:app_layered_image",
+    "label": "$string:app_name"
+  }
+}

+ 8 - 0
AppScope/resources/base/element/string.json

@@ -0,0 +1,8 @@
+{
+  "string": [
+    {
+      "name": "app_name",
+      "value": "list"
+    }
+  ]
+}

二進制
AppScope/resources/base/media/app_background.png


二進制
AppScope/resources/base/media/app_foreground.png


+ 7 - 0
AppScope/resources/base/media/app_layered_image.json

@@ -0,0 +1,7 @@
+{
+  "layered-image":
+  {
+    "background" : "$media:app_background",
+    "foreground" : "$media:app_foreground"
+  }
+}

+ 42 - 0
build-profile.json5

@@ -0,0 +1,42 @@
+{
+  "app": {
+    "signingConfigs": [],
+    "products": [
+      {
+        "name": "default",
+        "signingConfig": "default",
+        "targetSdkVersion": "5.1.0(18)",
+        "compatibleSdkVersion": "5.0.3(15)",
+        "runtimeOS": "HarmonyOS",
+        "buildOption": {
+          "strictMode": {
+            "caseSensitiveCheck": true,
+            "useNormalizedOHMUrl": true
+          }
+        }
+      }
+    ],
+    "buildModeSet": [
+      {
+        "name": "debug",
+      },
+      {
+        "name": "release"
+      }
+    ]
+  },
+  "modules": [
+    {
+      "name": "entry",
+      "srcPath": "./entry",
+      "targets": [
+        {
+          "name": "default",
+          "applyToProducts": [
+            "default"
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 32 - 0
code-linter.json5

@@ -0,0 +1,32 @@
+{
+  "files": [
+    "**/*.ets"
+  ],
+  "ignore": [
+    "**/src/ohosTest/**/*",
+    "**/src/test/**/*",
+    "**/src/mock/**/*",
+    "**/node_modules/**/*",
+    "**/oh_modules/**/*",
+    "**/build/**/*",
+    "**/.preview/**/*"
+  ],
+  "ruleSet": [
+    "plugin:@performance/recommended",
+    "plugin:@typescript-eslint/recommended"
+  ],
+  "rules": {
+    "@security/no-unsafe-aes": "error",
+    "@security/no-unsafe-hash": "error",
+    "@security/no-unsafe-mac": "warn",
+    "@security/no-unsafe-dh": "error",
+    "@security/no-unsafe-dsa": "error",
+    "@security/no-unsafe-ecdsa": "error",
+    "@security/no-unsafe-rsa-encrypt": "error",
+    "@security/no-unsafe-rsa-sign": "error",
+    "@security/no-unsafe-rsa-key": "error",
+    "@security/no-unsafe-dsa-key": "error",
+    "@security/no-unsafe-dh-key": "error",
+    "@security/no-unsafe-3des": "error"
+  }
+}

+ 6 - 0
entry/.gitignore

@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test

+ 28 - 0
entry/build-profile.json5

@@ -0,0 +1,28 @@
+{
+  "apiType": "stageMode",
+  "buildOption": {
+  },
+  "buildOptionSet": [
+    {
+      "name": "release",
+      "arkOptions": {
+        "obfuscation": {
+          "ruleOptions": {
+            "enable": false,
+            "files": [
+              "./obfuscation-rules.txt"
+            ]
+          }
+        }
+      }
+    },
+  ],
+  "targets": [
+    {
+      "name": "default"
+    },
+    {
+      "name": "ohosTest",
+    }
+  ]
+}

+ 6 - 0
entry/hvigorfile.ts

@@ -0,0 +1,6 @@
+import { hapTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 23 - 0
entry/obfuscation-rules.txt

@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+#   https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation

+ 10 - 0
entry/oh-package.json5

@@ -0,0 +1,10 @@
+{
+  "name": "entry",
+  "version": "1.0.0",
+  "description": "Please describe the basic information.",
+  "main": "",
+  "author": "",
+  "license": "",
+  "dependencies": {}
+}
+

+ 33 - 0
entry/src/main/ets/components/ReNameInput.ets

@@ -0,0 +1,33 @@
+import { promptAction } from "@kit.ArkUI"
+
+@Component
+export struct ReNameInput{
+  @Prop text:string="未命名"
+  @State isFocus:boolean=false
+  inputChange=(value:string)=>{
+
+  }
+  build() {
+    Row({space:10}){
+      TextInput({text:$$this.text})
+        .width(194)
+        .height(30)
+        .padding(0)
+        .fontColor('#564F4A')
+        .borderRadius(0)
+        .backgroundColor(Color.Transparent)
+        // .enableKeyboardOnFocus(this.isFocus)
+        .onChange((value:string)=>{
+          if(value.length>5){
+            this.text = value.slice(0, 5)
+            promptAction.showToast({
+              message:"名称最多不超过五个"
+            })
+            return
+          }
+          this.inputChange(value)
+        })
+    }
+
+  }
+}

+ 7 - 0
entry/src/main/ets/constants/index.ets

@@ -0,0 +1,7 @@
+export enum StateColor{
+  EASY='#A5D61D',
+  MILD='#00BFFF',
+  MEDIUM='#F7CE00',
+  HARD='#F9A01E',
+  CRITICAL='#E84026'
+}

+ 87 - 0
entry/src/main/ets/database/NoteDB.ets

@@ -0,0 +1,87 @@
+import { relationalStore, ValuesBucket } from '@kit.ArkData'
+import { NoteDBInfo } from '../models/Note'
+
+class NoteDB {
+  private store: relationalStore.RdbStore | null = null
+  private tableName = 'note'
+  private sqlCreate = `CREATE TABLE IF NOT EXISTS ${this.tableName} (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        title TEXT NOT NULL,
+        content TEXT NOT NULL,
+        date_added INTEGER NOT NULL
+      )`
+
+  async getStoreInstance() {
+    if (this.store) { return this.store }
+    const store = await relationalStore.getRdbStore(getContext(), {
+      name: 'note.db',
+      securityLevel: relationalStore.SecurityLevel.S1
+    })
+    this.store = store
+    return this.store
+  }
+  constructor() {
+    this.getStoreInstance()
+      .then(store => {
+        store.executeSql(this.sqlCreate)
+      })
+  }
+
+  // 新增
+  async insert(item: NoteDBInfo) {
+    //获取操作数据库的对象
+    const store = await this.getStoreInstance()
+    return store.insert(this.tableName, item)
+  }
+
+  // 查询数量
+  async queryCount() {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    const resultSet = await store.query(predicates)
+    return resultSet.rowCount > 0 ? resultSet.rowCount : 0
+  }
+
+  // 查询
+  async query(id?: number) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    // 倒序排列
+    predicates.orderByDesc('id')
+    // 如果有 id,添加 id 作为查询条件
+    if (id) {
+      predicates.equalTo('id', id)
+    }
+    const resultSet = await store.query(predicates)
+    const list: NoteDBInfo[] = []
+    while (resultSet.goToNextRow()) {
+      // 获取行数据
+      const row = resultSet.getRow() as NoteDBInfo
+      // 追加到数组中
+      list.push(row)
+    }
+    // 循环结束,释放结果集的内存空间(性能优化)
+    resultSet.close()
+    // 循环结束后,返回结果
+    return list
+  }
+
+  async update(item: Partial<NoteDBInfo>) {
+    if (!item.id) { return Promise.reject('id error') }
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('id', item.id)
+    return store.update(item, predicates)
+  }
+
+  async delete(ids: number[]) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.in('id', ids)
+    return store.delete(predicates)
+  }
+
+
+
+}
+export const noteDB = new NoteDB()

+ 108 - 0
entry/src/main/ets/database/TaskCategoryDataBase.ets

@@ -0,0 +1,108 @@
+import { relationalStore, ValuesBucket } from '@kit.ArkData'
+import { ITaskCategory } from '../models/TaskCategory'
+
+// 隐私笔记数据库封装
+class TaskCategoryDB {
+  // 操作数据库的实例
+  private store: relationalStore.RdbStore | null = null
+  // 数据库表名
+  private tableName = 'TaskCategoryDB'
+  // 创建数据库的语句
+  private sqlCreate = `CREATE TABLE IF NOT EXISTS ${this.tableName} (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        name TEXT NOT NULL,
+        color TEXT NOT NULL
+      )`
+
+  // 获取数据库操作的实例
+  async getStoreInstance() {
+    // 如果数据库实例已存在,直接返回,没有才创建实例
+    if (this.store) { return this.store }
+    // 获取操作数据库的实例
+    const store = await relationalStore.getRdbStore(getContext(), {
+      name: 'TaskCategory.db', // 数据库名称
+      securityLevel: relationalStore.SecurityLevel.S1 // 安全等级
+    })
+    // 存储起来方便下次直接获取
+    this.store = store
+    // 返回 store 实例
+    return this.store
+  }
+
+
+  // 类的构造器,new 的时候会自动触发
+  constructor() {
+    // 创建/打开数据库文件
+    this.getStoreInstance()
+      .then(store => {
+        // 执行创建语句,用于创建数据库的表
+        store.executeSql(this.sqlCreate)
+      })
+  }
+
+  // 新增
+  async insert(item: ITaskCategory) {
+    //获取操作数据库的对象
+    const store = await this.getStoreInstance()
+    return store.insert(this.tableName, item)
+  }
+
+  // 查询数量
+  async queryCount() {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    const resultSet = await store.query(predicates)
+    return resultSet.rowCount > 0 ? resultSet.rowCount : 0
+  }
+
+  // 查询
+  async query(id?: number) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    // 倒序排列
+    predicates.orderByDesc('id')
+    // 如果有 id,添加 id 作为查询条件
+    if (id) {
+      predicates.equalTo('id', id)
+    }
+    const resultSet = await store.query(predicates)
+    const list: ITaskCategory[] = []
+    while (resultSet.goToNextRow()) {
+      // 获取行数据
+      const row = resultSet.getRow() as ITaskCategory
+      // 追加到数组中
+      list.push(row)
+    }
+    // 循环结束,释放结果集的内存空间(性能优化)
+    resultSet.close()
+    // 循环结束后,返回结果
+    return list
+  }
+
+  // 更新
+  //在更新的时候,不是所有要必传,就要用工具把必选改为可选
+  async update(item: Partial<ITaskCategory>) {
+    // 如果没有 id 直接退出
+    if (!item.id) { return Promise.reject('id error') }
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('id', item.id)
+    // 更新完成,返回受影响的行数
+    return store.update(item, predicates)
+  }
+
+  // 删除
+  async delete(ids: number[]) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.in('id', ids)
+    // 删除完成,返回受影响的行数
+    return store.delete(predicates)
+  }
+
+
+
+
+}
+export const taskCategoryDB = new TaskCategoryDB()
+

+ 114 - 0
entry/src/main/ets/database/TaskDataBase.ets

@@ -0,0 +1,114 @@
+import { relationalStore, ValuesBucket } from '@kit.ArkData'
+import { ITaskItem } from '../models/Task'
+
+// 隐私笔记数据库封装
+class TaskItemDB {
+  // 操作数据库的实例
+  private store: relationalStore.RdbStore | null = null
+  // 数据库表名
+  private tableName = 'TaskDB'
+  // 创建数据库的语句
+  private sqlCreate = `CREATE TABLE IF NOT EXISTS ${this.tableName} (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        taskName TEXT NOT NULL,
+        detail TEXT NOT NULL,
+        startDate INTEGER NOT NULL,
+        dueDate INTEGER NOT NULL,
+        isCompleted INTEGER NOT NULL,
+        category INTEGER NOT NULL,
+        categoryName TEXT NOT NULL,
+        topped INTEGER NOT NULL
+      )`
+
+  // 获取数据库操作的实例
+  async getStoreInstance() {
+    // 如果数据库实例已存在,直接返回,没有才创建实例
+    if (this.store) { return this.store }
+    // 获取操作数据库的实例
+    const store = await relationalStore.getRdbStore(getContext(), {
+      name: 'Task.db', // 数据库名称
+      securityLevel: relationalStore.SecurityLevel.S1 // 安全等级
+    })
+    // 存储起来方便下次直接获取
+    this.store = store
+    // 返回 store 实例
+    return this.store
+  }
+
+
+  // 类的构造器,new 的时候会自动触发
+  constructor() {
+    // 创建/打开数据库文件
+    this.getStoreInstance()
+      .then(store => {
+        // 执行创建语句,用于创建数据库的表
+        store.executeSql(this.sqlCreate)
+      })
+  }
+
+  // 新增
+  async insert(item: ITaskItem) {
+    //获取操作数据库的对象
+    const store = await this.getStoreInstance()
+    return store.insert(this.tableName, item)
+  }
+
+  // 查询数量
+  async queryCount() {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    const resultSet = await store.query(predicates)
+    return resultSet.rowCount > 0 ? resultSet.rowCount : 0
+  }
+
+  // 查询
+  async query(id?: number) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    // 倒序排列
+    predicates.orderByDesc('id')
+    // 如果有 id,添加 id 作为查询条件
+    if (id) {
+      predicates.equalTo('id', id)
+    }
+    const resultSet = await store.query(predicates)
+    const list: ITaskItem[] = []
+    while (resultSet.goToNextRow()) {
+      // 获取行数据
+      const row = resultSet.getRow() as ITaskItem
+      // 追加到数组中
+      list.push(row)
+    }
+    // 循环结束,释放结果集的内存空间(性能优化)
+    resultSet.close()
+    // 循环结束后,返回结果
+    return list
+  }
+
+  // 更新
+  //在更新的时候,不是所有要必传,就要用工具把必选改为可选
+  async update(item: Partial<ITaskItem>) {
+    // 如果没有 id 直接退出
+    if (!item.id) { return Promise.reject('id error') }
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.equalTo('id', item.id)
+    // 更新完成,返回受影响的行数
+    return store.update(item, predicates)
+  }
+
+  // 删除
+  async delete(ids: number[]) {
+    const store = await this.getStoreInstance()
+    const predicates = new relationalStore.RdbPredicates(this.tableName)
+    predicates.in('id', ids)
+    // 删除完成,返回受影响的行数
+    return store.delete(predicates)
+  }
+
+
+
+
+}
+export const taskItemDB = new TaskItemDB()
+

+ 346 - 0
entry/src/main/ets/dialog/TaskItemDialog.ets

@@ -0,0 +1,346 @@
+import { promptAction } from "@kit.ArkUI"
+import { ITaskItem, TaskItem } from "../models/Task"
+import { ITaskCategory, TaskCategory } from "../models/TaskCategory"
+import dayjs from 'dayjs'
+
+//添加,详情弹窗
+@CustomDialog
+export struct TaskItemDialog {
+
+  // taskItem: TaskItem=new TaskItem({} as ITaskItem)
+  @Prop
+  taskItem:ITaskItem={} as ITaskItem
+  // @Link prefData: PreferenceData
+  @Prop categoryList: ITaskCategory[]=[]
+  controller: CustomDialogController
+  confirm=(taskItem:ITaskItem) => {
+
+  }
+
+  @State title:string=""
+
+  @State startDate:Date=new Date()
+  @State dueDate:Date=new Date()
+  @State taskName:string=""
+  @State detail:string=""
+  @State isCompleted:number=0
+  @State category:number=1
+  @State topped:number=0
+  @State showedTaskCategory: string = '默认清单'
+
+
+  @State taskCategoryColor: string = '#000000'
+  @State handlePopup: boolean = false
+  aboutToAppear(): void {
+    if(this.taskItem.id==null){
+      this.title='新增事项'
+      this.category=1
+      this.showedTaskCategory='默认清单'
+
+    }else{
+      this.title='编辑事项'
+      this.startDate=new Date(this.taskItem.startDate)
+      this.dueDate=new Date(this.taskItem.dueDate)
+      this.taskName=this.taskItem.taskName
+      this.detail=this.taskItem.detail
+      this.isCompleted=this.taskItem.isCompleted
+      this.category=this.taskItem.category
+      this.topped=this.taskItem.topped
+      this.showedTaskCategory=this.taskItem.categoryName
+    }
+  }
+
+
+  @Builder DatePickerMenu(date: Date, str: string) {
+    Menu() {
+      MenuItem() {
+        DatePicker({
+          start: new Date('1970-01-01'),
+          selected: date,
+          end: new Date('2100-01-01')
+        }).onDateChange((value:Date)=>{
+           date=value
+          if(str=='start'){
+            this.startDate=date
+          }else{
+            this.dueDate=date
+          }
+        })
+          .backgroundColor(0xffffff)
+      }
+    }
+  }
+  @Builder CategoryPickerMenu() {
+    Menu() {
+      ForEach(this.categoryList, (item:ITaskCategory,index:number) => {
+        MenuItem({content: item.name}) {
+          Text(item.name)
+        }
+          .onClick(() => {
+            this.showedTaskCategory = item.name
+            this.category=item.id as number
+          })
+      })
+    }
+  }
+
+
+  // aboutToAppear() {
+  //   this.taskName = this.taskItem.task_name
+  //   this.taskSubject = this.taskItem.subject
+  //   this.taskDetailText = this.taskItem.detail
+  //   this.taskDdlDetail = this.taskItem.ddl_detail
+  //   this.taskDate = new Date()
+  //   this.startDate = new Date()
+  //   this.taskDate.setSeconds(0)
+  //   this.startDate.setSeconds(0)
+  //   Logger.debug('TaskItemDialog new date = ' + this.taskDate.toLocaleString())
+  //   if (this.taskItem.start_date_stamp) this.startDate.setTime(this.taskItem.start_date_stamp)
+  //   if (this.taskItem.due_date_stamp) this.taskDate.setTime(this.taskItem.due_date_stamp)
+  //   this.startTask[0] = getDateString(this.startDate.getTime())
+  //   this.startTask[1] = getTimeString(this.startDate.getTime())
+  //   this.endTask[0] = getDateString(this.taskDate.getTime())
+  //   this.endTask[1] = getTimeString(this.taskDate.getTime())
+  //   this.showedTaskDDL = getDDLPresetFromDetail(this.taskDdlDetail)
+  //   this.taskCategoryID = this.taskItem.category
+  //   for (let i = 0; i < this.categoryList.length; ++i) {
+  //     if (this.categoryList[i].id == this.taskCategoryID) {
+  //       this.showedTaskCategory = this.categoryList[i].name
+  //       this.taskCategoryColor = this.categoryList[i].color
+  //       break;
+  //     }
+  //     if (i == this.categoryList.length - 1) {
+  //       this.taskCategoryID = this.categoryList[0].id
+  //       this.showedTaskCategory = this.categoryList[0].name
+  //       this.taskCategoryColor = this.categoryList[0].color
+  //     }
+  //   }
+  // }
+
+  build() {
+    Column() {
+      Image($r('app.media.half'))
+        .width(64)
+        .height(24)
+        .onClick(() => {
+          this.controller?.close();
+        })
+      .margin({top: 5})
+      Column() {
+        Column() {
+          Row() {
+            Text(this.title)
+              .fontSize(20)
+              .alignSelf(ItemAlign.Start)
+              .fontColor('#564F4A')
+            Button() {
+              Text(this.showedTaskCategory).fontColor('#564F4A')
+            }.backgroundColor('#f1f2f3')
+            .borderRadius(5)
+            .padding({left: 12, right: 12, top: 8, bottom: 8})
+            .bindMenu(this.CategoryPickerMenu())
+          }
+          .margin({ left: 24, bottom: 20, right: 24 })
+          .width('100%')
+          .justifyContent(FlexAlign.SpaceBetween)
+
+          TextInput({
+            placeholder: '事项名称',
+            text: this.taskItem.taskName
+          })
+            .borderRadius(10)
+            .backgroundColor('rgba(254, 222, 155, 1)')
+            .placeholderColor('rgba(86, 79, 74, 1)')
+            .fontColor('rgba(86, 79, 74, 1)')
+            .onChange((value: string) => {
+              // this.taskItem.taskName = value
+              this.taskName=value
+            })
+            .margin({ bottom: 10 })
+            .height(50)
+          TextArea({ placeholder: '详细信息', text: this.taskItem.detail })
+            .borderRadius(10)
+            .backgroundColor('rgba(254, 222, 155, 1)')
+            .placeholderColor('rgba(86, 79, 74, 1)')
+            .fontColor('rgba(86, 79, 74, 1)')
+            .onChange((value: string) => {
+              this.detail=value
+            })
+            .height(50 * 3)
+          .margin({ bottom: 10 })
+          // Row(){
+          //   Button('任务紧急程度:' + this.showedTaskDDL)
+          //     // .bindMenu(this.DDLDetailPickerMenu)
+          //     .width('60%')
+          //     .margin({ right: 15 })
+          //     .backgroundColor(0xf1f2f3)
+          //     .fontColor(0x000000)
+          //   Button({type: ButtonType.Circle}) {
+          //     Image($r('app.media.ic_public_help_filled'))
+          //       .height(25)
+          //       .width(25)
+          //   }
+          //     .onClick(() => {this.handlePopup = !this.handlePopup})
+          //     .height(25)
+          //     .width(25)
+          //     .backgroundColor(0xffffff)
+          //     .bindPopup(this.handlePopup, {
+          //       message: '任务紧急程度会决定指示颜色变化的快慢,任务紧急程度越高,指示颜色越早变红。',
+          //       placementOnTop: true,
+          //       primaryButton: {
+          //         value: '明白了',
+          //         action: () => {this.handlePopup = false}
+          //       }
+          //     })
+          // }
+        }.padding({ left: 16, right: 16})
+        .margin({ bottom: 16})
+        Row() {
+          Button('布置日期:   ' + dayjs(this.startDate).format('YYYY-MM-DD'))
+            .width(200)
+            .bindMenu(this.DatePickerMenu(new Date(this.startDate), 'start'))
+            .backgroundColor('#adc1e2')
+            .fontColor('rgba(86, 79, 74, 1)')
+            .borderRadius(5)
+            .margin({right: 10})
+
+            Image($r('app.media.confim'))
+              .onClick(() => {this.handlePopup = !this.handlePopup})
+              .height(25)
+              .width(25)
+              .backgroundColor(0xffffff)
+              .bindPopup(this.handlePopup, {
+                message: '距离截至时间越近,指示的警告颜色就会加深',
+                placementOnTop: true,
+                primaryButton: {
+                  value: '明白了',
+                  action: () => {this.handlePopup = false}
+                }
+              })
+
+          // Button(this.startTask[1])
+          //   .bindMenu(this.TimePickerMenu(this.startDate, this.startTask))
+          //   .backgroundColor(0xf1f2f3)
+          //   .fontColor(0x000000)
+        }.margin({bottom: 8})
+        Row() {
+          Button('截止日期:   ' +dayjs(this.dueDate).format('YYYY-MM-DD'))
+            .width(200)
+            .bindMenu(this.DatePickerMenu(new Date(this.dueDate),'due'))
+            .backgroundColor('#adc1e2')
+            .borderRadius(5)
+            .fontColor('rgba(86, 79, 74, 1)')
+            .margin({right: 10})
+
+          Column(){
+
+          }.width(25)
+          .height(25)
+
+
+
+
+          //
+          // Button(this.endTask[1])
+          //   .bindMenu(this.TimePickerMenu(this.taskDate,this.endTask))
+          //   .backgroundColor(0xf1f2f3)
+          //   .fontColor(0x000000)
+        }
+      }.margin({bottom: 16})
+          // .margin({ bottom: 10 })
+      Row({space:20}) {
+            Text('取消')
+              .fontSize(18)
+              .fontWeight(500)
+              .fontColor('rgba(86, 79, 74, 1)')
+              .width(154)
+              .height(44)
+              .padding({left:58,right:58,top:10,bottom:10})
+              .border({
+                width:1,
+                color:'rgba(86, 79, 74, 1)'
+              })
+              .borderRadius(8)
+              .backgroundColor('rgba(254, 222, 155, 1)')
+              .onClick(() => {
+                this.controller.close()
+              })
+        Text('保存')
+          .fontSize(18)
+          .fontWeight(500)
+          .fontColor('rgba(86, 79, 74, 1)')
+          .width(154)
+          .height(44)
+          .padding({left:58,right:58,top:10,bottom:10})
+          .border({
+            width:1,
+            color:'rgba(86, 79, 74, 1)'
+          })
+          .borderRadius(8)
+          .backgroundColor('rgba(254, 222, 155, 1)')
+          .onClick(() => {
+            if (this.taskItem.taskName == '') {
+              promptAction.showToast({message: '任务名称不能为空'})
+              return
+            }
+            if (this.dueDate.getTime() < this.startDate.getTime()) {
+              promptAction.showToast({message: '结束日期不能在开始日期之前'})
+              return
+            }
+            this.taskItem={
+              id:this.taskItem.id,
+              taskName:this.taskName,
+              detail:this.detail,
+              startDate:this.startDate.getTime(),
+              dueDate:this.dueDate.getTime(),
+              isCompleted:this.isCompleted,
+              category:this.category,
+              categoryName:this.showedTaskCategory,
+              topped:this.topped
+            }
+            this.confirm(this.taskItem)
+
+
+            // this.taskItem.subject = this.taskSubject
+            // this.taskItem.task_name = this.taskName
+            // this.taskItem.detail = this.taskDetailText
+            // this.taskItem.due_date_stamp = this.taskDate.getTime()
+            // this.taskItem.start_date_stamp = this.startDate.getTime()
+            // this.taskItem.ddl_detail = this.taskDdlDetail
+            // this.taskItem.category = this.taskCategoryID
+            // Logger.debug(`TaskItemDialog ddlDetail = ${this.taskItem.ddl_detail}`)
+            // // Logger.debug(`TaskItemDialog due_date(stamp): ${this.taskItem.due_date_stamp}, date: ${this.taskDate.toDateString()}`)
+            // this.confirm(this.dialogIsAddNew, this.taskItem)
+            this.controller.close()
+          })
+      }.margin({ bottom: 20 })
+    }.backgroundColor('#fdf8ec')
+    .width('100%')
+    // .height('60%')
+    .borderRadius(24)
+    .justifyContent(FlexAlign.SpaceBetween)
+  }
+}
+
+function getTimeString(date_stamp: number): string {
+  let date: Date = new Date()
+  date.setTime(date_stamp)
+  // Logger.debug(`TaskList: datestamp = ${date_stamp}, time = ${date.toLocaleTimeString()}`)
+  return date.toLocaleTimeString()
+}
+
+function getDateString(date_stamp: number): string {
+  let date: Date = new Date()
+  date.setTime(date_stamp)
+  // Logger.debug(`TaskList: datestamp = ${date_stamp}, date = ${date.toLocaleDateString()}`)
+  let ds: string[] = date.toLocaleDateString().split('/')
+  let res: string = `${ds[2]}/${ds[0]}/${ds[1]}`
+  return res
+}
+
+// function getDDLPresetFromDetail(detail: string): string {
+//   for (let i = 0; i < 5; ++i) {
+//     Logger.debug('getDDL: ' + CommonConstants.DDL_DETAIL_PRESET[i].detail)
+//     if (CommonConstants.DDL_DETAIL_PRESET[i].detail == detail) return CommonConstants.DDL_DETAIL_PRESET[i].hint
+//   } return ''
+// }

+ 53 - 0
entry/src/main/ets/entryability/EntryAbility.ets

@@ -0,0 +1,53 @@
+import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { window } from '@kit.ArkUI';
+import { YTAvoid } from '../utils/YTAvoid';
+
+const DOMAIN = 0x0000;
+
+export default class EntryAbility extends UIAbility {
+  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
+    this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate');
+  }
+
+  onDestroy(): void {
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy');
+  }
+
+  onWindowStageCreate(windowStage: window.WindowStage): void {
+    // Main window is created, set main page for this ability
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+
+    const windowClass = windowStage.getMainWindowSync()
+    windowClass.setWindowLayoutFullScreen(true)
+    const top = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height
+    const bottom = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR).bottomRect.height
+
+    YTAvoid.setAvoid({
+      top, bottom
+    })
+    windowStage.loadContent('pages/Index', (err) => {
+      if (err.code) {
+        hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
+        return;
+      }
+      hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.');
+    });
+  }
+
+  onWindowStageDestroy(): void {
+    // Main window is destroyed, release UI related resources
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+  }
+
+  onForeground(): void {
+    // Ability has brought to foreground
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground');
+  }
+
+  onBackground(): void {
+    // Ability has back to background
+    hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground');
+  }
+}

+ 41 - 0
entry/src/main/ets/entryability/EntryAbility.ts

@@ -0,0 +1,41 @@
+import UIAbility from '@ohos.app.ability.UIAbility';
+import hilog from '@ohos.hilog';
+import window from '@ohos.window';
+
+export default class EntryAbility extends UIAbility {
+  onCreate(want, launchParam) {
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
+  }
+
+  onDestroy() {
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
+  }
+
+  onWindowStageCreate(windowStage: window.WindowStage) {
+    // Main window is created, set main page for this ability
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+
+    windowStage.loadContent('pages/Index', (err, data) => {
+      if (err.code) {
+        hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
+        return;
+      }
+      hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
+    });
+  }
+
+  onWindowStageDestroy() {
+    // Main window is destroyed, release UI related resources
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+  }
+
+  onForeground() {
+    // Ability has brought to foreground
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
+  }
+
+  onBackground() {
+    // Ability has back to background
+    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
+  }
+}

+ 16 - 0
entry/src/main/ets/entrybackupability/EntryBackupAbility.ets

@@ -0,0 +1,16 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
+
+const DOMAIN = 0x0000;
+
+export default class EntryBackupAbility extends BackupExtensionAbility {
+  async onBackup() {
+    hilog.info(DOMAIN, 'testTag', 'onBackup ok');
+    await Promise.resolve();
+  }
+
+  async onRestore(bundleVersion: BundleVersion) {
+    hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
+    await Promise.resolve();
+  }
+}

+ 9 - 0
entry/src/main/ets/models/Note.ets

@@ -0,0 +1,9 @@
+import { ValuesBucket } from "@kit.ArkData"
+
+// 隐私笔记的类型
+export interface NoteDBInfo extends ValuesBucket {
+  id: number | null // 新增时 id 设置为 null ,可实现 id 自增
+  title: string
+  content: string
+  date_added: number
+}

+ 142 - 0
entry/src/main/ets/models/Task.ets

@@ -0,0 +1,142 @@
+import { StateColor } from "../constants"
+import { ValuesBucket } from "@kit.ArkData"
+
+export interface ITaskItem extends ValuesBucket{
+  id: number | null
+  taskName: string //任务名称
+  detail: string  //详细内容
+  startDate: number  //开始时间
+  dueDate: number  //截止时间
+  isCompleted: number //是否已完成
+  // progressValue: number  //
+  category: number  //分类
+  categoryName:string
+  topped: number  //置顶
+}
+@ObservedV2
+export class TaskItem{
+  id: number|null
+  @Trace
+  taskName: string //任务名称
+  @Trace
+  detail: string  //详细内容
+  startDate: number  //开始时间
+  @Trace
+  dueDate: number  //截止时间
+  @Trace
+  isCompleted: number//是否已完成
+  // @Trace
+  progressValue: number=0  //
+  @Trace
+  category: number  //分类
+  @Trace
+  categoryName:string
+  @Trace
+  topped:number //置顶
+  constructor(task:ITaskItem) {
+    this.id=task.id as number
+    this.taskName=task.taskName
+    this.detail=task.detail
+    this.startDate=task.startDate
+    this.dueDate=task.dueDate
+    this.isCompleted=task.isCompleted
+    this.categoryName=task.categoryName
+    // this.progressValue=task.progressValue
+    this.category=task.category
+    this.topped=task.topped
+  }
+
+
+  // getTaskProgress(){
+  //   return this.progressValue
+  // }
+
+  getTaskState(){
+    //获取总时间
+    const fullTime=this.dueDate-this.startDate
+    //当前时间
+    const nowTime=new Date().getTime()
+    //已经过去的时间
+    const time=nowTime-this.startDate
+    const progress=Math.floor(time/fullTime*10)
+    this.progressValue=progress
+    if(progress<2){
+      return 'EASY'
+      // return StateColor.EASY
+    }else if(progress <4){
+      return 'MILD'
+      // this.progressValue=4
+    }else if(progress <6){
+      // this.progressValue=6
+      return 'MEDIUM'
+    }else if(progress<8){
+      // this.progressValue=8
+      return 'HARD'
+    }else{
+      // this.progressValue=10
+      return 'CRITICAL'
+    }
+  }
+
+  getTaskColor(){
+    if(this.getTaskState()=='EASY'){
+      return StateColor.EASY
+    }else if(this.getTaskState()=='MILD'){
+      return StateColor.MILD
+    }else if(this.getTaskState()=='MEDIUM'){
+      return StateColor.MEDIUM
+    }else if(this.getTaskState()=='HARD'){
+      return StateColor.HARD
+    }else {
+      return StateColor.CRITICAL
+    }
+  }
+  getProgressPercent(){
+    if(this.getTaskState()=='EASY'){
+      return 15
+    }else if(this.getTaskState()=='MILD'){
+      return 35
+    }else if(this.getTaskState()=='MEDIUM'){
+      return 55
+    }else if(this.getTaskState()=='HARD'){
+      return 75
+    }else {
+      return 95
+    }
+
+  }
+}
+
+// new TaskItem({
+//   id:1,
+//   taskName:"猪猪",
+//   detail:"haha",
+//   startDate:new Date().getTime()-2592000000,
+//   dueDate:new Date().getTime()+2592000000,
+//   isCompleted:false,
+//   category:1,
+//   categoryName:"默认清单",
+//   topped:false
+// }),
+// new TaskItem({
+//   id:2,
+//   taskName:"猪猪1",
+//   detail:"haha1",
+//   startDate:new Date().getTime(),
+//   dueDate:new Date().getTime()+2592000000,
+//   isCompleted:false,
+//   category:1,
+//   categoryName:"默认清单",
+//   topped:false
+// }),
+// new TaskItem({
+//   id:3,
+//   taskName:"猪猪1",
+//   detail:"ha2ha",
+//   startDate:new Date().getTime(),
+//   dueDate:new Date().getTime()+36000,
+//   isCompleted:false,
+//   categoryName:"默认清单",
+//   category:1,
+//   topped:false
+// }),

+ 14 - 0
entry/src/main/ets/models/TaskCategory.ets

@@ -0,0 +1,14 @@
+import { ValuesBucket } from "@kit.ArkData"
+
+export interface ITaskCategory extends ValuesBucket {
+  id: number | null
+  name: string
+  color: string
+
+
+}
+export class TaskCategory{
+  color: string = '#000000'
+  name: string = '默认清单'
+  id: number = 0
+}

+ 69 - 0
entry/src/main/ets/pages/Index.ets

@@ -0,0 +1,69 @@
+
+import { Main } from '../views/Main'
+import { DueTime } from '../views/DueTime'
+import { Note } from '../views/Note';
+import { Time } from '../views/Time';
+import { About } from '../views/About';
+import { YTAvoid } from '../utils/YTAvoid';
+
+@Entry
+@Component
+
+struct Index {
+  @State currentIndex: number = 0
+  @StorageProp(YTAvoid.SAFE_TOP_KEY)
+  top:number=0
+  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY)
+  bottom:number=0
+
+  private controller: TabsController = new TabsController();
+
+  @Builder TabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) {
+    Column() {
+      Image(this.currentIndex === targetIndex ? selectedImg : normalImg)
+        .size({ width: 25, height: 25 })
+      Text(title)
+        .fontColor(this.currentIndex === targetIndex ? '#756860' : '#A2A4B1')
+        .fontSize(12)
+    }
+    .width('100%')
+    .height(50)
+    .backgroundColor(Color.White)
+    .justifyContent(FlexAlign.Center)
+    .onClick(() => {
+      this.currentIndex = targetIndex
+      this.controller.changeIndex(targetIndex)
+    })
+  }
+  build() {
+    Column() {
+      Tabs({ barPosition: BarPosition.End, controller: this.controller }) {
+        TabContent() {
+          Main()
+        }.tabBar(this.TabBuilder("清单", 0, $r('app.media.c_book'), $r('app.media.book')))
+        TabContent() {
+          DueTime()
+        }.tabBar(this.TabBuilder("截止时间", 1, $r('app.media.timeselect'), $r('app.media.timeunselect')))
+        TabContent() {
+          Note()
+        }.tabBar(this.TabBuilder("笔记", 2, $r('app.media.notesel'), $r('app.media.note')))
+        TabContent() {
+          Time()
+        }.tabBar(this.TabBuilder("时间轴", 3, $r('app.media.timeselect'), $r('app.media.timeunselect')))
+        TabContent() {
+          About()
+        }.tabBar(this.TabBuilder("关于", 4, $r('app.media.c_my'), $r('app.media.my')))
+      }.onChange((index: number) => {
+        this.currentIndex = index
+      })
+      .scrollable(false)
+    }.width('100%')
+    .height('100%')
+    .backgroundImage($r('app.media.backimg'))
+    .backgroundImageSize({width:'100%',height:'100%'})
+    .backgroundColor('#fff')
+    .padding({bottom: this.bottom,top:this.top})
+
+  }
+
+}

+ 48 - 0
entry/src/main/ets/pages/PrivacyPage.ets

@@ -0,0 +1,48 @@
+import { webview } from '@kit.ArkWeb'
+import { router } from '@kit.ArkUI'
+import { YTAvoid } from '../utils/YTAvoid'
+
+@Entry
+@Component
+struct PrivacyPage {
+  private webviewController: WebviewController = new webview.WebviewController()
+  @StorageProp(YTAvoid.SAFE_TOP_KEY)
+  top:number=0
+  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY)
+  bottom:number=0
+
+  build() {
+    Column() {
+      Row() {
+        Image($r('app.media.icon'))
+          .width(24)
+          .margin({ left: 16 })
+          .onClick(()=>{
+            // yTRouter.routerBack()
+            router.back()
+
+          })
+        Text('隐私政策').fontColor(Color.Black)
+        Column(){
+
+        }.width(24)
+        .height(24)
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      .height(44)
+
+      Web({
+        src: "https://hm-test.ytpm.net/daysUserAgreement.html",
+        controller: this.webviewController,
+        renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
+      })
+        .padding(40)
+        .width('100%')
+        .layoutWeight(1)
+    }.width('100%').height('100%')
+    .backgroundColor(Color.White)
+    .padding({bottom: this.bottom,top:this.top})
+
+  }
+}

+ 48 - 0
entry/src/main/ets/pages/UserAgreementPage.ets

@@ -0,0 +1,48 @@
+import { webview } from '@kit.ArkWeb'
+import { router } from '@kit.ArkUI'
+import { YTAvoid } from '../utils/YTAvoid'
+
+@Entry
+@Component
+struct UserAgreementPage {
+  private webviewController: WebviewController = new webview.WebviewController()
+  @StorageProp(YTAvoid.SAFE_TOP_KEY)
+  top:number=0
+  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY)
+  bottom:number=0
+
+  build() {
+    Column() {
+      Row() {
+        Image($r('app.media.icon'))
+          .width(24)
+          .margin({ left: 16 })
+          .onClick(()=>{
+            // yTRouter.routerBack()
+            router.back()
+
+          })
+        Text('用户协议').fontColor(Color.Black)
+        Column(){
+
+        }.width(24)
+        .height(24)
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      .height(44)
+
+      Web({
+        src: "https://hm-test.ytpm.net/daysUserAgreement.html",
+        controller: this.webviewController,
+        renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
+      })
+        .padding(40)
+        .width('100%')
+        .layoutWeight(1)
+    }.width('100%').height('100%')
+    .backgroundColor(Color.White)
+    .padding({bottom: this.bottom,top:this.top})
+
+  }
+}

+ 162 - 0
entry/src/main/ets/test/index.ets

@@ -0,0 +1,162 @@
+/**
+ * 废弃的清单分类
+ */
+// .bindSheet($$this.isShowTaskCategoryBuilder,this.categoryBuilder(),{
+//   height:400,
+//   showClose:false,
+//   onWillDismiss: ((dismissSheetAction: DismissSheetAction) => {
+//     if (dismissSheetAction.reason == DismissReason.SLIDE_DOWN) {
+//       dismissSheetAction.dismiss(); //注册dismiss行为
+//     }
+//   }),
+// })
+
+
+
+// Row(){
+//   Image($r('app.media.icon')).width(24).margin({right:10}).onClick(async ()=>{
+//     this.isShowTaskCategoryBuilder=true
+//     this.taskCategoryCount=await this.getTaskCategoryCount()
+//   })
+// }.width('100%')
+// .justifyContent(FlexAlign.End)
+
+
+
+// @Builder
+// categoryBuilder(){
+//   Column(){
+//     Row(){
+//       Text('清单列表(左添加)')
+//       Image($r('app.media.icon')).width(24).onClick(()=>{
+//
+//         if(this.taskCategoryCount<this.categoryList.length){
+//           promptAction.showToast({
+//             message:'你还未命名上一个'
+//           })
+//           return
+//         }
+//         //在这里做一个判断,数据库的清单多少,当前多少,最多相差1,避免多次点击
+//         this.categoryList.push({} as ITaskCategory)
+//         this.insertTaskCategoryData({id:null,name:"未命名",color:'#fff'})
+//         // this.isShowTaskCategoryBuilder=false
+//       })
+//
+//       Image($r('app.media.icon')).width(24).onClick(()=>{
+//         this.isShowTaskCategoryBuilder=false
+//       })
+//     }.width('100%')
+//     .justifyContent(FlexAlign.Start)
+//     .margin({bottom:20})
+//
+//     List({space:20}){
+//       ForEach(this.categoryList,(item:ITaskCategory,index:number)=>{
+//         ListItem() {
+//           Row() {
+//             ReNameInput({
+//               text: item.name,
+//               inputChange: (text: string) => {
+//                 this.categoryList[index].name = text
+//                 this.updateTaskCategoryData(item)
+//               }
+//
+//             })
+//           }
+//           .width('100%')
+//           .borderRadius(6)
+//           .height(48)
+//           .padding(14) //16
+//           .backgroundColor('#F8F8F8')
+//           .animation({ curve: Curve.Sharp, duration: 300 })
+//           .bindContextMenu(this.MenuBuilder(item.id as number,index), ResponseType.LongPress)
+//         }
+//       })
+//     }.scrollBar(BarState.Off)
+//     .layoutWeight(1)
+//
+//
+//
+//     Text('确定')
+//       .fontSize(18)
+//       .fontWeight(500)
+//       .fontColor('rgba(86, 79, 74, 1)')
+//       .width(154)
+//       .height(44)
+//       .padding({left:58,right:58,top:10,bottom:10})
+//       .border({
+//         width:1,
+//         color:'rgba(86, 79, 74, 1)'
+//       })
+//       .borderRadius(8)
+//       .backgroundColor('rgba(254, 222, 155, 1)')
+//       .onClick(()=>{
+//        this.isShowTaskCategoryBuilder=false
+//     })
+//
+//
+//   }.width('100%')
+//   .height('100%')
+//   .padding(20)
+// }
+// @Builder
+// MenuBuilder(id:number,index:number) {
+//   Menu() {
+//     MenuItem({ content: '删除' }).onClick(()=>{
+//       //先删除本地list数据
+//       this.categoryList.splice(index,1)
+//       //删除数据库数据
+//       let ids=[] as number[]
+//       ids.push(id)
+//       this.deleteTaskCategoryData(ids)
+//       const idItem=this.taskList.filter(item=>item.category==id)
+//       const idsItem=idItem.map(item=>item.id)
+//       this.deleteTaskData(ids)
+//       this.getTaskData()
+//     })
+//   }
+//   .width(108)
+// }
+
+
+
+// //插入默认清单
+// async insertDefault(){
+//   await taskCategoryDB.insert({
+//     id:1,
+//     name:"默认清单",
+//     color:"#fff"
+//   })
+// }
+//
+// aboutToAppear(): void {
+//   //插入默认清单
+//   // this.insertDefault()
+//   this.getTaskData()
+//   // this.getTaskCategoryData()
+// }
+
+
+/**
+ * 任务分类api
+ */
+// async getTaskCategoryData(){
+//   const list=await taskCategoryDB.query() as ITaskCategory[]
+//   this.categoryList=list
+// }
+//
+// async insertTaskCategoryData(item:ITaskCategory){
+//   await taskCategoryDB.insert(item)
+// }
+// async updateTaskCategoryData(item:ITaskCategory){
+//   await taskCategoryDB.update(item)
+// }
+// async deleteTaskCategoryData(ids:number[]){
+//   await taskCategoryDB.delete(ids)
+//
+//   //同时也要删除下面所有关联的事项
+// }
+// //获取分类的数量
+// async getTaskCategoryCount(){
+//   return await taskCategoryDB.queryCount()
+// }
+

+ 55 - 0
entry/src/main/ets/utils/YTAvoid.ets

@@ -0,0 +1,55 @@
+import { window } from "@kit.ArkUI"
+
+export interface AvoidType {
+  top?: number,
+  bottom?: number
+}
+export class YTAvoid {
+  /**
+   * @type number
+   * @description 顶部安全区高度
+   */
+  static readonly SAFE_TOP_KEY: string = 'safeTop'
+  /**
+   * @type number
+   * @description 底部安全区高度
+   */
+  static readonly SAFE_BOTTOM_KEY: string = 'bottomTop'
+
+  static setAvoid(avoid: AvoidType) {
+    if (typeof avoid.top != 'undefined') {
+      AppStorage.setOrCreate<number>(YTAvoid.SAFE_TOP_KEY, px2vp(avoid.top))
+    }
+    if (typeof avoid.bottom != 'undefined') {
+      AppStorage.setOrCreate<number>(YTAvoid.SAFE_BOTTOM_KEY, px2vp(avoid.bottom))
+    }
+  }
+
+  static getTop() {
+    return AppStorage.get<number>(YTAvoid.SAFE_TOP_KEY)
+  }
+
+  static getBottom() {
+    return AppStorage.get<number>(YTAvoid.SAFE_BOTTOM_KEY)
+  }
+
+  static setTop(safeTop: number) {
+    AppStorage.setOrCreate<number>(YTAvoid.SAFE_TOP_KEY, safeTop)
+  }
+
+
+  static setBottom(safeBottom: number) {
+    AppStorage.setOrCreate<number>(YTAvoid.SAFE_BOTTOM_KEY, safeBottom)
+  }
+
+  static setStatusBarContentColor(color: string, context: Context) {
+    window.getLastWindow(context, (err, windowClass) => {
+      if (!err) {
+        windowClass.setWindowSystemBarProperties({ statusBarContentColor: color })
+      } else {
+        // YTLog.error(err)
+      }
+
+    })
+  }
+}

+ 10 - 0
entry/src/main/ets/utils/YTLog.ets

@@ -0,0 +1,10 @@
+import { Log } from '@abner/log'
+
+Log.init({
+  tag: "YTLog",
+  domain: 0x0000,
+  close: false,
+  isHilog: true,
+  showLogLocation: true,
+  logSize: 800
+})

+ 136 - 0
entry/src/main/ets/views/About.ets

@@ -0,0 +1,136 @@
+
+import { bundleManager } from '@kit.AbilityKit';
+import { router } from '@kit.ArkUI';
+import { YTAvoid } from '../utils/YTAvoid';
+
+
+@Component
+export struct About {
+  @State content: string = '';
+  @State isAgree: boolean = false
+  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY) safeBottom: number = 0
+  ICPRecordNumber: string = '19019164号-5A'
+  listData: string[] = ['用户协议', '隐私政策']
+  @State versionName: string = ''
+
+  async aboutToAppear() {
+    const res = await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT)
+    this.versionName = res.versionName
+  }
+
+  build() {
+    Column() {
+
+      Row() {
+        Image($r('app.media.icon'))
+          .width(24)
+          .margin({ left: 16 })
+          .onClick(()=>{
+            // yTRouter.routerBack()
+
+          })
+        Text('关于我们')
+        Column(){
+
+        }.width(24)
+        .height(24)
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      .height(44)
+      .padding({ top: 44 })
+
+      Column() {
+        Image($r('app.media.icon'))
+          .width(100)
+          .margin({ bottom: 16 })
+        Text('版本号:' + this.versionName)
+          .margin({ bottom: 8 })
+        Text('ICP备案号:' + this.ICPRecordNumber)
+          .margin({ bottom: 20 })
+          .fontSize(12)
+          .fontColor(Color.Gray)
+        List({ space: 25 }) {
+          ForEach(this.listData, (item: string, index) => {
+            ListItem() {
+              Row() {
+                Text(item).fontSize(13)
+                  .fontColor(Color.Black)
+                Blank()
+                Image($r('app.media.icon')).width('24').height('24').margin({ right: 10 })
+              }.width('100%')
+              .onClick(() => {
+                switch (index) {
+                  case 0:
+                    router.pushUrl({
+                      url:'pages/UserAgreementPage'
+                    })
+
+                    break;
+                  case 1:
+                    router.pushUrl({
+                      url:'pages/PrivacyPage'
+                    })
+
+                    break;
+                }
+
+              })
+            }
+          }, (item: string) => item)
+
+          ListItem() {
+            Row() {
+              Text('个性化推荐').fontSize(13)
+                .fontColor(Color.Black)
+              Blank()
+              Row() {
+                Text()
+                  .height('100%')
+                  .aspectRatio(1)
+                  .backgroundColor(Color.White)
+                  .borderRadius(20)
+              }
+              .padding(1)
+              .alignSelf(ItemAlign.End)
+              .width(39)
+              .aspectRatio(2)
+              .borderRadius(20)
+              .justifyContent(this.isAgree ? FlexAlign.End : FlexAlign.Start)
+              .backgroundColor(this.isAgree ? Color.Brown : '#D9D9D9')
+              .onClick(() => {
+                animateTo({ duration: 200 }, () => {
+                  this.isAgree = !this.isAgree
+                })
+              })
+            }
+            .width('100%')
+            .alignItems(VerticalAlign.Center)
+            .padding({ right: 16 })
+          }
+        }
+        .divider({
+          strokeWidth: 1,
+          color: '#DFDFDF',
+          startMargin: 20,
+          endMargin: 10
+        })
+        .width('100%')
+        .padding({ top: 10 })
+
+      }
+      .width('100%')
+      .margin({ top: 20 })
+      .padding({ left: 20, right: 20 })
+
+      // Web({
+      //   src: "https://hm-static.ytpm.net/friend/doc/%E7%94%A8%E6%88%B7%E5%8D%8F%E8%AE%AE.html",
+      //   controller: this.webviewController,
+      //   renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
+      // }).padding(40).width('100%').height('100%')
+
+    }
+    .padding({ bottom: 44 })
+    .height('100%')
+  }
+}

+ 168 - 0
entry/src/main/ets/views/DueTime.ets

@@ -0,0 +1,168 @@
+import { TaskItem } from "../models/Task";
+import { promptAction } from "@kit.ArkUI";
+import { StateColor } from "../constants/index";
+import dayjs from 'dayjs'
+
+
+@Component
+export struct DueTime{
+  @State message: string = 'Hello World';
+  @State isEditing:boolean=true
+  @State taskList: Array<TaskItem> = [
+    new TaskItem({
+      id:1,
+      taskName:"猪猪",
+      detail:"haha",
+      startDate:new Date().getTime()-2592000000,
+      dueDate:new Date().getTime()+2592000000,
+      isCompleted:0,
+      category:1,
+      categoryName:"默认清单",
+      topped:0
+    }),
+    new TaskItem({
+      id:1,
+      taskName:"猪猪",
+      detail:"haha",
+      startDate:new Date().getTime()-2592000000,
+      dueDate:new Date().getTime(),
+      isCompleted:0,
+      category:1,
+      categoryName:"默认清单",
+      topped:0
+    }),
+    new TaskItem({
+      id:2,
+      taskName:"猪猪1",
+      detail:"haha1",
+      startDate:new Date().getTime(),
+      dueDate:new Date().getTime()+2592000000,
+      isCompleted:0,
+      category:1,
+      categoryName:"默认清单",
+      topped:0
+    }),
+    new TaskItem({
+      id:3,
+      taskName:"猪猪1",
+      detail:"ha2ha",
+      startDate:new Date().getTime(),
+      dueDate:new Date().getTime()+36000,
+      isCompleted:0,
+      categoryName:"默认清单",
+      category:1,
+      topped:0
+    }),
+  ]
+  @Builder TaskList_ListItem(item: TaskItem) {
+    Column({space:10}) {
+      Row() {
+        Row() {
+            Checkbox()
+              .select(item.isCompleted?true:false)
+              .onChange((value: boolean) => {
+                animateTo({duration: 300, curve: Curve.EaseInOut}, () => {
+                  // item.is_completed = value
+                  // this.updateExistingTask(item)
+                })
+              })
+              .margin({ right: 10 })
+          Text(item.taskName)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .maxLines(1)
+            .width('60%')
+        }
+        Row() {
+          Column() {
+            Text(dayjs(item.startDate).format('YYYY-MM-DD'))
+              .fontSize(16)
+            Text(dayjs(item.dueDate).format('YYYY-MM-DD'))
+              .fontSize(13)
+          }.alignItems(HorizontalAlign.End)
+          .margin({ right: 10 })
+          }
+        Column(){
+
+        }.width(12)
+        .height(12)
+        .backgroundColor(item.getTaskColor())
+        .borderRadius('50%')
+        }
+      Progress({value: item.getProgressPercent(),total:100})
+        .margin({bottom: 10,left:20})
+        .color(item.getTaskColor())
+        .width(300)
+
+      }.justifyContent(FlexAlign.Center)
+      .alignItems(HorizontalAlign.Start)
+      .backgroundColor(Color.White)
+      .borderRadius(15)
+      .width('100%')
+      .height(66)
+      .width('100%')
+      .padding({ left: 12, right: 18 })
+
+
+    }
+
+
+  @Builder TaskListState(text: string, state: string) {
+    Column() {
+      Text(text)
+        .fontSize(20)
+        .width('100%')
+        .margin({ bottom: 10, top: 20 })
+        .textAlign(TextAlign.Start)
+        .padding({ left: 12, right: 12 })
+
+      List({space:10}) {
+        // 未办事项
+        ForEach(this.taskList, (item: TaskItem) => {
+          if (!item.isCompleted && item.getTaskState() == state) {
+            ListItem() {
+              this.TaskList_ListItem(item)
+            }.width('100%')
+            .onClick(() => {
+              // this.taskItem = item
+              // this.dialogController_view.open()
+            })
+          }
+        })
+      }
+      .width('100%')
+      .scrollBar(BarState.Off)
+      .divider({ strokeWidth: 1 })
+      .margin({ bottom: 20 })
+    }.layoutWeight(1)
+  }
+
+  build() {
+
+    Scroll(){
+      Column() {
+        this.TaskListState('非常紧急', 'CRITICAL')
+        this.TaskListState('紧急', 'HARD')
+        this.TaskListState('还有时间', 'MEDIUM')
+        this.TaskListState('刚刚够','MILD')
+        this.TaskListState('该开始了', 'EASY')
+
+
+        // Text(new Date().getTime().toString()).onClick(()=>{
+        //   promptAction.showToast({
+        //     message:JSON.stringify((Math.floor(new Date().getTime()/1000)).toString())
+        //   })
+        // })
+        // Button().onClick(()=>{
+        //   promptAction.showToast({
+        //     message:this.taskList[0].getTaskState()
+        //   })
+        // })
+      }.padding({ left: 12, right: 12, bottom: 10, top: 10 })
+      .layoutWeight(1)
+      .margin({bottom: 40})
+
+    }.width('100%')
+    .height('100%')
+    .scrollBar(BarState.Off)
+  }
+}

+ 354 - 0
entry/src/main/ets/views/Main.ets

@@ -0,0 +1,354 @@
+
+import { ReNameInput } from "../components/ReNameInput"
+import { TaskItemDialog } from "../dialog/TaskItemDialog"
+import { ITaskItem, TaskItem } from "../models/Task"
+import { ITaskCategory, TaskCategory } from "../models/TaskCategory"
+import dayjs from 'dayjs'
+import { promptAction } from "@kit.ArkUI"
+import { taskItemDB } from "../database/TaskDataBase"
+import { YTAvoid } from "../utils/YTAvoid"
+
+
+@Extend(Text) function textTitle() {
+  .fontSize(20)
+  .width('100%')
+  .margin({ left: 12})
+  .textAlign(TextAlign.Start)
+}
+
+@Component
+export struct Main {
+  @State taskList: Array<TaskItem> = []
+  @State categoryList: Array<ITaskCategory> = [
+    {
+      color:'#000000',
+      name:'默认清单',
+      id: 1,
+    },
+    {
+      id:2,
+      name:"学习清单",
+      color:"#fff"
+    },
+    {
+      id:2,
+      name:"生活清单",
+      color:"#fff"
+    },
+    {
+      id:2,
+      name:"其他清单",
+      color:"#fff"
+    },
+
+  ]
+
+  @StorageProp(YTAvoid.SAFE_TOP_KEY)
+  top:number=0
+  @State isEditing: boolean = true
+  @State dialogIsAddNew: boolean = true
+  @State
+  taskEditItem:ITaskItem={} as ITaskItem
+  taskEditId:number=0
+  taskCategoryCount:number=0
+
+  dialogController: CustomDialogController = new CustomDialogController({
+    builder: TaskItemDialog({
+      taskItem:this.taskEditItem,
+      categoryList:this.categoryList,
+      confirm:(item:ITaskItem)=>{
+        // this.taskList.push(item)
+        if(item.id==null){
+          //新增
+          this.taskList.push(new TaskItem(item))
+          //新增
+          this.insertTaskData({
+            id:null,
+            taskName:item.taskName,
+            detail:item.detail,
+            startDate:item.startDate,
+            dueDate:item.dueDate,
+            isCompleted:item.isCompleted,
+            category:item.category,
+            categoryName:item.categoryName,
+            topped:item.topped
+          } as ITaskItem)
+        }else{
+          //先更新task列表的数据
+         this.taskList.forEach((itemD,index)=>{
+           if(itemD.id==this.taskEditId){
+             this.taskList[index]=new TaskItem(item)
+           }
+         })
+          //再更新数据库数据
+          this.updateTaskData({
+            id:item.id,
+            taskName:item.taskName,
+            detail:item.detail,
+            startDate:item.startDate,
+            dueDate:item.dueDate,
+            isCompleted:item.isCompleted,
+            category:item.category,
+            categoryName:item.categoryName,
+            topped:item.topped
+          } as ITaskItem)
+        }
+
+      }
+
+    }),
+    alignment: DialogAlignment.Bottom,
+    customStyle: true
+  })
+
+  //删除单个
+  @Builder
+  itemEnd(taskItem:TaskItem) {
+    Row() {
+        Text("完成")
+          .fontSize(16)
+          .backgroundColor('#F59A23')
+          .fontColor(Color.Black)
+          .textAlign(TextAlign.Center)
+          .width(60)
+          .height('100%')
+          .borderRadius({
+            topRight: 10,
+            bottomRight: 10
+          })
+          .onClick(() => {
+            //将当前设置为已完成
+            //如果时已办事项,就提示已经完成  不能完成
+
+          })
+      Text("删除")
+        .fontSize(16)
+        .backgroundColor('#FF3B30')
+        .fontColor(Color.White)
+        .textAlign(TextAlign.Center)
+        .width(60)
+        .height('100%')
+        .borderRadius({
+          topRight: 10,
+          bottomRight: 10
+        })
+        .onClick(() => {
+          //先删除本地数组数据
+         // const a= this.taskList.slice(index,1)
+         //  this.taskList=[]
+         //  this.taskList=a
+         //
+          const arr=this.taskList.filter(item=>item.id!=taskItem.id)
+          this.taskList=[]
+          this.taskList=arr
+          // promptAction.showToast({
+          //   message:JSON.stringify(taskItem)
+          // })
+          //再删除数据里面的数据
+          let ids=[] as number[]
+          ids.push(taskItem.id as number)
+          this.deleteTaskData(ids)
+        })
+    }.padding(0).justifyContent(FlexAlign.SpaceEvenly)
+  }
+  @Builder
+  TaskList_ListItem(taskItem:TaskItem) {
+    Row() {
+      Text(taskItem.taskName)
+        .textOverflow({overflow: TextOverflow.Ellipsis })
+        .maxLines(1)
+
+
+      Blank()
+
+      Row() {
+        Text(dayjs(taskItem.startDate).format('YYYY-MM-DD'))
+          .margin({right: 10})
+
+
+        Text(taskItem.categoryName)
+          .fontSize(14)
+          .borderRadius(10)
+          .backgroundColor('#f1f2f3')
+          .margin({right: 8})
+          .padding({left: 6, right: 6, top: 4, bottom: 4})
+
+        Column(){
+
+        }.width(12)
+        .height(12)
+        .backgroundColor(taskItem.getTaskColor())
+        .borderRadius('50%')
+      }
+      // if (this.isEditing) {
+      //   Toggle({ type: ToggleType.Checkbox, isOn: false })
+      //     .onChange((isOn: Boolean) => {
+      //       if (isOn) this.deleteTarget.push(item)
+      //       else {
+      //         let this_id_index = this.deleteTarget.indexOf(item)
+      //         this.deleteTarget.splice(this_id_index, 1)
+      //       }
+      //     })
+      // }
+    }
+    .height(56)
+    .borderRadius(10)
+    .width('100%')
+    .backgroundColor('#eef6f0')
+    .padding({ left: 12, right: 12 })
+    .border({ width: 1, color: '#756860' })
+    .shadow({
+      // 模糊半径
+      radius: 10,
+      // 阴影类型
+      type: ShadowType.COLOR,
+      // 阴影颜色
+      color: 'rgba(181, 228, 255,0.5)',
+      // X 轴偏移
+      offsetX: -3,
+      // Y 轴偏移
+      offsetY: 10,
+      // 是否内部填充,值为布尔型,默认为flase
+      fill: false
+    })
+    .onClick(()=>{
+      this.taskEditItem=
+        {
+          id:taskItem.id,
+          taskName:taskItem.taskName,
+          detail:taskItem.detail,
+          startDate:taskItem.startDate,
+          dueDate:taskItem.dueDate,
+          category:taskItem.category,
+          categoryName:taskItem.categoryName,
+          isCompleted:taskItem.isCompleted,
+          topped:taskItem.topped
+      }
+      // promptAction.showToast({
+      //   message:JSON.stringify(this.taskEditItem),
+      //   offset:{
+      //     dx:10,
+      //     dy:10
+      //   }
+      // })
+      this.taskEditId=taskItem.id as number
+      this.dialogController.open()
+    })
+  }
+  /**
+   * 任务api
+   */
+  //获取task数据
+  async getTaskData(){
+    const list= await taskItemDB.query()  as ITaskItem[]
+    list.map((item)=>{
+     this.taskList.push(new TaskItem(item))
+    })
+    promptAction.showToast({
+      message:JSON.stringify(this.taskList)
+    })
+  }
+  //添加数据
+  async insertTaskData(item:ITaskItem){
+    const a=await taskItemDB.insert(item)
+  }
+  async updateTaskData(item:ITaskItem){
+    await taskItemDB.update(item)
+  }
+  async deleteTaskData(ids:number[]){
+    await taskItemDB.delete(ids)
+  }
+  aboutToAppear(): void {
+    this.getTaskData()
+  }
+  build() {
+    Column() {
+      Stack({ alignContent: Alignment.BottomEnd }) {
+        Column() {
+          Search()
+            .width('100%')
+            .height(40)
+            .onSubmit((value: string) => {
+              // this.querySearchTask(value)
+            })
+
+
+          Scroll() {
+            Column({space:20}) {
+              Column({ space: 10 }) {
+                Text('未办事项')
+                  .textTitle()
+                List({ space: 5 }) {
+                  ForEach(this.taskList, (item: TaskItem, index:number) => {
+                    if(item.isCompleted==0) {
+                      ListItem() {
+                        this.TaskList_ListItem(item)
+                      }.swipeAction({
+                        end: this.itemEnd.bind(this, item)
+                      })
+                    }
+                  })
+                  //,(item:TaskItem,index)=>{return item.id+index.toString()}
+                }
+                .width('100%')
+                .height(250)
+                .scrollBar(BarState.Off)
+                .nestedScroll({
+                  scrollForward: NestedScrollMode.SELF_FIRST,
+                  scrollBackward: NestedScrollMode.PARENT_FIRST
+                })
+              }.width('100%')
+              .height(300)
+              .padding({ left: 10, right: 10 })
+              .borderRadius(20)
+
+              Column({ space: 10 }) {
+                Text('已办事项')
+                  .textTitle()
+
+                Column() {
+                  List({ space: 5 }) {
+                    ForEach(this.taskList, (item: TaskItem, index) => {
+                      if(item.isCompleted==1) {
+
+                        ListItem() {
+                          this.TaskList_ListItem(item)
+                        }.swipeAction({
+                          end: this.itemEnd.bind(this, item),
+                        })
+                      }
+                    })
+                  }
+                }.width('100%')
+                .layoutWeight(1)
+
+              }.width('100%')
+              .padding({ left: 10, right: 10 })
+              .borderRadius(20)
+
+            }
+          }.width('100%')
+          .layoutWeight(1)
+          .scrollBar(BarState.Off)
+        }.width('100%')
+        .height('100%')
+        // UI 右下角的 Fab
+        Button({ type: ButtonType.Circle }) {
+         Image($r('app.media.home_add'))
+        }
+        .backgroundColor(this.isEditing ? 0x0A59F7 : 0xE84026)
+        .width(60)
+        .height(60)
+        .margin({ bottom: 12, right: (this.isEditing ? 0 : 12) })
+        .onClick(() => {
+          this.taskEditItem={} as ITaskItem
+          this.dialogController.open()
+        })
+      }.layoutWeight(1)
+    }.width('100%')
+    .height('100%')
+    .padding({ left: 10, right: 10})
+  }
+}
+
+

+ 259 - 0
entry/src/main/ets/views/Note.ets

@@ -0,0 +1,259 @@
+import dayjs from 'dayjs'
+import { noteDB } from '../database/NoteDB'
+import { NoteDBInfo } from '../models/Note'
+
+@Component
+export struct Note {
+  // 笔记列表
+  @State list: NoteDBInfo[] = []
+
+  // 标题
+  @State noteId:number| null=null
+  @State title: string = ''
+  // 内容
+  @State content: string = ''
+
+  @State isShow:boolean=false
+
+  // onPageShow(): void {
+  //   this.getList()
+  // }
+
+  // 获取列表
+  async getList() {
+    this.list = await noteDB.query()
+  }
+
+  // 删除数据
+  async deleteData(ids: number[]) {
+    await noteDB.delete(ids)
+    this.getList()
+  }
+
+  // 获取笔记详情-回显到页面中
+  async getDetail() {
+    // 根据 id 查找笔记
+    const list = await noteDB.query(this.noteId as number)
+    // 提取出笔记详情
+    const detail = list[0]
+    // 如果有笔记详情,回显到页面中
+    if (detail) {
+      this.title = detail.title
+      this.content = detail.content
+    }
+  }
+
+  async update(){
+    await noteDB.update({
+      id: this.noteId,
+      title: this.title,
+      content: this.content,
+      date_added: Date.now()
+    })
+    this.getList()
+  }
+
+  async insert(){
+    await noteDB.insert({
+      id: null,
+      title: this.title,
+      content: this.content,
+      date_added: Date.now()
+    })
+    this.getList()
+  }
+
+  @Builder
+  swipeActionEnd(id: number) {
+    Row() {
+      Button("删除")
+        .type(ButtonType.Normal)
+        .height('100%')
+        .aspectRatio(1)
+        .backgroundColor('#FF5E5D')
+        .onClick(() => {
+          // TODO:删除
+          let ids=[] as number[]
+          ids.push(id)
+          this.deleteData(ids)
+        })
+    }
+    .height('100%')
+    .justifyContent(FlexAlign.SpaceEvenly)
+  }
+  aboutToAppear(): void {
+    this.getList()
+  }
+
+  @Builder
+  AddOrEditBuilder(){
+    Stack({ alignContent: Alignment.Bottom }) {
+      Column({ space: 10 }) {
+        Row() {
+          Text('标题')
+            .fontSize(14)
+            .fontColor(Color.Black)
+
+          Text('保存')
+            .fontSize(14)
+            .fontColor(Color.Black)
+            .onClick(()=>{
+              //修改笔记内容,新增笔记内容
+              //todo:
+              if(this.noteId!=null){
+                this.update()
+              }else{
+                this.insert()
+              }
+              this.isShow=false
+              this.noteId=null
+              this.title=""
+              this.content=""
+
+            })
+
+        }.width('100%')
+        .justifyContent(FlexAlign.SpaceBetween)
+        TextInput({ placeholder: '请输入笔记标题', text: this.title })
+          .backgroundColor(Color.White)
+          .border({ width: 1, color: Color.Black, radius: 6 })
+          .padding({ left: 10 })
+          .onChange((text) => {
+            this.title = text
+          })
+          //
+        Text('内容')
+          .fontSize(14)
+          .fontColor(Color.White)
+          .width('100%')
+        TextArea({ placeholder: '请输入笔记内容', text: this.content })
+          .backgroundColor(Color.White)
+          .border({ width: 1, color: Color.Black, radius: 6 })
+          .layoutWeight(1)
+          .padding(10)
+          .onChange((text) => {
+            this.content = text
+          })
+      }
+      .padding({ bottom: 160 })
+
+      // if (this.routerParams.id) {
+        // 底部按钮
+        Row({ space: 10 }) {
+          Button('分享')
+            .type(ButtonType.Normal)
+            .backgroundColor(Color.Pink)
+            .borderRadius(10)
+            .layoutWeight(1)
+            .onClick(() => {
+              // this.shareNote()
+            })
+        // }
+
+      }.width('100%')
+        .padding({ bottom: 80 })
+    }
+    .padding({ left: 15, right: 15, top: 20 })
+  }
+
+  build() {
+      Stack({ alignContent: Alignment.BottomEnd }) {
+        if (this.list.length!=0) {
+          Column() {
+            List() {
+              ForEach(this.list, (item: NoteDBInfo) => {
+                ListItem() {
+                  Row() {
+                    Column() {
+                      Text(item.title)
+                        .fontSize(16)
+                        .fontColor(Color.Black)
+                      Text(dayjs(item.date_added)
+                        .format('YYYY年MM月DD日'))
+                        .fontSize(12)
+                        .fontColor(Color.Black)
+                        .lineHeight(25)
+                    }
+                    .alignItems(HorizontalAlign.Start)
+
+                    Column() {
+                      Image($r('app.media.icon'))
+                        .width(22)
+                        .aspectRatio(1)
+                    }
+                    .justifyContent(FlexAlign.Center)
+                    .height('100%')
+                  }
+                  .width('100%')
+                  .justifyContent(FlexAlign.SpaceBetween)
+                  .padding({ left: 15, right: 15 })
+                  .onClick(() => {
+                    this.isShow=true
+                    this.noteId=item.id as number
+                    this.title=item.title
+                    this.content=item.content
+                  })
+                }
+                .height(72)
+                .transition({ type: TransitionType.Delete, opacity: 0 })
+                .swipeAction({
+                  end: {
+                    builder:this.swipeActionEnd(item.id),
+                  },
+                  edgeEffect: SwipeEdgeEffect.None
+                })
+              })
+              // 底部占位
+              ListItem()
+                .height(126)
+            }
+            // 每行之间的分界线
+            .divider({
+              strokeWidth: 1,
+              color: Color.Pink,
+              startMargin: 15,
+              endMargin: 15
+            })
+            .width('100%')
+            .height('100%')
+          }
+          .height('100%')
+        } else {
+         //还没有笔记
+          Column(){
+
+
+            Text('去添加')
+              .padding({left:16,right:16,top:10,bottom:10})
+              .backgroundColor('#d1fd45')
+              .borderRadius(15)
+
+          }.width('100%')
+          .height('100%')
+          .justifyContent(FlexAlign.Center)
+
+        }
+
+        Column() {
+          Image($r("app.media.home_add"))
+            .width(56)
+            .aspectRatio(1)
+            .onClick(() => {
+              this.isShow=true
+              this.noteId=null
+              this.title=""
+              this.content=""
+            })
+        }
+        .width('100%')
+        .height(126)
+        .justifyContent(FlexAlign.Center)
+        .padding({ left: 15, right: 15 })
+      }
+      .bindSheet($$this.isShow,this.AddOrEditBuilder(),{
+        height:400,
+        showClose:false
+      })
+      .height('100%')
+  }
+}

+ 105 - 0
entry/src/main/ets/views/Time.ets

@@ -0,0 +1,105 @@
+interface DList {
+  id:number
+  textContent:string
+  time:string
+  icon:Resource
+  isPassed:Boolean
+  isCurrent:Boolean
+}
+@Component
+export struct Time {
+  @State list:DList[] = [
+    {
+      id: 1,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。在页面内容很多时,若用户需快速定位,可拖拽滚动条,如下图所示。当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。在页面内容很多时,若用户需快速定位,可拖拽滚动条,如下图所示。',
+      time:'15:01',
+      icon:$r('app.media.icon'),
+      isPassed:true,
+      isCurrent:false
+    },
+    {
+      id: 2,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。',
+      time:'15:02',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:true
+    },
+    {
+      id: 3,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。在页面内容很多时,若用户需快速定位,可拖拽滚动条,如下图所示。当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。在页面内容很多时,若用户需快速定位,可拖拽滚动条,如下图所示。',
+      time:'15:03',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:false
+    },
+    {
+      id: 4,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。',
+      time:'15:04',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:false
+    },
+    {
+      id: 5,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。',
+      time:'15:04',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:false
+    },
+    {
+      id: 6,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。',
+      time:'15:04',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:false
+    },
+    {
+      id: 7,
+      textContent: '当列表项高度(宽度)超出屏幕高度(宽度)时,列表可以沿垂直(水平)方向滚动。',
+      time:'15:04',
+      icon:$r('app.media.icon'),
+      isPassed:false,
+      isCurrent:false
+    },
+  ]
+  @State listLength:Number = this.list.length;
+  build() {
+    Column(){
+      List(){
+        ForEach(this.list,(item:DList)=>{
+          ListItem(){
+            Column(){
+              Row(){
+                Image(item.isPassed || item.isCurrent? $r('app.media.icon') : $r('app.media.icon'))
+                  .width(item.isCurrent?16:10)
+                  .height(item.isCurrent?16:10)
+                  .margin({right:item.isCurrent?8:5})
+                Text(item.time)
+              }.margin({left:item.isCurrent?-8:-5})
+              Column(){
+                Row(){
+                  Text(){
+                    Span(item.textContent)
+                    ImageSpan(item.icon)
+                      .width(20)
+                      .height(20)
+                      .verticalAlign(ImageSpanAlignment.BOTTOM)
+                  }
+                }
+                .padding({left:10})
+              }
+              .border({width:{left:item.id == this.listLength ? 0 : 1 },color:item.isPassed?'#e3bbbb':'#dddddd'})
+            }
+            .alignItems(HorizontalAlign.Start)
+            .width('80%')
+            .margin({bottom:10})
+          }
+        })
+      }.alignListItem(ListItemAlign.Center)
+    }
+  }
+}

+ 58 - 0
entry/src/main/module.json5

@@ -0,0 +1,58 @@
+{
+  "module": {
+    "requestPermissions": [
+      {
+        "name": "ohos.permission.INTERNET"
+      }
+    ],
+    "name": "entry",
+    "type": "entry",
+    "description": "$string:module_desc",
+    "mainElement": "EntryAbility",
+    "deviceTypes": [
+      "phone",
+      "tablet",
+      "2in1",
+      "wearable"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false,
+    "pages": "$profile:main_pages",
+    "abilities": [
+      {
+        "name": "EntryAbility",
+        "srcEntry": "./ets/entryability/EntryAbility.ets",
+        "description": "$string:EntryAbility_desc",
+        "icon": "$media:layered_image",
+        "label": "$string:EntryAbility_label",
+        "startWindowIcon": "$media:startIcon",
+        "startWindowBackground": "$color:start_window_background",
+        "exported": true,
+        "skills": [
+          {
+            "entities": [
+              "entity.system.home"
+            ],
+            "actions": [
+              "action.system.home"
+            ]
+          }
+        ]
+      }
+    ],
+    "extensionAbilities": [
+      {
+        "name": "EntryBackupAbility",
+        "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
+        "type": "backup",
+        "exported": false,
+        "metadata": [
+          {
+            "name": "ohos.extension.backup",
+            "resource": "$profile:backup_config"
+          }
+        ],
+      }
+    ]
+  }
+}

+ 8 - 0
entry/src/main/resources/base/element/color.json

@@ -0,0 +1,8 @@
+{
+  "color": [
+    {
+      "name": "start_window_background",
+      "value": "#FFFFFF"
+    }
+  ]
+}

+ 8 - 0
entry/src/main/resources/base/element/float.json

@@ -0,0 +1,8 @@
+{
+  "float": [
+    {
+      "name": "page_text_font_size",
+      "value": "50fp"
+    }
+  ]
+}

+ 16 - 0
entry/src/main/resources/base/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "module description"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "作业清单"
+    }
+  ]
+}

二進制
entry/src/main/resources/base/media/background.png


二進制
entry/src/main/resources/base/media/backimg.png


二進制
entry/src/main/resources/base/media/book.png


二進制
entry/src/main/resources/base/media/c_book.png


二進制
entry/src/main/resources/base/media/c_my.png


二進制
entry/src/main/resources/base/media/confim.png


二進制
entry/src/main/resources/base/media/foreground.png


二進制
entry/src/main/resources/base/media/half.png


二進制
entry/src/main/resources/base/media/home_add.png


二進制
entry/src/main/resources/base/media/icon.png


+ 7 - 0
entry/src/main/resources/base/media/layered_image.json

@@ -0,0 +1,7 @@
+{
+  "layered-image":
+  {
+    "background" : "$media:background",
+    "foreground" : "$media:foreground"
+  }
+}

二進制
entry/src/main/resources/base/media/my.png


二進制
entry/src/main/resources/base/media/my_app_icon.png


二進制
entry/src/main/resources/base/media/note.png


二進制
entry/src/main/resources/base/media/notesel.png


二進制
entry/src/main/resources/base/media/startIcon.png


二進制
entry/src/main/resources/base/media/timeselect.png


二進制
entry/src/main/resources/base/media/timeunselect.png


+ 3 - 0
entry/src/main/resources/base/profile/backup_config.json

@@ -0,0 +1,3 @@
+{
+  "allowToBackupRestore": true
+}

+ 7 - 0
entry/src/main/resources/base/profile/main_pages.json

@@ -0,0 +1,7 @@
+{
+  "src": [
+    "pages/Index",
+    "pages/PrivacyPage",
+    "pages/UserAgreementPage"
+  ]
+}

+ 8 - 0
entry/src/main/resources/dark/element/color.json

@@ -0,0 +1,8 @@
+{
+  "color": [
+    {
+      "name": "start_window_background",
+      "value": "#000000"
+    }
+  ]
+}

+ 16 - 0
entry/src/main/resources/en_US/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "module description"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "Task List"
+    }
+  ]
+}

二進制
entry/src/main/resources/rawfile/my_app_icon.png


二進制
entry/src/main/resources/rawfile/oobe/o1.png


二進制
entry/src/main/resources/rawfile/oobe/o2.png


二進制
entry/src/main/resources/rawfile/oobe/o3.png


二進制
entry/src/main/resources/rawfile/oobe/o4.png


二進制
entry/src/main/resources/rawfile/oobe/o5.png


二進制
entry/src/main/resources/rawfile/oobe/o6.png


二進制
entry/src/main/resources/rawfile/sr_my_app_icon.png


+ 16 - 0
entry/src/main/resources/zh_CN/element/string.json

@@ -0,0 +1,16 @@
+{
+  "string": [
+    {
+      "name": "module_desc",
+      "value": "模块描述"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "作业清单"
+    }
+  ]
+}

+ 2 - 0
entry/src/mock/mock-config.json5

@@ -0,0 +1,2 @@
+{
+}

+ 35 - 0
entry/src/ohosTest/ets/test/Ability.test.ets

@@ -0,0 +1,35 @@
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+  describe('ActsAbilityTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    })
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    })
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    })
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    })
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    })
+  })
+}

+ 5 - 0
entry/src/ohosTest/ets/test/List.test.ets

@@ -0,0 +1,5 @@
+import abilityTest from './Ability.test';
+
+export default function testsuite() {
+  abilityTest();
+}

+ 14 - 0
entry/src/ohosTest/module.json5

@@ -0,0 +1,14 @@
+{
+  "module": {
+    "name": "entry_test",
+    "type": "feature",
+    "deviceTypes": [
+      "phone",
+      "tablet",
+      "2in1",
+      "wearable"
+    ],
+    "deliveryWithInstall": true,
+    "installationFree": false
+  }
+}

+ 5 - 0
entry/src/test/List.test.ets

@@ -0,0 +1,5 @@
+import localUnitTest from './LocalUnit.test';
+
+export default function testsuite() {
+  localUnitTest();
+}

+ 33 - 0
entry/src/test/LocalUnit.test.ets

@@ -0,0 +1,33 @@
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function localUnitTest() {
+  describe('localUnitTest', () => {
+    // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+    beforeAll(() => {
+      // Presets an action, which is performed only once before all test cases of the test suite start.
+      // This API supports only one parameter: preset action function.
+    });
+    beforeEach(() => {
+      // Presets an action, which is performed before each unit test case starts.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: preset action function.
+    });
+    afterEach(() => {
+      // Presets a clear action, which is performed after each unit test case ends.
+      // The number of execution times is the same as the number of test cases defined by **it**.
+      // This API supports only one parameter: clear action function.
+    });
+    afterAll(() => {
+      // Presets a clear action, which is performed after all test cases of the test suite end.
+      // This API supports only one parameter: clear action function.
+    });
+    it('assertContain', 0, () => {
+      // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+      let a = 'abc';
+      let b = 'b';
+      // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+      expect(a).assertContain(b);
+      expect(a).assertEqual(a);
+    });
+  });
+}

+ 22 - 0
hvigor/hvigor-config.json5

@@ -0,0 +1,22 @@
+{
+  "modelVersion": "5.1.0",
+  "dependencies": {
+  },
+  "execution": {
+    // "analyze": "normal",                     /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */
+    // "daemon": true,                          /* Enable daemon compilation. Value: [ true | false ]. Default: true */
+    // "incremental": true,                     /* Enable incremental compilation. Value: [ true | false ]. Default: true */
+    // "parallel": true,                        /* Enable parallel compilation. Value: [ true | false ]. Default: true */
+    // "typeCheck": false,                      /* Enable typeCheck. Value: [ true | false ]. Default: false */
+  },
+  "logging": {
+    // "level": "info"                          /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
+  },
+  "debugging": {
+    // "stacktrace": false                      /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
+  },
+  "nodeOptions": {
+    // "maxOldSpaceSize": 8192                  /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
+    // "exposeGC": true                         /* Enable to trigger garbage collection explicitly. Default: true*/
+  }
+}

+ 6 - 0
hvigorfile.ts

@@ -0,0 +1,6 @@
+import { appTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+  system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+  plugins: []       /* Custom plugin to extend the functionality of Hvigor. */
+}

+ 45 - 0
oh-package-lock.json5

@@ -0,0 +1,45 @@
+{
+  "meta": {
+    "stableOrder": true,
+    "enableUnifiedLockfile": false
+  },
+  "lockfileVersion": 3,
+  "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
+  "specifiers": {
+    "@abner/log@^1.0.5": "@abner/log@1.0.5",
+    "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0",
+    "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21",
+    "dayjs@^1.11.13": "dayjs@1.11.13"
+  },
+  "packages": {
+    "@abner/log@1.0.5": {
+      "name": "@abner/log",
+      "version": "1.0.5",
+      "integrity": "sha512-ifkzK9CKO4Rq6+BrYqT0NE5pkFfONWgBtkPTXSqJHn4vzXwEkVIWUl0v8fmgtHE+8XALi3AiBGu0ldqkrgsZ7Q==",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@abner/log/-/log-1.0.5.har",
+      "registryType": "ohpm"
+    },
+    "@ohos/hamock@1.0.0": {
+      "name": "@ohos/hamock",
+      "version": "1.0.0",
+      "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har",
+      "registryType": "ohpm"
+    },
+    "@ohos/hypium@1.0.21": {
+      "name": "@ohos/hypium",
+      "version": "1.0.21",
+      "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.21.har",
+      "registryType": "ohpm"
+    },
+    "dayjs@1.11.13": {
+      "name": "dayjs",
+      "version": "1.11.13",
+      "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/dayjs/-/dayjs-1.11.13.tgz",
+      "shasum": "92430b0139055c3ebb60150aa13e860a4b5a366c",
+      "registryType": "ohpm"
+    }
+  }
+}

+ 13 - 0
oh-package.json5

@@ -0,0 +1,13 @@
+{
+  "modelVersion": "5.1.0",
+  "description": "Please describe the basic information.",
+  "dependencies": {
+    "dayjs": "^1.11.13",
+    "@abner/log": "^1.0.5"
+  },
+  "devDependencies": {
+    "@ohos/hypium": "1.0.21",
+    "@ohos/hamock": "1.0.0"
+  },
+  "dynamicDependencies": {}
+}