瀏覽代碼

feat: copy 视力检查相关功能

YuJing 2 周之前
父節點
當前提交
ce1668356c
共有 70 個文件被更改,包括 532 次插入2 次删除
  1. 1 1
      commons/basic/oh-package.json5
  2. 7 0
      commons/basic/src/main/ets/constants/index.ets
  3. 21 0
      commons/basic/src/main/ets/utils/arkts/utils/YTRouter.ets
  4. 91 0
      features/feature/src/main/ets/pages/TestResultPage.ets
  5. 401 0
      features/feature/src/main/ets/pages/VisionTestPage.ets
  6. 1 1
      features/feature/src/main/ets/view/FourView.ets
  7. 二進制
      features/feature/src/main/resources/base/media/bgi.png
  8. 二進制
      features/feature/src/main/resources/base/media/down.png
  9. 二進制
      features/feature/src/main/resources/base/media/error.png
  10. 二進制
      features/feature/src/main/resources/base/media/left.png
  11. 二進制
      features/feature/src/main/resources/base/media/right.png
  12. 二進制
      features/feature/src/main/resources/base/media/success.png
  13. 二進制
      features/feature/src/main/resources/base/media/up.png
  14. 10 0
      features/feature/src/main/resources/base/profile/router_map.json
  15. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_上.png
  16. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_下.png
  17. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_右.png
  18. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_左.png
  19. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_上.png
  20. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_下.png
  21. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_右.png
  22. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_左.png
  23. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_上.png
  24. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_下.png
  25. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_右.png
  26. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_左.png
  27. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_上.png
  28. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_下.png
  29. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_右.png
  30. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_左.png
  31. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_上.png
  32. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_下.png
  33. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_右.png
  34. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_左.png
  35. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_上.png
  36. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_下.png
  37. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_右.png
  38. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_左.png
  39. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_上.png
  40. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_下.png
  41. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_右.png
  42. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_左.png
  43. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_上.png
  44. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_下.png
  45. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_右.png
  46. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_左.png
  47. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_上.png
  48. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_下.png
  49. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_右.png
  50. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_左.png
  51. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_上.png
  52. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_下.png
  53. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_右.png
  54. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_左.png
  55. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_上.png
  56. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_下.png
  57. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_右.png
  58. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_左.png
  59. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_上.png
  60. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_下.png
  61. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_右.png
  62. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_左.png
  63. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_上.png
  64. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_下.png
  65. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_右.png
  66. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_左.png
  67. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_上.png
  68. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_下.png
  69. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_右.png
  70. 二進制
      features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_左.png

+ 1 - 1
commons/basic/oh-package.json5

@@ -9,7 +9,7 @@
   "dependencies": {
     "@ohos/axios": "^2.2.4",
     "@abner/log": "^1.0.5",
-    "@ibestservices/ibest-ui": "2.0.6",
+    "@ibestservices/ibest-ui": "2.1.0",
     "@tencent/wechat_open_sdk": "^1.0.0",
     "lunar": "^1.0.0",
     "@mumu/crop": "^1.0.3",

+ 7 - 0
commons/basic/src/main/ets/constants/index.ets

@@ -106,4 +106,11 @@ export enum EmitterKeyCollection {
    * @description 刷新当前选中日期数据
    */
   REFRESH_CURRENT_DATE_DATA = 'refreshCurrentDateData',
+}
+
+
+export enum DefaultEnum {
+  FALSE,
+  TRUE,
+  NULL
 }

+ 21 - 0
commons/basic/src/main/ets/utils/arkts/utils/YTRouter.ets

@@ -79,6 +79,27 @@ class YTRouter extends NavPathStack {
     yTRouter.pop()
   }
 
+
+  getVisionTestParam() {
+    return yTRouter.getParamByName('TestResultPage').pop() as string
+  }
+
+  router2TestResultPage(vision: string) {
+    if (yTRouter.getAllPathName().pop() === 'TestResultPage') {
+      return
+    }
+    yTRouter.replacePathByName('TestResultPage', vision)
+  }
+
+
+  router2VisionTestPage(replace: boolean = false) {
+    if (replace) {
+      yTRouter.replacePathByName('VisionTestPage', '')
+    } else {
+      yTRouter.pushPathByName('VisionTestPage', '')
+    }
+  }
+
   /**
    * DiaLog 相关
    */

+ 91 - 0
features/feature/src/main/ets/pages/TestResultPage.ets

@@ -0,0 +1,91 @@
+import { RouterPage, YTButton, YTHeader, yTRouter } from 'basic'
+
+@Component
+@RouterPage
+struct TestResultPage {
+  @State currentColor: ResourceColor = '#FF3D3D3D'
+  private declare visionResult: string
+  private declare description: string
+  private declare level: string
+
+  aboutToAppear(): void {
+    this.visionResult = yTRouter.getVisionTestParam()
+    if (Number(this.visionResult) >= 5.0) {
+      this.description = '您的视力,属于优秀视力范围,视\n' +
+        '觉功能良好。'
+      this.level = '标准视力'
+    } else if (Number(this.visionResult) >= 4.8) {
+      this.description = '您的视力,略低于标准视力。建议注意\n' +
+        '用眼卫生,定期复查视力变化。'
+      this.level = '轻度异常'
+    } else if (Number(this.visionResult) >= 4.5) {
+      this.description = '您的视力,可能存在轻度视力问题。\n' +
+        '建议咨询眼科医生进行专业检查。'
+      this.level = '中度异常'
+    } else {
+      this.description = '您的视力,建议尽快到专业眼科机构\n' +
+        '进行全面检查,及时干预治疗。'
+      this.currentColor = '#FFCD5E5E'
+      this.level = '重度异常'
+    }
+
+    // YTEyesRequest.addDetectionRecord(this.visionResult, (_, err) => {
+    //   if (err) {
+    //     IBestToast.show('记录保存失败')
+    //     YTLog.error(err)
+    //   }
+    // })
+  }
+
+  build() {
+    Column() {
+      YTHeader({ defaultStyle: { title: '测试结果' } })
+      Column() {
+        Text(this.level)
+          .fontSize(16)
+          .fontColor(this.currentColor)
+          .fontWeight(700)
+        Text(this.visionResult)
+          .fontSize(36)
+          .fontColor(this.currentColor)
+          .fontWeight(700)
+          .margin({ bottom: 13 })
+        Text(this.description)
+          .fontColor(this.currentColor)
+          .fontSize(16)
+          .fontWeight(700)
+          .height(86)
+          .width(284)
+          .borderRadius(18)
+          .margin({ bottom: 53 })
+          .border({ width: 2, color: this.currentColor == '#FFCD5E5E' ? this.currentColor : '#FF048AFF' })
+          .textAlign(TextAlign.Center)
+          .margin({ bottom: 173 })
+
+        YTButton({
+          btWidth: 255,
+          btHeight: 45,
+          btLinearGradient: { colors: [['#FF0088FF', 0], ['#FF51AEFF', 1]] },
+          btContent: '重新测试',
+          btFontSize: 16,
+          click: () => {
+            yTRouter.router2VisionTestPage(true)
+          }
+        })
+      }
+      .margin({ top: 110 })
+    }
+    .width('100%')
+    .height('100%')
+    .backgroundImage($r('app.media.bgi'))
+    .backgroundImageSize({ width: '100%', height: '100%' })
+  }
+}
+
+@Builder
+function TestResultBuilder() {
+  NavDestination() {
+    TestResultPage()
+  }
+  .hideTitleBar(true)
+}

+ 401 - 0
features/feature/src/main/ets/pages/VisionTestPage.ets

@@ -0,0 +1,401 @@
+import { DefaultEnum, IBestToast, RouterPage, YTButton, YTHeader, yTRouter } from 'basic';
+import { display } from '@kit.ArkUI';
+
+interface ResultType {
+  src: ResourceStr,
+  color: ResourceColor,
+  border: BorderOptions,
+  state: DefaultEnum
+}
+
+
+@Component
+@RouterPage
+struct VisionTestPage {
+  @State private currentIndex: number = 0
+  @State private resultArr: ResultType[] = Array.from<ResultType>({ length: 7 }).fill({
+    src: '',
+    color: Color.White,
+    border: {
+      color: '#FFD5D5D5',
+      width: 1
+    },
+    state: DefaultEnum.NULL
+  })
+  @State private isStartTest: boolean = false
+  @State private currentVision: string = '4.0'
+  private declare deviceDpi: number
+  private eHeightMap: Map<string, number> = this.getEHeightMap1m()
+  private angleArray: number[] = this.generateRandomAngleArray()
+
+  aboutToAppear() {
+    this.deviceDpi = display.getDefaultDisplaySync().densityDPI
+  }
+
+  build() {
+    Column() {
+      YTHeader({ centerComp: this.centerComp })
+      if (!this.isStartTest) {
+        Column() {
+          Text('1、视力表显示区‌:居中显示当前测试视标(E字方向随机)。\n' +
+            '2、方向选择区‌:底部设置4个方向按钮(上、下、左、右)。\n' +
+            '3、连对三次,累计对四次,进入更小视标测试。\n' +
+            '4、连错三次,累计错四次,结束测试,视力检测为次一级的视力。')
+            .fontColor('#FF0B8DFF')
+            .backgroundColor(Color.White)
+            .shadow({ radius: 10, color: '#17002BFF' })
+            .borderRadius(22)
+            .padding({
+              top: 31,
+              left: 14,
+              bottom: 29,
+              right: 5
+            })
+        }
+        .margin({ top: 43, bottom: 44 })
+        .padding({ left: 21, right: 19 })
+
+        YTButton({
+          btContent: '开始测试',
+          btWidth: 225,
+          btHeight: 46,
+          btLinearGradient: { colors: [['#FF0088FF', 0], ['#FF51AEFF', 1]], angle: 270 },
+          click: () => {
+            this.isStartTest = true
+          }
+        })
+      } else {
+        Column() {
+          Text('保持手机在眼前40厘米处,选择E的朝向')
+            .fontSize(16)
+            .fontWeight(400)
+            .fontColor('#FF3D3D3D')
+            .margin({ bottom: 17 })
+          Column() {
+            Row({ space: 3 }) {
+              ForEach(this.resultArr, (result: ResultType) => {
+                Column() {
+                  Image(result.src)
+                    .width(16)
+                }
+                .width(38)
+                .aspectRatio(1)
+                .justifyContent(FlexAlign.Center)
+                .backgroundColor(result.color)
+                .border(result.border)
+                .borderRadius(999)
+              })
+            }
+            .margin({ bottom: 32 })
+
+            Column() {
+              Image($rawfile('opToTypeChart/4.0_0.1_右.png'))
+                .height(this.mmToVp(this.eHeightMap.get(this.currentVision)!))
+                .rotate({ angle: this.angleArray[this.currentIndex] })
+            }
+            .width(198)
+            .aspectRatio(1)
+            .backgroundColor(Color.White)
+            .borderRadius(24)
+            .justifyContent(FlexAlign.Center)
+            .margin({ bottom: 40 })
+
+            RelativeContainer() {
+              Column() {
+                YTButton({
+                  btWidth: 78,
+                  btHeight: 78,
+                  btContent: '看不清',
+                  btFontSize: 22,
+                  btFontWeight: 700,
+                  btBorderRadius: 999,
+                  btLinearGradient: { colors: [['#FF0088FF', 0], ['#FF51AEFF', 1]] },
+                  click: () => {
+                    this.checkContinue(DefaultEnum.FALSE)
+                  }
+                })
+              }
+              .id('centerComp')
+              .height(98)
+              .width(98)
+              .justifyContent(FlexAlign.Center)
+              .alignRules({
+                center: { anchor: '__container__', align: VerticalAlign.Center },
+                middle: { anchor: '__container__', align: HorizontalAlign.Center },
+              })
+
+              Image($r('app.media.right'))
+                .alignRules({
+                  center: { anchor: '__container__', align: VerticalAlign.Center },
+                  left: { anchor: 'centerComp', align: HorizontalAlign.End }
+                })
+                .height(37)
+                .onClick(() => {
+                  if (this.angleArray[this.currentIndex] == 0) {
+                    IBestToast.show({ message: "正确", type: "success" })
+                    this.checkContinue(DefaultEnum.TRUE)
+                  } else {
+                    IBestToast.show({ message: "错误", type: "fail" })
+                    this.checkContinue(DefaultEnum.FALSE)
+                  }
+
+                })
+
+              Image($r('app.media.left'))
+                .alignRules({
+                  center: { anchor: '__container__', align: VerticalAlign.Center },
+                  right: { anchor: 'centerComp', align: HorizontalAlign.Start }
+                })
+                .height(37)
+                .onClick(() => {
+                  if (this.angleArray[this.currentIndex] == 180) {
+                    IBestToast.show({ message: "正确", type: "success" })
+                    this.checkContinue(DefaultEnum.TRUE)
+                  } else {
+                    IBestToast.show({ message: "错误", type: "fail" })
+                    this.checkContinue(DefaultEnum.FALSE)
+                  }
+                })
+
+              Image($r('app.media.up'))
+                .alignRules({
+                  bottom: { anchor: 'centerComp', align: VerticalAlign.Top },
+                  middle: { anchor: '__container__', align: HorizontalAlign.Center }
+                })
+                .width(37)
+                .onClick(() => {
+                  if (this.angleArray[this.currentIndex] == 270) {
+                    IBestToast.show({ message: "正确", type: "success" })
+                    this.checkContinue(DefaultEnum.TRUE)
+                  } else {
+                    IBestToast.show({ message: "错误", type: "fail" })
+                    this.checkContinue(DefaultEnum.FALSE)
+                  }
+                })
+
+              Image($r('app.media.down'))
+                .alignRules({
+                  top: { anchor: 'centerComp', align: VerticalAlign.Bottom },
+                  middle: { anchor: '__container__', align: HorizontalAlign.Center }
+                })
+                .width(37)
+                .onClick(() => {
+                  if (this.angleArray[this.currentIndex] == 90) {
+                    IBestToast.show({ message: "正确", type: "success" })
+                    this.checkContinue(DefaultEnum.TRUE)
+                  } else {
+                    IBestToast.show({ message: "错误", type: "fail" })
+                    this.checkContinue(DefaultEnum.FALSE)
+                  }
+                })
+
+            }
+            .height(218)
+            .aspectRatio(1)
+          }
+          .width('100%')
+          .layoutWeight(1)
+        }
+        .margin({ top: 25 })
+      }
+
+    }
+    .height('100%')
+    .width('100%')
+    .backgroundImage($r('app.media.bgi'))
+    .backgroundImageSize({ width: '100%', height: '100%' })
+  }
+
+  @Builder
+  centerComp() {
+    Text('视力检测')
+      .fontFamily('Alimama FangYuanTi VF')
+      .fontSize(24)
+      .fontWeight(700)
+      .fontColor('#FF0B0B0B')
+  }
+
+  /**
+   * 将毫米(mm)转换为鸿蒙虚拟像素(vp)
+   * @param mm 毫米尺寸(如 E 字高度 36.37mm)
+   * @param dpi 设备像素密度(每英寸点数,可从系统获取)
+   * @returns 对应的 vp 值(保留 2 位小数)
+   */
+  private mmToVp(mm: number): number {
+    // 核心公式:vp = mm × (dpi / 160)
+    const vp = mm * (this.deviceDpi / 160);
+    return parseFloat(vp.toFixed(2)); // 保留2位小数,避免浮点误差
+  }
+
+  private addResult(state: DefaultEnum): DefaultEnum {
+    switch (state) {
+      case DefaultEnum.TRUE:
+        this.resultArr[this.currentIndex] = {
+          src: $r('app.media.success'),
+          color: '#FFD9F3FC',
+          border: {
+            color: Color.Transparent,
+            width: 1
+          },
+          state: DefaultEnum.TRUE
+        }
+        // 检查连续3次正确错误或累计4次正确错误
+        return this.checkConsecutiveOrTotal()
+      case DefaultEnum.FALSE:
+        this.resultArr[this.currentIndex] = {
+          src: $r('app.media.error'),
+          color: '#FFF7F7F7',
+          border: {
+            color: Color.Transparent,
+            width: 1
+          },
+          state: DefaultEnum.FALSE
+        }
+        return this.checkConsecutiveOrTotal()
+      default:
+        return this.checkConsecutiveOrTotal()
+    }
+  }
+
+  private generateRandomAngleArray(): number[] {
+    // 候选角度集合
+    const candidateAngles = [0, 90, 180, 270];
+    // 数组长度
+    const length = 7;
+
+    // 生成随机数组:通过随机索引从候选集合中取元素
+    return Array.from<number, number>(
+      { length },
+      () => candidateAngles[Math.floor(Math.random() * candidateAngles.length)]
+    );
+  }
+
+  private checkContinue(state: DefaultEnum) {
+    switch (this.addResult(state)) {
+      case DefaultEnum.FALSE:
+        //跳转结束
+        yTRouter.router2TestResultPage(this.currentVision)
+        break
+      case DefaultEnum.TRUE:
+
+        if (Number(this.currentVision) < 5.3) {
+          this.currentVision = (Number(this.currentVision) + 0.1).toFixed(1)
+        } else {
+          yTRouter.router2TestResultPage(this.currentVision)
+          return
+        }
+
+        this.resultArr = Array.from<ResultType>({ length: 7 }).fill({
+          src: '',
+          color: Color.White,
+          border: {
+            color: '#FFD5D5D5',
+            width: 1
+          },
+          state: DefaultEnum.NULL
+        })
+        this.angleArray = this.generateRandomAngleArray()
+        this.currentIndex = 0
+
+        break
+      case DefaultEnum.NULL:
+        this.currentIndex++
+
+    }
+  }
+
+  /**
+   * 生成 5 分记录法视力值与 1 米距离 E 字高度的映射 Map
+   * @returns Map<视力值(字符串), 1米距离E字高度(mm,保留2位小数)>
+   */
+  private getEHeightMap1m(): Map<string, number> {
+    // 5 米距离下的标准 E 字高度(数据来源:GB 11533-2011 标准对数视力表)
+    const standard5mHeights: Record<string, number> = {
+      "4.0": 36.37,
+      "4.1": 30.31,
+      "4.2": 25.00,
+      "4.3": 21.05,
+      "4.4": 18.18,
+      "4.5": 14.54,
+      "4.6": 12.12,
+      "4.7": 9.09,
+      "4.8": 7.27,
+      "4.9": 6.06,
+      "5.0": 5.45,
+      "5.1": 4.55,
+      "5.2": 3.64,
+      "5.3": 3.03,
+    };
+
+    // 1 米距离是 5 米的 1/5,因此高度缩放比例为 0.2
+    const scale = 0.2;
+
+    // 创建并填充 Map
+    const eHeightMap1m = new Map<string, number>();
+    for (const key of Object.keys(standard5mHeights)) {
+      const height1m = Number((standard5mHeights[key] * scale).toFixed(2)); // 保留2位小数
+      eHeightMap1m.set(key, height1m);
+    }
+
+    return eHeightMap1m;
+  }
+
+  private checkConsecutiveOrTotal(): DefaultEnum {
+    let rightConsecutiveCount = 0
+
+    let rightTotalCount = 0
+
+    let errConsecutiveCount = 0
+
+    let errTotalCount = 0
+
+    // 检查累计正确次数
+    for (let i = 0; i <= this.currentIndex; i++) {
+      if (this.resultArr[i].state === DefaultEnum.TRUE) {
+        rightTotalCount++
+        rightConsecutiveCount++
+      } else {
+        rightConsecutiveCount = 0
+      }
+
+      if (this.resultArr[i].state === DefaultEnum.FALSE) {
+        errTotalCount++
+        errConsecutiveCount++
+      } else {
+        errConsecutiveCount = 0
+      }
+
+      if (errConsecutiveCount >= 3) {
+        return DefaultEnum.FALSE
+      }
+
+      // 如果有连续3次正确
+      if (rightConsecutiveCount >= 3) {
+        return DefaultEnum.TRUE
+      }
+    }
+
+    if (errTotalCount >= 4) {
+      return DefaultEnum.FALSE
+    }
+
+    // 如果累计4次正确
+    if (rightTotalCount >= 4) {
+      return DefaultEnum.TRUE
+    }
+
+    return DefaultEnum.NULL
+  }
+}
+
+@Builder
+function VisionTestBuilder() {
+  NavDestination() {
+    VisionTestPage()
+  }
+  .hideTitleBar(true)
+}
+
+
+
+

+ 1 - 1
features/feature/src/main/ets/view/FourView.ets

@@ -53,7 +53,7 @@ export struct FourView {
         yTRouter.pushPathByName('observationalPage', null)
         break
       case 3:
-        yTRouter.pushPathByName('visionPage', null)
+        yTRouter.pushPathByName('VisionTestPage', null)
         break
       case 4:
         yTRouter.pushPathByName('chessPage', null)

二進制
features/feature/src/main/resources/base/media/bgi.png


二進制
features/feature/src/main/resources/base/media/down.png


二進制
features/feature/src/main/resources/base/media/error.png


二進制
features/feature/src/main/resources/base/media/left.png


二進制
features/feature/src/main/resources/base/media/right.png


二進制
features/feature/src/main/resources/base/media/success.png


二進制
features/feature/src/main/resources/base/media/up.png


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

@@ -19,6 +19,16 @@
       "name": "observationalPage",
       "pageSourceFile": "src/main/ets/pages/observationalPage.ets",
       "buildFunction": "observationalBuilder"
+    },
+    {
+      "name": "TestResultPage",
+      "pageSourceFile": "src/main/ets/pages/TestResultPage.ets",
+      "buildFunction": "TestResultBuilder"
+    },
+    {
+      "name": "VisionTestPage",
+      "pageSourceFile": "src/main/ets/pages/VisionTestPage.ets",
+      "buildFunction": "VisionTestBuilder"
     }
   ]
 }

二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.0_0.1_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.1_0.12_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.2_0.15_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.3_0.2_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.4_0.25_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.5_0.3_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.6_0.4_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.7_0.5_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.8_0.6_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/4.9_0.8_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.0_1.0_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.1_1.2_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.2_1.5_左.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_上.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_下.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_右.png


二進制
features/feature/src/main/resources/rawfile/opToTypeChart/5.3_2.0_左.png