Ver Fonte

日期排序时间排序

XUYangWei há 2 meses atrás
pai
commit
6c004b6c74
21 ficheiros alterados com 789 adições e 480 exclusões
  1. 1 1
      commons/basic/src/main/ets/apis/YTRequest.ets
  2. 1 1
      commons/basic/src/main/ets/apis/YTUserRequest.ets
  3. 1 1
      commons/basic/src/main/ets/utils/YTRouter.ets
  4. 32 1
      features/feature/src/main/ets/api/RemindApi.ets
  5. 53 0
      features/feature/src/main/ets/components/maincomponent/BindSheetTask/CustomNumberDay.ets
  6. 34 0
      features/feature/src/main/ets/components/maincomponent/BindSheetTask/TextPickerRemind.ets
  7. 29 0
      features/feature/src/main/ets/components/maincomponent/ButtonCom.ets
  8. 2 2
      features/feature/src/main/ets/components/maincomponent/DiaryTimePicker.ets
  9. 98 0
      features/feature/src/main/ets/components/maincomponent/RemindItemClassComp.ets
  10. 22 17
      features/feature/src/main/ets/components/maincomponent/TimeLineNode.ets
  11. 23 0
      features/feature/src/main/ets/constants/index.ets
  12. 341 408
      features/feature/src/main/ets/pages/EditGreenPlantPage.ets
  13. 0 0
      features/feature/src/main/ets/utils/ButtonCom.ets
  14. 52 0
      features/feature/src/main/ets/utils/dateListFormat.ets
  15. 27 29
      features/feature/src/main/ets/view/MainView.ets
  16. 64 8
      features/feature/src/main/ets/viewmodels/EditGreenPlantPageModel.ets
  17. 2 8
      features/feature/src/main/ets/viewmodels/MainViewModel.ets
  18. BIN
      features/feature/src/main/resources/base/media/main_icon_add_green_plants.png
  19. BIN
      features/feature/src/main/resources/base/media/main_icon_left.png
  20. 6 3
      features/user/src/main/ets/pages/DelPhotoPage.ets
  21. 1 1
      products/entry/src/main/module.json5

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

@@ -125,7 +125,7 @@ export class YTRequest {
   static uploadFile(fullpath: string, success?: (url: string) => void) {
     const formData = new FormData()
     formData.append('file', fullpath)
-    const promise = YTRequest.upPost<ReqString, FormData>('/common/upload', formData, {
+    const promise = YTRequest.upPost<ReqString, FormData>('/prod-plants/common/upload', formData, {
       headers: { 'Content-Type': 'multipart/form-data' },
       context: ContextHelper.context,
       onUploadProgress: (progressEvent: AxiosProgressEvent): void => {

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

@@ -195,7 +195,7 @@ export class YTUserRequest extends YTRequest {
   static uploadUserFile(context: Context, fullpath: string, success: (url: string) => void) {
     const formData = new FormData()
     formData.append('file', fullpath)
-    YTUserRequest.upPost<ReqString, FormData>('/common/upload', formData, {
+    YTUserRequest.upPost<ReqString, FormData>('/prod-plants/common/upload', formData, {
       headers: { 'Content-Type': 'multipart/form-data' },
       context,
       onUploadProgress: (progressEvent: AxiosProgressEvent): void => {

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

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

+ 32 - 1
features/feature/src/main/ets/api/RemindApi.ets

@@ -13,6 +13,7 @@ export interface InsertEditRemindParams{
   oaid?:string
   plantsId: number
   itemId: number
+  itemIcon: string,
   itemName: string
   repeatType: string
   remindDate: string
@@ -28,6 +29,7 @@ export interface RemindItem{
   plantsId:number,
   itemId:number, //	养护事项ID
   itemName:string,
+  itemIcon: string,
   remindDate:string, //	首次提醒日期
   remindTime:string, //提醒时间(HH:mm:ss)
   repeatType:string, //	周期类型: once, daily, weekly, monthly, custom
@@ -36,7 +38,36 @@ export interface RemindItem{
   monthlyDay:string, //每月几号(1~31),仅 monthly 使用
   isOpen:boolean //	是否开启提醒:0=否,1=是
 }
-
+@ObservedV2
+export class RemindItemClass{
+  settingId:string
+  plantsId:number
+  itemId:number //	养护事项ID
+  itemName:string
+  itemIcon: string
+  remindDate:string//	首次提醒日期
+  remindTime:string //提醒时间(HH:mm:ss)
+  repeatType:string //	周期类型: once, daily, weekly, monthly, custom
+  intervalDays:string  //	自定义间隔天数(仅当 repeat_type=custom 时有效)
+  weeklyWeekday:string //每周几(1=周一, 7=周日),仅 weekly 使用
+  monthlyDay:string //每月几号(1~31),仅 monthly 使用
+  @Trace
+  isOpen:boolean //	是否开启提醒:0=否,1=是
+  constructor(item:RemindItem) {
+    this.settingId=item.settingId
+    this.plantsId=item.plantsId
+    this.itemId=item.itemId
+    this.itemName=item.itemName
+    this.itemIcon=item.itemIcon
+    this.remindDate=item.remindDate
+    this.remindTime=item.remindTime
+    this.repeatType=item.repeatType
+    this.intervalDays=item.intervalDays
+    this.weeklyWeekday=item.weeklyWeekday
+    this.monthlyDay=item.monthlyDay
+    this.isOpen=item.isOpen
+  }
+}
 export class RemindApi{
   //更具植物id获取植物提醒设置列表
   static async getRemindList(params:GetRemindParams){

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

@@ -0,0 +1,53 @@
+@ComponentV2
+export struct CustomNumberDay{
+  @Param date:string="2025-01-01"
+  @Event nextSelectDate:()=>void=()=>{}
+  @Event confirm:(text:string)=>void=(text:string)=>{}
+
+  build() {
+    Column(){
+      Row({space:30}){
+        Text('自')
+        Text(this.date)
+          .fontColor('#206D43')
+          .fontSize(20)
+          .fontWeight(500)
+          .backgroundColor('#EAF3F2')
+          .padding({left:14,right:14,top:13,bottom:13})
+          .borderRadius(20)
+          .onClick(()=>{
+            this.nextSelectDate()
+
+          })
+        Text('起')
+
+      }.width('100%')
+      .justifyContent(FlexAlign.Center)
+      .margin({bottom:40})
+      Row({space:30}){
+        Text('每隔')
+        TextInput({text:"12"})
+          .width(80)
+          .maxLength(2)
+          .textAlign(TextAlign.Center)
+          .fontColor('#206D43')
+          .fontSize(20)
+          .type(InputType.Number)
+          .fontWeight(500)
+          .backgroundColor('#EAF3F2')
+          .padding({left:14,right:14,top:13,bottom:13})
+          .borderRadius(20)
+          .onChange((value)=>{
+            //
+            this.confirm(value)
+
+          })
+        Text('天')
+
+      }.width('100%')
+      .justifyContent(FlexAlign.Center)
+
+    }
+
+  }
+}

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

@@ -0,0 +1,34 @@
+import { LengthMetrics } from "@kit.ArkUI"
+
+@ComponentV2
+export struct TextPickerRemind{
+
+  @Param textList:string[]=[]
+
+  @Event backText:(text:string,index?:number)=>void=(text:string,index?:number)=>{}
+  build() {
+    Stack() {
+      Row(){}.width('100%').height(44).backgroundColor('#EAF3F2').borderRadius(12)
+      TextPicker({ range: this.textList,columnWidths: [LengthMetrics.percent(100)]})
+        .width('100%')
+        .layoutWeight(1)
+        .selectedIndex(0)
+        .textStyle({
+          color:'#9C9898',
+          font:{size:16,weight:600}
+        })
+        .selectedTextStyle({
+          color:'#206D43',
+          font:{size:20,weight:600}
+        })
+        .borderRadius(0) //设置平角
+        .divider(null)
+        .gradientHeight(30)
+        .onChange((value,index)=>{
+          this.backText(value as string,index as number)
+
+        })
+
+    }.width('100%')
+  }
+}

+ 29 - 0
features/feature/src/main/ets/components/maincomponent/ButtonCom.ets

@@ -0,0 +1,29 @@
+@ComponentV2
+export struct ButtonCom{
+  @Event isShowBuilder:()=>void=()=>{}
+  @Param text:string="养护打卡"
+  @Param marBottom:number=0
+  build() {
+    Column() {
+      Text(this.text.slice(0,2)).fontColor('#498552')
+      Text(this.text.slice(2,4)).fontColor('#498552')
+    }.backgroundColor('#EAFFED')
+    .padding({
+      left: 12,
+      right: 12,
+      top: 10,
+      bottom: 9
+    })
+    .border({
+      width: 2,
+      color: '#81B433'
+    })
+    .margin({right:20,bottom:this.marBottom})
+    .borderRadius('50%')
+    .onClick(()=>{
+      this.isShowBuilder()
+    })
+
+
+  }
+}

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

@@ -68,8 +68,8 @@ export struct DiaryTimePicker {
         .padding({left: 10, right:10})
         .borderRadius(36)
         .onClick(() => {
-          const formattedHour = ((this.selectedHour+1)%24).toString().padStart(2, '0');
-          const formattedMinute = ((this.selectedMinute+1)%60).toString().padStart(2, '0');
+          const formattedHour = ((this.selectedHour+4)%24).toString().padStart(2, '0');
+          const formattedMinute = ((this.selectedMinute+4)%60).toString().padStart(2, '0');
           const formattedTime = `${formattedHour}:${formattedMinute}`;
           this.onConfirm?.(formattedTime);
         })

+ 98 - 0
features/feature/src/main/ets/components/maincomponent/RemindItemClassComp.ets

@@ -0,0 +1,98 @@
+import dayjs from "dayjs"
+import { RemindItemClass } from "../../api/RemindApi"
+import { DateFrequency, FREQUENCY_WEEK } from "../../constants"
+import { DateUtils } from "../../utils/DateUtils"
+
+
+@ComponentV2
+export struct RemindItemClassComp{
+  @Param @Require  item:RemindItemClass
+  // @Local text:string="仅一次"
+  textTranslate(item:string){
+    if(item==DateFrequency.NONE){
+      return "仅一次"
+    }else if(item==DateFrequency.DAY){
+      return "每天"
+    }else if(item==DateFrequency.WEEK){
+      return "每周"+FREQUENCY_WEEK[this.item.weeklyWeekday]
+    }else if(item==DateFrequency.MONTH){
+      return "每月"+this.item.monthlyDay+"号"
+    }else // (item==DateFrequency.FREE){
+      return "每隔"+this.item.intervalDays+"天"
+  }
+  build() {
+    Row() {
+      Column({ space: 6 }) {
+        Image(this.item.itemIcon).width(50)
+        Text(this.item.itemName)
+      }
+      Blank()
+      Column({ space: 17 }) {
+        Row({ space: 15 }) {
+          Text('下次提醒')
+            .fontSize(14)
+            .fontWeight(500)
+            .fontColor('#206D43')
+          Text(dayjs(this.item.remindDate + "T" + this.item.remindTime).format('YYYY-MM-DD HH:mm'))
+            .fontSize(12)
+        }
+
+        Row({ space: 15 }) {
+          Text('提醒间隔')
+            .fontSize(14)
+            .fontWeight(500)
+            .fontColor('#206D43')
+          Text(this.textTranslate(this.item.repeatType))
+            .fontSize(12)
+        }
+      }.height('100%')
+      .justifyContent(FlexAlign.Start)
+      .alignItems(HorizontalAlign.Start)
+      .margin({ top: 20, right: 15 })
+
+      Row() {
+        Text()
+          .height('100%')
+          .aspectRatio(1)
+          .border({
+            width:4,
+            color:'#fff'
+          })
+          .backgroundColor('#206d43')
+          .borderRadius(20)
+      }
+      .padding(1)
+      .alignSelf(ItemAlign.End)
+      .width(39)
+      .aspectRatio(2)
+      .borderRadius(20)
+      .justifyContent(this.item.isOpen ? FlexAlign.End : FlexAlign.Start)
+      .backgroundColor(this.item.isOpen ? '#2a7853' : '#D9D9D9')
+      .onClick(() => {
+        animateTo({ duration: 200 }, () => {
+          this.item.isOpen = !this.item.isOpen
+        })
+      })
+
+    }
+    .width('100%')
+    .height(100)
+    .shadow({
+      radius: 10,
+      type: ShadowType.COLOR,
+      color: '#1A000000',
+      offsetX: 1,
+      offsetY: 1,
+      fill: false
+    })
+    .padding({
+      left: 15,
+      right: 15,
+      top: 11,
+      bottom: 11
+    })
+    .backgroundColor('#fff')
+    .borderRadius(12)
+
+  }
+}

+ 22 - 17
features/feature/src/main/ets/components/maincomponent/TimeLineNode.ets

@@ -16,13 +16,14 @@ export struct TimeLineNode {
   build() {
     Row() {
       Row({space:22}) {
-        Text(this.bean.nodeState==0?'今天':'17:18')
+        Text(this.bean.nodeTime)
           .fontSize(14)
+          .width(56)
           .textAlign(TextAlign.Center)
           .backgroundColor(this.bean.nodeState==0?'#EAF3F2':Color.Transparent)
-          .width(50)
           .borderRadius(5)
-          .padding(this.bean.nodeState==0?{left:10,right:10,top:4,bottom:4}:0)
+          .padding({top:4,bottom:4})
+          .translate({ y: -6 })
         Column() {
           // 时间轴节点
           Row()
@@ -45,24 +46,28 @@ export struct TimeLineNode {
       .justifyContent(FlexAlign.Center)
 
       // 内容区域
-      Column() {
-        Text(this.bean.nodeName)
-          .fontSize(14)
-          .fontColor('#000')
-          .fontWeight(FontWeight.Medium)
+      Row({space:10}) {
+        Image(this.bean.nodeImg).width(21)
+
+        Column() {
+          Text(this.bean.nodeName)
+            .fontSize(14)
+            .fontColor('#000')
+            .fontWeight(FontWeight.Medium)
 
-        Text(this.bean.nodeMessage)
-          .fontSize(12)
-          .fontWeight(FontWeight.Regular)
-          .fontColor('#000')
-          .margin({ top: 2 })
+          Text(this.bean.nodeMessage)
+            .fontSize(12)
+            .fontWeight(FontWeight.Regular)
+            .fontColor('#000')
+            .margin({ top: 2 })
+        }
+        .alignItems(HorizontalAlign.Start)
+        .width('84%')
+        .translate({ y: 2 })
       }
-      .alignItems(HorizontalAlign.Start)
-      .width('84%')
-      .translate({ y: 2 })
     }
     .alignItems(VerticalAlign.Top)
-    .justifyContent(FlexAlign.Center)
+    .justifyContent(FlexAlign.Start)
     .width('100%')
   }
 }

+ 23 - 0
features/feature/src/main/ets/constants/index.ets

@@ -0,0 +1,23 @@
+export const FrequencyList=['仅提醒一次','每天','每周','每月','自定义间隔天数']
+export const WeekList=['周一','周二','周三','周四','周五','周六','周日']
+export const MonthList=['1号','2号','3号','4号','5号','6号','7号','8号','9号','10号',
+  '11号','12号','13号','14号','15号','16号','17号','18号','19号','20号',
+  '21号','22号','23号','24号','25号','26号','27号','28号','29号','30号']
+
+export enum DateFrequency{
+  NONE='once', //默认
+  DAY='daily', //每天
+  WEEK='weekly', //每周
+  MONTH='monthly', //每月
+  FREE='custom' //自定义
+}
+export const FREQUENCY_WEEK: Record<string, string> = {
+  '1': '周一',
+  '2': '周二',
+  '3': '周三',
+  '4': '周四',
+  '5': '周五',
+  '6': '周六',
+  '7': '周日'
+}
+

Diff do ficheiro suprimidas por serem muito extensas
+ 341 - 408
features/feature/src/main/ets/pages/EditGreenPlantPage.ets


+ 0 - 0
features/feature/src/main/ets/utils/ButtonCom.ets


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

@@ -0,0 +1,52 @@
+import { ClockLog } from "../api/ClockTaskApi";
+import { OrderDetailBean } from "../components/maincomponent/TimeLineNode";
+
+//把后端养护记录变成我们想要渲染得数据
+export function formatClockData(originalData:ClockLog[]) {
+  if (!originalData || !Array.isArray(originalData)) return [];
+  let result = [] as OrderDetailBean[];
+  const today = new Date().toDateString();
+  const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000).toDateString();
+
+  let lastDateLabel = "";
+
+  originalData.forEach(item => {
+    const itemDate = new Date(item.clockDate);
+    const itemTime = new Date(item.clockTime);
+    const itemDateStr = itemDate.toDateString();
+
+    // 确定日期标签
+    let dateLabel = "";
+    if (itemDateStr === today) {
+      dateLabel = '今日';
+    } else if (itemDateStr === yesterday) {
+      dateLabel = '昨日';
+    } else {
+      // 超过两天显示日期,格式为 MM.DD
+      const month = itemDate.getMonth() + 1;
+      const day = itemDate.getDate();
+      dateLabel = `${month}.${day}`;
+    }
+
+    // 添加日期节点(如果与上一个不同)
+    if (dateLabel !== lastDateLabel) {
+      result.push({
+        nodeTime: dateLabel,
+        nodeState:0
+      } as OrderDetailBean);
+      lastDateLabel = dateLabel;
+    }
+
+    // 添加具体事项
+    const timeStr = itemTime.toTimeString().slice(0, 5); // 获取 HH:MM 格式
+    result.push({
+      nodeTime:timeStr,
+      nodeName:item.itemName,
+      nodeMessage:item.remark,
+      nodeImg:item.itemIcon,
+      nodeState:1
+    } as OrderDetailBean);
+  });
+
+  return result;
+}

+ 27 - 29
features/feature/src/main/ets/view/MainView.ets

@@ -1,4 +1,4 @@
-import { YTHeader, yTRouter, yTToast, YTToast } from 'basic'
+import { IBestToast, YTHeader, yTRouter, yTToast, YTToast } from 'basic'
 import { MainViewModel } from '../viewmodels/MainViewModel'
 import { SwiperCom } from '../components/maincomponent/SwiperCom'
 import { BuilderHeader } from '../components/maincomponent/BuilderHeader'
@@ -16,6 +16,7 @@ import { ClockTaskApi, ClockTaskIcon, ClockTaskItem,
 import { SelectIcon } from '../components/maincomponent/BindSheetTask/SelectIcon'
 import dayjs from "dayjs"
 import { promptAction } from '@kit.ArkUI'
+import { ButtonCom } from '../components/maincomponent/ButtonCom'
 
 @ComponentV2
 export struct MainView {
@@ -86,7 +87,6 @@ export struct MainView {
           List({ space: 16 }) {
             ForEach(this.greenPlantList, (item:GreenPlants,index:number) => {
               ListItem() {
-                Row() {
                   Row() {
                     Column() {
                       Image(item.plantsPicture).width(55).height(79)
@@ -113,10 +113,18 @@ export struct MainView {
                     }.justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
 
                     Blank()
-                    this.MaintenanceClockTextBuilder()
+                   ButtonCom({
+                     text:"养护打卡",
+                     isShowBuilder:()=>{
+                       this.isShowMaintenanceBuilder=true
+                     }
+                   })
                   }
                   .width('100%')
+                  .height(115)
                   .backgroundColor('#fff')
+                  .justifyContent(FlexAlign.Center)
+                  .alignItems(VerticalAlign.Center)
                   .borderRadius(12)
                   .padding({
                     left: 17,
@@ -124,7 +132,7 @@ export struct MainView {
                     right: 20,
                     bottom: 17
                   })
-                }.width('100%').onClick(()=>{
+                  .onClick(()=>{
                   yTRouter.pushPathByName("EditGreenPlantPage",item.plantsId,(result:PopInfo)=>{
                     let ans=result.result as string
                     if(ans&&ans=='true'){
@@ -148,7 +156,7 @@ export struct MainView {
         })
       }.width('100%').height('100%')
       Column() {
-        Image($r('app.media.startIcon')).width(30).height(30)
+        Image($r('app.media.main_icon_add_green_plants')).width(30).height(30)
       }
       .width(60)
       .height(60)
@@ -223,28 +231,6 @@ export struct MainView {
 
     })
   }
-  //养护打卡文字按钮builder
-  @Builder
-  MaintenanceClockTextBuilder(){
-    Column() {
-      Text('养护').fontColor('#498552')
-      Text('打卡').fontColor('#498552')
-    }.backgroundColor('#EAFFED')
-    .padding({
-      left: 12,
-      right: 12,
-      top: 10,
-      bottom: 9
-    })
-    .border({
-      width: 2,
-      color: '#81B433'
-    })
-    .borderRadius('50%')
-    .onClick(()=>{
-      this.isShowMaintenanceBuilder=!this.isShowMaintenanceBuilder
-    })
-  }
   @Builder
   MaintenanceClockBindSheetBuilder(){
     Column(){
@@ -259,12 +245,25 @@ export struct MainView {
                   this.isShowMaintenanceBuilder=false
                 },
                 rightClick:()=>{
+                  if(this.vm.plantsId==0||this.vm.taskItemId==0||this.vm.clockDate==""||this.vm.clockTime==""){
+                    IBestToast.show({
+                      message:"请检查打卡项或打卡植物日期"
+                    })
+                    return
+                  }
+
+                  if(dayjs(this.vm.clockDate+" "+this.vm.clockTime).valueOf()>dayjs(new Date()).valueOf()){
+                    IBestToast.show({
+                      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
+                    clockTime:this.vm.clockDate+" "+this.vm.clockTime+":00"
                   }
                   this.insertClockLog(params)
                 }
@@ -334,7 +333,6 @@ export struct MainView {
           swiperBuilder3: () => { this.AddClockTaskAndSelectIcon() },
           swiperComController:this.vm.swiperComController[0]
         })
-
         SwiperCom({
           swiperBuilder1:()=>{
             //选择打卡植物

+ 64 - 8
features/feature/src/main/ets/viewmodels/EditGreenPlantPageModel.ets

@@ -1,3 +1,5 @@
+import { DateFrequency } from "../constants"
+
 @ObservedV2
 export class EditGreenPlantPageModel{
   @Trace
@@ -10,17 +12,71 @@ export class EditGreenPlantPageModel{
     new SwiperController(),
   ]
 
+  //新增提醒间隔类型
   @Trace
   frequency:string=DateFrequency.NONE //默认一次
   // @Trace
   // siw:SwiperController=new SwiperController()
+  //提醒事项id
+  @Trace
+  remindTaskItemId:number=0
+  //提醒事项名称
+  @Trace
+  remindTaskName:string=""
+  //t提醒事项图标
+  @Trace
+  remindTaskUrl:string=""
+  //植物id,植物名称
+  @Trace
+  remindPlantsId:number=0
+  @Trace
+  remindPlantsName:string=""
+  // @Local
+  // clockDate:string=""
+  // @Local
+  // clockTime:string=""
+  /**
+   * 新增事项
+   */
+  @Trace taskName:string=""
+  @Trace taskUrl:string=""
+
+  /**
+   * 时间间隔
+   */
+  //时间
+  @Trace
+  time:string=""
+  //日期
+  @Trace
+  date:string=""
+  //间隔天数
+  @Trace
+  dayNumber:string=""
+  //每周几
+  @Trace
+  week:string=""
+  //每月几号
+  @Trace
+  mon:string=""
 
-}
 
-export enum DateFrequency{
-  NONE='once', //默认
-  DAY='every_day', //每天
-  WEEK='every_week', //每周
-  MONTH='every_month', //每月
-  FREE='time_day' //自定义
-}
+  /**
+   * 养护打卡方面
+   */
+  /**
+   * 新增打卡记录
+   */
+  @Trace
+  taskItemId:number=0
+  @Trace
+  taskItemName:string=""
+  @Trace
+  plantsId:number=0
+  @Trace
+  plantsName:string=""
+  @Trace
+  clockDate:string=""
+  @Trace
+  clockTime:string=""
+}

+ 2 - 8
features/feature/src/main/ets/viewmodels/MainViewModel.ets

@@ -1,3 +1,5 @@
+import { DateFrequency } from "../constants"
+
 @ObservedV2
 export class MainViewModel{
   @Trace
@@ -41,11 +43,3 @@ export class MainViewModel{
   @Trace taskUrl:string=""
 
 }
-
-export enum DateFrequency{
-  NONE='once', //默认
-  DAY='every_day', //每天
-  WEEK='every_week', //每周
-  MONTH='every_month', //每月
-  FREE='time_day' //自定义
-}

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


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


+ 6 - 3
features/user/src/main/ets/pages/DelPhotoPage.ets

@@ -50,6 +50,9 @@ struct DelPhotoPage {
   aboutToDisappear(): void {
     YTAvoid.setStatusBarContentColor('#FF000000', this.context)
   }
+  onBackPressUpdateData(ans:string='false'){
+    yTRouter.pop(ans,true)
+  }
 
   build() {
     Column() {
@@ -222,10 +225,10 @@ struct DelPhotoPage {
                   }
                   if (this.type == 'image') {
                     IBestToast.showLoading({ message: '上传中...' })
-                    YTRequest.uploadFile(fullpath, (url) => {
-                      emitter.emit('upLoadEnd', { data: url })
+                    YTUserRequest.uploadFile(fullpath, (url) => {
+                      // emitter.emit('upLoadEnd', { data: url })
+                      this.onBackPressUpdateData(url)
                       IBestToast.hide()
-                      yTRouter.routerBack()
                     })
                   }
 

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

@@ -51,7 +51,7 @@
 //    "metadata": [
 //      {
 //        "name": "client_id",
-//        "value": "6917573740100956853"
+//        "value": "6917585066777310024"
 //      }
 //    ],
     "extensionAbilities": [

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff