张善主

feat(动态):增加底部按钮

@@ -14,6 +14,7 @@ import display from '@ohos.display'; @@ -14,6 +14,7 @@ import display from '@ohos.display';
14 import { BusinessError } from '@ohos.base'; 14 import { BusinessError } from '@ohos.base';
15 import { CommonConstants } from 'wdConstant/Index'; 15 import { CommonConstants } from 'wdConstant/Index';
16 import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo' 16 import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
  17 +import router from '@ohos.router';
17 const TAG = 'DynamicDetailComponent' 18 const TAG = 'DynamicDetailComponent'
18 @Preview 19 @Preview
19 @Component 20 @Component
@@ -32,6 +33,7 @@ export struct DynamicDetailComponent { @@ -32,6 +33,7 @@ export struct DynamicDetailComponent {
32 newsType:15 33 newsType:15
33 } as ContentDetailDTO 34 } as ContentDetailDTO
34 //变量 35 //变量
  36 + scroller: Scroller = new Scroller();
35 /** 37 /**
36 * 默认未关注 点击去关注 38 * 默认未关注 点击去关注
37 */ 39 */
@@ -55,7 +57,6 @@ export struct DynamicDetailComponent { @@ -55,7 +57,6 @@ export struct DynamicDetailComponent {
55 } 57 }
56 58
57 build() { 59 build() {
58 - Row() {  
59 Column(){ 60 Column(){
60 //logo、日期 61 //logo、日期
61 Row() { 62 Row() {
@@ -77,6 +78,9 @@ export struct DynamicDetailComponent { @@ -77,6 +78,9 @@ export struct DynamicDetailComponent {
77 .width('100%') 78 .width('100%')
78 .height($r('app.float.margin_7')) 79 .height($r('app.float.margin_7'))
79 .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) 80 .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
  81 + Stack({ alignContent: Alignment.Bottom }) {
  82 + Scroll(this.scroller) {
  83 + Column() {
80 //号主信息 84 //号主信息
81 Row() { 85 Row() {
82 //头像 86 //头像
@@ -110,6 +114,7 @@ export struct DynamicDetailComponent { @@ -110,6 +114,7 @@ export struct DynamicDetailComponent {
110 .fontColor($r('app.color.color_B0B0B0')) 114 .fontColor($r('app.color.color_B0B0B0'))
111 .fontWeight(FontWeight.Medium) 115 .fontWeight(FontWeight.Medium)
112 .maxLines(1) 116 .maxLines(1)
  117 + .textOverflow({ overflow: TextOverflow.Ellipsis })
113 .margin({ left: $r('app.float.margin_5') }) 118 .margin({ left: $r('app.float.margin_5') })
114 .alignSelf(ItemAlign.Start) 119 .alignSelf(ItemAlign.Start)
115 } 120 }
@@ -322,11 +327,55 @@ export struct DynamicDetailComponent { @@ -322,11 +327,55 @@ export struct DynamicDetailComponent {
322 .lineHeight($r('app.float.margin_20')) 327 .lineHeight($r('app.float.margin_20'))
323 .margin({ left: $r('app.float.margin_2')}) 328 .margin({ left: $r('app.float.margin_2')})
324 } 329 }
325 - //评论组件/底部组件  
326 - 330 + .margin({top:$r('app.float.margin_16')})
  331 + //fixme 评论组件
  332 + }
327 } 333 }
  334 + .width(CommonConstants.FULL_WIDTH)
  335 + .height(CommonConstants.FULL_HEIGHT)
  336 + .padding({ bottom: 76 })
  337 + .scrollBar(BarState.Off)
328 .alignSelf(ItemAlign.Start) 338 .alignSelf(ItemAlign.Start)
  339 + //底部交互区
  340 + Row() {
  341 + Image($r('app.media.icon_arrow_left'))
  342 + .width(24)
  343 + .height(24)
  344 + .onClick((event: ClickEvent) => {
  345 + router.back()
  346 + })
  347 +
  348 + Row() {
  349 + Image($r('app.media.icon_comment'))
  350 + .width(24)
  351 + .height(24)
  352 + .margin({ right: 24 })
  353 + .id('comment')
  354 +
  355 + Image($r('app.media.icon_star'))
  356 + .width(24)
  357 + .height(24)
  358 + .margin({ right: 24 })
  359 +
  360 + Image($r('app.media.icon_listen'))
  361 + .width(24)
  362 + .height(24)
  363 + .margin({ right: 24 })
  364 +
  365 + Image($r('app.media.icon_forward'))
  366 + .width(24)
  367 + .height(24)
  368 +
  369 + }
329 } 370 }
  371 + .width(CommonConstants.FULL_WIDTH)
  372 + .height(56)
  373 + .padding({ left: 15, right: 15, bottom: 50, top: 20 })
  374 + .justifyContent(FlexAlign.SpaceBetween)
  375 + .backgroundColor(Color.White)
  376 + }
  377 + }
  378 + .alignSelf(ItemAlign.Start)
330 .backgroundColor('#FFFFFFFF') 379 .backgroundColor('#FFFFFFFF')
331 .width('100%') 380 .width('100%')
332 .height('100%') 381 .height('100%')