Explorar o código

feat: 初始化项目

YuJing hai 2 meses
pai
achega
81f5429628

+ 2 - 4
features/feature/Index.ets

@@ -1,8 +1,6 @@
-export { MainView } from './src/main/ets/view/MainView';
+export { RecodView as MainView } from './src/main/ets/view/RecodView';
 
-export { SecondView } from './src/main/ets/view/SecondView';
-
-export { ThirdView } from './src/main/ets/view/ThirdView';
+export { DiaryView as SecondView } from './src/main/ets/view/DiaryView';
 
 export { add } from './src/main/ets/utils/Calc';
 

+ 106 - 0
features/feature/src/main/ets/models/BasicDataSource.ets

@@ -0,0 +1,106 @@
+// 拿走即用
+export class BasicDataSource<T> implements IDataSource {
+  private listeners: DataChangeListener[] = [];
+  private dataArray: T[] = [];
+
+
+  // =============================================================
+  // ===================  框架侧调用  ==============================
+  // ===============  接口内部需实现的方法  ==========================
+  // =============================================================
+
+  // 该方法为框架侧调用,为LazyForEach组件向其数据源处添加listener监听
+  registerDataChangeListener(listener: DataChangeListener): void {
+    if (this.listeners.indexOf(listener) < 0) {
+      console.info('add listener');
+      this.listeners.push(listener);
+    }
+  }
+
+  // 该方法为框架侧调用,为对应的LazyForEach组件在数据源处去除listener监听
+  unregisterDataChangeListener(listener: DataChangeListener): void {
+    const pos = this.listeners.indexOf(listener);
+    if (pos >= 0) {
+      console.info('remove listener');
+      this.listeners.splice(pos, 1);
+    }
+  }
+
+  // =============================================================
+  // ===================  程序调用  ===============================
+  // =========== 整合 DataChangeListener 内部的方法 ================
+  // =============================================================
+
+  // 通知LazyForEach组件需要重载所有子组件
+  notifyDataReload(): void {
+    this.listeners.forEach(listener => {
+      listener.onDataReloaded();
+    })
+  }
+
+  // 通知LazyForEach组件需要在index对应索引处添加子组件
+  notifyDataAdd(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataAdd(index);
+    })
+  }
+
+  // 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件
+  notifyDataChange(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataChange(index);
+    })
+  }
+
+  // 通知LazyForEach组件需要在index对应索引处删除该子组件
+  notifyDataDelete(index: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataDelete(index);
+    })
+  }
+
+  // 通知LazyForEach组件将from索引和to索引处的子组件进行交换
+  notifyDataMove(from: number, to: number): void {
+    this.listeners.forEach(listener => {
+      listener.onDataMove(from, to);
+    })
+  }
+
+
+  // =============================================================
+  // ======================  修改数据源  ===========================
+  // ======================== 外部调用 =============================
+  // =============================================================
+  public totalCount(): number {
+    return this.dataArray.length;
+  }
+
+  public getData(index: number): T {
+    return this.dataArray[index];
+  }
+
+  // 在指定的索引处添加一个元素
+  public addData(index: number, data: T): void {
+    this.dataArray.splice(index, 0, data);
+    this.notifyDataAdd(index);
+  }
+
+  // 往监听列表内部添加元素
+  public pushData(data: T): void {
+    this.dataArray.push(data);
+    this.notifyDataAdd(this.dataArray.length - 1);
+  }
+
+  // 所有数据进行重新赋值
+  public reloadData(data: T[]) {
+    this.dataArray = data
+    this.notifyDataReload()
+  }
+
+  // 传入一个数组, 初始化监听列表
+  public init(datas: T[]) {
+    datas.forEach(i => {
+      this.pushData(i)
+    })
+  }
+}

+ 7 - 0
features/feature/src/main/ets/models/DateInfo.ets

@@ -0,0 +1,7 @@
+// 日期信息接口定义
+export interface DateInfo {
+  year: number;   // 年份
+  month: number;  // 月份(1-12)
+  day: number;    // 日期(1-31)
+  week: string;   // 星期(中文)
+}

+ 23 - 0
features/feature/src/main/ets/pages/DiaryDetailPage.ets

@@ -0,0 +1,23 @@
+import { YTAvoid } from 'basic'
+
+@Component
+struct DiaryDetailPage{
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop: number = 0
+
+  build(){
+    NavDestination(){
+      Column(){
+        Text("日记详情")
+      }
+    }
+
+  }
+}
+
+@Builder
+function DiaryDetailBuilder() {
+  NavDestination() {
+    DiaryDetailPage()
+  }
+  .hideTitleBar(true)
+}

+ 116 - 0
features/feature/src/main/ets/pages/DiarySearchPage.ets

@@ -0,0 +1,116 @@
+import { YTAvoid, yTRouter } from 'basic'
+import { LengthMetrics } from '@kit.ArkUI'
+
+
+@Component
+struct DiarySearchPage{
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop: number = 0
+
+  build(){
+    NavDestination(){
+      Column(){
+        // Title
+        Row({ space: 15 }){
+          Image($r("app.media.back"))
+            .width(20)
+            .aspectRatio(1)
+            .onClick(() => {
+              yTRouter.pop()
+            })
+
+          // 搜索框
+          Row({space: 15}){
+            Image($r("app.media.Search"))
+              .width(20)
+              .aspectRatio(1)
+
+            TextInput({ placeholder: "输入物品名称" })
+              .backgroundColor(Color.Transparent)
+              .height('100%')
+              .layoutWeight(1)
+              .fontSize(12)
+              .borderRadius(0)
+
+              // .placeholderFont("水果片")
+              // .placeholderColor()
+              .padding(0)
+              .caretColor('app.color.main_ac_color_dark')
+              // .enabled(this.isEnable)
+              .onSubmit(()=>{
+                // this.submit(this.searchValue)
+              })
+
+            Row(){
+              Text("确认")
+            }
+          }
+          .height(40)
+          .layoutWeight(1)
+          .borderRadius(5)
+          .backgroundColor("#D7D7D7")
+          .padding({ left: 10, right: 10 })
+          .alignItems(VerticalAlign.Center)
+        }
+        .width('100%')
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.SpaceBetween)
+
+        Column({space: 15}){
+          // 搜索历史
+          Row(){
+            Text("搜索历史")
+
+            Image($r('app.media.del'))
+              .width(20)
+              .aspectRatio(1)
+          }
+          .width("100%")
+          .justifyContent(FlexAlign.SpaceBetween)
+
+          if(false){
+            Flex({wrap: FlexWrap.Wrap, space: { main: new LengthMetrics(8), cross: new LengthMetrics(8)}}){
+              ForEach(new Array(10).fill(0), (item: number, index: number) => {
+                this.keyWordItem("测试关键字")
+              })
+            }
+          } else {
+            Column({ space: 5 }){
+              Image($r('app.media.Search'))
+                .width(80)
+                .aspectRatio(1)
+
+              Text("暂无搜索历史")
+            }
+            .width("100%")
+            .padding({ top: 100 })
+            .alignItems(HorizontalAlign.Center)
+
+          }
+
+        }
+        .width("100%")
+        .padding({ top: 22, left: 8, right: 8 })
+
+      }
+      .padding({ top: this.safeTop + 22, left: 8, right: 8 })
+    }
+  }
+
+  @Builder
+  keyWordItem(keyWord: string, id?: number){
+    Row(){
+      Text(keyWord)
+    }
+    .borderRadius(8)
+    .backgroundColor("#D7D7D7")
+    .padding({left: 8, right: 8, top: 8, bottom: 8})
+  }
+}
+
+@Builder
+function DiarySearchBuilder() {
+  NavDestination() {
+    DiarySearchPage()
+  }
+  .hideTitleBar(true)
+}

+ 142 - 0
features/feature/src/main/ets/pages/IncreaseDiaryPage.ets

@@ -0,0 +1,142 @@
+import { YTAvoid, yTRouter } from 'basic'
+import { photoAccessHelper } from '@kit.MediaLibraryKit';
+
+@Component
+struct IncreaseDiaryPage {
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop: number = 0
+
+  @State titleInfo: string = ""
+  @State imageList: string[] = []
+
+  /**
+   * 选择图片
+   */
+  async photoSelect(){
+    let uris: Array<string> = [];
+    let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
+    PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
+    PhotoSelectOptions.maxSelectNumber = 1;
+    let photoPicker = new photoAccessHelper.PhotoViewPicker();
+
+    let photoSelectResult: photoAccessHelper.PhotoSelectResult = await photoPicker.select(PhotoSelectOptions);
+    let photoList = photoSelectResult.photoUris;
+    if (photoList.length > 0) {
+      this.imageList.push(...photoList);
+    }
+  }
+
+  build() {
+    NavDestination() {
+      Column({ space: 5 }) {
+        Row() {
+          Image($r("app.media.close"))
+            .width(20)
+            .aspectRatio(1)
+            .onClick(()=>{
+              yTRouter.pop()
+            })
+
+          Text("创造")
+            .fontSize(20)
+            .fontWeight(700)
+
+          Text("完成")
+        }
+        .width("100%")
+        .justifyContent(FlexAlign.SpaceBetween)
+
+        Column({space: 5}) {
+          // 标题栏
+          Row() {
+            TextInput({ text: $$this.titleInfo, placeholder: "输入标题会更受欢迎(✪ω✪)" })
+              .backgroundColor(Color.Transparent)
+              .height('100%')
+              .layoutWeight(1)
+              .fontSize(20)
+              .borderRadius(0)
+              .placeholderFont({ size: 20, weight: FontWeight.Bold })
+              .placeholderColor("#BFBFBF")
+              .padding(0)
+              .maxLength(20)
+              .caretColor('app.color.main_ac_color_dark')
+              // .onChange((text: string) => {
+              //   this.titleInfo = text
+              // })
+
+            Text(`${20 - this.titleInfo.length}`)
+              .fontColor("#BFBFBF")
+          }
+          .height(50)
+          .border({
+            width: {
+              bottom: 0.1
+            },
+            color: 20 - this.titleInfo.length === 0 ? Color.Red : "#BFBFBF"
+          })
+
+          // 内容栏
+          TextArea({ placeholder: "记录此刻" })
+            .backgroundColor(Color.Transparent)
+            .height(450)
+            .width("100%")
+            .fontSize(16)
+            .borderRadius(0)
+            .placeholderFont({ size: 16 })
+            .placeholderColor("#BFBFBF")
+            .padding(0)
+            .caretColor('app.color.main_ac_color_dark')
+
+
+          // 时间选择器
+          Row(){
+            Text("这是一个时间选择器")
+          }
+
+          // 图片显示器
+          Row({space: 5}){
+            ForEach(this.imageList, (item: string, index: number) => {
+              Image(item)
+                .width(100)
+                .height(150)
+            })
+          }
+
+          // 图片选择器
+          Row(){
+            Row({space: 5}){
+              Image($r('app.media.photoAlbum'))
+                .width(20)
+                .aspectRatio(1)
+
+              Text("相册")
+                .fontSize(16)
+                .fontWeight(700)
+            }
+            .onClick(()=>{
+              this.photoSelect()
+            })
+          }
+          .width("100%")
+          .alignItems(VerticalAlign.Center)
+          .justifyContent(FlexAlign.End)
+
+        }
+        .alignItems(HorizontalAlign.Start)
+        .justifyContent(FlexAlign.Start)
+        .width("100%")
+        .layoutWeight(1)
+      }
+      .width("100%")
+      .height("100%")
+      .padding({ top: this.safeTop, left: 16, right: 16 })
+    }
+  }
+}
+
+@Builder
+function IncreaseDiaryBuilder() {
+  NavDestination() {
+    IncreaseDiaryPage()
+  }
+  .hideTitleBar(true)
+}

+ 37 - 0
features/feature/src/main/ets/utils/weekUtil.ets

@@ -0,0 +1,37 @@
+import { DateInfo } from "../models/DateInfo";
+
+// 星期中文映射表
+const WEEK_MAP = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
+
+/**
+ * 生成从指定日期开始的连续日期数组
+ * @param startDate 起始日期(默认当前日期)
+ * @param count 生成的日期数量(默认7天)
+ * @returns 日期对象数组
+ */
+export function generateDateArray(
+  startDate: Date = new Date(),
+  count: number = 7
+): DateInfo[] {
+  const dateArray: DateInfo[] = [];
+
+  // 复制起始日期,避免修改原对象
+  const currentDate = new Date(startDate);
+
+  for (let i = 0; i < count; i++) {
+    // 注意:月份从0开始,需要+1转为1-12
+    const month = currentDate.getMonth() + 1;
+
+    dateArray.push({
+      year: currentDate.getFullYear(),
+      month: month,
+      day: currentDate.getDate(),
+      week: WEEK_MAP[currentDate.getDay()]  // getDay()返回0-6(0=周日)
+    });
+
+    // 日期加1天
+    currentDate.setDate(currentDate.getDate() + 1);
+  }
+
+  return dateArray;
+}

+ 187 - 0
features/feature/src/main/ets/view/DiaryView.ets

@@ -0,0 +1,187 @@
+import { IBestToast, YTAvoid, yTRouter, yTToast } from "basic"
+import { ArrayList } from "@kit.ArkTS"
+import { yTDoubleConfirm } from "basic/src/main/ets/components/generalComp/YtDoubleConfirm";
+
+/**
+ * 日记页面
+ */
+@Component
+export struct DiaryView {
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop: number = 0
+
+  /**
+   * 增加日记
+   */
+  increaseDiary() {
+    yTRouter.pushPathByName("IncreaseDiaryPage", null);
+  }
+
+  /**
+   * 删除日记
+   * @param index
+   */
+  decreaseDiary(index: number){
+    yTToast.doubleConfirm({
+      text: "删除日记",
+      message: "确定删除日记吗?",
+      click: () => {
+        IBestToast.show({ message: '删除了日记' })
+        yTToast.hide()
+      }
+    })
+  }
+
+  /**
+   * 搜索日记
+   */
+  routerSearchPage(){
+    yTRouter.pushPathByName("DiarySearchPage", null)
+  }
+
+  /**
+   * 查看日记详情
+   * @param index 日记索引
+   */
+  routerDiaryDetail(index: number){
+
+  }
+
+  /**
+   * 打开日期选择器
+   */
+  openDatePicker(){
+
+  }
+
+  build() {
+    /**
+     * 1. 令日期作为 listGroup 可以方便进行跳转
+     * 2. 内部存在多个 listItem 时添加粘性标题
+     * 3.
+     */
+    Column() {
+      Row() {
+        Image($r("app.media.calendar"))
+          .width(30)
+          .aspectRatio(1)
+
+
+        Text("日记本")
+          .fontSize(20)
+
+        Image($r("app.media.Search"))
+          .width(30)
+          .aspectRatio(1)
+          .onClick(this.routerSearchPage)
+      }
+      .width("100%")
+      .justifyContent(FlexAlign.SpaceBetween)
+      .padding({ bottom: 10 })
+
+      Stack({ alignContent: Alignment.BottomEnd }) {
+        List({ space: 15 }) {
+          ForEach([0, 0, 0, 0, 0], (item: string, index: number) => {
+            ListItemGroup({
+              header: this.DiaryHead("2025/08/12"),
+            }) {
+              ForEach(new Array(10).fill(0), (title: string, i: number) => {
+                ListItem() {
+                  this.DiaryItem("每日一记", i)
+                }
+                .swipeAction({
+                  end: this.DiaryDel(i)
+                })
+              })
+            }
+          })
+        }
+        .width("100%")
+        .height("100%")
+        .scrollBar(BarState.Off)
+
+
+        // 增加日记按钮
+        Row() {
+          Image($r("app.media.add"))
+            .width(20)
+            .aspectRatio(1)
+        }
+        .onClick(this.increaseDiary)
+        .width(40)
+        .aspectRatio(1)
+        .border({
+          width: 1
+        })
+        .borderRadius(20)
+        .margin({ bottom: 16 })
+        .backgroundColor(Color.White)
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.Center)
+      }
+      .width("100%")
+      .layoutWeight(1)
+    }
+    .width("100%")
+    .height("100%")
+    .padding({ top: this.safeTop + 22, left: 16, right: 16 })
+  }
+
+  // 日记时间组 - 头部组件
+  @Builder
+  DiaryHead(time: string) {
+    Text(time)
+  }
+
+  // 日记条目组件
+  @Builder
+  DiaryItem(title: string, index: number) {
+    Column() {
+      Text(title)
+        .fontSize(20)
+    }
+    .height(60)
+    .width("100%")
+    .borderRadius(20)
+    .backgroundColor("#D7D7D7")
+    .alignItems(HorizontalAlign.Start)
+    .justifyContent(FlexAlign.Center)
+    .padding({
+      left: 16,
+      right: 16,
+      top: 8,
+      bottom: 8
+    })
+    .margin({ top: 5, bottom: 5 })
+    .gesture(
+      LongPressGesture()
+        .onAction((event: GestureEvent) => {
+          console.log("触发删除")
+          this.decreaseDiary(index)
+        })
+    )
+  }
+
+  // 日记条目删除组件
+  @Builder
+  DiaryDel(index: number) {
+    Row() {
+      Row(){
+        Text("删除")
+          .fontSize(16)
+          .fontColor(Color.White)
+      }
+      .width(60)
+      .height("100%")
+      .backgroundColor(Color.Red)
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .borderRadius({
+        topLeft: 20, bottomLeft: 20
+      })
+      .onClick(() => {
+        this.decreaseDiary(index)
+      })
+    }
+    .padding({left: 10})
+  }
+}

+ 0 - 6
features/feature/src/main/ets/view/MainView.ets

@@ -1,6 +0,0 @@
-@Component
-export struct MainView {
-  build() {
-    Text('1')
-  }
-}

+ 75 - 0
features/feature/src/main/ets/view/RecodView.ets

@@ -0,0 +1,75 @@
+import { YTAvoid } from "basic"
+import { BasicDataSource } from "../models/BasicDataSource"
+import { DateInfo } from "../models/DateInfo"
+
+/**
+ * 记录页面
+ */
+@Component
+export struct RecodView {
+  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY) bottom: number = 0
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop: number = 0
+
+  @State weekLoop: BasicDataSource<DateInfo> = new BasicDataSource()
+
+  private swiperController: SwiperController = new SwiperController();
+
+  private weeks: ResourceStr[] = [
+    $r('app.string.hm_calendar_sunday'),
+    $r('app.string.hm_calendar_monday'),
+    $r('app.string.hm_calendar_tuesday'),
+    $r('app.string.hm_calendar_wednesday'),
+    $r('app.string.hm_calendar_thursday'),
+    $r('app.string.hm_calendar_friday'),
+    $r('app.string.hm_calendar_saturday'),
+  ]
+
+
+  aboutToAppear(): void {
+    // this.swiperController.changeIndex(19)
+  }
+
+  build() {
+    Column(){
+      Row(){
+        Text("你的生活小计")
+          .fontSize(20)
+
+        Image($r("app.media.calendar"))
+          .width(30)
+          .aspectRatio(1)
+      }
+      .width("100%")
+      .justifyContent(FlexAlign.SpaceBetween)
+
+      /**
+       * 日历组件
+       * 1. 懒加载用上
+       * 2. 纵向list, 最右边(今天)作为列表头
+       * 3. 一次加载一个月数据(待定), 是否可以添加触底刷新机制(到已加载的第一天触发)
+       *
+       * question
+       * 1. 使用日历选择器选择的时间跨度 大于 30 天时,怎么加载?
+       *
+       */
+      Column(){
+        Swiper(this.swiperController){
+          ForEach(new Array(20).fill(0), (item: number, index: number) => {
+            Column() {
+              Text("星期")
+              Text("日期" + index.toString())
+            }
+          })
+        }
+        .loop(false)
+        .displayCount(7)
+        .direction(Direction.Rtl)
+        .indicator(false)
+      }
+
+    }
+    .width("100%")
+    .height("100%")
+    .padding({ top: this.safeTop + 22, left: 16, right: 16 })
+  }
+}

+ 0 - 6
features/feature/src/main/ets/view/SecondView.ets

@@ -1,6 +0,0 @@
-@Component
-export struct SecondView {
-  build() {
-    Text('2')
-  }
-}

+ 0 - 6
features/feature/src/main/ets/view/ThirdView.ets

@@ -1,6 +0,0 @@
-@Component
-export struct ThirdView {
-  build() {
-    Text('3')
-  }
-}

+ 156 - 0
features/feature/src/main/resources/base/element/string.json

@@ -3,6 +3,162 @@
     {
       "name": "shared_desc",
       "value": "description"
+    },
+    {
+      "name": "module_desc",
+      "value": "module description"
+    },
+    {
+      "name": "EntryAbility_desc",
+      "value": "description"
+    },
+    {
+      "name": "EntryAbility_label",
+      "value": "日历日程"
+    },
+    {
+      "name": "hm_calendar_monday",
+      "value": "一"
+    },
+    {
+      "name": "hm_calendar_tuesday",
+      "value": "二"
+    },
+    {
+      "name": "hm_calendar_wednesday",
+      "value": "三"
+    },
+    {
+      "name": "hm_calendar_thursday",
+      "value": "四"
+    },
+    {
+      "name": "hm_calendar_friday",
+      "value": "五"
+    },
+    {
+      "name": "hm_calendar_saturday",
+      "value": "六"
+    },
+    {
+      "name": "hm_calendar_sunday",
+      "value": "日"
+    },
+    {
+      "name": "hm_calendar_clocked",
+      "value": "已打卡"
+    },
+    {
+      "name": "hm_calendar_back",
+      "value": "回今天"
+    },
+    {
+      "name": "hm_calendar_month",
+      "value": "月"
+    },
+    {
+      "name": "hm_calendar_currentDay",
+      "value": "今天"
+    },
+    {
+      "name": "hm_calendar_measures",
+      "value": "措施"
+    },
+    {
+      "name": "hm_calendar_time",
+      "value": "时间"
+    },
+    {
+      "name": "hm_calendar_cancel",
+      "value": "取消"
+    },
+    {
+      "name": "hm_calendar_confirm",
+      "value": "确定"
+    },
+    {
+      "name": "reason_read_calendar",
+      "value": "读取日历"
+    },
+    {
+      "name": "reason_write_calendar",
+      "value": "写入日历"
+    },
+    {
+      "name": "message",
+      "value": "插入成功"
+    },
+    {
+      "name": "back",
+      "value": "回到首页"
+    },
+    {
+      "name": "showToast",
+      "value": "该功能尚在开发中"
+    },
+    {
+      "name": "title",
+      "value": "事项标题"
+    },
+    {
+      "name": "location",
+      "value": "地点"
+    },
+    {
+      "name": "priority",
+      "value": "优先级"
+    },
+    {
+      "name": "timePeriod",
+      "value": "事件时间段"
+    },
+    {
+      "name": "permission",
+      "value": "暂无权限,请申请后再次尝试"
+    },
+    {
+      "name": "success",
+      "value": "添加成功!"
+    },
+    {
+      "name": "calendar",
+      "value": "日历"
+    },
+    {
+      "name": "TIME",
+      "value": "开始时间须要早于结束时间!"
+    },
+    {
+      "name": "TITLE",
+      "value": "请输入标题!"
+    },
+    {
+      "name": "HEADING",
+      "value": "标题"
+    },
+    {
+      "name": "TITLE_ENTER",
+      "value": "请输入标题"
+    },
+    {
+      "name": "LOCATION_ENTER",
+      "value": "请输入地点"
+    },
+    {
+      "name": "DATE",
+      "value": "时间"
+    },
+    {
+      "name": "start",
+      "value": "开始"
+    },
+    {
+      "name": "end",
+      "value": "结束"
+    },
+    {
+      "name": "plan",
+      "value": "请输入日程说明或者计划"
     }
   ]
 }

+ 1 - 0
features/feature/src/main/resources/base/media/Search.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755065843022" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6253" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M415.59889935 818.40673751c-103.69194019 0-207.38388041-39.48836529-286.31642412-118.42090898-157.86508737-157.87981634-157.86508737-414.78248979 0-572.66230613 157.85035841-157.85035841 414.76776082-157.90927428 572.64757719 0 157.86508737 157.87981634 157.86508737 414.78248979 0 572.66230613-78.93254368 78.93254368-182.63921287 118.42090898-286.33115307 118.42090898z m0-725.22496474c-82.09927197 0-164.21327292 31.25487175-226.70828746 93.74988629-125.00475803 125.00475803-125.00475803 328.44127481 0 453.44603281 125.01948701 124.9753001 328.41181686 125.03421596 453.43130386 0 125.00475803-125.00475803 125.00475803-328.44127481 0-453.44603281-62.5097435-62.49501453-144.60901547-93.74988627-226.7230164-93.74988629z" fill="#2c2c2c" p-id="6254"></path><path d="M973.48804978 1013.69813456c-10.78160515 0-21.57793927-4.10938229-29.79670383-12.34287584L658.31757585 715.95203069c-16.46698708-16.46698708-16.46698708-43.14114955 0-59.60813666s43.14114955-16.46698708 59.60813665 0l285.37377009 285.38849908c16.46698708 16.46698708 16.46698708 43.14114955 0 59.60813663a42.07329932 42.07329932 0 0 1-29.81143281 12.35760482z" fill="#2c2c2c" p-id="6255"></path></svg>

+ 1 - 0
features/feature/src/main/resources/base/media/add.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755066395823" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7241" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.81 118c22.66 0 41.013 18.364 41.013 41.025l-0.001 311.96h312.153c22.661 0 41.025 18.356 41.025 41.017 0 22.66-18.364 41.013-41.025 41.013H552.822v311.957c0 22.663-18.351 41.028-41.011 41.028-22.662 0-41.017-18.365-41.017-41.028l-0.001-311.957H159.028c-22.663 0-41.028-18.352-41.028-41.013 0-22.661 18.365-41.017 41.028-41.017h311.765v-311.96c0-22.661 18.356-41.025 41.018-41.025z" fill="#191F39" p-id="7242"></path></svg>

+ 1 - 0
features/feature/src/main/resources/base/media/calendar.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755056081010" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6298" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M725.333333 170.666667h74.709334C864.853333 170.666667 917.333333 223.189333 917.333333 288.096V799.893333C917.333333 864.757333 864.832 917.333333 800.042667 917.333333H223.957333C159.146667 917.333333 106.666667 864.810667 106.666667 799.904V288.106667C106.666667 223.242667 159.168 170.666667 223.957333 170.666667H298.666667v-32a32 32 0 0 1 64 0v32h298.666666v-32a32 32 0 0 1 64 0v32z m0 64v32a32 32 0 0 1-64 0v-32H362.666667v32a32 32 0 0 1-64 0v-32h-74.709334A53.354667 53.354667 0 0 0 170.666667 288.096V799.893333A53.301333 53.301333 0 0 0 223.957333 853.333333h576.085334A53.354667 53.354667 0 0 0 853.333333 799.904V288.106667A53.301333 53.301333 0 0 0 800.042667 234.666667H725.333333z m-10.666666 224a32 32 0 0 1 0 64H309.333333a32 32 0 0 1 0-64h405.333334zM586.666667 618.666667a32 32 0 0 1 0 64H309.333333a32 32 0 0 1 0-64h277.333334z" fill="#000000" p-id="6299"></path></svg>

+ 1 - 0
features/feature/src/main/resources/base/media/close.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755073797641" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8374" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" p-id="8375"></path></svg>

+ 1 - 0
features/feature/src/main/resources/base/media/del.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755072542687" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7312" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" fill="#000000" p-id="7313"></path></svg>

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

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755075747828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9441" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M876.613818 861.090909a11.636364 11.636364 0 0 0 11.636364-11.636364v-674.90909a11.636364 11.636364 0 0 0-11.636364-11.636364h-721.454545a11.636364 11.636364 0 0 0-11.636364 11.636364v674.90909a11.636364 11.636364 0 0 0 11.636364 11.636364h721.454545z m0 69.818182h-721.454545a81.454545 81.454545 0 0 1-81.454546-81.454546v-674.90909a81.454545 81.454545 0 0 1 81.454546-81.454546h721.454545a81.454545 81.454545 0 0 1 81.454546 81.454546v674.90909a81.454545 81.454545 0 0 1-81.454546 81.454546z" p-id="9442"></path><path d="M129.256727 700.206545l-47.197091-51.432727 182.574546-167.493818a81.454545 81.454545 0 0 1 113.314909 3.072l158.673454 162.327273a11.636364 11.636364 0 0 0 15.965091 0.651636l94.138182-81.803636a81.454545 81.454545 0 0 1 107.822546 0.861091l191.627636 171.962181-46.615273 51.968-191.650909-171.985454a11.636364 11.636364 0 0 0-15.383273-0.116364l-94.138181 81.803637a81.454545 81.454545 0 0 1-111.685819-4.538182l-158.696727-162.327273a11.636364 11.636364 0 0 0-16.174545-0.442182l-182.574546 167.493818z" p-id="9443"></path><path d="M686.545455 337.454545m-58.181819 0a58.181818 58.181818 0 1 0 116.363637 0 58.181818 58.181818 0 1 0-116.363637 0Z" p-id="9444"></path></svg>

+ 10 - 1
features/feature/src/main/resources/base/profile/router_map.json

@@ -1,5 +1,14 @@
 {
   "routerMap": [
-
+    {
+        "name": "IncreaseDiaryPage",
+        "pageSourceFile": "src/main/ets/pages/IncreaseDiaryPage.ets",
+        "buildFunction": "IncreaseDiaryBuilder"
+    },
+    {
+      "name": "DiarySearchPage",
+      "pageSourceFile": "src/main/ets/pages/DiarySearchPage.ets",
+      "buildFunction": "DiarySearchBuilder"
+    }
   ]
 }

+ 4 - 11
products/entry/src/main/ets/pages/Index.ets

@@ -1,6 +1,6 @@
 import { BasicType, YTAvoid, yTRouter, yTToast } from 'basic';
 import { Mine } from 'user/src/main/ets/views/Mine';
-import { MainView, SecondView, ThirdView } from 'feature';
+import { MainView, SecondView } from 'feature';
 
 @Entry
 @Component
@@ -10,17 +10,12 @@ struct Index {
   //tabs展示内容
   contentList: BasicType<undefined>[] = [
     {
-      text: '日历',
+      text: '记录',
       src: $r('app.media.app_icon'),
       acSrc: $r('app.media.app_icon')
     },
     {
-      text: '黄历',
-      src: $r('app.media.app_icon'),
-      acSrc: $r('app.media.app_icon')
-    },
-    {
-      text: '卡片',
+      text: '日记',
       src: $r('app.media.app_icon'),
       acSrc: $r('app.media.app_icon')
     },
@@ -42,7 +37,7 @@ struct Index {
   build() {
     Navigation(yTRouter) {
       Column() {
-        Tabs({ controller: this.tabsController }) {
+        Tabs({ controller: this.tabsController, index: 1 }) {
           ForEach(this.contentList, (_: BasicType<undefined>, index) => {
             TabContent() {
               if (index == 0) {
@@ -51,8 +46,6 @@ struct Index {
               } else if (index == 1) {
                 SecondView()
               } else if (index == 2) {
-                ThirdView()
-              } else {
                 Mine()
               }
             }