点击tabbar

This commit is contained in:
XiuYun CHEN
2025-06-05 14:10:30 +08:00
parent ca5ab146b7
commit efcb4be65a
11 changed files with 37 additions and 6 deletions
@@ -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!='回访中'))
{
@@ -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)
}
@@ -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)
@@ -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);
}
}
@@ -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);
}
}