diff --git a/commons/basic/src/main/ets/components/HdList.ets b/commons/basic/src/main/ets/components/HdList.ets index 78d75f1..8f20009 100644 --- a/commons/basic/src/main/ets/components/HdList.ets +++ b/commons/basic/src/main/ets/components/HdList.ets @@ -2,6 +2,7 @@ import { BasicConstant } from '../constants/BasicConstant' export class HdListController { loaded: () => void = () => { + } finished: () => void = () => { } @@ -96,6 +97,7 @@ export struct HdList { } this.loading = true this.onLoad() + }) .scrollBar(BarState.Off) .nestedScroll({ diff --git a/commons/basic/src/main/resources/base/media/default_video.png b/commons/basic/src/main/resources/base/media/default_video.png new file mode 100644 index 0000000..ce24a6a Binary files /dev/null and b/commons/basic/src/main/resources/base/media/default_video.png differ diff --git a/commons/basic/src/main/resources/base/media/home_scroll_default1.png b/commons/basic/src/main/resources/base/media/home_scroll_default1.png new file mode 100644 index 0000000..3328995 Binary files /dev/null and b/commons/basic/src/main/resources/base/media/home_scroll_default1.png differ diff --git a/features/Home/src/main/ets/components/ItemComp.ets b/features/Home/src/main/ets/components/ItemComp.ets index c92a123..c458bfb 100644 --- a/features/Home/src/main/ets/components/ItemComp.ets +++ b/features/Home/src/main/ets/components/ItemComp.ets @@ -43,7 +43,7 @@ export struct ItemComp { { Stack() { - Image(BasicConstant.urlHtml+this.item.liveimg).width('100%').height(162) + Image(BasicConstant.urlHtml+this.item.liveimg).width('100%').height(162).alt($r('app.media.home_scroll_default1')) .objectFit(ImageFit.Fill) if(this.status!=''&&(this.status!='已结束'&&this.status!='回访中')) { diff --git a/features/Home/src/main/ets/components/ItemCompBack.ets b/features/Home/src/main/ets/components/ItemCompBack.ets index efec7d5..7f86be0 100644 --- a/features/Home/src/main/ets/components/ItemCompBack.ets +++ b/features/Home/src/main/ets/components/ItemCompBack.ets @@ -41,7 +41,7 @@ export struct ItemCompBack { { Stack() { - Image(BasicConstant.urlHtml+this.item.liveimg).width('100%').height(162) + Image(BasicConstant.urlHtml+this.item.liveimg).width('100%').height(162).alt($r('app.media.home_scroll_default1')) .objectFit(ImageFit.Fill) Image($r('app.media.bofang')).width(40).height(40) } diff --git a/features/Home/src/main/ets/components/ItemCompVideo.ets b/features/Home/src/main/ets/components/ItemCompVideo.ets index 8406b4b..688c8f9 100644 --- a/features/Home/src/main/ets/components/ItemCompVideo.ets +++ b/features/Home/src/main/ets/components/ItemCompVideo.ets @@ -18,7 +18,7 @@ export struct ItemCompVideo { build() { Column() { - Image(BasicConstant.urlHtml+this.item.imgpath).width('100%').height(102) + Image(BasicConstant.urlHtml+this.item.imgpath).alt($r('app.media.default_video')).width('100%').height(102) .objectFit(ImageFit.Fill) Text(this.item.name).maxLines(2).fontSize(15).fontColor('app.color.666666').textAlign(TextAlign.Start).height(36) diff --git a/features/Home/src/main/ets/components/ListComp.ets b/features/Home/src/main/ets/components/ListComp.ets index 5523cf5..5644e55 100644 --- a/features/Home/src/main/ets/components/ListComp.ets +++ b/features/Home/src/main/ets/components/ListComp.ets @@ -13,6 +13,9 @@ export struct ListComp { @State list: ItemModel[] = [] controller = new HdListController() + scroller: Scroller = new Scroller() + @Consume@Watch('gotoTop') + toTop:boolean; @State page: number = 1 @State @@ -128,6 +131,7 @@ export struct ListComp { HdList({ lw: 1, controller: this.controller, + scroller:this.scroller, onRefresh: () => { this.onRefresh() }, @@ -145,5 +149,10 @@ export struct ListComp { } + } + gotoTop() + { + this.scroller.scrollToIndex(0); + } } \ No newline at end of file diff --git a/features/Home/src/main/ets/components/ListCompGandan.ets b/features/Home/src/main/ets/components/ListCompGandan.ets index e82e760..ebc494a 100644 --- a/features/Home/src/main/ets/components/ListCompGandan.ets +++ b/features/Home/src/main/ets/components/ListCompGandan.ets @@ -11,12 +11,16 @@ import HashMap from '@ohos.util.HashMap'; export struct ListCompGandan { @State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量 @Prop@Watch('onUpdate') sort:string='2' + + @Consume@Watch('gotoTop') + toTop:boolean; @Prop@Watch('onUpdate') type_uuid:string='' @Prop@Watch('onUpdate') keywords:string='' @State list: VideoMore[] = [] controller = new HdListController() + scroller: Scroller = new Scroller() @State page: number = 1 @@ -92,6 +96,7 @@ export struct ListCompGandan { } build() { + if (this.isEmptyViewVisible){ EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible}) .width('100%') @@ -100,6 +105,7 @@ export struct ListCompGandan { HdGrid({ lw: 1, controller: this.controller, + scroller:this.scroller, onRefresh: () => { this.onRefresh() }, @@ -115,4 +121,9 @@ export struct ListCompGandan { } } } + gotoTop() + { + this.scroller.scrollToIndex(0); + + } } \ No newline at end of file diff --git a/features/mypage/src/main/ets/view/FourSection.ets b/features/mypage/src/main/ets/view/FourSection.ets index 676b60c..1c91ff3 100644 --- a/features/mypage/src/main/ets/view/FourSection.ets +++ b/features/mypage/src/main/ets/view/FourSection.ets @@ -75,7 +75,7 @@ export struct FourSection { abilityName: 'com.huawei.hmos.settings.MainAbility', uri: 'application_info_entry', parameters: { - pushParams: 'com.example.expert' + pushParams: 'cn.shangyu.gdxzExprt' } }; const context = getContext(this) as common.UIAbilityContext; diff --git a/features/mypage/src/main/ets/view/HeaderView.ets b/features/mypage/src/main/ets/view/HeaderView.ets index 20885d9..f987323 100644 --- a/features/mypage/src/main/ets/view/HeaderView.ets +++ b/features/mypage/src/main/ets/view/HeaderView.ets @@ -36,7 +36,8 @@ export struct HeaderView { @State myPageData:object = new Object; @State heroArray:Array = []; @State clickHeroId:string = ''; - + @Consume@Watch('gotoTop') + toTop:boolean; private scrollerForList: Scroller = new Scroller() dialogController: CustomDialogController = new CustomDialogController({ @@ -162,4 +163,10 @@ export struct HeaderView { .backgroundImage(this.myPageData["myInfoBackGround"]).backgroundImageSize(ImageSize.Cover) } // } + gotoTop() + { + this.photoPath = BasicConstant.urlImage+authStore.getUser().photo; + + + } } diff --git a/products/expert/src/main/ets/pages/Tabbar/TabBarComp.ets b/products/expert/src/main/ets/pages/Tabbar/TabBarComp.ets index 801068f..64aa920 100644 --- a/products/expert/src/main/ets/pages/Tabbar/TabBarComp.ets +++ b/products/expert/src/main/ets/pages/Tabbar/TabBarComp.ets @@ -14,7 +14,8 @@ export struct TabBarComp { @State isLandscape: boolean = false listenerScreen = mediaquery.matchMediaSync('(orientation: landscape) and (device-type: tablet)') - + @Provide + toTop:boolean=false; aboutToAppear() { this.listenerScreen.on('change', (mediaQueryResult) => { this.isLandscape = mediaQueryResult.matches @@ -53,6 +54,7 @@ export struct TabBarComp { .barPosition(this.isLandscape ? BarPosition.Start : BarPosition.End) .onTabBarClick((index) => { this.activeIndex = index + this.toTop=!this.toTop }) .barHeight(this.isLandscape ? $r('app.float.tab_bar_item_height_lg') : $r('app.float.tab_bar_item_height_sm')) .scrollable(false)