1
0

4 Commitit 3baa90e99e ... 758bb4b77f

Tekijä SHA1 Viesti Päivämäärä
  YuJing 758bb4b77f feat: 发布 4 viikkoa sitten
  YuJing 71deef8b45 fix:问题反馈、密码重置 2 kuukautta sitten
  YuJing 403ffdc397 fix:登录逻辑、文案、注销 2 kuukautta sitten
  YuJing 86aa2a363c feat: 修改在日记页面弹出的日历样式, 优化了部分UI和交互逻辑 2 kuukautta sitten

+ 3 - 3
build-profile.json5

@@ -5,11 +5,11 @@
         "name": "default",
         "material": {
           "storeFile": "sign/basic.p12",
-          "storePassword": "00000018037629724E3117C3F352DE651A3DA377F66B3425918FC935209E426802F107E5600A05AD",
+          "storePassword": "00000018FC016AA1E3ECD64C31A0649B5FD9D4AD724F5263B494BAA60F8C9C1EAA381608E8BF043B",
           "keyAlias": "yt112233",
-          "keyPassword": "000000189B8E05080F3748E674C733C8454FB661510188FD202AA49D0D43F39F8212FF3BA5AB3890",
+          "keyPassword": "00000018593106C120DED77AFB34294D94BF19C3E7EB8A44859B9F6702C56BCC918FC9F6E04BBE78",
           "signAlg": "SHA256withECDSA",
-          "profile": "sign/朝暮日记调试证书Debug.p7b",
+          "profile": "sign/朝暮日记调试证书DeBug.p7b",
           "certpath": "sign/调试证书.cer"
         }
       }

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

@@ -209,7 +209,7 @@ export class YTUserRequest extends YTRequest {
 
   // 用户注销账号
   static logout() {
-    YTUserRequest.post<null, null>(YTUserUrl.LOGIN_OUT)
+    YTRequest.post<null, null>(YTUserUrl.LOGIN_OUT)
       .then(() => {
         IBestToast.show("注销成功")
         userInfo.logout()

+ 2 - 2
commons/basic/src/main/ets/constants/index.ets

@@ -92,9 +92,9 @@ export enum YTUserUrl {
   /**
    * @description 保存问题反馈
    */
-  SAVE_QUESTION = `/diaryApUser/saveQuestion`,
+  SAVE_QUESTION = `/diaryBack/saveQuestion`,
   /**
    * @description 注销账号
    */
-  LOGIN_OUT = '/api/diaryApUser/member/logout'
+  LOGIN_OUT = '/diaryApUser/logout'
 }

+ 5 - 2
commons/basic/src/main/ets/models/LoginCollect.ets

@@ -9,7 +9,8 @@ export class LoginCollect {
   password?: string; // 密码(密码登录/注册/重置时使用)
   smsCode?: string; // 验证码(验证码登录/注册/重置时使用)
   confirmPassword?: string; // 确认密码(注册/重置时使用)
-  isAgreePrivacy: boolean = false; // 是否同意隐私政策
+  isAgreePrivacy: boolean = false; // 是否同意隐私政策\
+  isPassword: boolean = false; // 是否为密码登录
   private code?: string //华为登录code
   private operation: 'register' | 'reset' | 'login'; // 当前操作类型:注册/重置/登录
   private uuid?: string //验证码登录防伪标识
@@ -19,6 +20,7 @@ export class LoginCollect {
 
   constructor(registerOrReset: 'register' | 'reset' | 'login') {
     this.operation = registerOrReset
+    this.isPassword = registerOrReset == 'reset' ? true : false
     const storageUUID = AppStorage.get<string>(AppStorageKeyCollect.UUID)
     if (storageUUID) {
       this.uuid = storageUUID
@@ -223,7 +225,8 @@ export class LoginCollect {
     }
 
     // 场景分支:密码登录 或 验证码登录
-    if (this.password) {
+    // 补充: 必须是在密码登录状态下才校验密码的合法性
+    if (this.isPassword && this.password) {
       // 密码登录:校验密码非空
       if (!this.password.trim()) {
 

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

@@ -6,6 +6,6 @@ export class YTDate extends Date {
     const hours = date.getHours().toString().padStart(2, '0');
     const minutes = date.getMinutes().toString().padStart(2, '0');
     const seconds = date.getSeconds().toString().padStart(2, '0');
-    return `${year + separator + month + separator + day} ${hours}:${minutes}:${seconds}`;
+    return `${year + separator + month + separator + day}T${hours}:${minutes}:${seconds}`;
   }
 }

+ 194 - 0
features/feature/src/main/ets/components/DiaryCalendarPicker.ets

@@ -0,0 +1,194 @@
+import { DateInfo } from "../models/DateInfo";
+import { DateUtils, WEEK_MAP } from "../utils/DateUtils";
+
+@Component
+@CustomDialog
+export struct DiaryCalendarPicker {
+  // 年月
+  @State year: number = 2025;
+  @State month: number = 8;
+  // 开始是星期几
+  @State weekStart: number = 1;
+  // 本月的天数
+  @State daysInMonth: number = 31;
+  // 渲染用的月份数组
+  @State monthArray: DateInfo[] = [];
+  @State showDatePickerMenu: boolean = false
+  @State selectDay: Date = new Date()
+
+  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()]
+  private linearInfo: LinearGradientOptions = {
+    colors: [['#B9FD2A', 0.01], ['#F5FD6D', 1]],
+    angle: 110
+  }
+
+  // 取消
+  @Require onCancel: () => void = () => {}
+  // 确定
+  @Require onConfirm: (date: Date) => void = () => {}
+  // yy-mm-dd
+  @Require dateList: string[] = []
+
+  controll?: CustomDialogController
+
+  // 更改月份
+  changeMonth(year: number, month: number) {
+    // 1. 获取当前月份的天数
+    this.daysInMonth = DateUtils.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),
+      ...DateUtils.generateBackwardDateArray(new Date(year, month - 1, 1), this.daysInMonth, false)];
+
+    return this.monthArray
+  }
+
+  aboutToAppear(): void {
+    this.changeMonth(2025, 8);
+
+    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}) {
+      Row() {
+        // 时间选择
+        Row({ space: 8 }) {
+          Text(`${this.year}-${this.month.toString().padStart(2, '0')}`)
+            .fontSize(16)
+            .fontWeight(600)
+
+          Image($r('app.media.Diary_DateOpen'))
+            .width(14)
+            .height(8)
+        }
+        .onClick(() => {
+          this.showDatePickerMenu = true
+        })
+        .bindMenu(this.showDatePickerMenu, this.dateSelectMenu, {
+          onDisappear: () => {
+            this.showDatePickerMenu = 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
+        })
+
+        // 确认和取消
+        Row({ space: 14 }) {
+          Text("取消")
+            .borderRadius(36)
+            .backgroundColor('#F6F6F6')
+            .padding({left: 20, top: 5, right: 20, bottom: 5})
+            .onClick(this.onCancel)
+          Text("确认")
+            .borderRadius(36)
+            .linearGradient(this.linearInfo)
+            .padding({left: 20, top: 5, right: 20, bottom: 5})
+            .onClick(() => {
+              this.onConfirm(this.selectDay)
+            })
+        }
+      }
+      .width("100%")
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.SpaceBetween)
+
+      Row() {
+        ForEach(WEEK_MAP, (item: string, index: number) => {
+          Text(item)
+            .width(32)
+            .textAlign(TextAlign.Center)
+        })
+      }
+      .width("100%")
+      .justifyContent(FlexAlign.SpaceBetween)
+
+      Grid() {
+        ForEach(this.monthArray, (item: DateInfo, index: number) => {
+          GridItem() {
+            Column({space: 3}) {
+              if (item.id) {
+                Row() {
+                  Text(item.day + '')
+                    .fontSize(12)
+                    .fontColor(DateUtils.isSameDay(item.id, this.selectDay) ? Color.Black : '#979797')
+                }
+                .width(32)
+                .aspectRatio(1)
+                .borderRadius(8)
+                .linearGradient(DateUtils.isSameDay(item.id, this.selectDay) ? this.linearInfo : {
+                  colors: [['#F6F6F6', 1]],
+                })
+                .alignItems(VerticalAlign.Center)
+                .justifyContent(FlexAlign.Center)
+                .onClick(() => {
+                  this.selectDay = item.id
+                })
+
+                  Text()
+                    .width(4)
+                    .aspectRatio(1)
+                    .borderRadius(2)
+                    .linearGradient(this.dateList.indexOf(DateUtils.formatDateToCustomString(item.id, false)) !== -1 ? this.linearInfo : null)
+              } else {
+                Text('')
+                Text('')
+              }
+            }
+            .width(49)
+            .aspectRatio(1)
+            .alignItems(HorizontalAlign.Center)
+            .justifyContent(FlexAlign.Center)
+          }
+        })
+      }
+      .columnsTemplate('repeat(7, 1fr)')
+      .width("100%")
+    }
+    .width("100%")
+    .height(400)
+    .backgroundColor(Color.White)
+    .padding({left: 15, right: 15, top: 20, bottom: 4})
+  }
+
+  @Builder
+  private dateSelectMenu() {
+    Stack({ alignContent: Alignment.Center }) {
+      TextPicker({ range: this.range, selected: this.selectedIndex })
+        .selectedTextStyle({ color: '#FF353C46', font: { weight: 500, size: 16 } })
+        .defaultPickerItemHeight(36)
+        .divider(null)
+        .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)
+  }
+}

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

@@ -1,4 +1,3 @@
-import { font } from "@kit.ArkUI";
 
 // 日期选择器
 @Component

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

@@ -38,6 +38,7 @@ export struct DiaryTimePicker {
           this.selectedHour = hour;
           this.selectedMinute = minute;
 
+          // 保证swiper组件已经渲染
           setTimeout(() => {
             this.hourController.changeIndex(hour);
             this.minuteController.changeIndex(minute);

+ 57 - 45
features/feature/src/main/ets/pages/IncreaseDiaryPage.ets

@@ -1,4 +1,4 @@
-import { IBestToast, YTAvoid, yTRouter, yTToast } from 'basic'
+import { IBestToast, YTAvoid, yTRouter, yTToast } from 'basic';
 import { photoAccessHelper } from '@kit.MediaLibraryKit';
 import { DiaryDatePicker } from '../components/DiaryDatePicker';
 import { DiaryData, PageStatus, Variable } from '../models';
@@ -8,8 +8,6 @@ import { DiaryTimePicker } from '../components/DiaryTimePicker';
 import { RecodeViewModel } from '../viewModels/RecodeViewModel';
 import { DoubleConfirm } from '../components/DoubleConfirm';
 import { Context } from '@ohos.abilityAccessCtrl';
-import { common } from '@kit.AbilityKit';
-import image from '@ohos.multimedia.image';
 
 /**
  * 新增/编辑 日记
@@ -194,6 +192,13 @@ struct IncreaseDiaryPage {
     // 获取参数
     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 id = (params?.id ?? -1) as number;
     if (id != -1) {
@@ -219,8 +224,6 @@ struct IncreaseDiaryPage {
   async aboutToAppear(): Promise<void> {
     this.diaryData.diaryDate = DateUtils.formatDateToCustomString(new Date(), true, false)
     this.getRouterParams()
-
-    // TODO 在没有数据的时候 时间选择器的回显为 undefined
   }
 
   build() {
@@ -271,7 +274,9 @@ struct IncreaseDiaryPage {
                     .height(8)
                 }
                 .onClick(() => {
-                  this.showDatePicker = true
+                  if(!this.pageReadOnly){
+                    this.showDatePicker = true
+                  }
                 })
 
                 // 时间选择
@@ -287,7 +292,9 @@ struct IncreaseDiaryPage {
                   }
                 }
                 .onClick(() => {
-                  this.showTimePicker = true
+                  if(!this.pageReadOnly) {
+                    this.showTimePicker = true
+                  }
                 })
               }
               .width("100%")
@@ -296,18 +303,26 @@ struct IncreaseDiaryPage {
 
               // 标题栏
               Row() {
-                TextInput({ text: $$this.diaryData.title, placeholder: "输入标题会更受欢迎!" })
-                  .padding(0)
-                  .fontSize(16)
-                  .fontWeight(500)
-                  .maxLength(20)
-                  .height('100%')
-                  .layoutWeight(1)
-                  .borderRadius(0)
-                  .placeholderColor("#BFBFBF")
-                  .backgroundColor(Color.Transparent)
-                  .caretColor('app.color.main_ac_color_dark')
-                  .placeholderFont({ size: 16, weight: FontWeight.Bold })
+                if(!this.pageReadOnly) {
+                  TextInput({ text: $$this.diaryData.title, placeholder: "输入标题会更受欢迎!" })
+                    .padding(0)
+                    .fontSize(16)
+                    .fontWeight(500)
+                    .maxLength(20)
+                    .height('100%')
+                    .layoutWeight(1)
+                    .borderRadius(0)
+                    .placeholderColor("#BFBFBF")
+                    .backgroundColor(Color.Transparent)
+                    .caretColor('app.color.main_ac_color_dark')
+                    .placeholderFont({ size: 16, weight: FontWeight.Bold })
+                } else {
+                  Text(this.diaryData.title)
+                    .fontSize(16)
+                    .fontWeight(500)
+                    .layoutWeight(1)
+                }
+
 
                 Row(){
                   if(this.diaryData.title && !this.pageReadOnly){
@@ -337,22 +352,30 @@ struct IncreaseDiaryPage {
               // 内容栏
               List(){
                 ListItem(){
-                  TextArea({ text: $$this.diaryData.content, placeholder: "记录此刻" })
-                    .padding(0)
-                    .fontSize(14)
-                    .width("100%")
-                    .height("100%")
-                    .borderRadius(0)
-                    .fontWeight(400)
-                    .placeholderColor("#BFBFBF")
-                    .placeholderFont({ size: 16 })
-                    .backgroundColor(Color.Transparent)
-                    .caretColor('app.color.main_ac_color_dark')
+                  if(!this.pageReadOnly) {
+                    TextArea({ text: $$this.diaryData.content, placeholder: "记录此刻" })
+                      .padding(0)
+                      .fontSize(14)
+                      .width("100%")
+                      .height("100%")
+                      .borderRadius(0)
+                      .fontWeight(400)
+                      .placeholderColor("#BFBFBF")
+                      .placeholderFont({ size: 16 })
+                      .backgroundColor(Color.Transparent)
+                      .caretColor('app.color.main_ac_color_dark')
+                  } else {
+                    Text(this.diaryData.content)
+                      .width("100%")
+                      .fontSize(14)
+                      .fontWeight(400)
+                  }
                 }
               }
               .padding({top: 12})
               .layoutWeight(1)
               .width("100%")
+              .scrollBar(BarState.Off)
 
               Column({space: 32}){
                 // 图片显示器
@@ -399,7 +422,6 @@ struct IncreaseDiaryPage {
                   .justifyContent(FlexAlign.Center)
                   .padding({ top: 6, right: 18, bottom: 6, left: 18})
                   .onClick(() => {
-                    // this.clearPhoto()
                     this.diaryData.content = ''
                   })
 
@@ -417,7 +439,9 @@ struct IncreaseDiaryPage {
                   .linearGradient(this.linearInfo)
                   .padding({ top: 12, right: 16, bottom: 12, left: 16})
                   .onClick(()=>{
-                    this.photoSelect()
+                    if(!this.pageReadOnly) {
+                      this.photoSelect()
+                    }
                   })
                 }
                 .width("100%")
@@ -429,17 +453,6 @@ struct IncreaseDiaryPage {
             .width("100%")
             .height("100%")
 
-            // 当页面不可编辑时添加覆盖层
-            if(this.pageReadOnly) {
-              Row()
-                .width('100%')
-                .height('100%')
-                .backgroundColor(Color.Transparent) // 透明覆盖层
-                .onTouch((event: TouchEvent) => {
-                  event.stopPropagation() // 阻止触摸事件
-                })
-            }
-
             // 开启时间选择器
             if(this.showTimePicker){
               Column(){
@@ -510,8 +523,7 @@ struct IncreaseDiaryPage {
     }
     .hideTitleBar(true)
     .onBackPressed(() => {
-      console.log("返回"+this.pageReadOnly)
-      return this.onRouterBack.bind(this)
+      return this.onRouterBack()
     })
   }
 }

+ 58 - 25
features/feature/src/main/ets/utils/DateUtils.ets

@@ -1,30 +1,18 @@
 import { DateInfo } from "../models/DateInfo";
 
 // 星期中文映射表
-const WEEK_MAP = ['日', '一', '二', '三', '四', '五', '六'];
-
-/**
- * 创建一个日期信息对象
- * @param date 日期对象
- * @returns DateInfo 对象
- */
-function createDateInfo(date: Date): DateInfo {
-  const year = date.getFullYear();
-  const month = date.getMonth() + 1;
-  const day = date.getDate();
-  const week = WEEK_MAP[date.getDay()];
-
-  return {
-    year: year,
-    month: month,
-    day: day,
-    week: week,
-    id: new Date(date)
-  };
-}
+export const WEEK_MAP = ['日', '一', '二', '三', '四', '五', '六'];
+
 
 
 export class DateUtils {
+  /**
+   * 格式化日期对象为自定义字符串
+   * @param date 日期对象
+   * @param needTime 是否需要时间 ( 时、分、秒 )
+   * @param needSecond 是否需要秒
+   * @returns
+   */
   static formatDateToCustomString(date: Date, needTime: boolean = true, needSecond: boolean = true): string {
     // 转换为 YY-MM-DD HH:mm:ss 格式
     const year = date.getFullYear().toString();
@@ -38,6 +26,30 @@ export class DateUtils {
     return result;
   }
 
+  /**
+   * 获取指定月份的天数
+   * @param year 年
+   * @param month 月份
+   * @returns 当月的天数
+   */
+  static getDaysInMonth(year: number, month: number): number {
+    return new Date(year, month, 0).getDate();
+  }
+
+  /**
+   * 判断两个 Date 对象是否为同一天
+   * @param date1
+   * @param date2
+   * @returns
+   */
+  static isSameDay(date1: Date, date2: Date): boolean {
+    return (
+      date1.getFullYear() === date2.getFullYear() &&
+      date1.getMonth() === date2.getMonth() &&
+      date1.getDate() === date2.getDate()
+    );
+  }
+
   /**
    * 生成从指定日期开始向前的连续日期数组
    * @param startDate 起始日期(默认当前日期)
@@ -55,7 +67,7 @@ export class DateUtils {
 
     for (let i = 0; i < count; i++) {
       // 添加日期信息到数组
-      dateArray.push(createDateInfo(currentDate));
+      dateArray.push(DateUtils.createDateInfo(currentDate));
 
       // 日期减1天(向前)
       currentDate.setDate(currentDate.getDate() - 1);
@@ -72,7 +84,8 @@ export class DateUtils {
    */
   static generateBackwardDateArray(
     startDate: Date = new Date(),
-    count: number = 7
+    count: number = 7,
+    isCheck: boolean = true
   ): DateInfo[] {
     const dateArray: DateInfo[] = [];
 
@@ -88,12 +101,12 @@ export class DateUtils {
 
     for (let i = 0; i < count; i++) {
       // 检查当前日期是否超过今天
-      if (currentDate > today) {
+      if (isCheck && currentDate > today) {
         break;
       }
 
       // 添加日期信息到数组
-      dateArray.push(createDateInfo(currentDate));
+      dateArray.push(DateUtils.createDateInfo(currentDate));
 
       // 日期加1天(向后)
       currentDate.setDate(currentDate.getDate() + 1);
@@ -101,5 +114,25 @@ export class DateUtils {
 
     return dateArray;
   }
+
+  /**
+   * 创建一个日期信息对象
+   * @param date 日期对象
+   * @returns DateInfo 对象
+   */
+  static createDateInfo(date: Date): DateInfo {
+    const year = date.getFullYear();
+    const month = date.getMonth() + 1;
+    const day = date.getDate();
+    const week = WEEK_MAP[date.getDay()];
+
+    return {
+      year: year,
+      month: month,
+      day: day,
+      week: week,
+      id: new Date(date)
+    };
+  }
 }
 

+ 18 - 10
features/feature/src/main/ets/view/DiaryView.ets

@@ -1,4 +1,5 @@
 import { IBestToast, userInfo, UserInfo, YTAvoid, yTRouter, yTToast } from "basic"
+import { DiaryCalendarPicker } from "../components/DiaryCalendarPicker"
 import { DiaryTitleItem } from "../components/DiaryTitleItem"
 import { DoubleConfirm } from "../components/DoubleConfirm"
 import { LoginComponent } from "../components/LoginComponent"
@@ -76,14 +77,21 @@ export struct DiaryView {
    * 打开日期选择器
    */
   openDatePicker(){
-    CalendarPickerDialog.show({
-      selected: new Date(),
-      start: new Date('1970-01-10'),
-      end: new Date(DateUtils.formatDateToCustomString(new Date(), false)),
-      onAccept: (value) => {
-        this.toDiaryHead(value)
-      }
+    let controll: CustomDialogController = new CustomDialogController({
+      builder: DiaryCalendarPicker({
+        dateList: this.Vm.dateList,
+        onConfirm: (value) => {
+          this.toDiaryHead(value)
+          controll.close()
+        },
+        onCancel: () => {
+          controll.close()
+        }
+      }),
+      alignment: DialogAlignment.Center,
     })
+
+    controll.open()
   }
 
   /**
@@ -213,15 +221,15 @@ export struct DiaryView {
           // 增加日记按钮
           Row() {
             Image($r("app.media.add_Img"))
-              .width(40)
+              .width(50)
               .aspectRatio(1)
           }
           .onClick(() => {
             this.routerDiaryPage()
           })
-          .width(40)
+          .width(50)
           .aspectRatio(1)
-          .borderRadius(20)
+          .borderRadius(30)
           .margin({ bottom: 16 })
           .alignItems(VerticalAlign.Center)
           .justifyContent(FlexAlign.Center)

+ 11 - 4
features/feature/src/main/ets/view/RecodView.ets

@@ -1,11 +1,10 @@
-import { AppStorageKeyCollect, IBestToast, userInfo, UserInfo, YTAvoid, yTRouter } from 'basic'
+import { IBestToast, userInfo, UserInfo, YTAvoid, yTRouter } from 'basic'
 import { DateInfo } from '../models/DateInfo'
 import { RecodeViewModel } from '../viewModels/RecodeViewModel'
 import { DiaryDatePicker } from '../components/DiaryDatePicker'
 import { DiaryTimePicker } from '../components/DiaryTimePicker'
 import { DateUtils } from '../utils/DateUtils'
 import { DiaryData, PageStatus } from '../models'
-import { CollaborationCameraStateDialog } from '@hms.collaboration.camera'
 import { LoginComponent } from '../components/LoginComponent'
 
 /**
@@ -78,9 +77,17 @@ export struct RecodView {
    * @param id
    */
   routerAddNote(id?: number) {
+    // 产品要求:
+    // 1. 日期需要和上一级页面选择的日期保持一致。
+    let date: string = this.Vm.getSelectedDate().split(' ')[0]
+    // 2. 时间需要和当前时间保持一致。
+    let time: string = DateUtils.formatDateToCustomString(new Date(), true, false).split(' ')[1]
+    let ans: string = date + ' ' + time
+
     yTRouter.pushPathByName("IncreaseDiaryPage", {
       'id': id,
-      'PageStatus': PageStatus.RECODE
+      'PageStatus': PageStatus.RECODE,
+      'nowDate': new Date(ans).getTime(),
     } as Record<string, boolean | number | string>);
   }
 
@@ -402,7 +409,7 @@ export struct RecodView {
               .onClick(() => {
                 this.routerAddNote()
               })
-              .width(40)
+              .width(50)
               .aspectRatio(1)
               .borderRadius(20)
               .margin({ bottom: 16 })

+ 2 - 11
features/user/src/main/ets/pages/ChangePassword.ets

@@ -110,18 +110,9 @@ struct ChangePassWord{
               bottom: 9
             },
             click: () => {
+              // 手动同意下, 防止在重置密码时会弹出隐私协议
+              this.loginCollect.isAgreePrivacy = true
               this.loginCollect.executeLogin("common")
-              // if (!this.value) {
-              //   IBestToast.show({
-              //     type: "warning",
-              //     message: "昵称不能为空"
-              //   })
-              //   return
-              // }
-              // YTUserRequest.changeNickname(this.value, () => {
-              //   IBestToast.show({ message: '名称修改成功' })
-              //   this.showReviseName = false
-              // })
             }
 
           }).margin({ bottom: 142 })

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

@@ -44,7 +44,7 @@ struct LoginPage {
             .borderRadius(12)
             .backgroundColor('#4DFFFFFF')
             .margin({ bottom: 24, right: 28, top: 20 })
-          Text('HELLLO,\n欢迎来到朝暮日记')
+          Text('HELLO,\n欢迎来到朝暮日记')
             .lineHeight(40)
             .fontSize(28)
             .fontWeight(600)

+ 0 - 3
features/user/src/main/ets/pages/SettingPage.ets

@@ -114,9 +114,6 @@ struct SettingPage {
             yTToast.doubleConfirm({
               text: '警告⚠', message: '确定要注销吗?\n注销后数据可能丢失无法恢复!',
               click: () => {
-                userInfo.logout()
-                yTToast.hide()
-                yTRouter.routerBack()
                 YTUserRequest.logout()
               },
             })

+ 4 - 5
features/user/src/main/ets/views/LoginView.ets

@@ -9,7 +9,6 @@ import { CodeInputType } from '../models'
 @Component
 export struct LoginView {
   @State private loginCollect: LoginCollect = new LoginCollect('login')
-  @State private isPassword: boolean = false
   private inputCaptchaType: CodeInputType = {
     txt: '验证码',
     placeHolder: '请输入验证码'
@@ -53,7 +52,7 @@ export struct LoginView {
           this.loginCollect.phonenumber = value
         }
       })
-      if (this.isPassword) {
+      if (this.loginCollect.isPassword) {
         LoginInput({
           item: this.inputPasswordType,
           inputData: this.loginCollect.password,
@@ -85,13 +84,13 @@ export struct LoginView {
       })
 
       Row() {
-        if (!this.isPassword) {
+        if (!this.loginCollect.isPassword) {
           Text('密码登录')
             .fontColor($r('[basic].color.main_blank'))
             .fontSize(12)
             .fontWeight(700)
             .onClick(() => {
-              this.isPassword = true
+              this.loginCollect.isPassword = true
             })
           Blank()
         } else {
@@ -100,7 +99,7 @@ export struct LoginView {
             .fontWeight(700)
             .fontSize(12)
             .onClick(() => {
-              this.isPassword = false
+              this.loginCollect.isPassword = false
             })
           Blank()
           Text('忘记密码?')

BIN
sign/朝暮日记发布证书Release.p7b