XUYangWei 2 tuần trước cách đây
mục cha
commit
16ec72922f

+ 4 - 4
build-profile.json5

@@ -5,12 +5,12 @@
         "name": "default",
         "material": {
           "storeFile": "C:/Users/EDY/Documents/xwechat_files/wxid_nz06488hmfxu22_a945/msg/file/2025-06/基础证书文件/基础证书文件/basic.p12",
-          "storePassword": "0000001823289D9EAF3D431D92D036AE5972DE8181D4E0F649FB3074CD20A0FE66E3C6796B1346BD",
+          "storePassword": "000000182240A171545DFB7E7582C17F2D771FAC8A850ACE2622BB4AB31BBE13062359BE9E6163A0",
           "keyAlias": "yt112233",
-          "keyPassword": "000000184889ED51C65D6B61C923DADA2E20D8013F88B31949D53F6FF8157C7CFD50099383C02D60",
+          "keyPassword": "000000187D4CA5B422C86D6AD38A9F78FCE3E9B94BABCF4F2C6DEC7A4CC2C81ABC4EF4576ABEC669",
           "signAlg": "SHA256withECDSA",
-          "profile": "C:/Users/EDY/Downloads/绿植养护调试Debug.p7b",
-          "certpath": "C:/Users/EDY/Documents/xwechat_files/wxid_nz06488hmfxu22_a945/msg/file/2025-06/基础证书文件/基础证书文件/调试证书.cer"
+          "profile": "C:/Users/EDY/Downloads/绿植发布证书Release.p7b",
+          "certpath": "C:/Users/EDY/Documents/xwechat_files/wxid_nz06488hmfxu22_a945/msg/file/2025-06/基础证书文件/基础证书文件/发布证书.cer"
         }
       }
     ],

+ 34 - 0
commons/basic/src/main/ets/components/ToastBuilders/SuccessBuilder.ets

@@ -0,0 +1,34 @@
+import { BasicType } from "../../models";
+import { yTToast } from "../../utils/YTToast";
+
+@Builder
+export function SuccessBuilder(item: BasicType<undefined>) {
+  Column(){
+    Column(){
+      Row({space:4}){
+        Image(item.src).width(22)
+        Text(item.message).fontSize(18).fontColor('#333333')
+      }.width('100%')
+      .justifyContent(FlexAlign.Start)
+      .margin({bottom:50})
+
+      Image($r('app.media.icon_success')).width(160).margin({bottom:26})
+
+      Text('打卡成功').fontSize(22).fontColor('#333333').fontWeight(500)
+    }.width(273)
+    .height(290)
+    .margin({bottom:34})
+    .borderRadius(32)
+    .padding({top:10,left:22})
+    .linearGradient({
+      angle:80,
+      colors:[
+        ['#EFFFF1',1]
+      ]
+    })
+
+    Image($r('app.media.icon_success_cancel')).width(35).onClick(()=>{
+      yTToast.hide()
+    })
+  }
+}

+ 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('123456')
+                    ytOaidUtils.setOaid(oaid)
                     YTLog.info(`succeeded in getting oaid by callback , oaid: ${oaid}`);
                   }
                 });

+ 4 - 0
commons/basic/src/main/ets/utils/YTToast.ets

@@ -7,6 +7,7 @@ import { agreePrivacy } from '../components/ToastBuilders/AgreePrivacy';
 import { LoginCollect } from '../models/LoginCollect';
 import { loginToUse } from '../components/ToastBuilders/LoginToUse';
 import { AlertToastBuilder } from '../components/ToastBuilders/AlertToastComp';
+import { SuccessBuilder } from '../components/ToastBuilders/SuccessBuilder';
 
 interface InitOption {
   context?: UIContext;
@@ -106,6 +107,9 @@ export class YTToast {
   doubleConfirm(item: BasicType) {
     this.openToast(wrapBuilder(yTDoubleConfirm), item)
   }
+  successConfirm(item: BasicType){
+    this.openToast(wrapBuilder(SuccessBuilder),item)
+  }
 
   agreePrivacy(item: BasicType) {
     this.openToast(wrapBuilder(agreePrivacy), item)

BIN
commons/basic/src/main/resources/base/media/icon_success.png


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

@@ -44,6 +44,8 @@ export class ApiUrl{
 
   //提醒年月红点
   static readonly GET_UNCOMPELTE_RED="/prod-plants/api/remind/getRemindSettingByMonth"
+  //是否打开
+  static readonly IS_OPEN="/prod-plants/api/remind/isOpen"
 
 
   /**

+ 9 - 1
features/feature/src/main/ets/api/ClockTaskApi.ets

@@ -45,6 +45,11 @@ export class ClockTaskApi{
     return await YTRequest.post<ResponseResult<ClockLog[]>,GetClockLogParams>(ApiUrl.GET_CLOCK_LOG_LIST,params)
   }
   static async insertClockLog(params:InsertClockParam){
+    if(params.messageId==0){
+      params.messageId=null
+    }else{
+      params.messageId=params.messageId
+    }
     return await YTRequest.post<boolean,InsertClockParam>(ApiUrl.INSERT_CLOCK_LOG,params)
 
   }
@@ -53,7 +58,10 @@ export interface InsertClockParam{
   plantsId:number,
   itemId:number,
   clockDate:string,
-  clockTime:string
+  clockTime:string,
+  remark:string,
+  messageId?:number|null
+
 }
 export interface GetClockLogParams{
   page: number,

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

@@ -7,6 +7,8 @@ export interface MessageItem {
   messageId: number,
   messageStatus: number,
   messageType: string,
+  plantsId?:number,
+  itemId?:number
 }
 export interface GetMessageParams{
   page:number,

+ 12 - 2
features/feature/src/main/ets/api/RemindApi.ets

@@ -8,7 +8,8 @@ export interface GetRemindParams{
   page: number,
   pageSizes: number,
   plantsId?: number,
-  remindDate?:string
+  remindDate?:string,
+  isOpen?:boolean
 }
 export interface InsertEditRemindParams{
   oaid?:string
@@ -104,10 +105,19 @@ export class RemindApi{
   }
   //删除
   static async deleteRemind(id:number){
-    return await YTRequest.post<boolean,number>(ApiUrl.DELETE_REMIND_ITEM,{} as ESObject,id)
+    return await YTRequest.post<boolean,number>(ApiUrl.DELETE_REMIND_ITEM,{} as ESObject,{settingId:id})
   }
   //红点
   static async getRed(yearMonth:string,odid:string){
     return await YTRequest.get<string[]>(ApiUrl.GET_UNCOMPELTE_RED,{yearMonth:yearMonth,odid:odid})
   }
+
+  //开启关闭
+  static async isOpen(id:number,isopen:boolean){
+    return await YTRequest.post<boolean,Record<string,string|number|boolean>>(ApiUrl.IS_OPEN,{
+      "isOpen":isopen?1:0,
+      "settingId":id
+    })
+
+  }
 }

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

@@ -36,8 +36,8 @@ export struct DiaryTimePicker {
 
           // 保证swiper组件已经渲染
           setTimeout(() => {
-            this.hourController.changeIndex(hour);
-            this.minuteController.changeIndex(minute);
+            this.hourController.changeIndex(hour-3);
+            this.minuteController.changeIndex(minute-3);
           }, 0)
         }
       }

+ 24 - 16
features/feature/src/main/ets/components/maincomponent/RemindItemClassComp.ets

@@ -13,6 +13,9 @@ export struct RemindItemClassComp{
   async editRemind(params:InsertEditRemindParams){
     await RemindApi.updateRemind(params)
   }
+  async isOpen(id:number,isOpen:boolean){
+    await RemindApi.isOpen(id,isOpen)
+  }
   textTranslate(item:string){
     if(item==DateFrequency.NONE){
       return "仅一次"
@@ -80,25 +83,30 @@ export struct RemindItemClassComp{
       .backgroundColor(this.item.isOpen ? '#2a7853' : '#D9D9D9')
       .onClick(() => {
         animateTo({ duration: 200 }, () => {
-          this.item.isOpen = !this.item.isOpen
-          if(this.item.repeatType==DateFrequency.NONE && this.item.isOpen==true){
+
+          if(this.item.repeatType==DateFrequency.NONE && this.item.isOpen==false){
             this.isShowBuilder()
             return
+          }else{
+            this.item.isOpen = !this.item.isOpen
+            this.isOpen(this.item.settingId,this.item.isOpen)
           }
-          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
-          })
+
+
+          // 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
+          // })
         })
       })
     }

+ 8 - 0
features/feature/src/main/ets/models/index.ets

@@ -79,4 +79,12 @@ export interface DiaryDataParamEdit{
   markDateTime?: string
   // 图片地址集合
   imageUrls?: string[]
+}
+//从消息页面携带对象
+export interface MessageToMain{
+  isShow:boolean
+  messageId:number,
+  plantsId:number,
+  itemId:number,
+
 }

+ 53 - 3
features/feature/src/main/ets/pages/EditGreenPlantPage.ets

@@ -3,7 +3,8 @@ import { BasicType,
   IBestNotify,
   IBestToast,
   reviseImgHeaderBuilder,
-  RouterPage, YTHeader, YTLog, YTPhotoHelper, yTRouter } from "basic"
+  RouterPage, YTHeader, YTLog, YTPhotoHelper, yTRouter,
+  yTToast } from "basic"
 import { BuilderHeader } from "../components/maincomponent/BuilderHeader"
 import { SwiperCom } from "../components/maincomponent/SwiperCom"
 import { OrderDetailBean, TimeLineNode } from "../components/maincomponent/TimeLineNode"
@@ -51,7 +52,7 @@ struct EditGreenPlantPage{
           const fullpath = await this.yTPhotoHelper.takePicture()
           this.showHeaderImgRevise = false
           yTRouter.router2DelPhotoPage({ src: fullpath, type: 'image'},(res:PopInfo)=>{
-            let ans=res.result as string
+            let ans=res.result['url'] as string
             if(ans&&ans!=''){
               this.vm.greenPlantsPicture=ans
             }
@@ -152,6 +153,9 @@ struct EditGreenPlantPage{
     await ClockTaskApi.insertClockTask(params)
     this.getClockTaskList()
   }
+  async delete(id:number){
+    return await RemindApi.deleteRemind(id)
+  }
 
   onBackPressUpdateData(ans:string='false'){
     yTRouter.pop(ans,true)
@@ -174,6 +178,38 @@ struct EditGreenPlantPage{
     this.vm.remindPlantsName=""
   }
   //校验
+  @Builder
+  itemEnd(id: number, index: number) {
+    Row() {
+      Image($r('app.media.main_icon_delete')).width(25).height(25)
+    }
+    .width(62)
+    .height(115)
+    .justifyContent(FlexAlign.Center)
+    .alignItems(VerticalAlign.Center)
+    .borderRadius(10)
+    .border({
+      width: 1,
+      color: Color.Red
+    })
+    .backgroundColor(Color.Red)
+    .borderRadius(10)
+    .onClick(() => {
+      //删除
+      yTToast.doubleConfirm({
+        message:"是否删除该提醒",
+        click:()=>{
+          this.delete(id).then((res)=>{
+            if(res==true) {
+              this.remindList = []
+              this.getRemindList({ plantsId: this.plantsId, page: 1, pageSizes: 20 })
+            }
+          })
+          yTToast.hide()
+        }
+      })
+    })
+  }
 
 
   build() {
@@ -328,7 +364,21 @@ struct EditGreenPlantPage{
                               this.isShowRemindClockBuilder = true
                             }
                           })
-                        }
+                        }.swipeAction({
+                          end: this.itemEnd(item.settingId, index),
+                        }).onClick(()=>{
+                          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)
                   }

+ 12 - 7
features/feature/src/main/ets/pages/MessagePage.ets

@@ -1,5 +1,7 @@
+import { it } from '@ohos/hypium'
 import { RouterPage, YTHeader, yTRouter } from 'basic'
 import { MessageApi, MessageItem, UpdateMessage } from '../api/MessageApi'
+import { MessageToMain } from '../models'
 
 @RouterPage
 @Component
@@ -19,7 +21,7 @@ struct MessagePage {
   aboutToAppear(): void {
     this.getMessageList()
   }
-  onBackPressUpdateData(ans:string='false'){
+  onBackPressUpdateData(ans:MessageToMain){
     yTRouter.pop(ans,true)
   }
 
@@ -91,13 +93,14 @@ struct MessagePage {
                 messageId:item.messageId,
                 messageStatus:2
               })
-              this.messageList.slice(index,1)
+             this.messageList=[]
+              this.getMessageList()
           })
           Text('去打卡')
             .padding({left:28,right:28,top:8,bottom:8})
             .fontColor('#fff').backgroundColor('#206D43')
             .borderRadius(20).onClick(()=>{
-              this.onBackPressUpdateData('true')
+              this.onBackPressUpdateData({isShow:true,messageId:item.messageId,plantsId:item.plantsId as number,itemId:item.itemId as number})
             })
       }
       .height(40)
@@ -145,9 +148,11 @@ struct MessagePage {
         .backgroundColor('#9DD0A1')
         .justifyContent(FlexAlign.Center)
         .alignItems(HorizontalAlign.Center)
-        Text(item.messageContent)
-          .fontSize(16)
-          .fontWeight(400)
+        Flex() {
+          Text(item.messageContent)
+            .fontSize(16)
+            .fontWeight(400)
+        }.layoutWeight(1)
       }
       .width('100%')
       .backgroundColor('#fff')
@@ -207,7 +212,7 @@ struct MessagePage {
     .width(26)
     .aspectRatio(1)
     .onClick(()=>{
-      this.onBackPressUpdateData('true')
+      this.onBackPressUpdateData({isShow:false,messageId:-1,plantsId:-1,itemId:-1})
     })
   }
 }

+ 205 - 139
features/feature/src/main/ets/view/MainView.ets

@@ -21,6 +21,7 @@ import { MessageApi, MessageItem } from '../api/MessageApi'
 import { NullBuilder } from '../components/NullCom'
 import { GreenPlantMainCard } from '../components/maincomponent/GreenPlantMainCard'
 import { it } from '@ohos/hypium'
+import { MessageToMain } from '../models'
 
 @ComponentV2
 export struct MainView {
@@ -80,11 +81,12 @@ export struct MainView {
   /**
    *
    */
-  async insertClockLog(params:InsertClockParam){
+  async insertClockLog(params:InsertClockParam,img:string,name:string){
     await ClockTaskApi.insertClockLog(params).then((res)=>{
       if(res==true){
-        IBestToast.show({
-          message:"打卡成功"
+        yTToast.successConfirm({
+          src:img,
+          message:name
         })
       }
     })
@@ -140,35 +142,36 @@ export struct MainView {
             .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
-                    },
+          Column() {
+            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') {
+                        //刷新植物列表
+                        this.getGreenList({ page: this.page, pageSizes: this.pageSize })
+                      }
+                    });
+                  })
+                  .swipeAction({
+                    end: this.itemEnd(item.plantsId, index),
                   })
-                }.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(item.plantsId, index),
                 })
-              })
-            }.width('100%')
-          }
+              }.height(550)
+            }
+          }.layoutWeight(1)
         }.width('100%')
         .padding({ left: 16, right: 16 })
         .bindSheet($$this.isShowMaintenanceBuilder, this.MaintenanceClockBindSheetBuilder(), {
@@ -252,11 +255,28 @@ export struct MainView {
     .aspectRatio(1)
     .onClick(()=>{
       yTRouter.pushPathByName("MessagePage",-1,(res:PopInfo)=>{
-        let ans=res.result as string
-        if(ans&&ans=='true'){
-          //刷新植物列表
-          this.getMessageList()
+        let ans=res.result as MessageToMain
+        // this.getMessageList()
+        if(ans&&ans.isShow){
+          //刷新弹窗
+          this.isShowMaintenanceBuilder=true
+          //根据id查数据即可
+          this.getClockTaskList()
+          this.getGreenList({ page: this.page, pageSizes: this.pageSize })
+          const a=this.clockTaskList.find(item=>item.itemId==ans.itemId)
+          this.vm.taskItemId=a?.itemId as number
+          this.vm.taskItemName=a?.itemName as string
+          this.vm.img=a?.itemIcon as string
+          const b=this.greenPlantList.find(item=>item.plantsId==ans.plantsId)
+          this.vm.plantsId=b?.plantsId as number
+          this.vm.plantsName=b?.plantsName as string
+          this.vm.clockDate=dayjs(new Date()).format('YYYY-MM-DD')
+          this.vm.clockTime=dayjs(new Date).format('HH:mm')
+          this.vm.messageId=ans.messageId
+        }else{
+          //取消
         }
+        this.getMessageList()
       });
     })
   }
@@ -294,154 +314,199 @@ export struct MainView {
   @Builder
   MaintenanceClockBindSheetBuilder(){
     Column(){
-      Swiper(this.vm.swiperController){
-          Column(){
-            Row(){
+      Stack({alignContent:Alignment.Bottom}) {
+        Swiper(this.vm.swiperController) {
+          Column() {
+            Row() {
               BuilderHeader({
-                leftTitle:"取消",
-                centerTitle:"养护打卡",
-                rightTitle:'打卡',
-                leftClick:()=>{
-                  this.isShowMaintenanceBuilder=false
+                leftTitle: "取消",
+                centerTitle: "养护打卡",
+                rightTitle: '打卡',
+                leftClick: () => {
+                  this.isShowMaintenanceBuilder = false
+                  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 = ""
+                  this.vm.remark=""
+                  this.vm.img=""
+                  this.vm.messageId=0
                 },
-                rightClick:()=>{
-                  if(this.vm.plantsId==0||this.vm.taskItemId==0||this.vm.clockDate==""||this.vm.clockTime==""){
+                rightClick: () => {
+                  if (this.vm.plantsId == 0 || this.vm.taskItemId == 0 || this.vm.clockDate == "" ||
+                    this.vm.clockTime == "") {
                     IBestToast.show({
-                      message:"请检查打卡项或打卡植物日期"
+                      message: "请检查打卡项或打卡植物日期"
                     })
                     return
                   }
 
-                  if(dayjs(this.vm.clockDate+" "+this.vm.clockTime).valueOf()>dayjs(new Date()).valueOf()){
+                  if (dayjs(this.vm.clockDate + " " + this.vm.clockTime).valueOf() > dayjs(new Date()).valueOf()) {
                     IBestToast.show({
-                      message:"打卡不得超过当前时间"
+                      message: "打卡不得超过当前时间"
                     })
                     return
                   }
-                  this.isShowMaintenanceBuilder=false
-                  const params:InsertClockParam={
-                    plantsId:this.vm.plantsId,
-                    itemId:this.vm.taskItemId,
-                    clockDate:this.vm.clockDate+" 00:00:00",
-                    clockTime:this.vm.clockDate+" "+this.vm.clockTime+":00"
+                  this.isShowMaintenanceBuilder = false
+                  const params: InsertClockParam = {
+                    plantsId: this.vm.plantsId,
+                    itemId: this.vm.taskItemId,
+                    clockDate: this.vm.clockDate + " 00:00:00",
+                    clockTime: this.vm.clockDate + " " + this.vm.clockTime + ":00",
+                    remark:this.vm.remark,
+                    messageId:this.vm.messageId
                   }
-                  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=""
+                  this.insertClockLog(params,this.vm.img,this.vm.taskItemName)
+                  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 = ""
+                  this.vm.remark=""
+                  this.vm.img=""
+                  this.vm.messageId=0
 
                 }
               })
 
             }.width('100%')
-            .margin({bottom:16})
+            .margin({ bottom: 16 })
 
-            Column({space:20}) {
+            Column({ space: 20 }) {
               Column() {
-                TaskItem({
-                  title:"打卡事项",
-                  TaskText:this.vm.taskItemName,
-                  swiperChange:()=>{
-                    this.vm.swiperController.changeIndex(1,true)
+                Stack({alignContent:Alignment.Center}) {
+                  Column() {
+                    TaskItem({
+                      title: "打卡事项",
+                      TaskText: this.vm.taskItemName,
+                      swiperChange: () => {
+                        this.vm.swiperController.changeIndex(1, true)
+                      }
+                    })
+                    TaskItem({
+                      title: "打卡植物",
+                      TaskText: this.vm.plantsName,
+                      swiperChange: () => {
+                        this.vm.swiperController.changeIndex(2, true)
+                      }
+                    })
                   }
-                })
-                TaskItem({
-                  title:"打卡植物",
-                  TaskText:this.vm.plantsName,
-                  swiperChange:()=>{
-                    this.vm.swiperController.changeIndex(2,true)
+                  if(this.vm.messageId!=0) {
+                    Column() {
+
+                    }.width('100%')
+                    .height(100)
+                    .onClick(()=>{
+                      IBestToast.show({
+                        message:"消息提醒打卡不可修改植物和事项"
+                      })
+                      return
+                    })
                   }
-                })
+                }
               }.backgroundColor('#F8F8F8')
-              .padding({left:10,right:10})
+              .padding({ left: 10, right: 10 })
               .borderRadius(12)
 
               Column() {
                 TaskItem({
-                  title:"打卡日期",
-                  TaskText:this.vm.clockDate,
-                  swiperChange:()=>{
-                    this.vm.swiperController.changeIndex(3,true)
+                  title: "打卡日期",
+                  TaskText: this.vm.clockDate,
+                  swiperChange: () => {
+                    this.vm.swiperController.changeIndex(3, true)
                   }
                 })
                 TaskItem({
-                  title:"打卡时间",
-                  TaskText:this.vm.clockTime,
-                  swiperChange:()=>{
-                    this.vm.swiperController.changeIndex(4,true)
+                  title: "打卡时间",
+                  TaskText: this.vm.clockTime,
+                  swiperChange: () => {
+                    this.vm.swiperController.changeIndex(4, true)
                   }
                 })
               }.backgroundColor('#F8F8F8')
-              .padding({left:10,right:10})
+              .padding({ left: 10, right: 10 })
               .borderRadius(12)
-              .onClick(()=>{
-                this.vm.swiperController.changeIndex(4,true)
+              .onClick(() => {
+                this.vm.swiperController.changeIndex(4, true)
 
               })
             }.width('100%')
 
 
-          }.width('100%')
+            TextArea({ placeholder: "您正在进行养护打卡,点击此处进行备注", text: this.vm.remark })
+              .width('100%')
+              .height(165)
+              .backgroundColor('#F8F8F8')
+              .borderRadius(12)
+              .placeholderColor('#4D333333')
+              .placeholderFont({ size: 14 })
+              .fontColor('#FF206D43')
+              .fontSize(16)
+              .margin({top:10,bottom:30})
+              .onChange((value)=>{
+                this.vm.remark=value
+              })
+
+          }
+          .width('100%')
           .height(530)
-          .padding({top:19,left:16,right:16})
+          .padding({ top: 19, left: 16, right: 16 })
           .backgroundColor(Color.White)
-          .borderRadius({topLeft:20,topRight:20})
-        //打卡事项swiper
-        SwiperCom({
-          swiperBuilder1:()=>{
-            this.SelectClockTask()
-          },
-          swiperBuilder2:()=>{
-            this.AddClockTask()
-          },
-          swiperBuilder3: () => { this.AddClockTaskAndSelectIcon() },
-          swiperComController:this.vm.swiperComController[0]
-        })
-        SwiperCom({
-          swiperBuilder1:()=>{
-            //选择打卡植物
-            this.SelectClockTaskGreenPlant()
-          },
-          swiperComController:this.vm.swiperComController[1]
-        })
-        SwiperCom({
-          swiperBuilder1:()=>{
-            //选择打卡日期
-            this.SelectDate()
-          },
-          swiperComController:this.vm.swiperComController[2]
-        })
-        SwiperCom({
-          swiperBuilder1:()=>{
-            //选择打卡时间
-            this.SelectTime()
-          },
-          swiperComController:this.vm.swiperComController[3]
-        })
-        TextArea({ placeholder:"您正在进行养护打卡,点击此处进行备注", text:"xxxx" }).width('100%')
-          .height(165)
-          .backgroundColor('#F8F8F8')
-          .borderRadius(12)
-          .placeholderColor('#4D333333')
-          .placeholderFont({size:14})
-          .fontColor('#FF206D43')
-          .fontSize(16)
+          .borderRadius({ topLeft: 20, topRight: 20 })
+
+          //打卡事项swiper
+          SwiperCom({
+            swiperBuilder1: () => {
+              this.SelectClockTask()
+            },
+            swiperBuilder2: () => {
+              this.AddClockTask()
+            },
+            swiperBuilder3: () => {
+              this.AddClockTaskAndSelectIcon()
+            },
+            swiperComController: this.vm.swiperComController[0]
+          })
+          SwiperCom({
+            swiperBuilder1: () => {
+              //选择打卡植物
+              this.SelectClockTaskGreenPlant()
+            },
+            swiperComController: this.vm.swiperComController[1]
+          })
+          SwiperCom({
+            swiperBuilder1: () => {
+              //选择打卡日期
+              this.SelectDate()
+            },
+            swiperComController: this.vm.swiperComController[2]
+          })
+          SwiperCom({
+            swiperBuilder1: () => {
+              //选择打卡时间
+              this.SelectTime()
+            },
+            swiperComController: this.vm.swiperComController[3]
+          })
 
-      }
-      .width('100%')
-      .height(530)
-      .autoPlay(false)
-      .indicator(false)
-      .disableSwipe(true)
-      .curve(Curve.EaseIn)
-      .duration(100)
 
+        }
+        .width('100%')
+        .height(530)
+        .autoPlay(false)
+        .indicator(false)
+        .disableSwipe(true)
+        .curve(Curve.EaseIn)
+        .duration(100)
 
+      }
 
     }.width('100%').backgroundColor(Color.Transparent)
   }
@@ -469,6 +534,7 @@ export struct MainView {
           //获取到打卡事项
           this.vm.taskItemId=task.itemId
           this.vm.taskItemName=task.itemName
+          this.vm.img=task.itemIcon
         },
         swiperChange:()=>{
           this.vm.swiperComController[0].changeIndex(1, true)

+ 9 - 7
features/feature/src/main/ets/view/SecondView.ets

@@ -5,6 +5,7 @@ import { GrowthApi } from "../api/GrowthApi"
 import { GrowthTaskItemInterface } from "../models/Second"
 import { DiaryData, PageStatus } from "../models"
 import { DateUtils } from "../utils/DateUtils"
+import { emitter } from "@kit.BasicServicesKit"
 
 @ComponentV2
 export struct SecondView {
@@ -303,13 +304,14 @@ export struct SecondView {
               .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()
-                    }
-                  });
+                  // yTRouter.pushPathByName("EditGreenPlantPage",-1,(result:PopInfo)=>{
+                  //   let ans=result.result as string
+                  //   if(ans&&ans=='true'){
+                  //     //刷新植物列表
+                  //     // this.getGrowthTaskList()
+                  //   }
+                  // });
+                  emitter.emit('toMain')
 
                 }else {
                   IBestToast.show({

+ 23 - 9
features/feature/src/main/ets/view/ThirdView.ets

@@ -1,4 +1,4 @@
-import { IBestToast, Pet, RDBMapper, RelationalStoreUtils, Test, YTCalendarPicker } from "basic";
+import { IBestToast, Pet, RDBMapper, RelationalStoreUtils, Test, YTCalendarPicker, yTToast, YTToast } from "basic";
 import dayjs from "dayjs";
 import { ClockTaskApi, InsertClockParam } from "../api/ClockTaskApi";
 import { GetRemindParams, RemindApi, RemindItem, RemindItemClass } from "../api/RemindApi";
@@ -23,11 +23,11 @@ export struct ThirdView {
 
   aboutToAppear(): void {
     const date=dayjs(new Date()).format('YYYY-MM-DD')
-    this.getRemindList({page:1,pageSizes:20,remindDate:date})
+    this.getRemindList({page:1,pageSizes:20,remindDate:date,isOpen:true})
     const yearMonth=dayjs(new Date()).format('YYYY-MM')
     this.getRed(yearMonth)
   }
-  async insertClockLog(vm:InsertClockParam){
+  async insertClockLog(vm:InsertClockParam,src:string,name:string){
     if(vm.plantsId==0||vm.itemId==0||vm.clockDate==""||vm.clockTime==""){
       IBestToast.show({
         message:"请检查打卡项或打卡植物日期"
@@ -45,12 +45,14 @@ export struct ThirdView {
       plantsId:vm.plantsId,
       itemId:vm.itemId,
       clockDate:vm.clockDate+" 00:00:00",
-      clockTime:vm.clockDate+" "+vm.clockTime+":00"
+      clockTime:vm.clockDate+" "+vm.clockTime+":00",
+      remark:""
     }
     await ClockTaskApi.insertClockLog(params).then((res)=>{
       if(res==true){
-        IBestToast.show({
-          message:'打卡成功'
+        yTToast.successConfirm({
+          src:src,
+          message:name
         })
       }
     })
@@ -62,7 +64,7 @@ export struct ThirdView {
       YTCalendarPicker({
         onClickItem:(date: Date)=>{
           const stringDate=dayjs(date).format('YYYY-MM-DD')
-          this.getRemindList({page:1,pageSizes:20,remindDate:stringDate})
+          this.getRemindList({page:1,pageSizes:20,remindDate:stringDate,isOpen:true})
         },
         updateRed:(year:string,month:string)=>{
           if(month.length==1){
@@ -115,8 +117,9 @@ export struct ThirdView {
                       itemId: item.itemId,
                       plantsId: item.plantsId,
                       clockDate: dayjs(new Date()).format('YYYY-MM-DD'),
-                      clockTime: dayjs(new Date()).format('HH:mm')
-                    })
+                      clockTime: dayjs(new Date()).format('HH:mm'),
+                      remark:""
+                    },item.itemIcon,item.itemName)
                   }
                 })
               }
@@ -135,12 +138,23 @@ export struct ThirdView {
             }
           })
         }.width('100%')
+        .layoutWeight(1)
       }
 
     }.height('100%')
     .padding({top:44,left:16,right:16})
     .justifyContent(FlexAlign.Start)
     .backgroundColor('#EAF3F2')
+    .onVisibleAreaChange([0, 1], (isExpanding: boolean, currentRatio: number) => {
+      if(isExpanding) {
+        const date=dayjs(new Date()).format('YYYY-MM-DD')
+        this.getRemindList({page:1,pageSizes:20,remindDate:date,isOpen:true})
+        const yearMonth=dayjs(new Date()).format('YYYY-MM')
+        this.getRed(yearMonth)
+      } else {
+        console.log("组件退了")
+      }
+    })
 
 
   }

+ 11 - 0
features/feature/src/main/ets/viewmodels/MainViewModel.ets

@@ -35,6 +35,17 @@ export class MainViewModel{
   clockDate:string=""
   @Trace
   clockTime:string=""
+  /**
+   * 备注
+   */
+  @Trace
+  remark:string=""
+
+  @Trace
+  img:string=""
+
+  @Trace
+  messageId:number=0
 
   /**
    * 新增事项

+ 3 - 1
products/entry/src/main/ets/entryability/EntryAbility.ets

@@ -10,7 +10,9 @@ const DOMAIN = 0x0000;
 
 export default class EntryAbility extends UIAbility {
   async onCreate(_: Want, __: AbilityConstant.LaunchParam) {
-    this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
+    // this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
+    this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT);
+
   }
 
   onDestroy(): void {

+ 10 - 0
products/entry/src/main/ets/pages/Index.ets

@@ -2,6 +2,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';
+import { emitter } from '@kit.BasicServicesKit';
 
 @Entry
 @Component
@@ -40,12 +41,21 @@ struct Index {
 
   aboutToAppear(): void {
     // 设置为 false 表示为单机 app
+    this.registerEmmiter()
     ContextHelper.init(this.getUIContext(), false)
     const id=setTimeout(()=>{
       GrowthApi.getUserInfo()
       clearTimeout(id)
     },100)
   }
+  //需要再其他页面控制tab导航切换
+  registerEmmiter(){
+    emitter.on('toMain',()=>{
+      this.currentIndex=0
+      this.tabsController.changeIndex(this.currentIndex)
+    })
+
+  }
   build() {
     Navigation(yTRouter) {
       Column() {