Ver Fonte

修改时间选择器bug

chenritian há 2 semanas atrás
pai
commit
a7871e3195

+ 6 - 1
entry/src/main/ets/pages/tabs/HomeTab.ets

@@ -9,6 +9,7 @@ import { yTBindSheet } from '../../utils/YTBindSheet';
 import { YTDate } from '../../utils/YTDate';
 import { fileUri } from '@kit.CoreFileKit';
 import { TimeTypeEnum } from '../../pickers/time';
+import { IBestImagePreview } from '@ibestservices/ibest-ui';
 
 PersistentStorage.PersistProp('myRecords', []);
 
@@ -205,13 +206,17 @@ export struct HomeTab {
       if (item.images && item.images.length > 0) {
         Scroll() {
           Row() {
-            ForEach(item.images, (uri: string) => {
+            ForEach(item.images, (uri: string, index) => {
               Image(fileUri.getUriFromPath(uri))
                 .width(80)
                 .height(80)
                 .borderRadius(8)
                 .margin({ right: 12 })
                 .objectFit(ImageFit.Cover)
+                .onClick(() => {
+                  IBestImagePreview.show(item.images.map(v => fileUri.getUriFromPath(v as string)),
+                    { startIndex: index })
+                })
             })
           }
         }

+ 8 - 3
entry/src/main/ets/pages/tabs/StatisticsTab.ets

@@ -6,6 +6,7 @@ import { DateUtils } from '../../utils/DateUtils';
 import { YTDate } from '../../utils/YTDate';
 import { fileUri } from '@kit.CoreFileKit';
 import { YTAvoid } from '../../utils/YTAvoid';
+import { IBestImagePreview } from '@ibestservices/ibest-ui';
 
 
 @Component
@@ -72,7 +73,7 @@ export struct StatisticsTab {
         .onClick(() => {
           YTDatePicker.show({
             date: new Date(this.beginTime),
-            type: SelectType.DATE_TIME,
+            type: SelectType.DATE,
             timeUnitType: TimeTypeEnum.HH_MM_SS,
             highlightStyle: {
               backgroundColor: Color.Transparent,
@@ -109,7 +110,7 @@ export struct StatisticsTab {
 
           YTDatePicker.show({
             date: new Date(this.beginTime),
-            type: SelectType.DATE_TIME,
+            type: SelectType.DATE,
             timeUnitType: TimeTypeEnum.HH_MM_SS,
             highlightStyle: {
               backgroundColor: Color.Transparent,
@@ -289,13 +290,17 @@ struct RecordItemView {
               if (item.images && item.images.length > 0) {
                 Scroll() {
                   Row() {
-                    ForEach(item.images, (uri: string) => {
+                    ForEach(item.images, (uri: string, index) => {
                       Image(fileUri.getUriFromPath(uri))
                         .width(80)
                         .height(80)
                         .borderRadius(6)
                         .margin({ right: 10 })
                         .objectFit(ImageFit.Cover)
+                        .onClick(() => {
+                          IBestImagePreview.show(item.images.map(v => fileUri.getUriFromPath(v as string)),
+                            { startIndex: index })
+                        })
                     })
                   }
                 }

+ 3 - 3
entry/src/main/ets/pickers/date/components/SelectTimeComp.ets

@@ -22,7 +22,7 @@ export struct SelectTimeComp {
             })
               .divider(null)
               .selectedTextStyle(this.item?.selectedTextStyle)
-              .textStyle(this.item?.selectedTextStyle)
+              .textStyle(this.item?.textStyle)
               .canLoop(true)
               .width(70)
               .onChange((val) => {
@@ -49,7 +49,7 @@ export struct SelectTimeComp {
           })
             .divider(null)
             .selectedTextStyle(this.item?.selectedTextStyle)
-            .textStyle(this.item?.selectedTextStyle)
+            .textStyle(this.item?.textStyle)
             .canLoop(true)
             .width(70)
             .onChange((val) => {
@@ -79,7 +79,7 @@ export struct SelectTimeComp {
             })
               .divider(null)
               .selectedTextStyle(this.item?.selectedTextStyle)
-              .textStyle(this.item?.selectedTextStyle)
+              .textStyle(this.item?.textStyle)
               .canLoop(true)
               .width(70)
               .onChange((val) => {