Prechádzať zdrojové kódy

feat: 完成学生页面下的 静态UI 和 相对应的交互逻辑。
完善 app 内部的图标的更换

YuJing 3 mesiacov pred
rodič
commit
e26fc6d4fb
44 zmenil súbory, kde vykonal 659 pridanie a 67 odobranie
  1. BIN
      AppScope/resources/base/media/app_icon.png
  2. BIN
      AppScope/resources/base/media/background.png
  3. BIN
      AppScope/resources/base/media/foreground.png
  4. 1 1
      commons/basic/src/main/ets/utils/YTRouter.ets
  5. 2 1
      features/feature/Index.ets
  6. 21 0
      features/feature/src/main/ets/components/EmptyComp.ets
  7. 5 2
      features/feature/src/main/ets/components/YtComp/_YtHeader.ets
  8. 3 0
      features/feature/src/main/ets/model/RouterModel.ets
  9. 139 0
      features/feature/src/main/ets/pages/IncreaseStudentPage.ets
  10. 0 0
      features/feature/src/main/ets/pages/otherPage/EntryPage.ets
  11. 164 0
      features/feature/src/main/ets/pages/otherPage/MinePage.ets
  12. 0 0
      features/feature/src/main/ets/pages/otherPage/PrivacyPage.ets
  13. 1 1
      features/feature/src/main/ets/pages/otherPage/YTNaviDiaLog.ets
  14. 14 0
      features/feature/src/main/ets/utils/RouterUtils.ets
  15. 6 0
      features/feature/src/main/ets/view/FiveView.ets
  16. 6 0
      features/feature/src/main/ets/view/FourView.ets
  17. 159 47
      features/feature/src/main/ets/view/MainView.ets
  18. 54 0
      features/feature/src/main/ets/viewModel/IncreaseStudentPage.ets
  19. 57 0
      features/feature/src/main/ets/viewModel/MainViewModel.ets
  20. BIN
      features/feature/src/main/resources/base/media/..png
  21. BIN
      features/feature/src/main/resources/base/media/icon_aboutMine.png
  22. BIN
      features/feature/src/main/resources/base/media/icon_del.png
  23. BIN
      features/feature/src/main/resources/base/media/icon_edit.png
  24. BIN
      features/feature/src/main/resources/base/media/icon_setting.png
  25. BIN
      features/feature/src/main/resources/base/media/icon_shar.png
  26. BIN
      features/feature/src/main/resources/base/media/icon_suggestion.png
  27. BIN
      features/feature/src/main/resources/base/media/img_BoyHead.png
  28. BIN
      features/feature/src/main/resources/base/media/img_GirHead.png
  29. BIN
      features/feature/src/main/resources/base/media/right_arrow.png
  30. 11 3
      features/feature/src/main/resources/base/profile/router_map.json
  31. 16 12
      products/entry/src/main/ets/pages/Index.ets
  32. BIN
      products/entry/src/main/resources/base/media/background.png
  33. BIN
      products/entry/src/main/resources/base/media/foreground.png
  34. BIN
      products/entry/src/main/resources/base/media/icon_classSchedule.png
  35. BIN
      products/entry/src/main/resources/base/media/icon_classSchedule_.png
  36. BIN
      products/entry/src/main/resources/base/media/icon_list.png
  37. BIN
      products/entry/src/main/resources/base/media/icon_list_.png
  38. BIN
      products/entry/src/main/resources/base/media/icon_roll.png
  39. BIN
      products/entry/src/main/resources/base/media/icon_roll_.png
  40. BIN
      products/entry/src/main/resources/base/media/icon_stat.png
  41. BIN
      products/entry/src/main/resources/base/media/icon_stat_.png
  42. BIN
      products/entry/src/main/resources/base/media/icon_student.png
  43. BIN
      products/entry/src/main/resources/base/media/icon_student_.png
  44. BIN
      products/entry/src/main/resources/base/media/startIcon.png

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


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


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


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

@@ -116,7 +116,7 @@ class YTRouter extends NavPathStack {
     let p: DiaLogParam = {
       pageEnum: DiaLogPageEnum.Confirm,
       param: param,
-      align: YTDiaLogModel.Bottom
+      align: YTDiaLogModel.Center
     }
     this.router2NaviDiaLog(p, back)
   }

+ 2 - 1
features/feature/Index.ets

@@ -3,6 +3,7 @@ export { MainView } from './src/main/ets/view/MainView';
 export { SecondView } from './src/main/ets/view/SecondView';
 
 export { ThirdView } from './src/main/ets/view/ThirdView';
-
+export { FourView } from './src/main/ets/view/FourView';
+export { FiveView } from './src/main/ets/view/FiveView';
 export { add } from './src/main/ets/utils/Calc';
 

+ 21 - 0
features/feature/src/main/ets/components/EmptyComp.ets

@@ -0,0 +1,21 @@
+@ComponentV2
+export struct EmptyComp {
+  @Require @BuilderParam _c: () => void
+  @Require @Param isEmpty: boolean = false
+
+  build() {
+    Column() {
+      if(this.isEmpty) {
+        Text('——暂无数据——')
+          .fontSize(18)
+          .fontColor('#BFBFBF')
+      } else {
+        this._c()
+      }
+    }
+    .width('100%')
+    .height('100%')
+    .alignItems(HorizontalAlign.Center)
+    .justifyContent(FlexAlign.Center)
+  }
+}

+ 5 - 2
features/feature/src/main/ets/components/YtComp/_YtHeader.ets

@@ -1,3 +1,5 @@
+import { yTRouter } from "basic"
+
 /**
  * @description 仿 YtHeader, 防止在 V2 装饰器下报错
  */
@@ -6,11 +8,12 @@ export struct _YtHeader {
   @Param isShowBackComp: boolean = true
   @Param @Require title: string
   @Param _h: Length = 54
+  @Param _padding: Length = 16
 
   @BuilderParam rightComp: () => void
   @BuilderParam leftComp: () => void
 
-  @Event _onBackPress: () => void = () => {}
+  @Event _onBackPress: () => void = () => { yTRouter.pop() }
   @Event _onClickTitle: () => void = () => {}
   @Event _onClickRightComp: () => void = () => {}
 
@@ -56,6 +59,6 @@ export struct _YtHeader {
       }
       .width("100%")
       .height(this._h)
-      .padding({top: 12, bottom: 12})
+      .padding({ top: 12, bottom: 12, left: this._padding, right: this._padding })
   }
 }

+ 3 - 0
features/feature/src/main/ets/model/RouterModel.ets

@@ -0,0 +1,3 @@
+export interface IncreaseStudentPageModel{
+  id?: string
+}

+ 139 - 0
features/feature/src/main/ets/pages/IncreaseStudentPage.ets

@@ -0,0 +1,139 @@
+import { _YtHeader } from '../components/YtComp/_YtHeader';
+import { IncreaseStudentPageViewModel } from '../viewModel/IncreaseStudentPage';
+import { cert } from '@kit.DeviceCertificateKit';
+
+@ComponentV2
+struct IncreaseStudentPage {
+  @Local vm: IncreaseStudentPageViewModel = new IncreaseStudentPageViewModel();
+
+  build() {
+    NavDestination() {
+      Column({space: 25}) {
+        _YtHeader({
+          title: this.vm.title,
+          _onBackPress: () => { this.vm._onBackPressed() },
+          _padding: 0
+        })
+
+        Column(){
+          Column(){
+            Row(){
+              Text('姓名')
+
+              TextInput({text: $$this.vm.name, placeholder: '请输入姓名'})
+                .width(100)
+                .border(null)
+                .fontSize(14)
+                .padding({ left: 10 })
+                .textAlign(TextAlign.End)
+                .placeholderColor('#BFBFBF')
+                .placeholderFont({ size: 14 })
+                .backgroundColor(Color.Transparent)
+            }
+            .width("100%")
+            .padding({top: 20, bottom: 20})
+            .justifyContent(FlexAlign.SpaceBetween)
+
+            Divider()
+              .height(1)
+              .width("100%")
+              .backgroundColor('#F6F6F6')
+
+            Row(){
+              Text('性别')
+
+              Row({space:5}){
+                Text(){
+                  if(this.vm.gender) {
+                    Span(this.vm.gender)
+                  } else {
+                    Span('请选择')
+                      .fontColor('#BFBFBF')
+                  }
+                }
+                .fontSize(14)
+
+                Image($r('[basic].media.ic_back'))
+                  .width(20)
+                  .rotate({angle: 270})
+                  .aspectRatio(1)
+              }
+              .bindMenu(this.genderEnum)
+            }
+            .width("100%")
+            .padding({top: 20, bottom: 20})
+            .justifyContent(FlexAlign.SpaceBetween)
+          }
+          .width('98%')
+          .borderRadius(15)
+          .backgroundColor(Color.White)
+          .padding({left: 18, right: 18})
+          .shadow({ radius: 6, color: '#1a000000' })
+
+          Row({space: 31}){
+            Text('取消')
+              .borderRadius(10)
+              .backgroundColor('#BFBFBF')
+              .padding({ left: 50, right: 50, top: 15, bottom: 15})
+              .onClick(() => { this.vm._onBackPressed() })
+
+            Text('保存')
+              .borderRadius(10)
+              .backgroundColor('#7186F9')
+              .padding({ left: 50, right: 50, top: 15, bottom: 15})
+              .onClick(() => { this.vm._onSave() })
+          }
+          .width('100%')
+          .justifyContent(FlexAlign.Center)
+        }
+        .width("100%")
+        .layoutWeight(1)
+        .justifyContent(FlexAlign.SpaceBetween)
+        .padding({ bottom: this.vm.safeBottom + 50 })
+      }
+      .width('100%')
+      .height('100%')
+      .backgroundColor('#F6F6F6')
+      .padding({ left:16, right:16, top: this.vm.safeTop})
+      .justifyContent(FlexAlign.Start)
+      .alignItems(HorizontalAlign.Center)
+    }
+    .hideTitleBar(true)
+    .onBackPressed(() => { return this.vm._onBackPressed() })
+  }
+
+  @Builder
+  genderEnum(){
+    Column() {
+      Row({space:34}){
+        Text('男')
+        Radio({group: 'sex', value: '男'})
+          .checked(this.vm.gender == '男')
+          .onChange(() => { this.vm._onGenderChange('男') })
+      }
+      .padding({ top: 10, bottom: 10})
+      .onClick(() => { this.vm._onGenderChange('男') })
+
+      Divider()
+        .height(1.5)
+        .width("100%")
+        .backgroundColor('#F6F6F6')
+
+      Row({space:34}){
+        Text('女')
+        Radio({group: 'sex', value: '女'})
+          .checked(this.vm.gender == '女')
+          .onChange(() => { this.vm._onGenderChange('女') })
+      }
+      .padding({ top: 10, bottom: 10})
+      .onClick(() => { this.vm._onGenderChange('女') })
+    }
+    .width(105)
+    .padding({left: 11, right: 11, top: 6, bottom: 6})
+  }
+}
+
+@Builder
+function IncreaseStudentPageBuilder() {
+  IncreaseStudentPage()
+}

+ 0 - 0
features/feature/src/main/ets/pages/EntryPage.ets → features/feature/src/main/ets/pages/otherPage/EntryPage.ets


+ 164 - 0
features/feature/src/main/ets/pages/otherPage/MinePage.ets

@@ -0,0 +1,164 @@
+import { BasicType, IBestToast, userInfo, UserInfo, YTAvoid, YTLog, yTRouter } from 'basic'
+import { common, Want } from '@kit.AbilityKit'
+import { BusinessError } from '@kit.BasicServicesKit'
+import { BUNDLE_NAME } from 'BuildProfile'
+import { systemShare } from '@kit.ShareKit'
+import { uniformTypeDescriptor } from '@kit.ArkData'
+import { _YtHeader } from '../../components/YtComp/_YtHeader'
+
+@ComponentV2
+export struct MinePage {
+  @Local safeTop: number = 0
+  setArr: Array<BasicType> = [
+    {
+      text: '分享给好友',
+      message: '去分享',
+      click: () => {
+        this.shareData()
+      },
+      src: $r('app.media.right_arrow'),
+      acSrc: $r('app.media.icon_shar')
+    },
+    {
+      text: '意见反馈',
+      click: () => {
+        yTRouter.router2SuggestionPage()
+      },
+      src: $r('app.media.right_arrow'),
+      acSrc: $r('app.media.icon_suggestion')
+    },
+    {
+      text: '给个好评',
+      click: () => {
+        const want: Want = {
+          uri: "store://appgallery.huawei.com/app/detail?id=" + BUNDLE_NAME
+        };
+        const context = this.getUIContext().getHostContext() as common.UIAbilityContext;
+        context.startAbility(want).then(() => {
+          //拉起成功
+          YTLog.info('跳转成功')
+        }).catch((err: BusinessError) => {
+          // 拉起失败
+          YTLog.error(err)
+          IBestToast.show('出现未知错误,请稍后再试')
+        });
+      },
+      src: $r('app.media.right_arrow'),
+      acSrc: $r('app.media.icon_shar')
+
+    },
+    {
+      text: '关于我们',
+      click: () => {
+        yTRouter.router2AboutUS()
+      },
+      src: $r('app.media.right_arrow'),
+      acSrc: $r('app.media.icon_aboutMine')
+    }
+  ]
+
+  aboutToAppear(): void {
+    this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
+  }
+
+  build() {
+    NavDestination(){
+      Column() {
+        _YtHeader({
+          title: ''
+        })
+
+        Column({space: 12}){
+          Image($r('app.media.app_icon'))
+            .width(100)
+            .aspectRatio(1)
+            .borderRadius(12)
+
+          Text($r('app.string.app_name'))
+            .fontSize(18)
+            .fontWeight(500)
+        }
+        .padding({ bottom: 28, top: 16})
+
+        Column() {
+          List({space: 15}) {
+            ForEach(this.setArr, (item: BasicType, index) => {
+              ListItem() {
+                Row() {
+                  Row({space: 23}){
+                    Image(item.acSrc)
+                      .width(22)
+                      .aspectRatio(1)
+
+                    Text(item.text)
+                      .fontColor('#FF1C1C1C')
+                      .fontSize(14)
+                  }
+                  if (!index) {
+                    Text('去分享')
+                      .fontColor('#801C1C1C')
+                      .fontSize(14)
+                      .fontWeight(400)
+                  } else {
+                    Image($r('app.media.right_arrow'))
+                      .width(24)
+                      .aspectRatio(1)
+                  }
+                }
+                .width('100%')
+                .backgroundColor(`#EEEEEE`)
+                .borderRadius(20)
+                .justifyContent(FlexAlign.SpaceBetween)
+                .padding({ top: 20, left: 16, right: 16, bottom: 20 })
+                .onClick(() => {
+                  item.click?.()
+                })
+              }
+            })
+          }
+          .width('100%')
+          .height('100%')
+        }
+        .backgroundColor(Color.White)
+        .width('100%')
+        .height(550)
+        .borderRadius({ topRight: 32 })
+        .id("bottomColumn")
+        .padding({ top: 142, left: 24, right: 24 })
+      }
+      .width("100%")
+      .height('100%')
+      .alignItems(HorizontalAlign.Center)
+      .padding({top: this.safeTop})
+    }
+    .hideTitleBar(true)
+  }
+
+  async shareData() {
+    try {
+      // 构造ShareData,需配置一条有效数据信息
+      const data = new systemShare.SharedData({
+        // utd: uniformTypeDescriptor.UniformDataType.HYPERLINK,
+        utd: uniformTypeDescriptor.UniformDataType.TEXT,
+        title: '盒小仓',
+        content: 'http://appgallery.huawei.com/app/detail?id=6917580461832049757',
+        description: "http://appgallery.huawei.com/app/detail?id=6917580461832049757"
+      })
+      const controller = new systemShare.ShareController(data)
+      const context = this.getUIContext().getHostContext()! as common.UIAbilityContext;
+      // 进行分享面板显示
+      controller.show(context, {
+        previewMode: systemShare.SharePreviewMode.DEFAULT,
+        selectionMode: systemShare.SelectionMode.SINGLE,
+        // anchor: { windowOffset: { x: 0, y: 0 }, size: { width: this.breakWidth, height: 500 } }
+      })
+    } catch (error) {
+      IBestToast.show({ message: '当前设备不支持', duration: 500 })
+    }
+  }
+}
+
+@Builder
+export function MinePageBuilder() {
+  MinePage()
+}

+ 0 - 0
features/feature/src/main/ets/pages/PrivacyPage.ets → features/feature/src/main/ets/pages/otherPage/PrivacyPage.ets


+ 1 - 1
features/feature/src/main/ets/pages/YTNaviDiaLog.ets → features/feature/src/main/ets/pages/otherPage/YTNaviDiaLog.ets

@@ -1,7 +1,7 @@
 import { yTRouter } from 'basic'
 import { YTDiaLogComp } from 'basic/src/main/ets/components/generalComp/YTDiaLogComp'
 import { DiaLogParam, YTDiaLogModel } from 'basic/src/main/ets/models/YTDiaLogModel'
-import { getBuilder } from '../components/YtComp/YTDiaLogBuild'
+import { getBuilder } from '../../components/YtComp/YTDiaLogBuild'
 
 @ComponentV2
 struct YTNaviDiaLog {

+ 14 - 0
features/feature/src/main/ets/utils/RouterUtils.ets

@@ -1,9 +1,23 @@
 import { yTRouter } from "basic"
+import { IncreaseStudentPageModel } from "../model/RouterModel"
 
 class RouterUtils{
   router2MainPage(param: ESObject, back: Callback<PopInfo>){
     yTRouter.pushPathByName('Mainpage', param, back)
   }
+
+  router2MinePage(param: ESObject, back: Callback<PopInfo>){
+    yTRouter.pushPathByName('MinePage', param, back)
+  }
+
+  // 添加、修改 学生信息页面
+  router2IncreaseStudentPage(param: IncreaseStudentPageModel | null, back: Callback<PopInfo>){
+    yTRouter.pushPathByName('IncreaseStudentPage', param, back)
+  }
+
+  getIncreaseStudentPageParam(): IncreaseStudentPageModel{
+    return yTRouter.getParamByName('IncreaseStudentPage').pop() as IncreaseStudentPageModel
+  }
 }
 
 export const iRouter = new RouterUtils()

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

@@ -0,0 +1,6 @@
+@Component
+export struct FiveView {
+  build() {
+
+  }
+}

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

@@ -0,0 +1,6 @@
+@Component
+export struct FourView {
+  build() {
+
+  }
+}

+ 159 - 47
features/feature/src/main/ets/view/MainView.ets

@@ -1,55 +1,167 @@
-import { BackgroundPageModifier, DateOption, YTAddressSelectorDialog, YTDateUtil } from 'basic'
-import { UnitType } from 'basic/src/main/ets/datepicker/DatePickerEnums'
-import { promptAction } from '@kit.ArkUI'
+import { EmptyComp } from "../components/EmptyComp"
+import { _YtHeader } from "../components/YtComp/_YtHeader"
+import { MainViewModel } from "../viewModel/MainViewModel"
 
-@Component
+@ComponentV2
 export struct MainView {
+  @Local vm: MainViewModel = new MainViewModel()
+
   build() {
-    Column() {
-      Text('打开日历')
-        .onClick(() => {
-          //以下内容都可以不传 有默认值
-          const date: Date = new Date()
-          const yTDateDialog = new YTAddressSelectorDialog(this.getUIContext())
-          let dateOption = new DateOption() //选项配置类
-          dateOption.date = date //当前日期  默认今天
-          dateOption.minDate = new Date(2000, 0, 1) //最小选择的日期 默认10年前的今天
-          dateOption.maxDate = new Date(2048, 12, 30) //最大选择的日期 默认10年后的今天
-          dateOption.unitType = UnitType.YEAR_MONTH_DAY //日期单位 默认年月日 可选年月、月日等组合
-          dateOption.confirm = (date: Date) => { //确认选择回调函数
-            console.log('确认', YTDateUtil.formatDate(date))
-            promptAction.openToast({ message: YTDateUtil.formatDate(date) })
-          }
-          dateOption.headerLeftBuilder = wrapBuilder(headerLeftBuilder) //头部左侧按钮 默认返回按钮
-          dateOption.headerRightBuilder = wrapBuilder(headerRightBuilder) //头部右侧按钮 默认确认按钮
-          dateOption.highlightBackgroundColor = Color.Pink //选中高亮背景色
-          dateOption.highlightBorderColor = Color.Red //选中高亮边框色
-          dateOption.textStyle = {
-            //日期文字样式
-            font: { size: 20, weight: 400 },
-            color: Color.Gray
-          }
-          dateOption.selectedTextStyle = {
-            //选中日期文字样式
-            font: { size: 25, weight: 400 },
-            color: Color.Yellow
+    Column(){
+      _YtHeader({
+        rightComp: () => { this.rightComp() },
+        leftComp: () => { this.leftComp() },
+        isShowBackComp: false,
+        title: ''
+      })
+
+      // boy and gir
+      Row(){
+        Row({space: 42}){
+          this.circleContainer('#7186F9', '男孩', 10)
+          this.circleContainer('#FB9BC1', '女孩', 10)
+        }
+
+        Text('添加')
+          .fontSize(18)
+          .fontWeight(500)
+          .borderRadius(8)
+          .fontColor(Color.White)
+          .backgroundColor(Color.Black)
+          .padding({left: 15, top: 7, right: 15, bottom: 7})
+          .onClick(() => { this.vm._onAddStudent() })
+      }
+      .width("100%")
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.SpaceBetween)
+      .padding({right: 18, left: 42, top: 20, bottom: 20 })
+
+      // 学生列表
+      Column(){
+        EmptyComp({
+          isEmpty: this.vm.dataSource.length == 0
+        }){
+          List({space: 16}){
+            ForEach(this.vm.dataSource, (item: number, index) => {
+              ListItem(){
+                Row({space: 22}){
+                  Image(item == 1 ? $r('app.media.img_BoyHead') : $r('app.media.img_GirHead'))
+                    .width(52)
+                    .aspectRatio(1)
+
+                  Text('李明 - ' +  (item == 1 ? '男' : '女'))
+                    .fontSize(14)
+                    .fontWeight(400)
+                }
+                .width("97%")
+                .borderRadius(15)
+                .margin({left: 3})
+                .backgroundColor(Color.White)
+                .justifyContent(FlexAlign.Start)
+                .alignItems(VerticalAlign.Center)
+                .shadow({ radius: 6, color: '#1a000000' })
+                .padding({left: 12, top: 9, right: 12, bottom: 9})
+              }
+              .align(Alignment.Center)
+              .swipeAction({
+                end: () => { this.swiperAction(index) }
+              })
+            })
           }
-          yTDateDialog.show(dateOption) //设置好配置之后打开日历的函数
-        })
+          .width("100%")
+          .height('100%')
+          .scrollBar(BarState.Off)
+          .padding({ bottom: 16 })
+        }
+      }
+      .width('100%')
+      .layoutWeight(1)
+      .backgroundColor('#FAFAFA')
+      .justifyContent(FlexAlign.Center)
+      .alignItems(HorizontalAlign.Center)
+      .padding({left: 16, right: 16, top: 16})
+      .borderRadius({topLeft: 20, topRight: 20})
+    }
+    .height('100%')
+    .width('100%')
+    .linearGradient(this.vm.linear)
+    .padding({top: this.vm.safeTop })
+    .justifyContent(FlexAlign.Center)
+    .alignItems(HorizontalAlign.Center)
+  }
+
+  // 圆型容器
+  @Builder
+  circleContainer(mainColor: ResourceColor, text: string, count: number){
+    Column({space: 12}){
+      Row(){
+        Row(){
+          Text(text)
+            .fontSize(18)
+            .fontWeight(500)
+            .fontColor(Color.White)
+        }
+        .width("100%")
+        .aspectRatio(1)
+        .borderRadius(30)
+        .backgroundColor(mainColor)
+        .justifyContent(FlexAlign.Center)
+      }
+      .width(60)
+      .padding(2)
+      .aspectRatio(1)
+      .borderRadius(30)
+      .backgroundColor(Color.White)
+      .border({ width: 2, color: mainColor })
+
+      Text(`${count} 人`)
+        .fontSize(16)
+        .fontWeight(500)
+        .fontColor('#333333')
     }
-    .attributeModifier(new BackgroundPageModifier(true))
+  }
+
+  @Builder
+  swiperAction(index: number){
+    Row(){
+      Row(){
+        Image($r('app.media.icon_edit'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#BFBFBF')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .padding({ left: 18, top: 23, right: 18, bottom: 23 })
+      .onClick(() => { this.vm._onEditStudent() })
+
+      Row(){
+        Image($r('app.media.icon_del'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#FF3B30')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .borderRadius({topRight: 15, bottomRight: 15})
+      .padding({ left: 18, top: 23, right: 18, bottom: 23 })
+      .onClick(() => { this.vm._onDeleteStudent() })
+    }
+    .borderRadius({topRight: 15, bottomRight: 15})
+  }
+
+  @Builder
+  rightComp(){
+    Image($r('app.media.icon_setting'))
+      .width(25)
+      .aspectRatio(1)
+      .onClick(() => { this.vm._onMyPage() })
+  }
 
+  @Builder
+  leftComp(){
+    Text('学生信息')
+      .fontSize(24)
+      .fontWeight(600)
   }
-}
-
-@Builder
-function headerLeftBuilder() {
-  Image($r('app.media.app_icon'))
-    .width(24)
-}
-
-@Builder
-function headerRightBuilder() {
-  Image($r("app.media.app_icon"))
-    .width(24)
 }

+ 54 - 0
features/feature/src/main/ets/viewModel/IncreaseStudentPage.ets

@@ -0,0 +1,54 @@
+import { YTAvoid, yTRouter } from "basic"
+import { iRouter } from "../utils/RouterUtils"
+
+@ObservedV2
+export class IncreaseStudentPageViewModel{
+  @Trace safeTop: number = 0
+  @Trace safeBottom: number = 0
+  @Trace title: string = '添加'
+  @Trace name: string = ''
+  @Trace gender: string = ''
+
+  constructor() {
+    this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
+    this.safeBottom = AppStorage.get(YTAvoid.SAFE_BOTTOM_KEY) as number
+    let param = iRouter.getIncreaseStudentPageParam()
+
+    if(param?.id){
+      this.title = '编辑'
+    }
+  }
+
+
+  // 修改性别
+  _onGenderChange(gender: string){
+    this.gender = gender
+  }
+
+  // 保存
+  _onSave(){
+
+
+    this._onBackPressed(false)
+  }
+
+  /**
+   * 重写的返回逻辑
+   * @returns
+   */
+  _onBackPressed(isDiaLog: boolean = true){
+    if(isDiaLog){
+      yTRouter.router2DoubleConfirmDiaLog({
+        text: '编辑内容未保存,确定离开吗?',
+        color: '#7186F9'
+      }, (res) => {
+        if (res?.result && res.result == 'true') {
+          yTRouter.pop('')
+        }
+      })
+    } else {
+      yTRouter.pop('')
+    }
+    return true;
+  }
+}

+ 57 - 0
features/feature/src/main/ets/viewModel/MainViewModel.ets

@@ -0,0 +1,57 @@
+import { YTAvoid, yTRouter } from "basic"
+import { iRouter } from "../utils/RouterUtils"
+
+@ObservedV2
+export class MainViewModel{
+  @Trace safeTop: number = 0
+
+  dataSource: number[] = [ 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 2, 3 ]
+  linear: LinearGradientOptions = {
+    colors: [ ['#A9A8FF', 0.01], ['#EBF7FF', 0.3] ],
+  }
+
+  constructor() {
+    this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
+  }
+
+
+  // 进入我的页面
+  _onMyPage() {
+    iRouter.router2MinePage(null, () =>{})
+  }
+
+  // 添加学生
+  _onAddStudent() {
+    iRouter.router2IncreaseStudentPage(null, (popInfo: PopInfo) => {
+
+    })
+  }
+
+  // 编辑学生
+  _onEditStudent() {
+    iRouter.router2IncreaseStudentPage({ id: '12' }, (popInfo: PopInfo) => {
+
+    })
+  }
+
+  // 删除学生
+  _onDeleteStudent() {
+    yTRouter.router2DoubleConfirmDiaLog({
+      text: '是否确认删除?',
+      color: '#7186F9'
+    }, (res) => {
+      if (res?.result && res.result == 'true') {
+
+      }
+    })
+  }
+
+  /**
+   * 重写的返回逻辑
+   * @returns
+   */
+  _onBackPressed(){
+    yTRouter.pop('')
+    return true;
+  }
+}

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


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


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


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


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


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


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


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


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


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


+ 11 - 3
features/feature/src/main/resources/base/profile/router_map.json

@@ -2,16 +2,24 @@
   "routerMap": [
     {
       "name": "YTNaviDiaLog",
-      "pageSourceFile": "src/main/ets/pages/YTNaviDiaLog.ets",
+      "pageSourceFile": "src/main/ets/pages/otherPage/YTNaviDiaLog.ets",
       "buildFunction": "YTNaviDiaLogBuilder"
     }, {
       "name": "EntryPage",
-      "pageSourceFile": "src/main/ets/pages/EntryPage.ets",
+      "pageSourceFile": "src/main/ets/pages/otherPage/EntryPage.ets",
       "buildFunction": "EntryPageBuilder"
     }, {
       "name": "PrivacyPage",
-      "pageSourceFile": "src/main/ets/pages/PrivacyPage.ets",
+      "pageSourceFile": "src/main/ets/pages/otherPage/PrivacyPage.ets",
       "buildFunction": "PrivacyPageBuilder"
+    }, {
+      "name": "MinePage",
+      "pageSourceFile": "src/main/ets/pages/otherPage/MinePage.ets",
+      "buildFunction": "MinePageBuilder"
+    }, {
+      "name": "IncreaseStudentPage",
+      "pageSourceFile": "src/main/ets/pages/IncreaseStudentPage.ets",
+      "buildFunction": "IncreaseStudentPageBuilder"
     }
   ]
 }

+ 16 - 12
products/entry/src/main/ets/pages/Index.ets

@@ -1,6 +1,6 @@
 import { AppStorageKeyCollect, BasicType, ContextHelper, YTAvoid, yTRouter } from 'basic';
 import { Mine } from 'user/src/main/ets/views/Mine';
-import { MainView, SecondView, ThirdView } from 'feature';
+import { FiveView, FourView, MainView, SecondView, ThirdView } from 'feature';
 
 @Entry
 @Component
@@ -12,28 +12,28 @@ struct Index {
     {
       text: '学生',
       // 未选中
-      src: $r('app.media.app_icon'),
+      src: $r('app.media.icon_student'),
       // 选中
-      acSrc: $r('app.media.app_icon')
+      acSrc: $r('app.media.icon_student_')
     },
     {
       text: '座位',
-      src: $r('app.media.app_icon'),
-      acSrc: $r('app.media.app_icon')
+      src: $r('app.media.icon_stat'),
+      acSrc: $r('app.media.icon_stat_')
     },
     {
       text: '点名',
-      src: $r('app.media.app_icon'),
-      acSrc: $r('app.media.app_icon')
+      src: $r('app.media.icon_roll'),
+      acSrc: $r('app.media.icon_roll_')
     },
     {
       text: '成绩',
-      src: $r('app.media.app_icon'),
-      acSrc: $r('app.media.app_icon')
+      src: $r('app.media.icon_list'),
+      acSrc: $r('app.media.icon_list_')
     }, {
       text: '课程表',
-      src: $r('app.media.app_icon'),
-      acSrc: $r('app.media.app_icon')
+      src: $r('app.media.icon_classSchedule'),
+      acSrc: $r('app.media.icon_classSchedule_')
     }
   ]
   tabsController: TabsController = new TabsController()
@@ -64,6 +64,10 @@ struct Index {
                 SecondView()
               } else if (index == 2) {
                 ThirdView()
+              } else if (index == 3) {
+                FourView()
+              } else if (index == 4){
+                FiveView()
               } else {
                 Mine()
               }
@@ -106,7 +110,7 @@ struct Index {
       Text(item.text)
         .fontSize($r('[basic].float.page_text_font_size_10'))
         .lineHeight(16)
-        .fontColor(this.currentIndex == item.index ? $r('[basic].color.main_ac_color_dark') :
+        .fontColor(this.currentIndex == item.index ? '#5668FC' :
         $r('[basic].color.main_na_color'))
     }
     .margin({ top: 5 })

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


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


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


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


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


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


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


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


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


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


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


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


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