소스 검색

修改提醒时间操作bug

XUYangWei 2 달 전
부모
커밋
a9c0322e9d
75개의 변경된 파일2040개의 추가작업 그리고 637개의 파일을 삭제
  1. 1 1
      AppScope/resources/base/element/string.json
  2. BIN
      AppScope/resources/base/media/app_icon.png
  3. BIN
      AppScope/resources/base/media/background.png
  4. BIN
      AppScope/resources/base/media/foreground.png
  5. 16 16
      build-profile.json5
  6. 4 4
      commons/basic/src/main/ets/apis/YTRequest.ets
  7. 1 1
      commons/basic/src/main/ets/apis/YTUserRequest.ets
  8. 1 1
      commons/basic/src/main/ets/components/generalComp/YTButton.ets
  9. 43 40
      commons/basic/src/main/ets/components/generalComp/YTCalendarPicker.ets
  10. 1 1
      commons/basic/src/main/ets/utils/ContextHelper.ets
  11. 1 1
      commons/basic/src/main/ets/utils/YTRouter.ets
  12. 3 0
      features/feature/src/main/ets/api/ApiUrl.ets
  13. 15 17
      features/feature/src/main/ets/api/DiaryApi.ets
  14. 1 1
      features/feature/src/main/ets/api/GreenPlantApi.ets
  15. 7 7
      features/feature/src/main/ets/api/GrowthApi.ets
  16. 28 0
      features/feature/src/main/ets/api/MessageApi.ets
  17. 27 16
      features/feature/src/main/ets/api/RemindApi.ets
  18. 10 0
      features/feature/src/main/ets/components/NullCom.ets
  19. 1 1
      features/feature/src/main/ets/components/fourcomponent/DiaryDatePicker.ets
  20. 5 5
      features/feature/src/main/ets/components/fourcomponent/DiaryTimePicker.ets
  21. 1 1
      features/feature/src/main/ets/components/maincomponent/BindSheetTask/CustomNumberDay.ets
  22. 1 1
      features/feature/src/main/ets/components/maincomponent/BindSheetTask/TextPickerRemind.ets
  23. 2 1
      features/feature/src/main/ets/components/maincomponent/DiaryDatePicker.ets
  24. 1 1
      features/feature/src/main/ets/components/maincomponent/DiaryTimePicker.ets
  25. 76 0
      features/feature/src/main/ets/components/maincomponent/GreenPlantMainCard.ets
  26. 30 3
      features/feature/src/main/ets/components/maincomponent/RemindItemClassComp.ets
  27. 6 0
      features/feature/src/main/ets/components/maincomponent/checkBox.ets
  28. 372 0
      features/feature/src/main/ets/components/threecomponent/YTCalendarPicker.ets
  29. 22 22
      features/feature/src/main/ets/data/index.ets
  30. 2 26
      features/feature/src/main/ets/models/Second.ets
  31. 63 16
      features/feature/src/main/ets/models/index.ets
  32. 199 87
      features/feature/src/main/ets/pages/EditGreenPlantPage.ets
  33. 60 54
      features/feature/src/main/ets/pages/GrowInfoPage.ets
  34. 55 31
      features/feature/src/main/ets/pages/IncreaseDiaryPage.ets
  35. 218 0
      features/feature/src/main/ets/pages/MessagePage.ets
  36. 1 1
      features/feature/src/main/ets/utils/DateUtils.ets
  37. 40 0
      features/feature/src/main/ets/utils/dateListFormat.ets
  38. 9 9
      features/feature/src/main/ets/view/DiaryViewModel.ets
  39. 13 10
      features/feature/src/main/ets/view/FourView.ets
  40. 156 87
      features/feature/src/main/ets/view/MainView.ets
  41. 36 15
      features/feature/src/main/ets/view/RecodeViewModel.ets
  42. 284 114
      features/feature/src/main/ets/view/SecondView.ets
  43. 139 3
      features/feature/src/main/ets/view/ThirdView.ets
  44. 38 1
      features/feature/src/main/ets/viewmodels/EditGreenPlantPageModel.ets
  45. 16 1
      features/feature/src/main/ets/viewmodels/SecondViewModel.ets
  46. BIN
      features/feature/src/main/resources/base/media/icon_edit_page_tab.png
  47. BIN
      features/feature/src/main/resources/base/media/icon_growth_people1.png
  48. BIN
      features/feature/src/main/resources/base/media/icon_growth_people2.png
  49. BIN
      features/feature/src/main/resources/base/media/icon_growth_people3.png
  50. BIN
      features/feature/src/main/resources/base/media/icon_growth_right.png
  51. BIN
      features/feature/src/main/resources/base/media/icon_growth_value.png
  52. BIN
      features/feature/src/main/resources/base/media/icon_null.png
  53. BIN
      features/feature/src/main/resources/base/media/icon_sort_1.png
  54. BIN
      features/feature/src/main/resources/base/media/icon_sort_2.png
  55. BIN
      features/feature/src/main/resources/base/media/photoAlbum.png
  56. 0 12
      features/feature/src/main/resources/base/media/photoAlbum.svg
  57. 5 0
      features/feature/src/main/resources/base/profile/router_map.json
  58. 2 2
      features/user/src/main/ets/pages/DelPhotoPage.ets
  59. 4 7
      features/user/src/main/ets/pages/Privacy.ets
  60. 1 1
      features/user/src/main/ets/pages/UserAgreement.ets
  61. 9 9
      features/user/src/main/ets/views/Mine.ets
  62. BIN
      features/user/src/main/resources/base/media/icon_about_wo.png
  63. BIN
      features/user/src/main/resources/base/media/icon_mine_share.png
  64. BIN
      features/user/src/main/resources/base/media/icon_mine_sugestion.png
  65. 5 1
      products/entry/src/main/ets/pages/Index.ets
  66. 2 2
      products/entry/src/main/ets/pages/PrivacyPage.ets
  67. 6 6
      products/entry/src/main/module.json5
  68. 1 1
      products/entry/src/main/resources/base/element/string.json
  69. BIN
      products/entry/src/main/resources/base/media/app_icon.png
  70. BIN
      products/entry/src/main/resources/base/media/background.png
  71. BIN
      products/entry/src/main/resources/base/media/foreground.png
  72. BIN
      products/entry/src/main/resources/base/media/icon_about_wo.png
  73. BIN
      products/entry/src/main/resources/base/media/icon_mine_share.png
  74. BIN
      products/entry/src/main/resources/base/media/icon_mine_sugestion.png
  75. BIN
      products/entry/src/main/resources/base/media/startIcon.png

+ 1 - 1
AppScope/resources/base/element/string.json

@@ -2,7 +2,7 @@
   "string": [
     {
       "name": "app_name",
-      "value": "YTSketch"
+      "value": "绿植养护助手"
     }
   ]
 }

BIN
AppScope/resources/base/media/app_icon.png


BIN
AppScope/resources/base/media/background.png


BIN
AppScope/resources/base/media/foreground.png


+ 16 - 16
build-profile.json5

@@ -1,19 +1,19 @@
 {
   "app": {
-//    "signingConfigs": [
-//      {
-//        "name": "default",
-//        "material": {
-//          "storeFile": "sign/basic.p12",
-//          "storePassword": "000000181F0EECD983295AB4504A961E19D1B5914CB198FA414395A09865788F96EFF93C84981A55",
-//          "keyAlias": "yt112233",
-//          "keyPassword": "0000001871572C6DAC842AAE8EF9A99F0F746307476E0F0ACF919CC12B0F81467CF5B0CCDBF97E2D",
-//          "signAlg": "SHA256withECDSA",
-//          "profile": "sign/聊天恋爱宝调试证书.p7b",
-//          "certpath": "sign/调试证书.cer"
-//        }
-//      }
-//    ],
+    "signingConfigs": [
+      {
+        "name": "default",
+        "material": {
+          "storeFile": "C:/Users/EDY/Documents/xwechat_files/wxid_nz06488hmfxu22_a945/msg/file/2025-06/基础证书文件/基础证书文件/basic.p12",
+          "storePassword": "0000001823289D9EAF3D431D92D036AE5972DE8181D4E0F649FB3074CD20A0FE66E3C6796B1346BD",
+          "keyAlias": "yt112233",
+          "keyPassword": "000000184889ED51C65D6B61C923DADA2E20D8013F88B31949D53F6FF8157C7CFD50099383C02D60",
+          "signAlg": "SHA256withECDSA",
+          "profile": "C:/Users/EDY/Downloads/绿植养护调试Debug.p7b",
+          "certpath": "C:/Users/EDY/Documents/xwechat_files/wxid_nz06488hmfxu22_a945/msg/file/2025-06/基础证书文件/基础证书文件/调试证书.cer"
+        }
+      }
+    ],
     "products": [
       {
         "name": "default",
@@ -30,12 +30,12 @@
     ],
     "buildModeSet": [
       {
-        "name": "debug",
+        "name": "debug"
       },
       {
         "name": "release"
       }
-    ]
+    ],
   },
   "modules": [
     {

+ 4 - 4
commons/basic/src/main/ets/apis/YTRequest.ets

@@ -35,8 +35,8 @@ instance.interceptors.request.use(async (config: InternalAxiosRequestConfig) =>
   // 为请求参数添加 oaid
   if ((config.method == 'get' || config.method == 'delete') && config.url) {
     if(config?.params) {
-      // config.params.oaid=await ytOaidUtils.getOaid()
-      config.params.oaid="814d1a21-c082-4faf-9cec-f84cb3d05512"
+      config.params.oaid=await ytOaidUtils.getOaid()
+      // config.params.oaid="814d1a21-c082-4faf-9cec-f84cb3d05512"
       // ytOaidUtils.getOaid().then((res)=>{
      //   config.params.oaid =res
      //   YTLog.info(res)
@@ -48,8 +48,8 @@ instance.interceptors.request.use(async (config: InternalAxiosRequestConfig) =>
        //   config.data.oaid =res
        //   YTLog.info(res)
        // })
-      // config.data.oaid=await ytOaidUtils.getOaid()
-      config.data.oaid="814d1a21-c082-4faf-9cec-f84cb3d05512"
+      config.data.oaid=await ytOaidUtils.getOaid()
+      // config.data.oaid="814d1a21-c082-4faf-9cec-f84cb3d05512"
     }
   }
 

+ 1 - 1
commons/basic/src/main/ets/apis/YTUserRequest.ets

@@ -177,7 +177,7 @@ export class YTUserRequest extends YTRequest {
 
   //问题反馈
   static questionBack(des: string, createBy: string) {
-    YTUserRequest.post<null, ReqString>(`/warehouseBack/saveQuestion`, {
+    YTUserRequest.post<null, ReqString>(`/prod-plants/api/plants/saveQuestion`, {
       'backQuestion': des,
       'mobile': createBy,
       'createTime': new YTDate().formatDate('-', true),

+ 1 - 1
commons/basic/src/main/ets/components/generalComp/YTButton.ets

@@ -31,7 +31,7 @@ export struct YTButton {
 
   aboutToAppear(): void {
     if (!this.bgc) {
-      this.btLinearGradient = { angle: 92, colors: [['#FF4597F7', 0.023], ['#FF6B6DF7', 1.081]] }
+      this.btLinearGradient = { angle: 92, colors: [['#206D43', 1]] }
     }
   }
 

+ 43 - 40
commons/basic/src/main/ets/components/generalComp/YTCalendarPicker.ets

@@ -7,13 +7,13 @@ export struct YTCalendarPicker {
    * 外部传入
    */
   // 主题色
-  linearInfo: LinearGradientOptions = { colors: [['#B9FD2A', 0.01], ['#F5FD6D', 1]], angle: 110 }
+  linearInfo: LinearGradientOptions = { colors: [['#206D43', 1]], angle: 110 }
 
   // 边距
   cPadding: Padding | Length | LocalizedPadding = { left: 0, right: 0, top: 20, bottom: 4  }
 
   // yyyy-mm-dd 格式的数组, 符合数组内格式的日期下会有标记
-  dateList: string[] = []
+  @Prop dateList: string[] = []
 
   // 取消
   onCancel: () => void = () => {}
@@ -26,6 +26,8 @@ export struct YTCalendarPicker {
 
   // 是否显示头部标题
   showTitle: boolean = true
+  //更改月份之后重新获取红点
+  updateRed:(year:string,month:string)=>void=()=>{}
 
   /**
    * 内部方法
@@ -214,10 +216,9 @@ export struct YTCalendarPicker {
           // 月份切换
           Row({ space: 8 }) {
             Text(`${this.year}-${this.month.toString().padStart(2, '0')}`)
-              .fontSize(16)
+              .fontSize(18)
               .fontWeight(600)
-              .fontColor(Color.Black)
-
+              .fontColor('#1C1C1C')
             Image($r('app.media.ic_back'))
               .width(14)
               .height(8)
@@ -232,16 +233,15 @@ export struct YTCalendarPicker {
               this.year = this.range[this.selectedIndex[0]].text.valueOf() as number
               this.month = this.range[this.selectedIndex[0]].children![this.selectedIndex[1]].text.valueOf() as number
               this.changeMonth(this.year, this.month)
+              this.updateRed(this.year.toString(),this.month.toString())
             },
             placement: Placement.Bottom
           })
 
-          // 右上角的结构
-          this.buttonRow()
         }
         .width("100%")
         .alignItems(VerticalAlign.Center)
-        .justifyContent(FlexAlign.SpaceBetween)
+        .justifyContent(FlexAlign.Center)
       }
 
       // 周 title 的显示
@@ -268,7 +268,7 @@ export struct YTCalendarPicker {
                 Row() {
                   Text(item.day + '')
                     .fontSize(12)
-                    .fontColor(this.isSameDay(item.id, this.selectDay) ? Color.Black : '#979797')
+                    .fontColor(this.isSameDay(item.id, this.selectDay) ? Color.White : '#979797')
                 }
                 .width("100%")
                 .aspectRatio(1)
@@ -287,7 +287,9 @@ export struct YTCalendarPicker {
                   .width(4)
                   .aspectRatio(1)
                   .borderRadius(2)
-                  .linearGradient(this.dateList.indexOf(this.formatDateToCustomString(item.id, false)) !== -1 ? this.linearInfo : null)
+                  .backgroundColor(Color.Red)
+                  .backgroundColor(this.dateList.indexOf(item.year+"-"+item.month+"-"+item.day)!==-1 ? Color.Red:null)
+                  // .linearGradient(this.dateList.indexOf(this.formatDateToCustomString(item.id, false)) !== -1 ? this.linearInfo : null)
               } else {
                 // 空白占位符
                 Text('')
@@ -305,6 +307,7 @@ export struct YTCalendarPicker {
       .columnsTemplate('repeat(7, 1fr)')
     }
     .width("100%")
+    .borderRadius(12)
     .padding(this.cPadding)
     .backgroundColor(Color.White)
   }
@@ -339,34 +342,34 @@ export struct YTCalendarPicker {
     .backgroundColor(Color.White)
   }
 
-  // 右上角结构 - 确定和取消按钮
-  @Builder
-  private buttonRow() {
-    Row({ space: 14 }) {
-      Text("取消")
-        .borderRadius(36)
-        .backgroundColor('#F6F6F6')
-        .fontColor(Color.Black)
-        .padding({
-          left: 20,
-          top: 5,
-          right: 20,
-          bottom: 5
-        })
-        .onClick(this.onCancel)
-      Text("确认")
-        .borderRadius(36)
-        .linearGradient(this.linearInfo)
-        .fontColor(Color.Black)
-        .padding({
-          left: 20,
-          top: 5,
-          right: 20,
-          bottom: 5
-        })
-        .onClick(() => {
-          this.onConfirm(this.selectDay)
-        })
-    }
-  }
+  // // 右上角结构 - 确定和取消按钮
+  // @Builder
+  // private buttonRow() {
+  //   Row({ space: 14 }) {
+  //     Text("取消")
+  //       .borderRadius(36)
+  //       .backgroundColor('#F6F6F6')
+  //       .fontColor(Color.Black)
+  //       .padding({
+  //         left: 20,
+  //         top: 5,
+  //         right: 20,
+  //         bottom: 5
+  //       })
+  //       .onClick(this.onCancel)
+  //     Text("确认")
+  //       .borderRadius(36)
+  //       .linearGradient(this.linearInfo)
+  //       .fontColor(Color.Black)
+  //       .padding({
+  //         left: 20,
+  //         top: 5,
+  //         right: 20,
+  //         bottom: 5
+  //       })
+  //       .onClick(() => {
+  //         this.onConfirm(this.selectDay)
+  //       })
+  //   }
+  // }
 }

+ 1 - 1
commons/basic/src/main/ets/utils/ContextHelper.ets

@@ -102,7 +102,7 @@ export class ContextHelper {
                   } else {
                     const oaid: string = data;
                     jHStartAd.init(ContextHelper.UIAbilityContext, oaid)
-                    ytOaidUtils.setOaid(oaid)
+                    ytOaidUtils.setOaid('123456')
                     YTLog.info(`succeeded in getting oaid by callback , oaid: ${oaid}`);
                   }
                 });

+ 1 - 1
commons/basic/src/main/ets/utils/YTRouter.ets

@@ -60,7 +60,7 @@ class YTRouter extends NavPathStack {
   }
 
   router2DelPhotoPage(param: DelPhotoParam,success?:(res:PopInfo)=>void) {
-    yTRouter.pushPathByName('DelPhotoPage', param)
+    yTRouter.pushPathByName('DelPhotoPage', param,success)
   }
 
   getDelPhotoParam() {

+ 3 - 0
features/feature/src/main/ets/api/ApiUrl.ets

@@ -42,6 +42,9 @@ export class ApiUrl{
   //修改提醒设置
   static readonly UPDATE_REMIND_ITEM="/prod-plants/api/remind/edit"
 
+  //提醒年月红点
+  static readonly GET_UNCOMPELTE_RED="/prod-plants/api/remind/getRemindSettingByMonth"
+
 
   /**
    * 植物管理

+ 15 - 17
features/feature/src/main/ets/api/DiaryApi.ets

@@ -1,6 +1,7 @@
 import { YTRequest } from "basic";
-import { data } from "../data";
-import { DiaryData } from "../models";
+import { DiaryData, DiaryDataParam, DiaryDataParamEdit } from "../models";
+import { ApiUrl } from "./ApiUrl";
+
 export class DiaryApi {
   /**
    * 删除日记
@@ -63,9 +64,9 @@ export class DiaryApi {
    * @returns
    */
   static deleteNote(id: number): Promise<boolean> {
-    // return YTRequest.delete<boolean>(ApiUrl.DELETE_NOTE + '?id=' + id)
+    return YTRequest.post<boolean,ESObject>(ApiUrl.DELETE_RECORD,{} as ESObject,{markId:id})
     // const a=true
-    return Promise.resolve(true)
+    // return Promise.resolve(true)
   }
 
   /**
@@ -73,9 +74,9 @@ export class DiaryApi {
    * @param params 生活小记录数据结构
    * @returns
    */
-  // static saveNote(params: DiaryData): Promise<boolean> {
-  //   // return YTRequest.post<boolean, DiaryData>(ApiUrl.NOTE_SAVE, params)
-  // }
+  static saveNote(params: DiaryDataParam): Promise<boolean> {
+    return YTRequest.post<boolean, DiaryDataParam>(ApiUrl.INSERT_RECORD, params)
+  }
 
   /**
    * 查询生活小记录
@@ -83,8 +84,7 @@ export class DiaryApi {
    * @returns 生活小记录列表
    */
   static queryNoteList(nowTime: string): Promise<DiaryData[]> {
-    return Promise.resolve(data as DiaryData[]);
-    // return YTRequest.get<DiaryData[]>(ApiUrl.QUERY_BY_NOTE_LIST + '?nowTime=' + nowTime)
+    return YTRequest.post<DiaryData[]>(ApiUrl.GET_RECORD_LIST,{date:nowTime})
   }
 
   /**
@@ -93,7 +93,7 @@ export class DiaryApi {
    * @returns
    */
   // static queryNoteById(id: number): Promise<DiaryData> {
-  //   // return YTRequest.get<DiaryData>(ApiUrl.QUERY_NOTE_BY_ID + '?id=' + id)
+  //   return YTRequest.get<DiaryData>(ApiUrl.QUERY_NOTE_BY_ID + '?id=' + id)
   // }
 
   /**
@@ -101,18 +101,16 @@ export class DiaryApi {
    * @param params 生活小记录数据结构
    * @returns
    */
-  // static updateNote(params: DiaryData): Promise<boolean> {
-  //   // return YTRequest.post<boolean, DiaryData>(ApiUrl.UPDATE_NOTE, params)
-  // }
+  static updateNote(params: DiaryDataParamEdit): Promise<boolean> {
+    return YTRequest.post<boolean, DiaryDataParamEdit>(ApiUrl.UPDATE_RECORD, params)
+  }
 
   /**
    * 修改生活小记录时间
    * @param params 生活小记录数据结构
    * @returns
    */
-  static updateNoteTime(params: DiaryData): Promise<boolean> {
-
-    return Promise.resolve(true)
-    // return YTRequest.post<boolean, DiaryData>(ApiUrl.UPDATE_NOTE_TIME, params)
+  static updateNoteTime(params: DiaryDataParamEdit): Promise<boolean> {
+    return YTRequest.post<boolean, DiaryDataParamEdit>(ApiUrl.UPDATE_RECORD, params)
   }
 }

+ 1 - 1
features/feature/src/main/ets/api/GreenPlantApi.ets

@@ -84,7 +84,7 @@ export class GreenPlantsApi{
    * 删除植物
    */
   static async deleteGreenPlants(id:number){
-    return await YTRequest.post<boolean,number>(ApiUrl.DELETE_GREEN_PLANTS_ITEM,{} as ESObject,id)
+    return await YTRequest.post<boolean,number>(ApiUrl.DELETE_GREEN_PLANTS_ITEM,{} as ESObject,{plantsId:id})
   }
   /**
    * 获取植物列表

+ 7 - 7
features/feature/src/main/ets/api/GrowthApi.ets

@@ -25,23 +25,23 @@ export class GrowthApi{
   //获取每日挑战列表
 
   static async getChallengeList(){
-   return await YTRequest.get<Challenge>(ApiUrl.GET_EVERY_DAY_CHALLENGE_LIST)
+   return await YTRequest.get<Challenge>(ApiUrl.GET_EVERY_DAY_CHALLENGE_LIST,{})
   }
   //获取成长点明细
   static  async getGrowthLog(){
-    return await YTRequest.post<GrowthLog,null>(ApiUrl.GET_GROWTH_LOG)
+    return await YTRequest.post<GrowthLog,ESObject>(ApiUrl.GET_GROWTH_LOG,{})
   }
   //签到
   static async SignIn(){
-    return await YTRequest.get<boolean>(ApiUrl.SIGN_IN)
+    return await YTRequest.get<boolean>(ApiUrl.SIGN_IN,{})
   }
   //获取用户总成长点
   static async getUserGrowthValue(){
-    return await YTRequest.get<string>(ApiUrl.GET_USER_GROWTH_VALUE)
+    return await YTRequest.get<string>(ApiUrl.GET_USER_GROWTH_VALUE,{})
   }
   // //获取用户信息
-  // static async getUserInfo(){
-  //   return await YTRequest.get<UserInfo>(ApiUrl.GET_USER_INFO)
-  // }
+  static async getUserInfo(){
+    return await YTRequest.get<Record<string,string|number>>(ApiUrl.GET_USER_INFO,{})
+  }
   //
 }

+ 28 - 0
features/feature/src/main/ets/api/MessageApi.ets

@@ -0,0 +1,28 @@
+import { YTRequest } from "basic";
+import { ApiUrl } from "./ApiUrl";
+import { ResponseResult } from "./GreenPlantApi";
+
+export interface MessageItem {
+  messageContent: string,
+  messageId: number,
+  messageStatus: number,
+  messageType: string,
+}
+export interface GetMessageParams{
+  page:number,
+  pageSizes:number,
+}
+export interface  UpdateMessage{
+  messageId: number,
+  messageStatus: number
+}
+
+export class MessageApi{
+  static async getMessageList(param:GetMessageParams){
+    return await YTRequest.post<ResponseResult<MessageItem[]>,GetMessageParams>(ApiUrl.GET_MESSAGE_LIST,param)
+  }
+  static async updateMessage(params:UpdateMessage){
+    return await YTRequest.post<boolean,UpdateMessage>(ApiUrl.UPDATE_MESSAGE,params)
+
+  }
+}

+ 27 - 16
features/feature/src/main/ets/api/RemindApi.ets

@@ -7,25 +7,28 @@ export interface GetRemindParams{
   oaid?: number
   page: number,
   pageSizes: number,
-  plantsId: number
+  plantsId?: number,
+  remindDate?:string
 }
 export interface InsertEditRemindParams{
   oaid?:string
-  plantsId: number
-  itemId: number
-  itemIcon: string,
-  itemName: string
-  repeatType: string
-  remindDate: string
-  remindTime: string
-  weeklyWeekday:number
-  monthlyDay:number
-  intervalDays:number
+  plantsId?: number
+  settingId?:number,
+  itemId?: number,
+  isOpen?:boolean,
+  itemIcon?: string,
+  itemName?: string
+  repeatType?: string
+  remindDate?: string
+  remindTime?: string
+  weeklyWeekday?:number
+  monthlyDay?:number
+  intervalDays?:number
 }
 //设置数据接口
 export interface RemindItem{
   oaid?:string,
-  settingId:string,
+  settingId:number,
   plantsId:number,
   itemId:number, //	养护事项ID
   itemName:string,
@@ -36,11 +39,15 @@ export interface RemindItem{
   intervalDays:string  //	自定义间隔天数(仅当 repeat_type=custom 时有效)
   weeklyWeekday:string, //每周几(1=周一, 7=周日),仅 weekly 使用
   monthlyDay:string, //每月几号(1~31),仅 monthly 使用
-  isOpen:boolean //	是否开启提醒:0=否,1=是
+  isOpen:boolean //	是否开启提醒:0=否,1=是"plantsName": "",
+  plantsPicture: string,
+  plantsName: string,
 }
 @ObservedV2
 export class RemindItemClass{
-  settingId:string
+  plantsPicture: string
+  plantsName: string
+  settingId:number
   plantsId:number
   itemId:number //	养护事项ID
   itemName:string
@@ -66,6 +73,8 @@ export class RemindItemClass{
     this.weeklyWeekday=item.weeklyWeekday
     this.monthlyDay=item.monthlyDay
     this.isOpen=item.isOpen
+    this.plantsName=item.plantsName
+    this.plantsPicture=item.plantsPicture
   }
 }
 export class RemindApi{
@@ -97,6 +106,8 @@ export class RemindApi{
   static async deleteRemind(id:number){
     return await YTRequest.post<boolean,number>(ApiUrl.DELETE_REMIND_ITEM,{} as ESObject,id)
   }
-
-
+  //红点
+  static async getRed(yearMonth:string,odid:string){
+    return await YTRequest.get<string[]>(ApiUrl.GET_UNCOMPELTE_RED,{yearMonth:yearMonth,odid:odid})
+  }
 }

+ 10 - 0
features/feature/src/main/ets/components/NullCom.ets

@@ -0,0 +1,10 @@
+//无数据的时候展示
+@Builder
+export function NullBuilder(){
+  Column({ space: 10 }) {
+    Image($r('app.media.app_icon')).width(100).height(100)
+    Text('暂无数据').fontColor('#B2B2B2')
+
+  }.width('100%').layoutWeight(1).justifyContent(FlexAlign.Center).alignItems(HorizontalAlign.Center)
+
+}

+ 1 - 1
features/feature/src/main/ets/components/fourcomponent/DiaryDatePicker.ets

@@ -26,7 +26,7 @@ export struct DiaryDatePicker {
         Text("确认")
           .fontSize(16)
           .fontWeight(500)
-          .borderRadius(32)
+          .borderRadius(8)
           .backgroundColor('#206D43')
           // .linearGradient(this.linearInfo)
           .padding({ left: 16, right: 16, top: 4, bottom: 4})

+ 5 - 5
features/feature/src/main/ets/components/fourcomponent/DiaryTimePicker.ets

@@ -7,7 +7,7 @@ export struct DiaryTimePicker {
   private hourController: SwiperController = new SwiperController()
   private minuteController: SwiperController = new SwiperController()
   iwidth= 160
-  timeStr: String = DateUtils.formatDateToCustomString(new Date(), true).split(' ')[1]
+  timeStr: String = DateUtils.formatDateToCustomString(new Date(), true).split('T')[1]
 
   // 回调函数
   onConfirm?: (time: string) => void = (time: string) => {
@@ -17,7 +17,7 @@ export struct DiaryTimePicker {
   onCancel?: () => void
 
   private linearInfo: LinearGradientOptions = {
-    colors: [ ['#B9FD2A', 0.01], ['#F5FD6D', 1] ],
+    colors: [ ['#206D43', 1]],
     angle: 150
   }
 
@@ -103,7 +103,7 @@ export struct DiaryTimePicker {
                   .fontSize(index === (this.selectedHour+1)%24 ? 16 : 14)
                   .width('100%')
                   .height(30)
-                  .fontColor(index === (this.selectedHour+1)%24 ? '#212245' : '#757575')
+                  .fontColor(index === (this.selectedHour+1)%24 ? '#fff' : '#757575')
                   .textAlign(TextAlign.Center)
                   .alignSelf(ItemAlign.Center)
                   .borderRadius(8)
@@ -130,7 +130,7 @@ export struct DiaryTimePicker {
           Text(':')
             .fontSize(24)
             .fontWeight(FontWeight.Bold)
-            .fontColor('#333333')
+            .fontColor('#fff')
             .alignSelf(ItemAlign.Center)
 
           // 分钟选择器
@@ -140,7 +140,7 @@ export struct DiaryTimePicker {
                 Text(`${index.toString().padStart(2, '0')}`)
                   .fontSize(index === (this.selectedMinute+1)%60 ? 16 : 14)
                   .fontWeight(FontWeight.Bold)
-                  .fontColor(index === (this.selectedMinute+1)%60 ? '#212245' : '#757575')
+                  .fontColor(index === (this.selectedMinute+1)%60 ? '#fff' : '#757575')
                   .width('100%')
                   .height(30)
                   .textAlign(TextAlign.Center)

+ 1 - 1
features/feature/src/main/ets/components/maincomponent/BindSheetTask/CustomNumberDay.ets

@@ -26,7 +26,7 @@ export struct CustomNumberDay{
       .margin({bottom:40})
       Row({space:30}){
         Text('每隔')
-        TextInput({text:"12"})
+        TextInput({text:""})
           .width(80)
           .maxLength(2)
           .textAlign(TextAlign.Center)

+ 1 - 1
features/feature/src/main/ets/components/maincomponent/BindSheetTask/TextPickerRemind.ets

@@ -12,7 +12,7 @@ export struct TextPickerRemind{
       TextPicker({ range: this.textList,columnWidths: [LengthMetrics.percent(100)]})
         .width('100%')
         .layoutWeight(1)
-        .selectedIndex(0)
+        // .selectedIndex(0)
         .textStyle({
           color:'#9C9898',
           font:{size:16,weight:600}

+ 2 - 1
features/feature/src/main/ets/components/maincomponent/DiaryDatePicker.ets

@@ -51,7 +51,8 @@ export struct DiaryDatePicker {
           .linearGradient(this.linearInfo)
 
         DatePicker({
-          end: new Date(),
+          start:new Date(),
+          end:new Date('2100-01-01'),
           selected: this.selectedDate,
         })
           .selectedTextStyle({

+ 1 - 1
features/feature/src/main/ets/components/maincomponent/DiaryTimePicker.ets

@@ -7,7 +7,7 @@ export struct DiaryTimePicker {
   private hourController: SwiperController = new SwiperController()
   private minuteController: SwiperController = new SwiperController()
   iwidth= 160
-  timeStr: String = DateUtils.formatDateToCustomString(new Date(), true).split(' ')[1]
+  timeStr: String = DateUtils.formatDateToCustomString(new Date(), true).split('T')[1]
 
   // 回调函数
   onConfirm?: (time: string) => void = (time: string) => {

+ 76 - 0
features/feature/src/main/ets/components/maincomponent/GreenPlantMainCard.ets

@@ -0,0 +1,76 @@
+import { GreenPlants } from "../../api/GreenPlantApi"
+import { ButtonCom } from "./ButtonCom"
+
+@ComponentV2
+export struct  GreenPlantMainCard{
+  @Param @Require item:GreenPlants
+  @Event ishow:()=>void=()=>{}
+  // @Event selChange:(sel:boolean)=>void=()=>{
+  //
+  // }
+  @Param isshow:boolean=false
+  build() {
+    Row() {
+      if(this.isshow) {
+        Checkbox({
+          group: 'cart',
+          name: this.item.plantsId.toString()
+        })
+          .shape(CheckBoxShape.ROUNDED_SQUARE)
+          .selectedColor('#498552')
+          .unselectedColor('#498552')
+      }
+      Row() {
+        Column() {
+          Image(this.item.plantsPicture).width(55).height(79)
+        }
+        .width(70)
+        .height(90)
+        .justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+        .borderRadius(20)
+        .backgroundColor('#E8EBF0')
+        .margin({ right: 9 })
+
+        Column({ space: 11 }) {
+          Text(this.item.plantsName).fontColor('#333333')
+          Row({ space: 5 }) {
+            Image($r("app.media.main_icon_clockDesc")).width(15).height(15)
+            Text(this.item.clockDesc.length > 8 ? this.item.clockDesc.slice(0, 8) : this.item.clockDesc)
+              .fontColor('#333333')
+              .fontSize(12)
+          }
+
+          Row({ space: 5 }) {
+            Image($r("app.media.main_icon_remindDesc")).width(15).height(15)
+            Text(this.item.remindDesc.length > 8 ? this.item.remindDesc.slice(0, 8) : this.item.remindDesc)
+              .fontColor('#333333')
+              .fontSize(12)
+          }
+        }.justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
+
+        Blank()
+        ButtonCom({
+          text: "养护打卡",
+          isShowBuilder: () => {
+            this.ishow()
+          }
+        })
+      }
+      .width('100%')
+      .height(115)
+      .backgroundColor('#fff')
+      .justifyContent(FlexAlign.Center)
+      .alignItems(VerticalAlign.Center)
+      .borderRadius(12)
+      .padding({
+        left: 17,
+        top: 17,
+        right: 20,
+        bottom: 17
+      })
+    }
+
+
+  }
+}

+ 30 - 3
features/feature/src/main/ets/components/maincomponent/RemindItemClassComp.ets

@@ -1,5 +1,5 @@
 import dayjs from "dayjs"
-import { RemindItemClass } from "../../api/RemindApi"
+import { InsertEditRemindParams, RemindApi, RemindItemClass } from "../../api/RemindApi"
 import { DateFrequency, FREQUENCY_WEEK } from "../../constants"
 import { DateUtils } from "../../utils/DateUtils"
 
@@ -7,7 +7,12 @@ import { DateUtils } from "../../utils/DateUtils"
 @ComponentV2
 export struct RemindItemClassComp{
   @Param @Require  item:RemindItemClass
+
+  @Event isShowBuilder:()=>void=()=>{}
   // @Local text:string="仅一次"
+  async editRemind(params:InsertEditRemindParams){
+    await RemindApi.updateRemind(params)
+  }
   textTranslate(item:string){
     if(item==DateFrequency.NONE){
       return "仅一次"
@@ -24,7 +29,12 @@ export struct RemindItemClassComp{
     Row() {
       Column({ space: 6 }) {
         Image(this.item.itemIcon).width(50)
-        Text(this.item.itemName)
+        Stack({alignContent:Alignment.Bottom}) {
+          Text(this.item.itemName).fontColor('#333333')
+          Row(){
+
+          }.width(40).height(4).borderRadius(10).backgroundColor('#9dd0a1')
+        }
       }
       Blank()
       Column({ space: 17 }) {
@@ -71,9 +81,26 @@ export struct RemindItemClassComp{
       .onClick(() => {
         animateTo({ duration: 200 }, () => {
           this.item.isOpen = !this.item.isOpen
+          if(this.item.repeatType==DateFrequency.NONE && this.item.isOpen==true){
+            this.isShowBuilder()
+            return
+          }
+          this.editRemind({
+            plantsId:this.item.plantsId,
+            itemId:this.item.itemId,
+            itemName:this.item.itemName,
+            itemIcon:this.item.itemIcon,
+            repeatType:this.item.repeatType,
+            remindDate:this.item.remindDate,
+            remindTime:this.item.remindTime,
+            intervalDays:Number(this.item.intervalDays),
+            monthlyDay:Number(this.item.monthlyDay),
+            weeklyWeekday:Number(this.item.weeklyWeekday),
+            isOpen:this.item.isOpen,
+            settingId:this.item.settingId
+          })
         })
       })
-
     }
     .width('100%')
     .height(100)

+ 6 - 0
features/feature/src/main/ets/components/maincomponent/checkBox.ets

@@ -0,0 +1,6 @@
+// Checkbox({
+//   group: 'cart',
+//   name: this.item.id
+// })
+//   .shape(CheckBoxShape.CIRCLE)
+//   .selectedColor(MAIN_RED)

+ 372 - 0
features/feature/src/main/ets/components/threecomponent/YTCalendarPicker.ets

@@ -0,0 +1,372 @@
+import { DateInfo } from "../../models";
+
+@Component
+@CustomDialog
+export struct YTCalendarPicker {
+  /**
+   * 外部传入
+   */
+  // 主题色
+  linearInfo: LinearGradientOptions = { colors: [['#B9FD2A', 0.01], ['#F5FD6D', 1]], angle: 110 }
+
+  // 边距
+  cPadding: Padding | Length | LocalizedPadding = { left: 0, right: 0, top: 20, bottom: 4  }
+
+  // yyyy-mm-dd 格式的数组, 符合数组内格式的日期下会有标记
+  dateList: string[] = []
+
+  // 取消
+  onCancel: () => void = () => {}
+
+  // 确定
+  onConfirm: (date: Date) => void = () => {}
+
+  // 点击某一天的回调
+  onClickItem: (date: Date) => void = () => {}
+
+  // 是否显示头部标题
+  showTitle: boolean = true
+
+  /**
+   * 内部方法
+   */
+
+  // 年月
+  @State year: number = new Date().getFullYear();
+  @State month: number = new Date().getMonth() + 1;
+
+  // 开始是星期几
+  @State private weekStart: number = 1;
+  // 本月的天数
+  @State private daysInMonth: number = 31;
+  // 渲染用的月份数组
+  @State private monthArray: DateInfo[] = [];
+  // 当前选中的日期
+  @State private selectDay: Date = new Date()
+  // 显示选择日期的菜单
+  @State private showDatePickerMenu: boolean = false
+
+  // 弹窗控制器 -
+  diaLogControl?: CustomDialogController
+  // 星期中文映射表
+  private readonly WEEK_MAP = ['日', '一', '二', '三', '四', '五', '六'];
+  // 日期选择器的范围
+  private declare range: TextCascadePickerRangeContent[]
+  // 年份 - 日期选择器使用
+  private years = Array.from<number, number>({ length: new Date().getFullYear() - 1970 + 1 }, (_: number, i: number) => 1970 + i)
+  //当前年月选择的下标
+  private selectedIndex: number[] = [new Date().getFullYear() - 1970, new Date().getMonth()]
+
+
+  /**
+   * 回调
+   */
+
+  // 更改月份
+  changeMonth(year: number, month: number) {
+    // 1. 获取当前月份的天数
+    this.daysInMonth = this.getDaysInMonth(year, month);
+
+    // 2. 获取当月的第一天是星期几
+    this.weekStart = new Date(year, month - 1, 1).getDay() + 1;
+
+    // 3. 初始化月份数组
+    this.monthArray = [...new Array(this.weekStart - 1).fill({} as DateInfo),
+      ...this.generateBackwardDateArray(new Date(year, month - 1, 1), this.daysInMonth, false)];
+
+    return this.monthArray
+  }
+
+  // 点击单个日期
+  clickItem(item: DateInfo){
+    this.selectDay = item.id
+    this.onClickItem(this.selectDay)
+  }
+
+  // 更改日期选择器的显示和隐藏
+  changeDatePickerMenu(show: boolean) {
+    animateToImmediately({ duration: 200 }, () => {
+      this.showDatePickerMenu = show
+    })
+  }
+
+  /**
+   * 获取指定月份的天数
+   * @param year 年
+   * @param month 月份
+   * @returns 当月的天数
+   */
+  getDaysInMonth(year: number, month: number): number {
+    return new Date(year, month, 0).getDate();
+  }
+
+  /**
+   * 判断两个 Date 对象是否为同一天
+   * @param date1
+   * @param date2
+   * @returns
+   */
+  isSameDay(date1: Date, date2: Date): boolean {
+    return (
+      date1.getFullYear() === date2.getFullYear() &&
+        date1.getMonth() === date2.getMonth() &&
+        date1.getDate() === date2.getDate()
+    );
+  }
+
+  /**
+   * 格式化日期对象为自定义字符串
+   * @param date 日期对象
+   * @param needTime 是否需要时间 ( 时、分、秒 )
+   * @param needSecond 是否需要秒
+   * @returns
+   */
+  formatDateToCustomString(date: Date, needTime: boolean = true, needSecond: boolean = true): string {
+    // 转换为 YY-MM-DD HH:mm:ss 格式
+    const year = date.getFullYear().toString();
+    const month = (date.getMonth() + 1).toString().padStart(2, '0');
+    const day = date.getDate().toString().padStart(2, '0');
+    const hours = date.getHours().toString().padStart(2, '0');
+    const minutes = date.getMinutes().toString().padStart(2, '0');
+    const seconds = date.getSeconds().toString().padStart(2, '0');
+
+    const result =
+      `${year}-${month}-${day}` + (needTime ? ` ${hours}:${minutes}` + (needSecond ? `:${seconds}` : '') : '');
+    return result;
+  }
+
+  /**
+   * 生成从指定日期开始向后的连续日期数组,可以包含今天但不能超过今天
+   * @param startDate 起始日期(默认当前日期)
+   * @param count 生成的日期数量(默认7天)
+   * @returns 日期对象数组,包含今天但不包含超过今天的日期
+   */
+  generateBackwardDateArray(
+    startDate: Date = new Date(),
+    count: number = 7,
+    isCheck: boolean = true
+  ): DateInfo[] {
+    const dateArray: DateInfo[] = [];
+
+    // 复制起始日期,避免修改原对象
+    const currentDate = new Date(startDate);
+
+    // 获取今天的日期
+    // 获取今天的日期并设置时间为23:59:59:999,便于比较
+    const today = new Date();
+    today.setHours(0, 0, 0, 0);
+    today.setDate(today.getDate() + 1);
+    today.setTime(today.getTime() - 1); // 设置为今天的最后一毫秒
+
+    for (let i = 0; i < count; i++) {
+      // 检查当前日期是否超过今天
+      if (isCheck && currentDate > today) {
+        break;
+      }
+
+      // 添加日期信息到数组
+      dateArray.push(this.createDateInfo(currentDate));
+
+      // 日期加1天(向后)
+      currentDate.setDate(currentDate.getDate() + 1);
+    }
+
+    return dateArray;
+  }
+
+  /**
+   * 创建一个日期信息对象
+   * @param date 日期对象
+   * @returns DateInfo 对象
+   */
+  createDateInfo(date: Date): DateInfo {
+    const year = date.getFullYear();
+    const month = date.getMonth() + 1;
+    const day = date.getDate();
+    const week = this.WEEK_MAP[date.getDay()];
+
+    return {
+      year: year,
+      month: month,
+      day: day,
+      week: week,
+      id: new Date(date)
+    };
+  }
+
+  aboutToAppear(): void {
+    this.changeMonth(this.year, this.month);
+
+    const monthsRange =
+      Array.from<number, number>({ length: 12 }, (_: number, i: number) => 1 + i).map(month => {
+        return { text: month.toString() } as TextCascadePickerRangeContent
+      })
+    this.range = this.years.map(year => {
+      return { text: year.toString(), children: monthsRange } as TextCascadePickerRangeContent
+    })
+  }
+
+  build() {
+    Column({ space: 20 }) {
+      // 月份切换和头部组件
+      if(this.showTitle) {
+        Row() {
+          // 月份切换
+          Row({ space: 8 }) {
+            Text(`${this.year}-${this.month.toString().padStart(2, '0')}`)
+              .fontSize(16)
+              .fontWeight(600)
+              .fontColor(Color.Black)
+
+            Image($r('app.media.main_icon_left'))
+              .width(14)
+              .height(8)
+              .rotate({angle: this.showDatePickerMenu ? 90 : 270})
+          }
+          .onClick(() => {
+            this.changeDatePickerMenu(true)
+          })
+          .bindMenu(this.showDatePickerMenu, this.dateSelectMenu, {
+            onDisappear: () => {
+              this.changeDatePickerMenu(false)
+              this.year = this.range[this.selectedIndex[0]].text.valueOf() as number
+              this.month = this.range[this.selectedIndex[0]].children![this.selectedIndex[1]].text.valueOf() as number
+              this.changeMonth(this.year, this.month)
+            },
+            placement: Placement.Bottom
+          })
+
+          // 右上角的结构
+          this.buttonRow()
+        }
+        .width("100%")
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.SpaceBetween)
+      }
+
+      // 周 title 的显示
+      Row() {
+        ForEach(this.WEEK_MAP, (item: string, index: number) => {
+          Row(){
+            Text(item)
+              .fontColor(Color.Black)
+          }
+          .layoutWeight(1)
+          .justifyContent(FlexAlign.Center)
+        })
+      }
+      .width("100%")
+      .justifyContent(FlexAlign.SpaceBetween)
+
+      // 日历主体
+      Grid() {
+        ForEach(this.monthArray, (item: DateInfo, index: number) => {
+          GridItem() {
+            Column({ space: 5 }) {
+              if (item.id) {
+                // 日历-单个日期的组件
+                Row() {
+                  Text(item.day + '')
+                    .fontSize(12)
+                    .fontColor(this.isSameDay(item.id, this.selectDay) ? Color.Black : '#979797')
+                }
+                .width("100%")
+                .aspectRatio(1)
+                .borderRadius(8)
+                .alignItems(VerticalAlign.Center)
+                .justifyContent(FlexAlign.Center)
+                .linearGradient(this.isSameDay(item.id, this.selectDay) ? this.linearInfo : {
+                  colors: [['#F6F6F6', 1]],
+                })
+                .onClick(() => {
+                  this.clickItem(item)
+                })
+
+                // 日期标记 - 如无需求,可删除
+                Text()
+                  .width(4)
+                  .aspectRatio(1)
+                  .borderRadius(2)
+                  .linearGradient(this.dateList.indexOf(this.formatDateToCustomString(item.id, false)) !== -1 ? this.linearInfo : null)
+              } else {
+                // 空白占位符
+                Text('')
+              }
+            }
+            .width(32)
+            .alignItems(HorizontalAlign.Center)
+            .justifyContent(FlexAlign.Center)
+          }
+        })
+      }
+      .rowsGap(10)
+      .maxCount(6)
+      .width("100%")
+      .columnsTemplate('repeat(7, 1fr)')
+    }
+    .width("100%")
+    .padding(this.cPadding)
+    .backgroundColor(Color.White)
+  }
+
+  // 日期选择菜单
+  @Builder
+  private dateSelectMenu() {
+    Stack({ alignContent: Alignment.Center }) {
+      TextPicker({ range: this.range, selected: this.selectedIndex })
+        .divider(null)
+        .defaultPickerItemHeight(36)
+        .backgroundColor(Color.White)
+        .selectedTextStyle({ color: '#FF353C46', font: { weight: 500, size: 16 } })
+        .onScrollStop((value, index) => {
+          console.log(`testLog ${value} ${index}`)
+          this.selectedIndex = index as number[]
+        })
+
+      //自定义选择遮罩
+      Column() {
+
+      }
+      .width('100%')
+      .height(36)
+      .backgroundColor('#52D9D9D9')
+      .borderRadius(8)
+    }
+    .height(140)
+    .width(160)
+    .padding(12)
+    .borderRadius(8)
+    .backgroundColor(Color.White)
+  }
+
+  // 右上角结构 - 确定和取消按钮
+  @Builder
+  private buttonRow() {
+    Row({ space: 14 }) {
+      Text("取消")
+        .borderRadius(36)
+        .backgroundColor('#F6F6F6')
+        .fontColor(Color.Black)
+        .padding({
+          left: 20,
+          top: 5,
+          right: 20,
+          bottom: 5
+        })
+        .onClick(this.onCancel)
+      Text("确认")
+        .borderRadius(36)
+        .linearGradient(this.linearInfo)
+        .fontColor(Color.Black)
+        .padding({
+          left: 20,
+          top: 5,
+          right: 20,
+          bottom: 5
+        })
+        .onClick(() => {
+          this.onConfirm(this.selectDay)
+        })
+    }
+  }
+}

+ 22 - 22
features/feature/src/main/ets/data/index.ets

@@ -1,24 +1,24 @@
 import { DiaryData } from "../models";
 
-export let data:DiaryData[]=[
-  {
-    id: 690,
-    userId: 4146,
-    title: "1",
-    content: "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈",
-    noteTime: "2025-10-11 14:34:00",
-    imageUrls: []
-  },
-  {
-    id: 691,
-    userId: 4146,
-    title: "嘿",
-    content: "耶耶耶",
-    noteTime: "2025-10-11 14:35:00",
-    imageUrls: [
-      "https://hm-static.ytpm.net/upload/20251011/77976a0b-e88f-4330-b363-4997b74ac8b0-1760164579584.jpeg",
-      "https://hm-static.ytpm.net/upload/20251011/455fa5ca-6bb7-49f4-998b-483f5b09c62a-1760164579584.jpeg"
-    ]
-  }
-
-]
+// export let data:DiaryData[]=[
+//   {
+//     id: 690,
+//     userId: 4146,
+//     title: "1",
+//     content: "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈",
+//     noteTime: "2025-10-11 14:34:00",
+//     imageUrls: []
+//   },
+//   {
+//     id: 691,
+//     userId: 4146,
+//     title: "嘿",
+//     content: "耶耶耶",
+//     noteTime: "2025-10-11 14:35:00",
+//     imageUrls: [
+//       "https://hm-static.ytpm.net/upload/20251011/77976a0b-e88f-4330-b363-4997b74ac8b0-1760164579584.jpeg",
+//       "https://hm-static.ytpm.net/upload/20251011/455fa5ca-6bb7-49f4-998b-483f5b09c62a-1760164579584.jpeg"
+//     ]
+//   }
+//
+// ]

+ 2 - 26
features/feature/src/main/ets/models/Second.ets

@@ -1,30 +1,6 @@
-interface TaskItemInterface{
-  isShowClose:boolean
+export interface GrowthTaskItemInterface{
   src: ResourceStr
   text: string
   message: string
-  click: () => void
-}
-@ObservedV2
-export class TaskItem{
-  @Trace
-  isShowClose:boolean
-  src: ResourceStr
-  text: string
-  message: string
-  click: () => void
-  constructor(item:TaskItemInterface) {
-    this.isShowClose=item.isShowClose
-    this.src=item.src
-    this.text=item.text
-    this.message=item.message
-    this.click=item.click
-  }
-}
-
-//成长明细
-export interface GrowInfo{
-  text:string,
-  date:string,
-  value:string
 }
+export const GrowthConstants=['','签到','养护打卡','新增绿植','记录']

+ 63 - 16
features/feature/src/main/ets/models/index.ets

@@ -1,27 +1,36 @@
 /**
  * 日记详细数据模型
  */
-export interface DiaryData{
-  // 富文本正文
-  content?: string
-  // 日记日期
-  diaryDate?: string
-  // 日记id
-  id?: number
-  // 图片地址集合
-  imageUrls?: string[]
-  // 日记标题
-  title?: string
-  // 用户id
-  userId?: number
-  // 时间
-  noteTime?: string
-}
+// export interface DiaryData{
+//   // 富文本正文
+//   content?: string
+//   // 日记日期
+//   diaryDate?: string
+//   // 日记id
+//   id?: number
+//   // 图片地址集合
+//   imageUrls?: string[]
+//   // 日记标题
+//   title?: string
+//   // 用户id
+//   userId?: number
+//   // 时间
+//   noteTime?: string
+// }
 
 export enum PageStatus{
   DIARY,
   RECODE
 }
+// 日期信息接口定义
+export interface DateInfo {
+  year: number;   // 年份
+  month: number;  // 月份(1-12)
+  day: number;    // 日期(1-31)
+  week: string;   // 星期(中文)
+  id: Date ;    // 唯一标识
+}
+
 
 // 常量
 export enum Constant{
@@ -32,4 +41,42 @@ export enum Constant{
 // 变量
 export class Variable{
   static pageReadOnly: boolean = false;
+}
+
+export interface DiaryData{
+  // 日记id
+  markId?: number
+  // 富文本正文
+  content?: string
+  // 日记标题
+  title?: string
+  diaryDate?: string
+  // 日记日期
+  markDateTime?: string
+  // 图片地址集合
+  imageUrls?: string[]
+}
+export interface DiaryDataParam{
+  // 日记id
+  markId?: number
+  // 富文本正文
+  content?: string
+  // 日记标题
+  title?: string
+  // 日记日期
+  markDateTime?: string
+  // 图片地址集合
+  imageUrls?: string[]
+}
+export interface DiaryDataParamEdit{
+  // 日记id
+  markId?: number
+  // 富文本正文
+  content?: string
+  // 日记标题
+  title?: string
+  // 日记日期
+  markDateTime?: string
+  // 图片地址集合
+  imageUrls?: string[]
 }

+ 199 - 87
features/feature/src/main/ets/pages/EditGreenPlantPage.ets

@@ -1,4 +1,7 @@
-import { BasicType, IBestToast,
+import { BasicType,
+  IBest,
+  IBestNotify,
+  IBestToast,
   reviseImgHeaderBuilder,
   RouterPage, YTHeader, YTLog, YTPhotoHelper, yTRouter } from "basic"
 import { BuilderHeader } from "../components/maincomponent/BuilderHeader"
@@ -20,10 +23,11 @@ import { SelectIcon } from "../components/maincomponent/BindSheetTask/SelectIcon
 import { TaskGreenPlantsSelect } from "../components/maincomponent/BindSheetTask/TaskGreenPlantsSelect"
 import { TextPickerRemind } from "../components/maincomponent/BindSheetTask/TextPickerRemind"
 import { CustomNumberDay } from "../components/maincomponent/BindSheetTask/CustomNumberDay"
-import { formatClockData } from "../utils/dateListFormat"
+import { formatClockData, textTranslate, textTransLateMon, textTransLateWeek } from "../utils/dateListFormat"
 import { FrequencyList,WeekList,MonthList, DateFrequency } from "../constants"
 import { ButtonCom } from "../components/maincomponent/ButtonCom"
 import { RemindItemClassComp } from "../components/maincomponent/RemindItemClassComp"
+import { NullBuilder } from "../components/NullCom"
 
 @ComponentV2
 @RouterPage
@@ -32,11 +36,12 @@ struct EditGreenPlantPage{
   @Local currentSelectIndex:number=0
   @Local timeLineList: OrderDetailBean[] = []
   @Local remindList:RemindItemClass[]=[]
-  @Local private greenPlantItem:GreenPlants={} as GreenPlants
   @Local clockTaskList:ClockTaskItem[]=[]
   @Local ClockTaskIconList:ClockTaskIcon[]=[]
   @Local private plantsId:number=-1
   @Local showHeaderImgRevise:boolean=false
+  //提醒时间在当前时间之前就会标红
+  @Local isShowRed:boolean=false
   private yTPhotoHelper = new YTPhotoHelper()
   private options: BasicType[] = [
     {
@@ -47,10 +52,8 @@ struct EditGreenPlantPage{
           this.showHeaderImgRevise = false
           yTRouter.router2DelPhotoPage({ src: fullpath, type: 'image'},(res:PopInfo)=>{
             let ans=res.result as string
-            if(ans&&ans!='false'){
-              this.greenPlantItem.plantsPicture=ans
-              YTLog.info(this.greenPlantItem)
-
+            if(ans&&ans!=''){
+              this.vm.greenPlantsPicture=ans
             }
           })
         } catch (e) {
@@ -65,10 +68,9 @@ struct EditGreenPlantPage{
           (fullPath) => {
             this.showHeaderImgRevise = false
             yTRouter.router2DelPhotoPage({ src: fullPath, type: 'image' },(res:PopInfo)=>{
-              let ans=res.result as string
-              if(ans&&ans!='false'){
-                this.greenPlantItem.plantsPicture=ans
-                YTLog.info(this.greenPlantItem)
+              let ans=res.result['url'] as string
+              if(ans&&ans!=''){
+                this.vm.greenPlantsPicture=ans
               }
             })
           })
@@ -94,23 +96,26 @@ struct EditGreenPlantPage{
     if(this.plantsId!=-1){
       this.title='编辑绿植'
       this.getGreenPlantsById(this.plantsId)
-      this.getClockLogList({plantsId:6,page:1,pageSizes:20})
-      this.getRemindList({plantsId:6,page:1,pageSizes:20})
+      this.getClockLogList({plantsId:this.plantsId,page:1,pageSizes:20})
+      this.getRemindList({plantsId:this.plantsId,page:1,pageSizes:20})
       this.getClockTaskList()
       this.getClockTaskIconList()
     }else{
     }
   }
   async getGreenPlantsById(id:number){
-    this.greenPlantItem=await GreenPlantsApi.getGreenPlantsDetail(id)
+    const ans=await GreenPlantsApi.getGreenPlantsDetail(id)
+    this.vm.greenPlantsName=ans.plantsName
+    this.vm.greenPlantsPicture=ans.plantsPicture
+    this.plantsId=ans.plantsId
   }
   async editGreenPlants(params:InsertEditGreenPlantsParams){
     await GreenPlantsApi.editGreenPlants(params)
-    this.onBackPressUpdateData()
+    this.onBackPressUpdateData('true')
   }
   async insertGreenPlants(params:InsertEditGreenPlantsParams){
     await GreenPlantsApi.insertGreenPlants(params)
-    this.onBackPressUpdateData()
+    this.onBackPressUpdateData('true')
 
   }
   async getClockLogList(params:GetClockLogParams){
@@ -129,7 +134,13 @@ struct EditGreenPlantPage{
   }
   async insertRemind(params:InsertEditRemindParams){
     await RemindApi.insertRemind(params)
+    this.remindList=[]
+    this.getRemindList({plantsId:this.plantsId,page:1,pageSizes:20})
+  }
+  async editRemind(params:InsertEditRemindParams){
+    await RemindApi.updateRemind(params)
   }
+
   async getClockTaskList(){
     //获取打卡事项
     this.clockTaskList=await ClockTaskApi.getClockTaskList()
@@ -162,6 +173,9 @@ struct EditGreenPlantPage{
     this.vm.remindPlantsId=0
     this.vm.remindPlantsName=""
   }
+  //校验
+
+
   build() {
     NavDestination(){
       Column({space:20}) {
@@ -182,7 +196,7 @@ struct EditGreenPlantPage{
           }.width('100%')
           .justifyContent(FlexAlign.Start)
           Row(){
-            Image(this.plantsId==-1?$r('app.media.icon_plants_null_picture_'):this.greenPlantItem.plantsPicture)
+            Image(this.vm.greenPlantsPicture==""?$r('app.media.icon_plants_null_picture_'):this.vm.greenPlantsPicture)
               .width(this.plantsId==-1?33:76)
               .height(this.plantsId==-1?33:113)
           }.width(106)
@@ -197,7 +211,7 @@ struct EditGreenPlantPage{
 
           Row(){
             Text('名称').fontSize(14).fontColor('#333333')
-            TextInput({placeholder:"点击输入植物名称",text:this.greenPlantItem.plantsName})
+            TextInput({placeholder:"点击输入植物名称",text:this.vm.greenPlantsName})
               .width(100)
               .height(16)
               .backgroundColor(Color.Transparent)
@@ -211,10 +225,10 @@ struct EditGreenPlantPage{
               .fontColor('#206D43')
               .onChange((value:string)=>{
                 if(value.length>7){
-                  this.greenPlantItem.plantsName=value.slice(7)
+                  this.vm.greenPlantsName=value.slice(7)
                   return
                 }
-                this.greenPlantItem.plantsName=value
+                this.vm.greenPlantsName=value
               })
           }.width('100%')
           .justifyContent(FlexAlign.SpaceBetween)
@@ -236,19 +250,24 @@ struct EditGreenPlantPage{
         Row(){
           Column(){
             Text('养护记录').fontSize(this.currentSelectIndex==0?16:14)
-            Row()
-              .width(20)
-              .height(3)
-              .backgroundColor(this.currentSelectIndex==0?'#206d43':Color.Transparent)
+            Column(){
+              if(this.currentSelectIndex==0){
+                Image($r('app.media.icon_edit_page_tab')).width(16).height(6)
+              }
+            }.width(16)
+            .height(6)
           }.margin({right:22}).onClick(()=>{
             this.currentSelectIndex=0
           })
           Column(){
             Text('提醒设置').fontSize(this.currentSelectIndex==1?16:14)
-            Row()
-              .width(20)
-              .height(3)
-              .backgroundColor(this.currentSelectIndex==1?'#206d43':Color.Transparent)
+            Column(){
+              if(this.currentSelectIndex==1){
+                Image($r('app.media.icon_edit_page_tab')).width(16).height(6)
+              }
+            }.width(16)
+            .height(6)
+
           }.onClick(()=>{
             this.currentSelectIndex=1
 
@@ -256,57 +275,84 @@ struct EditGreenPlantPage{
         }.width('100%')
         Column() {
           if (this.currentSelectIndex == 0) {
-            Stack({alignContent:Alignment.BottomEnd}){
-            List() {
-              ForEach(this.timeLineList, (item: OrderDetailBean, index: number) => {
-                TimeLineNode({ bean: item, index: index,totalSize:this.timeLineList.length})
-              }, (item: object) => JSON.stringify(item))
-            }.margin({ left: 10 }).scrollBar(BarState.Off).height('100%').alignListItem(ListItemAlign.Start)
-              ButtonCom({
-                marBottom:50,
-                isShowBuilder:()=>{
-                  if(this.plantsId==-1) {
-                    IBestToast.show({
-                      message:"先添加植物"
-                    })
-                   return
-                  }
-                  this.reset()
-                  this.isShowMaintenanceBuilder = true
-                }
-              })
+            if(this.timeLineList.length==0){
+             NullBuilder()
+            }else {
+              Stack({ alignContent: Alignment.BottomEnd }) {
+                List() {
+                  ForEach(this.timeLineList, (item: OrderDetailBean, index: number) => {
+                    ListItem() {
+                      TimeLineNode({ bean: item, index: index, totalSize: this.timeLineList.length })
+                    }
+                  }, (item: object) => JSON.stringify(item))
+                }.height('100%').margin({ left: 10 }).scrollBar(BarState.Off).alignListItem(ListItemAlign.Start)
+
+                // ButtonCom({
+                //   marBottom:50,
+                //   isShowBuilder:()=>{
+                //     if(this.plantsId==-1) {
+                //       IBestToast.show({
+                //         message:"先添加植物"
+                //       })
+                //      return
+                //     }
+                //     this.reset()
+                //     this.isShowMaintenanceBuilder = true
+                //   }
+                // })
               }.layoutWeight(1)
+            }
           }else{
-            Stack({alignContent:Alignment.BottomEnd}) {
-              List({ space: 15 }) {
-                  ForEach(this.remindList, (item: RemindItemClass, index: number) => {
-                    ListItem() {
-                      RemindItemClassComp({
-                        item:item
+
+              Stack({ alignContent: Alignment.BottomEnd }) {
+                Column() {
+                  if (this.remindList.length == 0) {
+                    NullBuilder()
+                  } else {
+                    List({ space: 15 }) {
+                      ForEach(this.remindList, (item: RemindItemClass, index: number) => {
+                        ListItem() {
+                          RemindItemClassComp({
+                            item: item,
+                            isShowBuilder: () => {
+                              this.reset()
+                              this.vm.remindPlantsId = item.plantsId
+                              this.vm.remindTaskItemId = item.itemId
+                              this.vm.remindTaskName = item.itemName
+                              this.vm.remindPlantsName = item.plantsName
+                              this.vm.remindTaskUrl = item.itemIcon
+                              this.vm.frequency = item.repeatType
+                              this.vm.date = item.remindDate
+                              this.vm.plantsId = item.plantsId
+                              this.vm.time = item.remindTime.slice(0, 5)
+                              this.isShowRemindClockBuilder = true
+                            }
+                          })
+                        }
                       })
-                    }
-                  })
-                }.height('100%').alignListItem(ListItemAlign.Start)
-              ButtonCom({
-                marBottom:50,
-                text:"提醒设置",
-                isShowBuilder:()=>{
-                  if(this.plantsId==-1) {
-                    IBestToast.show({
-                      message:"先添加植物"
-                    })
-                   return
+                    }.height('100%').alignListItem(ListItemAlign.Start)
                   }
-                  this.reset()
-                  this.isShowRemindClockBuilder = true
-
-                }
-              })
-            }.layoutWeight(1)
+                }.height('100%')
+                ButtonCom({
+                  marBottom: 50,
+                  text: "提醒设置",
+                  isShowBuilder: () => {
+                    if (this.plantsId == -1) {
+                      IBestToast.show({
+                        message: "先添加植物"
+                      })
+                      return
+                    }
+                    this.reset()
+                    this.isShowRemindClockBuilder = true
 
+                  }
+                })
+              }.layoutWeight(1)
           }
         }
         .layoutWeight(1)
+        .justifyContent(FlexAlign.Start)
         .bindSheet($$this.isShowRemindClockBuilder,this.RemindClockBuilder(),{
           height:530,
           showClose:false,
@@ -330,15 +376,15 @@ struct EditGreenPlantPage{
   @Builder
   rightBuilder(){
     Text('确认').fontSize(16).fontColor('#206D43').onClick(()=>{
-      if(this.greenPlantItem.plantsName==""||this.greenPlantItem.plantsName==null){
+      if(this.vm.greenPlantsName==""){
         IBestToast.show({
           message:"植物名称不能为空"
         })
         return
       }
-      if(this.greenPlantItem.plantsPicture==""||this.greenPlantItem.plantsPicture==null){
+      if(this.vm.greenPlantsPicture==""){
         IBestToast.show({
-          message:"植物名称不能为空"
+          message:"植物图片不能为空"
         })
         return
       }
@@ -346,14 +392,14 @@ struct EditGreenPlantPage{
       if(this.plantsId==-1){
         this.insertGreenPlants({
           plantsId:0,
-          plantsName:this.greenPlantItem.plantsName,
-          plantsPicture:this.greenPlantItem.plantsPicture
+          plantsName:this.vm.greenPlantsName,
+          plantsPicture:this.vm.greenPlantsPicture
         })
       }else{
-        this.insertGreenPlants({
+        this.editGreenPlants({
           plantsId:this.plantsId,
-          plantsName:this.greenPlantItem.plantsName,
-          plantsPicture:this.greenPlantItem.plantsPicture
+          plantsName:this.vm.greenPlantsName,
+          plantsPicture:this.vm.greenPlantsPicture
         })
       }
 
@@ -372,8 +418,33 @@ struct EditGreenPlantPage{
                 rightTitle:'设置',
                 leftClick:()=>{
                   this.isShowRemindClockBuilder=false
+                  this.reset()
                 },
                 rightClick:()=>{
+                  if(this.vm.remindTaskName==""){
+                    IBestToast.show({
+                      message:"你还没选择事项"
+                    })
+                    return
+                  }
+                  if(this.vm.remindPlantsName==""){
+                    IBestToast.show({
+                      message:"你还没选择植物"
+                    })
+                    return
+                  }
+                  if(this.vm.time==""){
+                    IBestToast.show({
+                      message:"时间不合法"
+                    })
+                    return
+                  }
+                  if(this.vm.frequency==DateFrequency.NONE || this.vm.frequency==DateFrequency.FREE){
+                    this.vm.date=this.vm.date
+                  }else{
+                    this.vm.date=dayjs(new Date()).format('YYYY-MM-DD')
+                  }
+
                   this.isShowRemindClockBuilder=false
                   const params:InsertEditRemindParams={
                     plantsId:this.vm.remindPlantsId,
@@ -384,11 +455,14 @@ struct EditGreenPlantPage{
                     remindDate:this.vm.date,
                     remindTime:this.vm.time+":00",
                     intervalDays:Number(this.vm.dayNumber),
-                    monthlyDay:Number(this.vm.mon),
-                    weeklyWeekday:Number(this.vm.week)
+                    monthlyDay:textTransLateMon(this.vm.mon), //Number(this.vm.mon)
+                    weeklyWeekday:textTransLateWeek(this.vm.week),
+                    isOpen:true,
+                    settingId:0
                   }
                   // this.insertClockLog(params)
                   this.insertRemind(params)
+                  this.reset()
                 }
               })
 
@@ -419,7 +493,7 @@ struct EditGreenPlantPage{
               Column() {
                 TaskItem({
                   title:"多久提醒一次",
-                  TaskText:this.vm.frequency,
+                  TaskText:textTranslate(this.vm.frequency),
                   swiperChange:()=>{
                     this.vm.swiperController.changeIndex(3,true)
                   }
@@ -436,6 +510,7 @@ struct EditGreenPlantPage{
                   Row() {
                     if(this.vm.frequency==DateFrequency.NONE){
                       Text('日期')
+                        // .fontColor(this.isShowRed?Color.Red:'#000')
                     }else if(this.vm.frequency==DateFrequency.WEEK){
                       Text('每周几提醒')
                     }else if(this.vm.frequency==DateFrequency.MONTH){
@@ -473,6 +548,10 @@ struct EditGreenPlantPage{
               .padding({left:10,right:10})
               .borderRadius(12)
 
+              if(this.vm.isshowRed){
+                Text('提醒时间不能小于当前时间哦').fontColor(Color.Red)
+              }
+
               Column(){
                 Text('注:\n' +
                   '若已有该事项提醒,则会进行更新\n' +
@@ -541,6 +620,7 @@ struct EditGreenPlantPage{
             swiperBuilder2:()=>{
               //日期
               this.SelectCustomRemindDate()
+              // this.SelectRemindDate()
             },
             swiperComController:this.vm.swiperComController[3]
           })
@@ -738,12 +818,18 @@ struct EditGreenPlantPage{
           backText:(value,index)=>{
             if(index==0){
               this.vm.frequency=DateFrequency.NONE
+              this.vm.date=dayjs(new Date()).format('YYYY-MM-DD')
             }else if(index==1){
               this.vm.frequency=DateFrequency.DAY
+              this.vm.date=dayjs(new Date()).format('YYYY-MM-DD')
             }else if(index==2){
               this.vm.frequency=DateFrequency.WEEK
+              this.vm.week="周一"
+              this.vm.date=dayjs(new Date()).format('YYYY-MM-DD')
             }else if(index==3){
               this.vm.frequency=DateFrequency.MONTH
+              this.vm.week="1号"
+              this.vm.date=dayjs(new Date()).format('YYYY-MM-DD')
             }else{
               this.vm.frequency=DateFrequency.FREE
             }
@@ -784,7 +870,7 @@ struct EditGreenPlantPage{
           this.vm.date=dayjs(date).format('YYYY-MM-DD')
         }
       })
-    }.ColStyle()
+    }.ColStyle(Color.Transparent)
   }
   @Builder
   SelectCustomRemindDate(){
@@ -792,15 +878,21 @@ struct EditGreenPlantPage{
     Column(){
       DiaryDatePicker({
         back:()=>{
-          this.vm.swiperController[3].changeIndex(1,true)
+          // this.vm.swiperController[3].changeIndex(0,true)
+          // this.vm.swiperController.changeIndex(4,true)
+          this.vm.swiperComController[3].changeIndex(0,true)
+
         },
         selectDateBack:(date: Date)=>{
           //需要带参数确定
-          this.vm.swiperController[3].changeIndex(1,true)
+          // this.vm.swiperController[3].changeIndex(0,true)
+          // this.vm.swiperController.changeIndex(4,true)
+          this.vm.swiperComController[3].changeIndex(0,true)
+
           this.vm.date=dayjs(date).format('YYYY-MM-DD')
         }
       })
-    }.ColStyle()
+    }.ColStyle(Color.Transparent)
   }
 
   @Builder
@@ -816,7 +908,10 @@ struct EditGreenPlantPage{
         },
         rightClick:()=>{
           this.vm.swiperController.changeIndex(0,true)
-          //选择植物成功,返回
+          if(this.vm.week=="") {
+            this.vm.week = "周一"
+          }
+            //选择植物成功,返回
           //应该再这里赋值的
         }
       })
@@ -844,6 +939,9 @@ struct EditGreenPlantPage{
           this.vm.swiperController.changeIndex(0,true)
           //选择植物成功,返回
           //应该再这里赋值的
+          if(this.vm.mon=="") {
+            this.vm.week = "1号"
+          }
         }
       })
       TextPickerRemind({
@@ -869,7 +967,21 @@ struct EditGreenPlantPage{
           this.vm.swiperController.changeIndex(0,true)
         },
         rightClick:()=>{
+          if(this.vm.date==""){
+            IBestToast.show({
+              message:"你还没选择时间"
+            })
+            return
+          }
+          if(this.vm.dayNumber=="0"||this.vm.dayNumber==""){
+            IBestToast.show({
+              message:"你还没输入多少天"
+            })
+            return
+          }
           this.vm.swiperController.changeIndex(0,true)
+
+
           //选择植物成功,返回
           //应该再这里赋值的
         }

+ 60 - 54
features/feature/src/main/ets/pages/GrowInfoPage.ets

@@ -1,43 +1,38 @@
 import { RouterPage, YTHeader } from 'basic'
-import { GrowInfo } from '../models/Second'
+import dayjs from 'dayjs'
+import { GrowthApi, GrowthItem } from '../api/GrowthApi'
+import { NullBuilder } from '../components/NullCom'
+import { GrowthConstants } from '../models/Second'
 import { SecondViewModel } from '../viewmodels/SecondViewModel'
 
 @ComponentV2
 @RouterPage
 struct GrowInfoPage {
-  @Local vm:SecondViewModel=new SecondViewModel()
-  @Local growInfoList:GrowInfo[]=[
-    {
-      text:"签到",
-      date:"2021.2.9",
-      value:'1'
-    },
-    {
-      text:"签到",
-      date:"2021.2.9",
-      value:'1'
-    },
-    {
-      text:"签到",
-      date:"2021.2.9",
-      value:'1'
-    },
-    {
-      text:"签到",
-      date:"2021.2.9",
-      value:'1'
-    },
-    {
-      text:"签到",
-      date:"2021.2.9",
-      value:'1'
-    },
+  @Local monthValue:string=""
+  @Local value:string=""
+  @Local growInfoList:GrowthItem[]=[
+    // {
+    //   text:"签到",
+    //   date:"2021.2.9",
+    //   value:'1'
+    // },
   ]
+  aboutToAppear(): void {
+    this.getGrowthLog()
+  }
+
+  async getGrowthLog(){
+    const res=await GrowthApi.getGrowthLog()
+    this.growInfoList=res.records
+    this.monthValue=res.obtained.toString()
+    this.value=res.totalGrowth.toString()
+  }
+
   build() {
     NavDestination(){
       Column({space:35}){
         YTHeader({title:'成长点明细查询'})
-        Text(this.vm.value.toString()).fontSize(40).fontWeight(500).fontColor('#333333')
+        Text(this.value).fontSize(40).fontWeight(500).fontColor('#333333')
         //成长明细列表
 
         Column(){
@@ -45,43 +40,54 @@ struct GrowInfoPage {
             Text('成长点明细')
               .fontSize(25)
               .fontColor('#206D43')
-            Row(){
-              Text('本月获取230')
-                .fontSize(10)
+            Stack({alignContent:Alignment.Center}){
+              Text(){
+                Span('本月获取')
+                Span(this.monthValue).fontColor('#206D43')
+              }.fontSize(16)
                 .fontColor('#9C9898')
+              Image($r('app.media.icon_growth_value')).width(108).height(14).margin({top:10})
             }
 
           }.width('100%')
           .justifyContent(FlexAlign.SpaceBetween)
-          .padding({left:16,right:26})
+          .padding({left:16}) //26
           .height(53)
+          if(this.growInfoList.length==0){
+            NullBuilder()
+          }else {
 
-          List({space:9}){
-            ForEach(this.growInfoList,(item:GrowInfo,index:number)=>{
-              ListItem(){
-                Row({space:17}){
-                  Column({space:5}){
-                    Text(item.text).fontColor('#333333').fontWeight(500)
-                    Text(item.date).fontSize(12).fontColor('#9C9898')
-                  }.alignItems(HorizontalAlign.Start)
 
-                  Text('+'+item.value).fontColor('#206D43').fontWeight(500)
-                }.width('100%')
-                .height(70)
-                .justifyContent(FlexAlign.SpaceBetween)
-                .backgroundColor(Color.White)
-                .padding({left:13,right:13})
-                .borderRadius(12)
+            List({ space: 9 }) {
+              ForEach(this.growInfoList, (item: GrowthItem, index: number) => {
+                ListItem() {
+                  Row({ space: 17 }) {
+                    Column({ space: 5 }) {
+                      Text(GrowthConstants[item.taskType]).fontColor('#333333').fontWeight(500)
+                      Text(dayjs(item.operateTime).format('YYYY.MM.DD')).fontSize(12).fontColor('#9C9898')
+                    }.alignItems(HorizontalAlign.Start)
 
-              }
-            })
-          }.layoutWeight(1)
-          .scrollBar(BarState.Off)
-          .padding(6)
-          .align(Alignment.Top)
+                    Text('+' + item.growthPoints).fontColor('#206D43').fontWeight(500)
+                  }
+                  .width('100%')
+                  .height(70)
+                  .justifyContent(FlexAlign.SpaceBetween)
+                  .backgroundColor(Color.White)
+                  .padding({ left: 13, right: 13 })
+                  .borderRadius(12)
 
+                }
+              })
+            }
+            .layoutWeight(1)
+            .scrollBar(BarState.Off)
+            .padding(6)
+            .margin({ bottom: 20 })
+            .align(Alignment.Top)
+          }
 
         }.width('90%')
+        .layoutWeight(1)
         .borderRadius({topLeft:20,topRight:20})
         .backgroundColor('#F8F8F8')
       }

+ 55 - 31
features/feature/src/main/ets/pages/IncreaseDiaryPage.ets

@@ -7,6 +7,8 @@ import { DiaryTimePicker } from '../components/fourcomponent/DiaryTimePicker';
 import { DateUtils } from '../utils/DateUtils';
 import { DiaryViewModel } from '../view/DiaryViewModel';
 import { RecodeViewModel } from '../view/RecodeViewModel';
+import dayjs from 'dayjs';
+import { promptAction } from '@kit.ArkUI';
 
 /**
  * 新增/编辑 日记
@@ -63,6 +65,10 @@ struct IncreaseDiaryPage {
       IBestToast.show({ message: '请填写标题和内容' })
       return;
     }
+    if(this.diaryData.title.length>20){
+      IBestToast.show({ message: '标题不能超过20' })
+      return;
+    }
 
     // 浅拷贝
     let diaryData = JSON.parse(JSON.stringify(this.diaryData)) as DiaryData
@@ -92,7 +98,7 @@ struct IncreaseDiaryPage {
 
 
     // 判断是否是新增日记 - 有 id 时为 修改日记
-    if(!this.diaryData.id) {
+    if(!this.diaryData.markId) {
       diaryData.diaryDate += ':00'
       this.onSubmit(diaryData)
     } else {
@@ -109,8 +115,8 @@ struct IncreaseDiaryPage {
       // ans = await DiaryViewModel.saveDiaryLog(data)
       console.log("日记-保存结果" + JSON.stringify(ans))
     } else {
-      data.noteTime = data.diaryDate
-      // ans = await RecodeViewModel.saveNote(data)
+      data.markDateTime = data.diaryDate?.replace(' ','T')
+      ans = await RecodeViewModel.saveNote(data)
       console.log("小记录-保存结果" + JSON.stringify(ans))
     }
 
@@ -127,13 +133,14 @@ struct IncreaseDiaryPage {
     let ans: boolean = false
     console.log("修改")
     if(this.pageStatus === PageStatus.DIARY) {
-      let time = DateUtils.formatDateToCustomString(new Date()).split(' ')[1]
-      data.diaryDate = data.diaryDate?.split(' ')[0] + ' ' +time
+      let time = DateUtils.formatDateToCustomString(new Date()).split('T')[1]
+      data.diaryDate = data.diaryDate?.split('T')[0] + 'T' +time
       // ans = await DiaryViewModel.updateDiaryLog(data)
       console.log("日记-修改结果" + ans)
     } else {
-      data.noteTime = data.diaryDate + ':00'
-      // ans = await RecodeViewModel.updateNote(data)
+      data.markDateTime = data.diaryDate + ':00'
+      data.markDateTime = data.diaryDate?.replace(' ','T')
+      ans = await RecodeViewModel.updateNote(data)
       console.log("小记录-修改结果" + JSON.stringify(ans))
     }
 
@@ -185,17 +192,12 @@ struct IncreaseDiaryPage {
   // 路由参数解析
   async getRouterParams(){
     // 获取路由参数
-    const params = yTRouter.getParamByName("IncreaseDiaryPage").pop() as Record<string, boolean | number>;
-
+    const params = yTRouter.getParamByName("IncreaseDiaryPage").pop() as Record<string, number | string| string[]>;
     // 获取参数
     this.pageStatus = (params?.PageStatus ?? PageStatus.DIARY) as PageStatus
 
-    let date = (params?.nowDate ?? -1)as number
-
-    if(date != -1){
-      this.diaryData.diaryDate = DateUtils.formatDateToCustomString(new Date(date), true, false)
-      console.log("参数" + this.diaryData.diaryDate)
-    }
+    // let date = (params?.nowDate ?? -1)as number
+    let date=dayjs(new Date()).format('YYYY-MM-DD HH:mm')
 
     // 获取参数
     let id = (params?.id ?? -1) as number;
@@ -206,13 +208,23 @@ struct IncreaseDiaryPage {
         // this.diaryData = await DiaryViewModel.queryDiaryLogById(id)
       } else {
         // this.diaryData = await RecodeViewModel.queryNoteById(id)
-        this.diaryData.diaryDate = this.diaryData.noteTime
+        // this.diaryData.diaryDate = this.diaryData.markDate
+        this.diaryData.markId=id
+        this.diaryData={
+          markId:id,
+          title:params.title as string,
+          markDateTime:params.markDateTime as string,
+          imageUrls:params.imageUrls as string[],
+          content:params.content as string,
+        } as DiaryData
+
       }
       try{
-        let time = this.diaryData.diaryDate?.split(' ')?.[1]
-        let time1 = time?.split(':')
-        time1?.pop()
-        this.diaryData.diaryDate = this.diaryData.diaryDate?.split(' ')?.[0] + ' ' + time1?.join(':')
+        // let time = this.diaryData.diaryDate?.split('T')?.[1]
+        // let time1 = time?.split(':')
+        // time1?.pop()
+        // this.diaryData.diaryDate = this.diaryData.diaryDate?.split('T')?.[0] + ' ' + time1?.join(':')
+        this.diaryData.diaryDate=dayjs(this.diaryData.markDateTime).format('YYYY-MM-DD HH:mm')
       } catch (e){
         console.log("时间解析错误")
       }
@@ -220,7 +232,7 @@ struct IncreaseDiaryPage {
   }
 
   async aboutToAppear(): Promise<void> {
-    this.diaryData.diaryDate = DateUtils.formatDateToCustomString(new Date(), true, false)
+    this.diaryData.diaryDate =dayjs(new Date()).format('YYYY-MM-DD HH:mm')
     this.getRouterParams()
   }
 
@@ -293,7 +305,7 @@ struct IncreaseDiaryPage {
               // 标题栏
               Row() {
                 if(!this.pageReadOnly) {
-                  TextInput({ text: $$this.diaryData.title, placeholder: "输入标题会更受欢迎!" })
+                  TextInput({ text: this.diaryData.title, placeholder: "输入标题会更受欢迎!" })
                     .padding(0)
                     .fontSize(16)
                     .fontWeight(500)
@@ -305,6 +317,9 @@ struct IncreaseDiaryPage {
                     .backgroundColor(Color.Transparent)
                     .caretColor('app.color.main_ac_color_dark')
                     .placeholderFont({ size: 14 })
+                    .onChange((value)=>{
+                      this.diaryData.title=value.slice(0,20)
+                    })
                 } else {
                   Text(this.diaryData.title)
                     .fontSize(16)
@@ -342,7 +357,7 @@ struct IncreaseDiaryPage {
               List(){
                 ListItem(){
                   if(!this.pageReadOnly) {
-                    TextArea({ text: $$this.diaryData.content, placeholder: "记录此刻" })
+                    TextArea({ text: this.diaryData.content, placeholder: "记录此刻" })
                       .padding(0)
                       .fontSize(14)
                       .width("100%")
@@ -353,6 +368,9 @@ struct IncreaseDiaryPage {
                       .placeholderFont({ size: 16 })
                       .backgroundColor(Color.Transparent)
                       .caretColor('app.color.main_ac_color_dark')
+                      .onChange((value)=>{
+                        this.diaryData.content=value
+                      })
                   } else {
                     Text(this.diaryData.content)
                       .width("100%")
@@ -418,13 +436,14 @@ struct IncreaseDiaryPage {
                   Row({space: 5}){
                     Image($r('app.media.photoAlbum'))
                       .width(20)
-                      .aspectRatio(1)
-
+                      .height(20)
                     Text("相册")
                       .fontSize(18)
+                      .fontColor('#ff')
                       .fontWeight(500)
                   }
                   .borderRadius(18)
+                  .backgroundColor('#206D43')
                   // .linearGradient(this.linearInfo)
                   .padding({ top: 12, right: 16, bottom: 12, left: 16})
                   .onClick(()=>{
@@ -449,17 +468,18 @@ struct IncreaseDiaryPage {
         .padding({ left: 20, right: 20 })
         .bindSheet($$this.showTimePicker,this.TimePickerBuilder(),{
           width:'100%',
-          height:400,
-          showClose:false
-
+          showClose:false,
+          height:300,
+          backgroundColor:Color.Transparent
         })
       }
       .width("100%")
       .height("100%")
       .bindSheet($$this.showDatePicker,this.DatePickerBuilder(),{
         width:'100%',
+        showClose:false,
         height:300,
-        showClose:false
+        backgroundColor:Color.Transparent
 
       })
 
@@ -491,7 +511,11 @@ struct IncreaseDiaryPage {
         })
           .width("100%")
           .height('100%')
-      // }
+          .onClick(() => {
+            this.showDatePicker = false
+          })
+
+          // }
       // .width("100%")
       // .height("100%")
       // .alignItems(HorizontalAlign.Start)
@@ -508,7 +532,7 @@ struct IncreaseDiaryPage {
     // if(this.showTimePicker){
       Column(){
         DiaryTimePicker({
-          timeStr: (this.diaryData.diaryDate ?? DateUtils.formatDateToCustomString(new Date(), true)).split(' ')[1],
+          timeStr: (this.diaryData.diaryDate ?? DateUtils.formatDateToCustomString(new Date(), true)).split('T')[1],
           onConfirm: (time: string) => {
             this.showTimePicker = false
             console.log("选择的时间 " + time)

+ 218 - 0
features/feature/src/main/ets/pages/MessagePage.ets

@@ -0,0 +1,218 @@
+import { RouterPage, YTHeader, yTRouter } from 'basic'
+import { MessageApi, MessageItem, UpdateMessage } from '../api/MessageApi'
+
+@RouterPage
+@Component
+struct MessagePage {
+
+  @State messageList:MessageItem[]=[]
+  // 获取消息列表
+  async getMessageList(){
+    const res= await MessageApi.getMessageList({page:1,pageSizes:20})
+    this.messageList =res.records as MessageItem[]
+  }
+
+  // // 处理消息通知
+  // async confirmNotice(status:number,odid:string,messageId:number) {
+  //   await MessageApi.confirmPartner(odid,status,messageId)
+  // }
+  aboutToAppear(): void {
+    this.getMessageList()
+  }
+  onBackPressUpdateData(ans:string='false'){
+    yTRouter.pop(ans,true)
+  }
+
+  async updateMessage(params:UpdateMessage){
+    await MessageApi.updateMessage(params)
+  }
+  build() {
+    NavDestination() {
+      Column({space: 10}) {
+        YTHeader({
+          leftComp:()=>{
+            this.leftComp()
+          },
+          title:"消息通知",
+        })
+        Column(){
+          List({space: 17}){
+            if(this.messageList.length == 0) {
+              this.EmptyBuilder()
+            }
+            ForEach(this.messageList, (item: MessageItem, index: number) => {
+              ListItem(){
+                if(item.messageStatus==0) {
+                  this._ConfirmCard(item,index)
+
+                } else if(item.messageStatus==1) {
+                  this._FriendsApplyCard(item)
+                }else {
+                  this._FriendsApplyCard2(item)
+                }
+              }
+            })
+          }
+          .width("100%")
+          .height("100%")
+          .scrollBar(BarState.Off)
+        }
+        .width("100%")
+        .layoutWeight(1)
+        .padding({ bottom: 20 })
+      }
+      .width("100%")
+      .height("100%")
+      .padding({ top: 0, left: 26, right: 26 })
+    }
+    .hideTitleBar(true)
+  }
+
+  // 需确认信息的卡片 - 加入了他人的亲友团
+  @Builder _ConfirmCard(item:MessageItem,index:number) {
+    Column(){
+      Flex() {
+        Text(item.messageContent)
+          .fontSize(16)
+          .fontWeight(400)
+          .padding({ left: 16 })
+          .fontColor(Color.Black)
+          .maxLines(2)
+          .margin({ bottom: 10 })
+      }
+
+      Row(){
+          Text("忽略")
+            .padding({left:30,right:30,top:8,bottom:8})
+            .fontColor('#878787').backgroundColor('#DFDFDF')
+            .borderRadius(20)
+            .onClick(()=>{
+              this.updateMessage({
+                messageId:item.messageId,
+                messageStatus:2
+              })
+              this.messageList.slice(index,1)
+          })
+          Text('去打卡')
+            .padding({left:28,right:28,top:8,bottom:8})
+            .fontColor('#fff').backgroundColor('#206D43')
+            .borderRadius(20).onClick(()=>{
+              this.onBackPressUpdateData('true')
+            })
+      }
+      .height(40)
+      .width('100%')
+      .borderRadius({ topLeft: 25 })
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.SpaceEvenly)
+      .alignRules({
+        right: { anchor: "__container__", align: HorizontalAlign.End},
+        bottom: { anchor: "__container__", align: VerticalAlign.Bottom}
+      })
+      // .onClick(() => { if(item.confirmed === false) this.confirmNotice(item.id ?? '0') })
+    }
+    .height(145)
+    .shadow({
+      // 模糊半径
+      radius: 10,
+      // 阴影类型
+      type: ShadowType.COLOR,
+      // 阴影颜色
+      color: '#1A000000',
+      // X 轴偏移
+      offsetX: 1,
+      // Y 轴偏移
+      offsetY: 1,
+      // 是否内部填充,值为布尔型,默认为flase
+      fill: false
+    })
+    .width("100%")
+    .borderRadius(4)
+    .backgroundColor('#fff')
+    .justifyContent(FlexAlign.SpaceEvenly)
+  }
+
+  // 亲友团申请卡片 - 他人要加入你的亲友团
+  @Builder _FriendsApplyCard(item: MessageItem) {
+    Column(){
+      Row({space:15}){
+        Column(){
+          Text('已').fontColor('#fff')
+          Text('处理').fontColor('#fff')
+        }.width(50)
+        .height(50)
+        .borderRadius(25)
+        .backgroundColor('#9DD0A1')
+        .justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+        Text(item.messageContent)
+          .fontSize(16)
+          .fontWeight(400)
+      }
+      .width('100%')
+      .backgroundColor('#fff')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .padding({ left: 23, right: 23, top: 15, bottom: 10 })
+    }
+    .width("100%")
+  }
+
+  // 亲友团申请卡片 - 他人要加入你的亲友团
+  @Builder _FriendsApplyCard2(item: MessageItem) {
+    Column(){
+      Row({space:15}){
+        Column(){
+          Text('已').fontColor('#fff')
+          Text('忽略').fontColor('#fff')
+        }.width(50)
+        .height(50)
+        .borderRadius(25)
+        .backgroundColor('#F0F0F0')
+        .justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+        Text(item.messageContent)
+          .fontSize(16)
+          .fontWeight(400)
+      }
+      .width('100%')
+      .backgroundColor('#fff')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .padding({ left: 23, right: 23, top: 15, bottom: 10 })
+    }
+    .width("100%")
+  }
+
+  // 空白页
+  @Builder EmptyBuilder(){
+    Column(){
+      Text("暂无数据")
+        .fontSize(20)
+        .fontWeight(400)
+        .opacity(0.8)
+    }
+    .width('100%')
+    .height('100%')
+    .alignItems(HorizontalAlign.Center)
+    .justifyContent(FlexAlign.Center)
+  }
+
+  @Builder leftComp(){
+    Column(){
+      Image($r('[basic].media.ic_back'))
+        .width(24)
+        .aspectRatio(1)
+    }
+    .width(26)
+    .aspectRatio(1)
+    .onClick(()=>{
+      this.onBackPressUpdateData('true')
+    })
+  }
+}
+
+@Builder
+function MessageBuilder() {
+  MessagePage()
+}

+ 1 - 1
features/feature/src/main/ets/utils/DateUtils.ets

@@ -22,7 +22,7 @@ export class DateUtils {
     const minutes = date.getMinutes().toString().padStart(2, '0');
     const seconds = date.getSeconds().toString().padStart(2, '0');
 
-    const result = `${year}-${month}-${day}` + (needTime ? ` ${hours}:${minutes}` + (needSecond ? `:${seconds}` : '') : '');
+    const result = `${year}-${month}-${day}` + (needTime ? `T${hours}:${minutes}` + (needSecond ? `:${seconds}` : '') : '');
     return result;
   }
 

+ 40 - 0
features/feature/src/main/ets/utils/dateListFormat.ets

@@ -1,5 +1,6 @@
 import { ClockLog } from "../api/ClockTaskApi";
 import { OrderDetailBean } from "../components/maincomponent/TimeLineNode";
+import { DateFrequency } from "../constants";
 
 //把后端养护记录变成我们想要渲染得数据
 export function formatClockData(originalData:ClockLog[]) {
@@ -49,4 +50,43 @@ export function formatClockData(originalData:ClockLog[]) {
   });
 
   return result;
+}
+
+export function textTranslate(item:string) {
+  if (item == DateFrequency.DAY) {
+    return "每天"
+  } else if (item == DateFrequency.WEEK) {
+    return "每周"
+  } else if (item == DateFrequency.MONTH) {
+    return "每月"
+  } else if (item == DateFrequency.FREE) {
+    return "自定义天数"
+  }else{
+    return "仅一次"
+  }
+}
+export function textTransLateWeek(item:string){
+  if(item=='周一'){
+    return 1
+  }else if(item=="周二"){
+    return 2
+  }else if(item=="周三"){
+    return 3
+  }else if(item=="周四"){
+    return 4
+  }else if(item=="周五"){
+    return 5
+  }else if(item=="周六"){
+    return 6
+  }else {
+    return 7
+  }
+}
+export function textTransLateMon(item:string){
+  const a=item.replace('号','')
+  if(Number(a)>=28){
+    return 28
+  }else {
+    return Number(a)
+  }
 }

+ 9 - 9
features/feature/src/main/ets/view/DiaryViewModel.ets

@@ -61,15 +61,15 @@ export class DiaryViewModel{
    * @param params 日记数据结构
    * @returns
    */
-  static async updateDiaryLog(params: DiaryData) {
-    let ans = params.diaryDate?.split(' ')[1]
-    if(!ans) {
-      params.diaryDate += ' 00:00:01'
-    }
-    // const result = await DiaryApi.updateDiaryLog(params)
-    // YTLog.info(`修改日记结果 ${result}`)
-    // return result
-  }
+  // static async updateDiaryLog(params: DiaryData) {
+  //   let ans = params.diaryDate?.split(' ')[1]
+  //   if(!ans) {
+  //     params.diaryDate += ' 00:00:01'
+  //   }
+  //   // const result = await DiaryApi.updateDiaryLog(params)
+  //   // YTLog.info(`修改日记结果 ${result}`)
+  //   // return result
+  // }
 
   /**
    * 查询日记详情

+ 13 - 10
features/feature/src/main/ets/view/FourView.ets

@@ -43,7 +43,7 @@ export struct FourView {
    */
   async updateNoteTime(index: number, time: string) {
     let currentNote: DiaryData = this.Vm.recodeList[index]
-    currentNote.noteTime = currentNote.noteTime?.split(' ')[0] + ' ' + time + ':00'
+    currentNote.markDateTime = currentNote.markDateTime?.split('T')[0] + 'T' + time + ':00'
     let ans = await this.Vm.updateNoteTime(currentNote)
     if(ans) {
       //TODO:请求后端刷新数据
@@ -58,19 +58,22 @@ export struct FourView {
    * 跳转至添加小记录页面
    * @param id
    */
-  routerAddNote(id?: number) {
+  routerAddNote(id: number,item:DiaryData) {
     // 产品要求:
     // 1. 日期需要和上一级页面选择的日期保持一致。
-    let date: string = this.Vm.getSelectedDate().split(' ')[0]
+    let date: string = this.Vm.getSelectedDate().split('T')[0]
     // 2. 时间需要和当前时间保持一致。
-    let time: string = DateUtils.formatDateToCustomString(new Date(), true, false).split(' ')[1]
+    let time: string = DateUtils.formatDateToCustomString(new Date(), true, false).split('T')[1]
     let ans: string = date + ' ' + time
 
     yTRouter.pushPathByName("IncreaseDiaryPage", {
       'id': id,
       'PageStatus': PageStatus.RECODE,
-      'nowDate': new Date(ans).getTime(),
-    } as Record<string, boolean | number | string>);
+      'title': item.title,
+      'markDateTime':item.markDateTime,
+      'imageUrls':item.imageUrls,
+      'content':item.content,
+    } as Record<string, number | string | string[]>);
   }
 
   aboutToAppear(): void {
@@ -318,7 +321,7 @@ export struct FourView {
                       .alignItems(HorizontalAlign.Start)
                       .justifyContent(FlexAlign.Start)
                       .onClick(() => {
-                        this.routerAddNote(item.id!)
+                        this.routerAddNote(item.markId!,item)
                         this.Vm.showDatePicker = false
                         this.Vm.showTimePicker = -1
                       })
@@ -326,7 +329,7 @@ export struct FourView {
                         LongPressGesture()
                           .onAction(() => {
                             console.log("长按了哦")
-                            this.Vm.onDelRecode(item.id!)
+                            this.Vm.onDelRecode(item.markId!)
                           })
                       )
                     }
@@ -358,7 +361,7 @@ export struct FourView {
                       .border({width: 1, color: Color.Black})
                       .padding({ left: 16, top: 12, right: 16, bottom: 12})
                       .onClick(() => {
-                        this.routerAddNote()
+                        this.routerAddNote(-1,{ markId:-1} as DiaryData)
                       })
 
                       Text("暂无记录~")
@@ -390,7 +393,7 @@ export struct FourView {
                   .aspectRatio(1)
               }
               .onClick(() => {
-                this.routerAddNote()
+                this.routerAddNote(-1,{markId:-1} as DiaryData)
               })
               .width(60)
               .aspectRatio(1)

+ 156 - 87
features/feature/src/main/ets/view/MainView.ets

@@ -17,6 +17,10 @@ import { SelectIcon } from '../components/maincomponent/BindSheetTask/SelectIcon
 import dayjs from "dayjs"
 import { promptAction } from '@kit.ArkUI'
 import { ButtonCom } from '../components/maincomponent/ButtonCom'
+import { MessageApi, MessageItem } from '../api/MessageApi'
+import { NullBuilder } from '../components/NullCom'
+import { GreenPlantMainCard } from '../components/maincomponent/GreenPlantMainCard'
+import { it } from '@ohos/hypium'
 
 @ComponentV2
 export struct MainView {
@@ -25,13 +29,31 @@ export struct MainView {
   @Local clockTaskList:ClockTaskItem[]=[]
   @Local ClockTaskIconList:ClockTaskIcon[]=[]
   @Local vm:MainViewModel=new MainViewModel()
+  @Local isShowCheckBox:boolean=false
+  @Local selectedIds:string[]=[]
+  @Local sort:boolean=false
    private  page:number=1
    private pageSize:number=20
   select:number=-1
+  @Local isShowRed:boolean=false
+  async getMessageList(){
+    const res= await MessageApi.getMessageList({page:1,pageSizes:20})
+    const arr=res.records as MessageItem[]
+    arr.forEach((item,index)=>{
+      if(item.messageStatus!=0){
+        this.isShowRed=false
+      }else{
+        this.isShowRed=true
+        return
+      }
+    })
+  }
+
   aboutToAppear(): void {
     this.getGreenList({page:this.page,pageSizes:this.pageSize})
     this.getClockTaskList()
     this.getClockTaskIconList()
+    this.getMessageList()
   }
   async getGreenList(param:GetGreenPlantsParams){
    const arr=await GreenPlantsApi.getGreenPlants(param)
@@ -59,7 +81,13 @@ export struct MainView {
    *
    */
   async insertClockLog(params:InsertClockParam){
-    await ClockTaskApi.insertClockLog(params)
+    await ClockTaskApi.insertClockLog(params).then((res)=>{
+      if(res==true){
+        IBestToast.show({
+          message:"打卡成功"
+        })
+      }
+    })
   }
 
   build() {
@@ -68,111 +96,139 @@ export struct MainView {
         YTHeader({
           backArrow: false,
           title: '我的绿植',
-          rightComp:()=>{this.rightComp()} ,
-          headerPadding: { top: 19, left: 16, right: 16}
+          rightComp: () => {
+            this.rightComp()
+          },
+          headerPadding: { top: 19, left: 16, right: 16 }
         })
         Column() {
           //搜索框
           SearchGreenPlant({
-            submit:(keyword:string)=>{
+            submit: (keyword: string) => {
               //发送请求,搜索植物
-              this.getGreenList({plantsName:keyword,page:1,pageSizes:20})
+              this.getGreenList({ plantsName: keyword, page: 1, pageSizes: 20 })
             }
           })
           Row() {
-            Text('最近添加').fontSize(14).fontColor('#333333')
-            Image($r('app.media.main_icon_edit')).width(24)
-          }.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({top:15,bottom:15})
-
-          List({ space: 16 }) {
-            ForEach(this.greenPlantList, (item:GreenPlants,index:number) => {
-              ListItem() {
-                  Row() {
-                    Column() {
-                      Image(item.plantsPicture).width(55).height(79)
-                    }
-                    .width(70)
-                    .height(90)
-                    .justifyContent(FlexAlign.Center)
-                    .alignItems(HorizontalAlign.Center)
-                    .borderRadius(20)
-                    .backgroundColor('#E8EBF0')
-                    .margin({ right: 9 })
-
-                    Column({ space: 11 }) {
-                      Text(item.plantsName).fontColor('#333333')
-                      Row({ space: 5 }) {
-                        Image($r("app.media.main_icon_clockDesc")).width(15).height(15)
-                        Text(item.clockDesc).fontColor('#333333').fontSize(12)
-                      }
-
-                      Row({ space: 5 }) {
-                        Image($r("app.media.main_icon_remindDesc")).width(15).height(15)
-                        Text(item.remindDesc).fontColor('#333333').fontSize(12)
-                      }
-                    }.justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
-
-                    Blank()
-                   ButtonCom({
-                     text:"养护打卡",
-                     isShowBuilder:()=>{
-                       this.isShowMaintenanceBuilder=true
-                     }
-                   })
-                  }
-                  .width('100%')
-                  .height(115)
-                  .backgroundColor('#fff')
-                  .justifyContent(FlexAlign.Center)
-                  .alignItems(VerticalAlign.Center)
-                  .borderRadius(12)
-                  .padding({
-                    left: 17,
-                    top: 17,
-                    right: 20,
-                    bottom: 17
+            if (this.isShowCheckBox) {
+              CheckboxGroup({
+                group: 'cart'
+              })
+                .checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
+                .selectedColor('#498552')
+                .unselectedColor('#498552')
+                .onChange((res) => {
+                  this.selectedIds = res.name
+                })
+            } else {
+              Row({space:5}) {
+                Image(this.sort?$r('app.media.icon_sort_1'):$r('app.media.icon_sort_2')).width(11).onClick(()=>{
+                  this.sort=!this.sort
+                  this.greenPlantList.reverse()
+                })
+                Text('最近添加').fontSize(14).fontColor('#333333')
+              }
+            }
+            Column() {
+              Image($r('app.media.main_icon_edit')).width(24).onClick(() => {
+                this.isShowCheckBox = !this.isShowCheckBox
+              })
+            }
+            .width(30)
+            .height(30)
+            .borderRadius(15)
+            .backgroundColor(this.isShowCheckBox ? '#498552' : '#fff')
+            .alignItems(HorizontalAlign.Center)
+          }.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({ top: 15, bottom: 15 })
+
+          if (this.greenPlantList.length == 0) {
+            NullBuilder()
+          } else {
+            List({ space: 16 }) {
+              ForEach(this.greenPlantList, (item: GreenPlants, index: number) => {
+                ListItem() {
+                  GreenPlantMainCard({
+                    item: item,
+                    isshow: this.isShowCheckBox,
+                    ishow: () => {
+                      this.isShowMaintenanceBuilder = true
+                    },
                   })
-                  .onClick(()=>{
-                  yTRouter.pushPathByName("EditGreenPlantPage",item.plantsId,(result:PopInfo)=>{
-                    let ans=result.result as string
-                    if(ans&&ans=='true'){
+                }.onClick(() => {
+                  yTRouter.pushPathByName("EditGreenPlantPage", item.plantsId, (result: PopInfo) => {
+                    let ans = result.result as string
+                    if (ans && ans == 'true') {
                       //刷新植物列表
+                      this.getGreenList({ page: this.page, pageSizes: this.pageSize })
                     }
                   });
                 })
-              }.swipeAction({
-                end: this.itemEnd(1, 0),
+                .swipeAction({
+                  end: this.itemEnd(item.plantsId, index),
+                })
               })
-            })
-          }.width('100%')
-
+            }.width('100%')
+          }
         }.width('100%')
         .padding({ left: 16, right: 16 })
         .bindSheet($$this.isShowMaintenanceBuilder, this.MaintenanceClockBindSheetBuilder(), {
           height: 530,
           showClose: false,
           backgroundColor: Color.Transparent,
-          radius:{topLeft:20,topRight:20}
+          radius: { topLeft: 20, topRight: 20 }
         })
       }.width('100%').height('100%')
-      Column() {
-        Image($r('app.media.main_icon_add_green_plants')).width(30).height(30)
-      }
-      .width(60)
-      .height(60)
-      .justifyContent(FlexAlign.Center)
-      .borderRadius('50%')
-      .backgroundColor('#FF01A74D')
-      .margin({ bottom: 22, right: 22 })
-      .onClick(() => {
-        yTRouter.pushPathByName("EditGreenPlantPage",-1,(result:PopInfo)=>{
-          let ans=result.result as string
-          if(ans&&ans=='true'){
-            //刷新植物列表
+
+      Row() {
+        if(this.isShowCheckBox) {
+          Text('删除')
+            .width(300)
+            .height(50)
+            .fontSize(18)
+            .textAlign(TextAlign.Center)
+            .borderRadius(25)
+            .backgroundColor('#206D43')
+            .fontColor('#fff')
+            .margin({right:30,bottom:10})
+            .onClick(async ()=>{
+              let a=[] as Promise<boolean>[]
+              if(this.selectedIds.length!=0) {
+                this.selectedIds.forEach(item=>{
+                  a.push(this.deleteGreenList(Number(item)))
+                })
+                const res=await Promise.allSettled(a)
+                if(res){
+                  IBestToast.show({
+                    message:"删除成功"
+                  })
+                  this.selectedIds=[]
+                  this.getGreenList({ page: this.page, pageSizes: this.pageSize })
+                }
+              }
+            })
+        }else {
+          Column() {
+            Image($r('app.media.main_icon_add_green_plants')).width(30).height(30)
           }
-        });
+          .width(60)
+          .height(60)
+          .justifyContent(FlexAlign.Center)
+          .borderRadius('50%')
+          .backgroundColor('#206D43')
+          .margin({ bottom: 22, right: 22 })
+          .onClick(() => {
+            yTRouter.pushPathByName("EditGreenPlantPage", -1, (result: PopInfo) => {
+              let ans = result.result as string
+              if (ans && ans == 'true') {
+                //刷新植物列表
+                this.getGreenList({ page: this.page, pageSizes: this.pageSize })
+              }
+            });
 
-      })
+          })
+        }
+    }.width('100%')
+      .justifyContent(FlexAlign.End)
 
     }.width('100%')
     .height('100%')
@@ -184,7 +240,7 @@ export struct MainView {
       Image($r('app.media.icon_message'))
         .width(24)
         .aspectRatio(1)
-      if(true){
+      if(this.isShowRed){
         Text()
           .width(10)
           .aspectRatio(1)
@@ -195,7 +251,13 @@ export struct MainView {
     .width(26)
     .aspectRatio(1)
     .onClick(()=>{
-      // yTRouter.router2MessagePage()
+      yTRouter.pushPathByName("MessagePage",-1,(res:PopInfo)=>{
+        let ans=res.result as string
+        if(ans&&ans=='true'){
+          //刷新植物列表
+          this.getMessageList()
+        }
+      });
     })
   }
   @Builder
@@ -220,9 +282,7 @@ export struct MainView {
         message:"是否删除该绿植",
         click:()=>{
           this.deleteGreenList(id).then((res)=>{
-            if(res){
-              this.greenPlantList.filter(item=>item.plantsId!=id)
-            }
+            this.getGreenList({page:this.page,pageSizes:this.pageSize})
           })
           yTToast.hide()
         }
@@ -266,6 +326,15 @@ export struct MainView {
                     clockTime:this.vm.clockDate+" "+this.vm.clockTime+":00"
                   }
                   this.insertClockLog(params)
+                  this.vm.taskItemId=0
+                  this.vm.taskItemName=""
+                  this.vm.plantsId=0
+                  this.vm.plantsName=""
+                  this.vm.clockDate=""
+                  this.vm.clockTime=""
+                  this.vm.taskName=""
+                  this.vm.taskUrl=""
+
                 }
               })
 

+ 36 - 15
features/feature/src/main/ets/view/RecodeViewModel.ets

@@ -1,6 +1,6 @@
 import { AppStorageKeyCollect, IBestToast, yTToast } from 'basic';
 import { DiaryApi } from '../api/DiaryApi';
-import { DiaryData } from '../models';
+import { DiaryData, DiaryDataParam, DiaryDataParamEdit } from '../models';
 import { BasicDataSource } from '../models/BasicDataSource';
 import { DateInfo } from '../models/DateInfo';
 import { DateUtils } from '../utils/DateUtils';
@@ -151,7 +151,7 @@ export class RecodeViewModel{
   }
 
   getTime(index: number){
-    let time = this.recodeList[index].noteTime?.split(' ')[1]
+    let time = this.recodeList[index].markDateTime?.split('T')[1]
     let time1 = time?.split(':')
     time1?.pop()
     return time1?.join(':')
@@ -171,10 +171,10 @@ export class RecodeViewModel{
         if(ans){
           IBestToast.show({ message: '删除了记录' })
           //删除
-          this.recodeList=this.recodeList.filter(item=>item.id!=id)
+          this.recodeList=this.recodeList.filter(item=>item.markId!=id)
           //TODO:需要接后台数据请求删除后德数据列表,上述就需要删除
           //后端请求刷新数据
-          // this.changeDataByIndex()
+          this.changeDataByIndex()
         }
       }
     })
@@ -190,11 +190,11 @@ export class RecodeViewModel{
     const result: DiaryData[] = await DiaryApi.queryNoteList(nowTime)
     //
     result.forEach(item => {
-      item.diaryDate = item.noteTime
+      item.diaryDate = item.markDateTime
     })
     //
     result.sort((a, b) => {
-      return new Date(a.noteTime!).getTime() - new Date(b.noteTime!).getTime()
+      return new Date(a.markId!).getTime() - new Date(b.markId!).getTime()
     })
     //
     this.recodeList = result
@@ -204,25 +204,46 @@ export class RecodeViewModel{
 
   // 修改生活小记录时间
   async updateNoteTime(params: DiaryData){
-    const ans = await DiaryApi.updateNoteTime(params)
+    const param={
+      markId:params.markId,
+      title:params.title,
+      content:params.content,
+      markDateTime:params.markDateTime,
+      imageUrls:params.imageUrls
+    } as DiaryDataParamEdit
+    const ans = await DiaryApi.updateNoteTime(param)
     return ans;
   }
 
   // 查询生活小记录对象
-  static async queryNoteById(id: number){
-    // const ans: DiaryData = await DiaryApi.queryNoteById(id)
-    // return ans;
-  }
+  // static async queryNoteById(id: number){
+  //   const ans: DiaryData = await DiaryApi.queryNoteById(id)
+  //   return ans;
+  // }
 
   // 编辑生活小记录
   static async updateNote(params: DiaryData){
-    // const ans = await DiaryApi.updateNote(params)
-    // return ans;
+    const param={
+      markId:params.markId,
+      title:params.title,
+      content:params.content,
+      markDateTime:params.markDateTime,
+      imageUrls:params.imageUrls
+    } as DiaryDataParamEdit
+    const ans = await DiaryApi.updateNote(param)
+    return ans;
   }
 
   // 添加生活小记录
   static async saveNote(params: DiaryData){
-    // const ans = await DiaryApi.saveNote(params)
-    // return ans;
+    const param={
+      markId:params.markId,
+      title:params.title,
+      content:params.content,
+      markDateTime:params.markDateTime,
+      imageUrls:params.imageUrls
+    } as DiaryDataParam
+    const ans = await DiaryApi.saveNote(param)
+    return ans;
   }
 }

+ 284 - 114
features/feature/src/main/ets/view/SecondView.ets

@@ -1,64 +1,103 @@
-import { BasicType, yTRouter } from "basic"
+import { BasicType, IBestToast, YTLog, yTRouter } from "basic"
 import { SecondViewModel } from "../viewmodels/SecondViewModel"
 import { promptAction } from "@kit.ArkUI"
-import { TaskItem } from "../models/Second"
+import { GrowthApi } from "../api/GrowthApi"
+import { GrowthTaskItemInterface } from "../models/Second"
+import { DiaryData, PageStatus } from "../models"
+import { DateUtils } from "../utils/DateUtils"
 
 @ComponentV2
 export struct SecondView {
   @Local vm:SecondViewModel=new SecondViewModel()
   //任务栏
-  @Local setArr: Array<TaskItem> = [
-    new TaskItem({
-      text: '签到一次',
-      message: '1',
-      src:$r('app.media.app_icon'),
-      isShowClose:false,
-      click:()=>{
-        if(!this.setArr[0].isShowClose){
-          //点击签到
-          this.setArr[0].isShowClose=true
-        }
-      }
-    }),
-    new TaskItem({
-      text: '养护打卡成功一次',
-      message: '1',
-      src:$r('app.media.app_icon'),
-      isShowClose:false,
-      click:()=>{
-        if(!this.setArr[1].isShowClose){
-          //跳转页面
-        }
+   setArr: GrowthTaskItemInterface[] = [
+   {
+       text: '签到一次',
+       message: '1',
+       src:$r('app.media.app_icon'),
+     },
+{
+       text: '养护打卡成功一次',
+       message: '1',
+       src:$r('app.media.app_icon'),
+     },
+  {
+       text: '新增一盆绿植',
+       message: '5',
+       src:$r('app.media.app_icon'),
 
-      }
+     },
+ {
+       text: '记录一次',
+       message: '3',
+       src:$r('app.media.app_icon')
+     }
+   ]
+  @Local img:ResourceStr=$r('app.media.icon_growth_people1')
+  @Local num:string=""
 
-    }),
-    new TaskItem({
-      text: '新增一盆绿植',
-      message: '5',
-      src:$r('app.media.app_icon'),
-      isShowClose:false,
-      click:()=>{
-        if(!this.setArr[2].isShowClose){
-          //跳转页面
-        }
+  aboutToAppear(): void {
+    this.getGrowthTaskList()
+    this.getUserGrowthValue()
+  }
 
-      }
 
-    }),
-    new TaskItem({
-      text: '记录一次',
-      message: '1',
-      src:$r('app.media.app_icon'),
-      isShowClose:false,
-      click:()=>{
-        if(!this.setArr[3].isShowClose){
-          //跳转页面
-        }
 
+  async getGrowthTaskList(){
+    const res=await GrowthApi.getChallengeList()
+    this.vm.signIn=Number(res.signIn)
+    this.vm.clockPlants=Number(res.clockPlants)
+    this.vm.createPlants=Number(res.createPlants)
+    this.vm.createRecord=Number(res.createRecord)
+
+  }
+  routerAddNote(id: number,item:DiaryData) {
+    // 产品要求:
+    // 1. 日期需要和上一级页面选择的日期保持一致。
+    const res = DateUtils.formatDateToCustomString(new Date(), false)
+    let date: string = res.split('T')[0]
+    // 2. 时间需要和当前时间保持一致。
+    let time: string = DateUtils.formatDateToCustomString(new Date(), true, false).split('T')[1]
+    let ans: string = date + ' ' + time
+
+    yTRouter.pushPathByName("IncreaseDiaryPage", {
+      'id': id,
+      'PageStatus': PageStatus.RECODE,
+      'title': item.title,
+      'markDateTime':item.markDateTime,
+      'imageUrls':item.imageUrls,
+      'content':item.content,
+    } as Record<string, number | string | string[]>);
+  }
+  //签到
+  async singIn(){
+    await GrowthApi.SignIn().then((res)=>{
+      if(res){
+        IBestToast.show({
+          message:"签到成功"
+        })
+        this.vm.signIn=1
+        this.getUserGrowthValue()
       }
-    }),
-  ]
+    })
+  }
+  //获取总成长点
+  async getUserGrowthValue(){
+    const res=await GrowthApi.getUserGrowthValue()
+    this.vm.value=Number(res)
+    if(this.vm.value<70){
+      this.img=$r('app.media.icon_growth_people1')
+      this.num=(70-this.vm.value).toString()
+    }else if (this.vm.value<300){
+      this.img=$r('app.media.icon_growth_people2')
+      this.num=(300-this.vm.value).toString()
+    }else{
+      this.img=$r('app.media.icon_growth_people3')
+    }
+
+  }
+
+
 
   build() {
     Column({space:19}) {
@@ -70,7 +109,7 @@ export struct SecondView {
           Text(this.vm.value.toString()).fontSize(30).fontColor('#333333')
           Row({space:5}){
             Text('我的成长点').fontSize(10).fontColor('#206D43')
-            Image($r('app.media.app_icon')).width(14)
+            Image($r('app.media.icon_growth_right')).width(14)
           }.backgroundColor('#d0e3d9')
           .padding({top:3,left:6,bottom:3,right:6})
           .borderRadius(19)
@@ -80,74 +119,17 @@ export struct SecondView {
 
         }.alignItems(HorizontalAlign.Start)
 
-        Image($r('app.media.app_icon')).width(200)
+        Column({space:5}) {
+          Image(this.img).width(200)
+          Text(this.vm.value<300?'进入下一阶段还需'+this.num+"成长点":"").fontColor('#333333').fontSize(12)
+        }.justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+
       }.width('100%')
       .alignItems(VerticalAlign.Top)
-      //任务栏
-      Column(){
-        Row() {
-          Text('每日任务')
-            .fontSize(25)
-            .fontColor('#206D43')
-          Text('做任务得每周成长点')
-            .fontSize(10)
-            .fontColor('#9C9898')
-            .margin({top:10})
-        }.width('100%')
-        .justifyContent(FlexAlign.SpaceBetween)
-        .padding({left:16,right:26})
-        .height(53)
-
-        List({space:9}){
-          ForEach(this.setArr,(item:BasicType,index:number)=>{
-            ListItem(){
-              Row({space:17}){
-
-                Image(item.src).width(40)
-                Column({space:4}){
-                  Text(item.text).fontColor('#333333').fontWeight(500)
-                  Text(`+${item.message}成长点`).fontColor('#E69E21').fontSize(12)
-                }.alignItems(HorizontalAlign.Start)
-                Blank()
-                if(index==0) {
-                  Text(item.isShowClose ? '已签到' : '签 到')
-                    .fontColor('#fff')
-                    .padding({
-                      left: 11,
-                      right: 11,
-                      top: 8,
-                      bottom: 8
-                    })
-                    .backgroundColor(item.isShowClose?'#C4C4C4':'#206D43')
-                    .borderRadius(10)
-                    .onClick(item.click)
-                }else{
-                  Text(item.isShowClose?'已完成':'去完成')
-                    .fontColor('#fff')
-                    .padding({left:11,right:11,top:8,bottom:8})
-                    .backgroundColor(item.isShowClose?'#C4C4C4':'#206D43')
-                    .borderRadius(10)
-                    .onClick(item.click)
-                }
-
+      //任务栏,每日任务
+      this.ChanListBuilder()
 
-              }.width('100%')
-              .height(70)
-              .backgroundColor(Color.White)
-              .padding({left:13,right:13})
-              .borderRadius(12)
-
-            }
-          })
-        }.layoutWeight(1)
-        .scrollBar(BarState.Off)
-        .padding(6)
-        .align(Alignment.Top)
-
-
-      }.width('100%')
-      .borderRadius({topLeft:20,topRight:20})
-      .backgroundColor('#F8F8F8')
 
     }
     .height('100%')
@@ -251,4 +233,192 @@ export struct SecondView {
       }.width(320).margin({bottom:30})
     }
   }
+
+  @Builder
+  ChanListBuilder(){
+    Column(){
+      Row() {
+        Text('每日任务')
+          .fontSize(25)
+          .fontColor('#206D43')
+        Text('做任务得每周成长点')
+          .fontSize(10)
+          .fontColor('#9C9898')
+          .margin({top:10})
+      }.width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      .padding({left:16,right:26})
+      .height(53)
+
+      List({space:9}){
+        ListItem(){
+          Row({space:17}){
+            Image(this.setArr[0].src).width(40)
+            Column({space:4}){
+              Text(this.setArr[0].text).fontColor('#333333').fontWeight(500)
+              Text(`+${this.setArr[0].message}成长点`).fontColor('#E69E21').fontSize(12)
+            }.alignItems(HorizontalAlign.Start)
+            Blank()
+            Text(this.vm.signIn ? '已签到' : '签 到')
+              .fontColor('#fff')
+              .padding({
+                left: 11,
+                right: 11,
+                top: 8,
+                bottom: 8
+              })
+              .backgroundColor(this.vm.signIn?'#C4C4C4':'#206D43')
+              .borderRadius(10)
+              .onClick(()=>{
+                if(this.vm.signIn==0){
+                 this.singIn()
+                }else {
+                  IBestToast.show({
+                    message:"你已经签过到了"
+                  })
+                }
+              })
+
+
+          }.width('100%')
+          .height(70)
+          .backgroundColor(Color.White)
+          .padding({left:13,right:13})
+          .borderRadius(12)
+        }
+        ListItem(){
+          Row({space:17}){
+
+            Image(this.setArr[1].src).width(40)
+            Column({space:4}){
+              Text(this.setArr[1].text).fontColor('#333333').fontWeight(500)
+              Text(`+${this.setArr[1].message}成长点`).fontColor('#E69E21').fontSize(12)
+            }.alignItems(HorizontalAlign.Start)
+            Blank()
+
+            Text(this.vm.clockPlants?'已完成':'去完成')
+              .fontColor('#fff')
+              .padding({left:11,right:11,top:8,bottom:8})
+              .backgroundColor(this.vm.clockPlants?'#C4C4C4':'#206D43')
+              .borderRadius(10)
+              .onClick(()=>{
+                if(this.vm.clockPlants==0){
+                  yTRouter.pushPathByName("EditGreenPlantPage",-1,(result:PopInfo)=>{
+                    let ans=result.result as string
+                    if(ans&&ans=='true'){
+                      //刷新植物列表
+                      // this.getGrowthTaskList()
+                    }
+                  });
+
+                }else {
+                  IBestToast.show({
+                    message:"你已经完成了"
+                  })
+                }
+
+              })
+
+
+
+          }.width('100%')
+          .height(70)
+          .backgroundColor(Color.White)
+          .padding({left:13,right:13})
+          .borderRadius(12)
+
+        }
+        ListItem(){
+          Row({space:17}){
+
+            Image(this.setArr[2].src).width(40)
+            Column({space:4}){
+              Text(this.setArr[2].text).fontColor('#333333').fontWeight(500)
+              Text(`+${this.setArr[2].message}成长点`).fontColor('#E69E21').fontSize(12)
+            }.alignItems(HorizontalAlign.Start)
+            Blank()
+
+            Text(this.vm.createPlants?'已完成':'去完成')
+              .fontColor('#fff')
+              .padding({left:11,right:11,top:8,bottom:8})
+              .backgroundColor(this.vm.createPlants?'#C4C4C4':'#206D43')
+              .borderRadius(10)
+              .onClick(()=>{
+                if(this.vm.createPlants==0){
+                  yTRouter.pushPathByName("EditGreenPlantPage",-1,(result:PopInfo)=>{
+                    let ans=result.result as string
+                    if(ans&&ans=='true'){
+                      //刷新植物列表
+                    // this.getGrowthTaskList()
+                    }
+                  });
+
+                }else {
+                  IBestToast.show({
+                    message:"你已经完成了"
+                  })
+                }
+
+              })
+          }.width('100%')
+          .height(70)
+          .backgroundColor(Color.White)
+          .padding({left:13,right:13})
+          .borderRadius(12)
+
+        }
+        ListItem(){
+          Row({space:17}){
+
+            Image(this.setArr[3].src).width(40)
+            Column({space:4}){
+              Text(this.setArr[3].text).fontColor('#333333').fontWeight(500)
+              Text(`+${this.setArr[3].message}成长点`).fontColor('#E69E21').fontSize(12)
+            }.alignItems(HorizontalAlign.Start)
+            Blank()
+
+            Text(this.vm.createRecord?'已完成':'去完成')
+              .fontColor('#fff')
+              .padding({left:11,right:11,top:8,bottom:8})
+              .backgroundColor(this.vm.createRecord?'#C4C4C4':'#206D43')
+              .borderRadius(10)
+              .onClick(()=>{
+                if(this.vm.createRecord==0){
+                 this.routerAddNote(-1,{markId:-1} as DiaryData)
+
+                }else {
+                  IBestToast.show({
+                    message:"你已经完成了"
+                  })
+                }
+
+              })
+          }.width('100%')
+          .height(70)
+          .backgroundColor(Color.White)
+          .padding({left:13,right:13})
+          .borderRadius(12)
+
+        }
+
+      }.layoutWeight(1)
+      .scrollBar(BarState.Off)
+      .padding(6)
+      .align(Alignment.Top)
+
+
+    }.width('100%')
+    .borderRadius({topLeft:20,topRight:20})
+    .backgroundColor('#F8F8F8')
+    .onVisibleAreaChange([0, 1], (isExpanding: boolean, currentRatio: number) => {
+      if(isExpanding) {
+        console.log("组件出来了")
+        this.getGrowthTaskList()
+        this.getUserGrowthValue()
+      } else {
+        console.log("组件退了")
+      }
+    })
+
+  }
 }

+ 139 - 3
features/feature/src/main/ets/view/ThirdView.ets

@@ -1,11 +1,147 @@
-import { Pet, RDBMapper, RelationalStoreUtils, Test } from "basic";
+import { IBestToast, Pet, RDBMapper, RelationalStoreUtils, Test, YTCalendarPicker } from "basic";
+import dayjs from "dayjs";
+import { ClockTaskApi, InsertClockParam } from "../api/ClockTaskApi";
+import { GetRemindParams, RemindApi, RemindItem, RemindItemClass } from "../api/RemindApi";
+import { ButtonCom } from "../components/maincomponent/ButtonCom";
+import { NullBuilder } from "../components/NullCom";
 
 @Component
 export struct ThirdView {
-  build() {
-    Column(){
+  @State remindList:RemindItem[]=[]
+  @State dataList:string[]=[]
+  @StorageProp('OAIDD')
+  odid:string=""
+
+  async getRemindList(params:GetRemindParams){
+    const arr=await RemindApi.getRemindList(params)
+    this.remindList=arr.records as RemindItem[]
+  }
+  async getRed(yearMonth:string){
+    this.dataList=await RemindApi.getRed(yearMonth,this.odid)
+  }
+
 
+  aboutToAppear(): void {
+    const date=dayjs(new Date()).format('YYYY-MM-DD')
+    this.getRemindList({page:1,pageSizes:20,remindDate:date})
+    const yearMonth=dayjs(new Date()).format('YYYY-MM')
+    this.getRed(yearMonth)
+  }
+  async insertClockLog(vm:InsertClockParam){
+    if(vm.plantsId==0||vm.itemId==0||vm.clockDate==""||vm.clockTime==""){
+      IBestToast.show({
+        message:"请检查打卡项或打卡植物日期"
+      })
+      return
+    }
+
+    if(dayjs(vm.clockDate+" "+vm.clockTime).valueOf()>dayjs(new Date()).valueOf()){
+      IBestToast.show({
+        message:"打卡不得超过当前时间"
+      })
+      return
     }
+    const params:InsertClockParam={
+      plantsId:vm.plantsId,
+      itemId:vm.itemId,
+      clockDate:vm.clockDate+" 00:00:00",
+      clockTime:vm.clockDate+" "+vm.clockTime+":00"
+    }
+    await ClockTaskApi.insertClockLog(params).then((res)=>{
+      if(res==true){
+        IBestToast.show({
+          message:'打卡成功'
+        })
+      }
+    })
+  }
+
+
+  build() {
+    Column({space:20}){
+      YTCalendarPicker({
+        onClickItem:(date: Date)=>{
+          const stringDate=dayjs(date).format('YYYY-MM-DD')
+          this.getRemindList({page:1,pageSizes:20,remindDate:stringDate})
+        },
+        updateRed:(year:string,month:string)=>{
+          if(month.length==1){
+            month="0"+month
+          }
+          const date=year+"-"+month
+          this.getRed(date)
+        },
+        dateList:this.dataList
+      })
+      if(this.remindList.length==0){
+        NullBuilder()
+      }else {
+
+        List({ space: 16 }) {
+          ForEach(this.remindList, (item: RemindItem, index: number) => {
+            ListItem() {
+              Row() {
+                Column() {
+                  Image(item.plantsPicture).width(55).height(79)
+                }
+                .width(70)
+                .height(90)
+                .justifyContent(FlexAlign.Center)
+                .alignItems(HorizontalAlign.Center)
+                .borderRadius(20)
+                .backgroundColor('#E8EBF0')
+                .margin({ right: 9 })
+
+                Column({ space: 11 }) {
+                  Text(item.plantsName).fontColor('#333333')
+                  Row({ space: 5 }) {
+                    Image(item.itemIcon).width(15).height(15)
+                    Text(item.itemName).fontColor('#333333').fontSize(12)
+                  }
+
+                  Row({ space: 5 }) {
+                    Image($r("app.media.main_icon_remindDesc")).width(15).height(15)
+                    Text(item.remindTime.slice(0, 5)).fontColor('#333333').fontSize(12)
+                  }
+                }.justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
+
+                Blank()
+                ButtonCom({
+                  text: "养护打卡",
+                  isShowBuilder: () => {
+                    // this.isShowMaintenanceBuilder=true
+                    //直接打卡
+                    this.insertClockLog({
+                      itemId: item.itemId,
+                      plantsId: item.plantsId,
+                      clockDate: dayjs(new Date()).format('YYYY-MM-DD'),
+                      clockTime: dayjs(new Date()).format('HH:mm')
+                    })
+                  }
+                })
+              }
+              .width('100%')
+              .height(115)
+              .backgroundColor('#fff')
+              .justifyContent(FlexAlign.Center)
+              .alignItems(VerticalAlign.Center)
+              .borderRadius(12)
+              .padding({
+                left: 17,
+                top: 17,
+                right: 20,
+                bottom: 17
+              })
+            }
+          })
+        }.width('100%')
+      }
+
+    }.height('100%')
+    .padding({top:44,left:16,right:16})
+    .justifyContent(FlexAlign.Start)
+    .backgroundColor('#EAF3F2')
+
 
   }
 }

+ 38 - 1
features/feature/src/main/ets/viewmodels/EditGreenPlantPageModel.ets

@@ -1,3 +1,4 @@
+import dayjs from "dayjs"
 import { DateFrequency } from "../constants"
 
 @ObservedV2
@@ -12,6 +13,14 @@ export class EditGreenPlantPageModel{
     new SwiperController(),
   ]
 
+  /**
+   * 新增绿植
+   */
+  @Trace
+  greenPlantsName:string=""
+  @Trace
+  greenPlantsPicture:string=""
+
   //新增提醒间隔类型
   @Trace
   frequency:string=DateFrequency.NONE //默认一次
@@ -45,11 +54,13 @@ export class EditGreenPlantPageModel{
    * 时间间隔
    */
   //时间
+
+
   @Trace
   time:string=""
   //日期
   @Trace
-  date:string=""
+  date:string=dayjs(new Date).format('YYYY-MM-DD')
   //间隔天数
   @Trace
   dayNumber:string=""
@@ -79,4 +90,30 @@ export class EditGreenPlantPageModel{
   clockDate:string=""
   @Trace
   clockTime:string=""
+
+  @Trace
+  isshowRed:boolean=false
+
+  @Monitor('date')
+  onNameChangeDate(monitor: IMonitor) {
+    if(dayjs(this.date+" "+this.time).valueOf()<dayjs(new Date()).valueOf()){
+      //提醒的时间在当前时间之前
+      this.isshowRed=true
+    }else{
+      this.isshowRed=false
+    }
+  }
+  @Monitor('time')
+  onNameChangeTime(monitor: IMonitor) {
+    if(dayjs(this.date+" "+this.time).valueOf()<dayjs(new Date()).valueOf()){
+      //提醒的时间在当前时间之前
+      this.isshowRed=true
+    }else{
+      this.isshowRed=false
+    }
+
+
+
+  }
+
 }

+ 16 - 1
features/feature/src/main/ets/viewmodels/SecondViewModel.ets

@@ -1,6 +1,21 @@
+
 @ObservedV2
 export class  SecondViewModel{
   //成长值
   @Trace
-  value:number=70
+  value:number=0
+
+
+  @Trace
+  signIn:number=0
+
+  @Trace
+  clockPlants:number=0
+
+  @Trace
+  createPlants:number=0
+
+  @Trace
+  createRecord:number=0
+
 }

BIN
features/feature/src/main/resources/base/media/icon_edit_page_tab.png


BIN
features/feature/src/main/resources/base/media/icon_growth_people1.png


BIN
features/feature/src/main/resources/base/media/icon_growth_people2.png


BIN
features/feature/src/main/resources/base/media/icon_growth_people3.png


BIN
features/feature/src/main/resources/base/media/icon_growth_right.png


BIN
features/feature/src/main/resources/base/media/icon_growth_value.png


BIN
features/feature/src/main/resources/base/media/icon_null.png


BIN
features/feature/src/main/resources/base/media/icon_sort_1.png


BIN
features/feature/src/main/resources/base/media/icon_sort_2.png


BIN
features/feature/src/main/resources/base/media/photoAlbum.png


+ 0 - 12
features/feature/src/main/resources/base/media/photoAlbum.svg

@@ -1,12 +0,0 @@
-<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="design-iconfont">
-  <g clip-path="url(#qnjwvfk81__clip0_4996_75116)">
-    <path d="M1.20364 8.58219C1.54832 5.17362 4.27706 2.54264 7.68904 2.23347C9.16308 2.0999 10.7001 2 12 2C13.2999 2 14.8369 2.0999 16.311 2.23347C19.7229 2.54264 22.4517 5.17362 22.7964 8.58219C22.9158 9.76383 23 10.9639 23 12C23 13.0361 22.9158 14.2362 22.7964 15.4178C22.4517 18.8264 19.7229 21.4574 16.311 21.7665C14.8369 21.9001 13.2999 22 12 22C10.7001 22 9.16308 21.9001 7.68904 21.7665C4.27707 21.4574 1.54832 18.8264 1.20364 15.4178C1.08416 14.2362 1 13.0361 1 12C1 10.9639 1.08416 9.76383 1.20364 8.58219Z" stroke="#212245" stroke-width="2"/>
-    <path d="M5 17L7.91343 14.0234L11 17.5L15 13L19 17" stroke="#212245" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
-    <path fill="#212245" d="M16 5A2 2 0 1 0 16 9A2 2 0 1 0 16 5Z"/>
-  </g>
-  <defs>
-    <clipPath id="qnjwvfk81__clip0_4996_75116">
-      <path fill="#fff" d="M0 0H24V24H0z"/>
-    </clipPath>
-  </defs>
-</svg>

+ 5 - 0
features/feature/src/main/resources/base/profile/router_map.json

@@ -19,6 +19,11 @@
       "name": "EditGreenPlantPage",
       "pageSourceFile": "src/main/ets/pages/EditGreenPlantPage.ets",
       "buildFunction": "EditGreenPlantBuilder"
+    },
+    {
+      "name": "MessagePage",
+      "pageSourceFile": "src/main/ets/pages/MessagePage.ets",
+      "buildFunction": "MessageBuilder"
     }
   ]
 }

+ 2 - 2
features/user/src/main/ets/pages/DelPhotoPage.ets

@@ -50,8 +50,8 @@ struct DelPhotoPage {
   aboutToDisappear(): void {
     YTAvoid.setStatusBarContentColor('#FF000000', this.context)
   }
-  onBackPressUpdateData(ans:string='false'){
-    yTRouter.pop(ans,true)
+  onBackPressUpdateData(ans:string=''){
+    yTRouter.pop({url:ans},true)
   }
 
   build() {

+ 4 - 7
features/user/src/main/ets/pages/Privacy.ets

@@ -15,19 +15,16 @@ export struct Privacy {
   @State content: string = '';
   @StorageProp(YTAvoid.SAFE_BOTTOM_KEY) safeBottom: number = 0
   private webviewController: WebviewController = new webview.WebviewController()
-
   build() {
-
     Column() {
       YTHeader({ defaultStyle: { 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-static.ytpm.net/plants/privacy.html",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
-      }).padding(20)
+      }).layoutWeight(1)
+        .padding(40)
     }
-    .width('100%')
-    .height('100%')
-    .padding({ bottom: this.safeBottom })
+
   }
 }

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

@@ -17,7 +17,7 @@ struct UserAgreementPage {
     Column() {
       YTHeader({ defaultStyle: { 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-static.ytpm.net/plants/userAgreement.html",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
       })

+ 9 - 9
features/user/src/main/ets/views/Mine.ets

@@ -28,31 +28,31 @@ export struct Mine {
   setArr: Array<BasicType<undefined>> = [
     {
       // acSrc:$r('app.media.icon_mine_share'),
-      acSrc:$r('app.media.app_icon'),
+      acSrc:$r('app.media.icon_mine_share'),
       text: '分享给好友',
       click: () => {
         this.shareData()
       },
-      src: $r('app.media.mine_right_arrow')
+      src: $r('app.media.MRight')
     },
     {
-      acSrc:$r("app.media.app_icon"),
+      acSrc:$r("app.media.icon_mine_sugestion"),
       // acSrc:$r("app.media.icon_mine_suggestion"),
 
       text: '意见反馈',
       click: () => {
         yTRouter.router2SuggestionPage()
       },
-      src: $r('app.media.mine_right_arrow')
+      src: $r('app.media.MRight')
     },
     {
       // acSrc:$r('app.media.icon_mine_about'),
-      acSrc:$r('app.media.app_icon'),
+      acSrc:$r('app.media.icon_about_wo'),
       text: '关于我们',
       click: () => {
         yTRouter.router2AboutUS()
       },
-      src: $r('app.media.mine_right_arrow')
+      src: $r('app.media.MRight')
     },
   ]
   async  shareData() {
@@ -61,9 +61,9 @@ export struct Mine {
       const data = new systemShare.SharedData({
         // utd: uniformTypeDescriptor.UniformDataType.HYPERLINK,
         utd:uniformTypeDescriptor.UniformDataType.TEXT,
-        title: '静心',
-        content:'http://appgallery.huawei.com/app/detail?id=6917585407845246645',
-        description:"http://appgallery.huawei.com/app/detail?id=6917585407845246645"
+        title: '绿植养护助手',
+        content:'http://appgallery.huawei.com/app/detail?id=6917587544032929452',
+        description:"http://appgallery.huawei.com/app/detail?id=6917587544032929452"
       })
       const controller = new systemShare.ShareController(data)
       const context = getContext() as common.UIAbilityContext;

BIN
features/user/src/main/resources/base/media/icon_about_wo.png


BIN
features/user/src/main/resources/base/media/icon_mine_share.png


BIN
features/user/src/main/resources/base/media/icon_mine_sugestion.png


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

@@ -1,6 +1,7 @@
 import { BasicType, ContextHelper, YTAvoid, yTRouter } from 'basic';
 import { Mine } from 'user/src/main/ets/views/Mine';
 import { FourView, MainView, SecondView, ThirdView } from 'feature';
+import { GrowthApi } from 'feature/src/main/ets/api/GrowthApi';
 
 @Entry
 @Component
@@ -40,8 +41,11 @@ struct Index {
   aboutToAppear(): void {
     // 设置为 false 表示为单机 app
     ContextHelper.init(this.getUIContext(), false)
+    const id=setTimeout(()=>{
+      GrowthApi.getUserInfo()
+      clearTimeout(id)
+    },100)
   }
-
   build() {
     Navigation(yTRouter) {
       Column() {

+ 2 - 2
products/entry/src/main/ets/pages/PrivacyPage.ets

@@ -14,10 +14,10 @@ struct PrivacyPage {
   private forEach: Array<BasicType> = [
     {
       text: '隐私政策',
-      message: 'https://hm-test.ytpm.net/classAffairsPrivacy'
+      message: 'https://hm-static.ytpm.net/plants/privacy.html'
     }, {
       text: '用户协议',
-      message: 'https://hm-test.ytpm.net/classAffairsUserAgreement'
+      message: 'https://hm-static.ytpm.net/plants/userAgreement.html'
     }
   ]
 

+ 6 - 6
products/entry/src/main/module.json5

@@ -48,12 +48,12 @@
         ]
       }
     ],
-//    "metadata": [
-//      {
-//        "name": "client_id",
-//        "value": "6917585066777310024"
-//      }
-//    ],
+    "metadata": [
+      {
+        "name": "client_id",
+        "value": "6917587544032929452"
+      }
+    ],
     "extensionAbilities": [
       {
         "name": "EntryBackupAbility",

+ 1 - 1
products/entry/src/main/resources/base/element/string.json

@@ -10,7 +10,7 @@
     },
     {
       "name": "EntryAbility_label",
-      "value": "label"
+      "value": "绿植养护助手"
     },
     {
       "name": "reason",

BIN
products/entry/src/main/resources/base/media/app_icon.png


BIN
products/entry/src/main/resources/base/media/background.png


BIN
products/entry/src/main/resources/base/media/foreground.png


BIN
products/entry/src/main/resources/base/media/icon_about_wo.png


BIN
products/entry/src/main/resources/base/media/icon_mine_share.png


BIN
products/entry/src/main/resources/base/media/icon_mine_sugestion.png


BIN
products/entry/src/main/resources/base/media/startIcon.png