wangliang_wd

feat:优化早晚报

@@ -37,6 +37,7 @@ export struct MorningEveningPaperComponent { @@ -37,6 +37,7 @@ export struct MorningEveningPaperComponent {
37 @Provide commentList: InteractDataDTO[] = [] 37 @Provide commentList: InteractDataDTO[] = []
38 @State audioPlayUrl: string = "" 38 @State audioPlayUrl: string = ""
39 @State isNoListContent:boolean = false; 39 @State isNoListContent:boolean = false;
  40 + @State isContentFailed:boolean = false;
40 @State executedStartTime:number = new Date().getTime() 41 @State executedStartTime:number = new Date().getTime()
41 // @Consume dailyPaperTopicPageId: number 42 // @Consume dailyPaperTopicPageId: number
42 // @Provide compListItem: CompList = {} as CompList 43 // @Provide compListItem: CompList = {} as CompList
@@ -177,6 +178,7 @@ export struct MorningEveningPaperComponent { @@ -177,6 +178,7 @@ export struct MorningEveningPaperComponent {
177 } 178 }
178 this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true 179 this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true
179 } catch (exception) { 180 } catch (exception) {
  181 + this.isContentFailed = true
180 182
181 } 183 }
182 184
@@ -264,56 +266,64 @@ export struct MorningEveningPaperComponent { @@ -264,56 +266,64 @@ export struct MorningEveningPaperComponent {
264 } 266 }
265 267
266 build() { 268 build() {
267 - Stack({ alignContent: Alignment.Top }) {  
268 - List() {  
269 - if (this.pageInfoBean?.topicInfo?.frontLinkObject) {  
270 -  
271 - ListItem() {  
272 - topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject})  
273 - } 269 + if (this.isContentFailed){
  270 + Column(){
  271 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_ContentFailed})
  272 + }.backgroundColor(this.mixedBgColor ?? Color.Black)
  273 + }else {
  274 + Stack({ alignContent: Alignment.Top }) {
  275 + List() {
  276 + if (this.pageInfoBean?.topicInfo?.frontLinkObject) {
274 277
275 - } 278 + ListItem() {
  279 + topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject})
  280 + }
276 281
277 - if (this.audioPlayUrl.length > 0){  
278 - ListItem() {  
279 - this.AudioBarView()  
280 } 282 }
281 - .margin({  
282 - top: this.isHasTopView ? 10 : 44 + this.topSafeHeight  
283 - })  
284 - }  
285 283
286 - ListItem() {  
287 - if(this.isNoListContent){  
288 - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})  
289 - }else {  
290 - SingleColumn999Component({  
291 - compListItem: this.compListItem, 284 + if (this.audioPlayUrl.length > 0){
  285 + ListItem() {
  286 + this.AudioBarView()
  287 + }
  288 + .margin({
  289 + top: this.isHasTopView ? 10 : 44 + this.topSafeHeight
292 }) 290 })
293 - .margin({  
294 - top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight 291 + }
  292 +
  293 + ListItem() {
  294 + if(this.isNoListContent){
  295 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})
  296 + }else {
  297 + SingleColumn999Component({
  298 + compListItem: this.compListItem,
295 }) 299 })
  300 + .margin({
  301 + top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight
  302 + })
  303 + }
296 } 304 }
297 } 305 }
  306 + // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
  307 + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
  308 + .scrollBar(BarState.Off)
  309 + .onWillScroll(scrollOffset =>{
  310 + this.scrollOffset = this.scrollOffset + scrollOffset as number
  311 + })
  312 +
  313 + this.topPaperTitle()
298 } 314 }
299 - // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)  
300 - .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果  
301 - .scrollBar(BarState.Off)  
302 - .onWillScroll(scrollOffset =>{  
303 - this.scrollOffset = this.scrollOffset + scrollOffset as number 315 + .width('100%')
  316 + .height('100%')
  317 + .padding({
  318 + top: 0,
  319 + // bottom: this.bottomSafeHeight
304 }) 320 })
305 -  
306 - this.topPaperTitle() 321 + // .backgroundColor(Color.Black)
  322 + // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
  323 + .backgroundColor(this.mixedBgColor ?? Color.Black)
307 } 324 }
308 - .width('100%')  
309 - .height('100%')  
310 - .padding({  
311 - top: 0,  
312 - // bottom: this.bottomSafeHeight  
313 - })  
314 - // .backgroundColor(Color.Black)  
315 - // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)  
316 - .backgroundColor(this.mixedBgColor ?? Color.Black) 325 +
  326 +
317 } 327 }
318 328
319 @Builder 329 @Builder
@@ -23,10 +23,10 @@ export struct PeopleShipRecommendComponent { @@ -23,10 +23,10 @@ export struct PeopleShipRecommendComponent {
23 right: '4vp' 23 right: '4vp'
24 }) 24 })
25 Text('为你推荐优质号主') 25 Text('为你推荐优质号主')
26 - .height('40vp') 26 + .height('30vp')
27 .fontColor($r('app.color.color_222222')) 27 .fontColor($r('app.color.color_222222'))
28 .fontWeight(600) 28 .fontWeight(600)
29 - .fontSize($r('app.float.vp_15_7')) 29 + .fontSize($r('app.float.vp_18'))
30 30
31 Blank() 31 Blank()
32 Button({ type: ButtonType.Normal, stateEffect: false }) { 32 Button({ type: ButtonType.Normal, stateEffect: false }) {