Showing
2 changed files
with
56 additions
and
47 deletions
| @@ -10,54 +10,57 @@ export struct ChatItemComponent { | @@ -10,54 +10,57 @@ export struct ChatItemComponent { | ||
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | build() { | 12 | build() { |
| 13 | - Row() { | ||
| 14 | - Text() { | ||
| 15 | - if (this.item.role == LiveMessageRole.host) { | ||
| 16 | - Span(' 主持人 ') | ||
| 17 | - .fontSize(11) | ||
| 18 | - // .lineHeight(16) | ||
| 19 | - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | ||
| 20 | - .fontColor('#FFFFFFFF') | ||
| 21 | - .fontFamily('PingFang SC-Regular') | ||
| 22 | - .fontWeight(400) | ||
| 23 | - Span(' ') | ||
| 24 | - } | ||
| 25 | - if (this.item.role == LiveMessageRole.guest) { | ||
| 26 | - Span(' 嘉宾 ') | ||
| 27 | - .fontSize(11) | ||
| 28 | - // .lineHeight(16) | ||
| 29 | - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | 13 | + Row(){ |
| 14 | + Row() { | ||
| 15 | + Text() { | ||
| 16 | + if (this.item.role == LiveMessageRole.host) { | ||
| 17 | + Span(' 主持人 ') | ||
| 18 | + .fontSize(11) | ||
| 19 | + // .lineHeight(16) | ||
| 20 | + .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | ||
| 21 | + .fontColor('#FFFFFFFF') | ||
| 22 | + .fontFamily('PingFang SC-Regular') | ||
| 23 | + .fontWeight(400) | ||
| 24 | + Span(' ') | ||
| 25 | + } | ||
| 26 | + if (this.item.role == LiveMessageRole.guest) { | ||
| 27 | + Span(' 嘉宾 ') | ||
| 28 | + .fontSize(11) | ||
| 29 | + // .lineHeight(16) | ||
| 30 | + .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | ||
| 31 | + .fontColor('#FFFFFFFF') | ||
| 32 | + .fontFamily('PingFang SC-Regular') | ||
| 33 | + .fontWeight(400) | ||
| 34 | + Span(' ') | ||
| 35 | + } | ||
| 36 | + Span(this.item.senderUserName + ': ') | ||
| 37 | + .fontSize(14) | ||
| 38 | + .lineHeight(22) | ||
| 39 | + .fontColor('#FFFFC63F') | ||
| 40 | + .padding({ right: 118 }) | ||
| 41 | + .fontFamily('PingFang SC-Semibold') | ||
| 42 | + .fontWeight(600) | ||
| 43 | + | ||
| 44 | + Span(this.item.text) | ||
| 45 | + .fontSize(14) | ||
| 46 | + .lineHeight(22) | ||
| 30 | .fontColor('#FFFFFFFF') | 47 | .fontColor('#FFFFFFFF') |
| 31 | - .fontFamily('PingFang SC-Regular') | ||
| 32 | - .fontWeight(400) | ||
| 33 | - Span(' ') | 48 | + .fontFamily('PingFang SC-Semibold') |
| 49 | + .fontWeight(600) | ||
| 34 | } | 50 | } |
| 35 | - Span(this.item.senderUserName + ': ') | ||
| 36 | - .fontSize(14) | ||
| 37 | - .lineHeight(22) | ||
| 38 | - .fontColor('#FFFFC63F') | ||
| 39 | - .padding({ right: 118 }) | ||
| 40 | - .fontFamily('PingFang SC-Semibold') | ||
| 41 | - .fontWeight(600) | 51 | + .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 }) |
| 42 | 52 | ||
| 43 | - Span(this.item.text) | ||
| 44 | - .fontSize(14) | ||
| 45 | - .lineHeight(22) | ||
| 46 | - .fontColor('#FFFFFFFF') | ||
| 47 | - .fontFamily('PingFang SC-Semibold') | ||
| 48 | - .fontWeight(600) | ||
| 49 | } | 53 | } |
| 50 | - .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 }) | ||
| 51 | - | ||
| 52 | - } | ||
| 53 | - .backgroundColor('#4D000000') | ||
| 54 | - .borderRadius(3) | ||
| 55 | - .padding({ | ||
| 56 | - top: 6, | ||
| 57 | - bottom: 6, | ||
| 58 | - left: 8, | ||
| 59 | - right: 8 | ||
| 60 | - }) | ||
| 61 | - .margin({ left: 16, bottom: 4 }) | 54 | + .backgroundColor('#4D000000') |
| 55 | + .borderRadius(3) | ||
| 56 | + .padding({ | ||
| 57 | + top: 6, | ||
| 58 | + bottom: 6, | ||
| 59 | + left: 8, | ||
| 60 | + right: 8 | ||
| 61 | + }) | ||
| 62 | + .margin({ left: 16, bottom: 4 }) | ||
| 63 | + }.width("100%") | ||
| 64 | + .backgroundColor(Color.Transparent) | ||
| 62 | } | 65 | } |
| 63 | } | 66 | } |
| @@ -100,16 +100,22 @@ export struct PlayerCommentComponent { | @@ -100,16 +100,22 @@ export struct PlayerCommentComponent { | ||
| 100 | ForEach(this.liveChatList, (item: LiveRoomItemBean) => { | 100 | ForEach(this.liveChatList, (item: LiveRoomItemBean) => { |
| 101 | ListItem() { | 101 | ListItem() { |
| 102 | ChatItemComponent({ item: item }) | 102 | ChatItemComponent({ item: item }) |
| 103 | - } | 103 | + }.blendMode(BlendMode.SRC_IN, BlendApplyType.OFFSCREEN) |
| 104 | }) | 104 | }) |
| 105 | } | 105 | } |
| 106 | - .width('80%') | 106 | + .width('100%') |
| 107 | .scrollBar(BarState.Off) | 107 | .scrollBar(BarState.Off) |
| 108 | + .edgeEffect(EdgeEffect.None) | ||
| 108 | 109 | ||
| 109 | } | 110 | } |
| 110 | .constraintSize({ | 111 | .constraintSize({ |
| 111 | maxHeight: 280 | 112 | maxHeight: 280 |
| 113 | + }).width("80%") | ||
| 114 | + .linearGradient({ angle: 0, | ||
| 115 | + colors: [[0xff000000, 0.85], [0x01000000, 1.0]] | ||
| 112 | }) | 116 | }) |
| 117 | + .blendMode(BlendMode.SRC_OVER, BlendApplyType.OFFSCREEN) | ||
| 118 | + | ||
| 113 | 119 | ||
| 114 | // 收藏、分享、点赞是否需要根据字段显隐 | 120 | // 收藏、分享、点赞是否需要根据字段显隐 |
| 115 | LiveOperRowListView({ | 121 | LiveOperRowListView({ |
-
Please register or login to post a comment