wangliang_wd

feat:优化早晚报

... ... @@ -37,6 +37,7 @@ export struct MorningEveningPaperComponent {
@Provide commentList: InteractDataDTO[] = []
@State audioPlayUrl: string = ""
@State isNoListContent:boolean = false;
@State isContentFailed:boolean = false;
@State executedStartTime:number = new Date().getTime()
// @Consume dailyPaperTopicPageId: number
// @Provide compListItem: CompList = {} as CompList
... ... @@ -177,6 +178,7 @@ export struct MorningEveningPaperComponent {
}
this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true
} catch (exception) {
this.isContentFailed = true
}
... ... @@ -264,56 +266,64 @@ export struct MorningEveningPaperComponent {
}
build() {
Stack({ alignContent: Alignment.Top }) {
List() {
if (this.pageInfoBean?.topicInfo?.frontLinkObject) {
ListItem() {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject})
}
if (this.isContentFailed){
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_ContentFailed})
}.backgroundColor(this.mixedBgColor ?? Color.Black)
}else {
Stack({ alignContent: Alignment.Top }) {
List() {
if (this.pageInfoBean?.topicInfo?.frontLinkObject) {
}
ListItem() {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject})
}
if (this.audioPlayUrl.length > 0){
ListItem() {
this.AudioBarView()
}
.margin({
top: this.isHasTopView ? 10 : 44 + this.topSafeHeight
})
}
ListItem() {
if(this.isNoListContent){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})
}else {
SingleColumn999Component({
compListItem: this.compListItem,
if (this.audioPlayUrl.length > 0){
ListItem() {
this.AudioBarView()
}
.margin({
top: this.isHasTopView ? 10 : 44 + this.topSafeHeight
})
.margin({
top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight
}
ListItem() {
if(this.isNoListContent){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})
}else {
SingleColumn999Component({
compListItem: this.compListItem,
})
.margin({
top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight
})
}
}
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
})
this.topPaperTitle()
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
.width('100%')
.height('100%')
.padding({
top: 0,
// bottom: this.bottomSafeHeight
})
this.topPaperTitle()
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
}
.width('100%')
.height('100%')
.padding({
top: 0,
// bottom: this.bottomSafeHeight
})
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
}
@Builder
... ...
... ... @@ -23,10 +23,10 @@ export struct PeopleShipRecommendComponent {
right: '4vp'
})
Text('为你推荐优质号主')
.height('40vp')
.height('30vp')
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.fontSize($r('app.float.vp_15_7'))
.fontSize($r('app.float.vp_18'))
Blank()
Button({ type: ButtonType.Normal, stateEffect: false }) {
... ...