diff --git a/entry/src/main/ets/common/BreakpointSystem.ets b/entry/src/main/ets/common/BreakpointSystem.ets index fd82cbe0d89fa0608a5b77a9b746b81c28218972..fa084659fb6136e2f2e43a8f62bfd21d8fddafca 100644 --- a/entry/src/main/ets/common/BreakpointSystem.ets +++ b/entry/src/main/ets/common/BreakpointSystem.ets @@ -14,9 +14,9 @@ */ export class BreakpointType { - sm: T - md: T - lg: T + private sm: T + private md: T + private lg: T constructor(sm: T, md: T, lg: T) { this.sm = sm; diff --git a/entry/src/main/ets/common/CommonConstants.ets b/entry/src/main/ets/common/CommonConstants.ets index bd14d9eb8df267fde26453d5ef21ac16e33be43b..bea3c179cd2a9a42d425f08e2ad038be8a9e203f 100644 --- a/entry/src/main/ets/common/CommonConstants.ets +++ b/entry/src/main/ets/common/CommonConstants.ets @@ -30,7 +30,6 @@ export class CommonConstants { * Index page padding top size. */ static readonly PADDING_TOP_INDEX: number = 64; - /** * Index page padding bottom size. */ diff --git a/entry/src/main/ets/common/MailSideBar.ets b/entry/src/main/ets/common/MailSideBar.ets index b82e1cfc1658d5ae6ace74404ada833b40bca600..812cedfad8186a56ec256f57eef4e79a64b32fbd 100644 --- a/entry/src/main/ets/common/MailSideBar.ets +++ b/entry/src/main/ets/common/MailSideBar.ets @@ -18,7 +18,7 @@ import { BreakpointType } from './BreakpointSystem'; import { CommonConstants } from './CommonConstants'; @Extend(Text) -function TextStyle() { +function textStyle() { .backgroundColor('#254ff7') .fontColor('#fff') .fontSize(10) @@ -90,7 +90,7 @@ struct AccountInfo { .width(18) .height(18) .borderRadius(18) - .TextStyle() + .textStyle() } }.width('100%').height(56) } diff --git a/entry/src/main/ets/common/PhotoContent.ets b/entry/src/main/ets/common/PhotoContent.ets index f3cdcbd4ecb293f3dcf3101b93820f9dce0163e7..9407f46a97f6b284fef1e23d1473e71746b58136 100644 --- a/entry/src/main/ets/common/PhotoContent.ets +++ b/entry/src/main/ets/common/PhotoContent.ets @@ -13,21 +13,21 @@ * limitations under the License. */ -import { photoType } from '../model/dataType'; +import { PhotoType } from '../model/dataType'; import { BreakpointType } from './BreakpointSystem'; import { CommonConstants } from './CommonConstants'; @Component export struct PhotoContent { - @State photoList: photoType[] = [ - new photoType($r('app.string.picture'), 1234, $r('app.media.P1')), - new photoType($r('app.string.video'), 12, $r('app.media.P2')), - new photoType($r('app.string.collect'), 7, $r('app.media.P3')), - new photoType($r('app.string.newAlbum'), 11, $r('app.media.P4')), - new photoType($r('app.string.avatar'), 223, $r('app.media.P5')), - new photoType($r('app.string.address'), 125, $r('app.media.P6')), - new photoType($r('app.string.category'), 234, $r('app.media.P7')), - new photoType($r('app.string.pictureType'), 22, $r('app.media.P8')), + @State photoList: PhotoType[] = [ + new PhotoType($r('app.string.picture'), 1234, $r('app.media.P1')), + new PhotoType($r('app.string.video'), 12, $r('app.media.P2')), + new PhotoType($r('app.string.collect'), 7, $r('app.media.P3')), + new PhotoType($r('app.string.newAlbum'), 11, $r('app.media.P4')), + new PhotoType($r('app.string.avatar'), 223, $r('app.media.P5')), + new PhotoType($r('app.string.address'), 125, $r('app.media.P6')), + new PhotoType($r('app.string.category'), 234, $r('app.media.P7')), + new PhotoType($r('app.string.pictureType'), 22, $r('app.media.P8')), ] @State columnsTemplate: string = '1fr 1fr 1fr'; @Link @Watch('onStateChange') sideBarStatus: boolean; @@ -44,9 +44,9 @@ export struct PhotoContent { this.columnsTemplate = '1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr'; } else if (this.sideBarStatus === false && this.currentBreakPoint === 'md') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; - } else if (this.sideBarStatus === true && this.currentBreakPoint === 'sm'){ + } else if (this.sideBarStatus === true && this.currentBreakPoint === 'sm') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; - } else if (this.sideBarStatus === false && this.currentBreakPoint === 'sm'){ + } else if (this.sideBarStatus === false && this.currentBreakPoint === 'sm') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; } } @@ -61,9 +61,9 @@ export struct PhotoContent { this.columnsTemplate = '1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr'; } else if (this.sideBarStatus === false && this.currentBreakPoint === 'md') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; - } else if (this.sideBarStatus === true && this.currentBreakPoint === 'sm'){ + } else if (this.sideBarStatus === true && this.currentBreakPoint === 'sm') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; - } else if (this.sideBarStatus === false && this.currentBreakPoint === 'sm'){ + } else if (this.sideBarStatus === false && this.currentBreakPoint === 'sm') { this.columnsTemplate = '1fr 1fr 1fr 1fr'; } }) @@ -90,7 +90,7 @@ export struct PhotoContent { .width('100%') Grid() { - ForEach(this.photoList, (item: photoType) => { + ForEach(this.photoList, (item: PhotoType) => { GridItem() { Column() { Image(item.src).width('100%').aspectRatio(1).borderRadius(12) diff --git a/entry/src/main/ets/common/PhotoSideBar.ets b/entry/src/main/ets/common/PhotoSideBar.ets index 91e3c183c4becf0f394dbb39b4c0e2230657166e..aa03eb253b96115ac41509507725016a805c9890 100644 --- a/entry/src/main/ets/common/PhotoSideBar.ets +++ b/entry/src/main/ets/common/PhotoSideBar.ets @@ -13,22 +13,22 @@ * limitations under the License. */ -import { photoType } from '../model/dataType'; +import { PhotoType } from '../model/dataType'; import { BreakpointType } from './BreakpointSystem'; import { CommonConstants } from './CommonConstants'; @Component export struct PhotoSideBar { - @State photoList: photoType[] = [ - new photoType($r('app.string.picture'), 1234), - new photoType($r('app.string.video'), 12), - new photoType($r('app.string.collect'), 7), - new photoType($r('app.string.newAlbum'), 11), - new photoType($r('app.string.avatar'), 223), - new photoType($r('app.string.address'), 125), - new photoType($r('app.string.category'), 234), - new photoType($r('app.string.pictureType'), 22), - new photoType($r('app.string.hidden'), 1), + @State photoList: PhotoType[] = [ + new PhotoType($r('app.string.picture'), 1234), + new PhotoType($r('app.string.video'), 12), + new PhotoType($r('app.string.collect'), 7), + new PhotoType($r('app.string.newAlbum'), 11), + new PhotoType($r('app.string.avatar'), 223), + new PhotoType($r('app.string.address'), 125), + new PhotoType($r('app.string.category'), 234), + new PhotoType($r('app.string.pictureType'), 22), + new PhotoType($r('app.string.hidden'), 1), ]; @StorageProp('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; @StorageProp('topRectHeight') @@ -82,7 +82,7 @@ export struct PhotoSideBar { .borderRadius(10) } - ForEach(this.photoList, (item: photoType, index: number | undefined) => { + ForEach(this.photoList, (item: PhotoType, index: number | undefined) => { ListItem() { Row() { Text(item.name) diff --git a/entry/src/main/ets/common/SettingItem.ets b/entry/src/main/ets/common/SettingItem.ets index f4358e636abf3bf028f02286a85d5182eb440984..276141c0ee7860dd6e7b0df9f52ac7fa0e53142c 100644 --- a/entry/src/main/ets/common/SettingItem.ets +++ b/entry/src/main/ets/common/SettingItem.ets @@ -15,10 +15,10 @@ @Component export struct MainItem { - itemDesc: Resource = $r("app.string.nonSense"); - src: Resource = $r("app.media.icon"); + itemDesc: Resource = $r('app.string.nonSense'); + src: Resource = $r('app.media.icon'); isUserItem: boolean = false; - itemStatusDesc: Resource = $r("app.string.nonSense"); + itemStatusDesc: Resource = $r('app.string.nonSense'); build() { Row() { @@ -60,12 +60,12 @@ export struct MainItem { @Component export struct SubItem { - itemDesc: Resource = $r("app.string.nonSense"); - src: Resource = $r("app.media.icon"); + itemDesc: Resource = $r('app.string.nonSense'); + src: Resource = $r('app.media.icon'); isShowButton: boolean = false; isShowRightArrow: boolean = false; - itemStatusDesc: Resource = $r("app.string.nonSense"); - content: Resource = $r("app.string.nonSense"); + itemStatusDesc: Resource = $r('app.string.nonSense'); + content: Resource = $r('app.string.nonSense'); isLinkAddress: boolean = false; build() { diff --git a/entry/src/main/ets/model/dataType.ets b/entry/src/main/ets/model/dataType.ets index bbea14b83e47265fd0f546af56007bf40b07e182..4d7bcc3b345dfec56db44f5216cfe8be7f427522 100644 --- a/entry/src/main/ets/model/dataType.ets +++ b/entry/src/main/ets/model/dataType.ets @@ -14,8 +14,8 @@ */ export class OperateTabs { - src: Resource; - name: Resource; + public src: Resource; + public name: Resource; constructor(src: Resource, name: Resource) { this.src = src; @@ -24,9 +24,9 @@ export class OperateTabs { } export class MailType { - type: Resource; - num: number; - src: Resource; + public type: Resource; + public num: number; + public src: Resource; constructor(type: Resource, num: number, src: Resource) { this.type = type; @@ -35,10 +35,10 @@ export class MailType { } } -export class photoType { - name: Resource; - count: number; - src: Resource | undefined; +export class PhotoType { + public name: Resource; + public count: number; + public src: Resource | undefined; constructor(name: Resource, count: number, src?: Resource | undefined) { this.name = name;