diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 56deb8c2f2b9131cc11fb987278628b7b6983617..2bb4548491da1976005df9b92228eb86be946eeb 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -41,7 +41,7 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('currentBreakpoint', this.curBp); } } catch (error) { - hilog.error(0x0000, TAG, `updateBreakpoint catch err:`, JSON.stringify((error as BusinessError).message) ?? ''); + hilog.error(0x0000, TAG, `updateBreakpoint catch err:`, (error as BusinessError).message); } } @@ -72,7 +72,7 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('resourceManager', resourceManager); windowStage.loadContent('pages/Index', (err, _) => { if (err.code) { - hilog.error(0x0000, TAG, 'Failed to load the content. Cause:', JSON.stringify(err.message) ?? ''); + hilog.error(0x0000, TAG, 'Failed to load the content. Cause:', err.message); return; } hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in loading the content'); @@ -81,8 +81,7 @@ export default class EntryAbility extends UIAbility { windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in setting the window layout to full-screen mode'); }).catch((err: BusinessError) => { - hilog.error(0x0000, TAG, 'Failed to set the window layout to full-screen mode. Cause:', - JSON.stringify(err.message) ?? ''); + hilog.error(0x0000, TAG, 'Failed to set the window layout to full-screen mode. Cause:', err.message); }); }); } diff --git a/entry/src/main/ets/view/ButtonItem.ets b/entry/src/main/ets/view/ButtonItem.ets index 647fe1994de316ec7ceb1fc40735a6cd16ee6697..78b7f3d8086be1d22eb32c89b0821d98633a7d39 100644 --- a/entry/src/main/ets/view/ButtonItem.ets +++ b/entry/src/main/ets/view/ButtonItem.ets @@ -27,29 +27,18 @@ export default struct ButtonItem { build() { Row() { - Row() { - SymbolGlyph(this.unit.buttonLikesImg) - .fontColor([$r('sys.color.comp_foreground_primary')]) - .fontSize($r('sys.float.Title_M')) - } - - Row() { - SymbolGlyph(this.unit.buttonCommentImg) - .fontColor([$r('sys.color.comp_foreground_primary')]) - .fontSize($r('sys.float.Title_M')) - } - - Row() { - SymbolGlyph(this.unit.buttonCollectImg) - .fontColor([$r('sys.color.comp_foreground_primary')]) - .fontSize($r('sys.float.Title_M')) - } - - Row() { - SymbolGlyph(this.unit.buttonShareImg) - .fontColor([$r('sys.color.comp_foreground_primary')]) - .fontSize($r('sys.float.Title_M')) - } + SymbolGlyph(this.unit.buttonLikesImg) + .fontColor([$r('sys.color.comp_foreground_primary')]) + .fontSize($r('sys.float.Title_M')) + SymbolGlyph(this.unit.buttonCommentImg) + .fontColor([$r('sys.color.comp_foreground_primary')]) + .fontSize($r('sys.float.Title_M')) + SymbolGlyph(this.unit.buttonCollectImg) + .fontColor([$r('sys.color.comp_foreground_primary')]) + .fontSize($r('sys.float.Title_M')) + SymbolGlyph(this.unit.buttonShareImg) + .fontColor([$r('sys.color.comp_foreground_primary')]) + .fontSize($r('sys.float.Title_M')) } .height(ROW_HEIGHT) .width(Constants.FULL_SIZE) diff --git a/entry/src/main/ets/view/SampleUnitPicView.ets b/entry/src/main/ets/view/SampleUnitPicView.ets index 406e67bab27da693f21eb66569517f1623e1961a..2150d126cb8caa0f7180a133ce0012e01c78b824 100644 --- a/entry/src/main/ets/view/SampleUnitPicView.ets +++ b/entry/src/main/ets/view/SampleUnitPicView.ets @@ -28,7 +28,7 @@ const IMAGE_SET_SIZE_9: number = 9; @Component export default struct SampleUnitPicView { @StorageLink('currentBreakpoint') curBp: string = Constants.BREAK_POINT_SM; - private imageArray: (string | Resource)[] = []; + @Prop imageArray: ResourceStr[] = []; private arraySize: number = 0; aboutToAppear(): void { @@ -38,7 +38,7 @@ export default struct SampleUnitPicView { build() { Column() { Grid() { - ForEach(this.imageArray.slice(0, this.arraySize), (item: string | Resource, index: number) => { + ForEach(this.imageArray.slice(0, this.arraySize), (item: string | Resource) => { GridItem() { Image(item) .objectFit(ImageFit.Cover) diff --git a/entry/src/main/ets/viewmodel/SampleUnitItem.ets b/entry/src/main/ets/viewmodel/SampleUnitItem.ets index 88eea897056e836a58a965bf529e30a80c225750..4425065a20c91834d2b6b83f54516a59e0cc4fb6 100644 --- a/entry/src/main/ets/viewmodel/SampleUnitItem.ets +++ b/entry/src/main/ets/viewmodel/SampleUnitItem.ets @@ -20,8 +20,7 @@ export default class SampleUnitItem { public button: ButtonUnitItem; public pic?: Resource[]; - constructor(type: string, button: ButtonUnitItem, pic: Resource[], - ) { + constructor(type: string, button: ButtonUnitItem, pic: Resource[]) { this.type = type; this.button = button; this.pic = pic; diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index de78b5cae3b2ba99788048311e5d0cd34d075039..b2b33b8607d3688403661c437df3b87ee32d03ab 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -21,7 +21,7 @@ "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", - "exported": true, + "exported": false, "skills": [ { "entities": [