Browse Source

fix:
1. 修复了在日记页面删除日记时 日期title 还在的 bug
2. 新增了《隐私政策》《用户协议》链接

YuJing 2 months ago
parent
commit
0956ad927d

+ 1 - 1
features/feature/src/main/ets/view/DiaryView.ets

@@ -194,7 +194,7 @@ export struct DiaryView {
                   })
                 }, (item: DiaryData) => item.id?.toString())
               }
-            }, (item: DiaryData) => item.diaryDate)
+            }, (groupTitle: string, index: number) => groupTitle)
           }
           .width("100%")
           .height("100%")

+ 4 - 11
features/feature/src/main/ets/viewModels/DiaryViewModel.ets

@@ -35,20 +35,13 @@ export class DiaryViewModel{
     YTLog.info(`查询日记列表结果 ${JSON.stringify(result)}`)
     this.diaryDataList = result
 
-    let i = 0;
-    this.dateList[0] = result[0].diaryDate!
-    // for (let index = 0; index < result.length; index++) {
-    //   if(result[index].diaryDate != this.dateList[i]){
-    //     this.dateList.push(result[index].diaryDate!)
-    //     i++;
-    //   }
-    // }
+    let dateList: string[] = [result[0].diaryDate!]
     result.forEach(item => {
-      if(this.dateList.indexOf(item.diaryDate!) === -1){
-        this.dateList.push(item.diaryDate!)
+      if(dateList.indexOf(item.diaryDate!) === -1){
+        dateList.push(item.diaryDate!)
       }
     })
-
+    this.dateList = dateList
     console.log('title_List ' + JSON.stringify(this.dateList))
   }
 

+ 1 - 2
features/user/src/main/ets/pages/Privacy.ets

@@ -17,11 +17,10 @@ export struct Privacy {
   private webviewController: WebviewController = new webview.WebviewController()
 
   build() {
-
     Column() {
       YTHeader({ title: "隐私政策" })
       Web({
-        src: "https://hm-static.ytpm.net/friend/doc/%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96.html",
+        src: "https://hm-test.ytpm.net/diaryPrivatePolicy",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
       }).padding(20)

+ 1 - 1
features/user/src/main/ets/pages/UserAgreement.ets

@@ -17,7 +17,7 @@ struct UserAgreementPage {
     Column() {
       YTHeader({ title: '用户协议' })
       Web({
-        src: "https://hm-static.ytpm.net/friend/doc/%E7%94%A8%E6%88%B7%E5%8D%8F%E8%AE%AE.html",
+        src: "https://hm-test.ytpm.net/diaryUserAgreement",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
       })

+ 1 - 1
products/entry/src/main/ets/pages/Index.ets

@@ -37,7 +37,7 @@ struct Index {
   build() {
     Navigation(yTRouter) {
       Column() {
-        Tabs({ controller: this.tabsController, index: 1 }) {
+        Tabs({ controller: this.tabsController, index: 0 }) {
           ForEach(this.contentList, (_: BasicType<undefined>, index) => {
             TabContent() {
               if (index == 0) {