Showing
19 changed files
with
152 additions
and
80 deletions
| @@ -3,6 +3,7 @@ import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; | @@ -3,6 +3,7 @@ import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; | ||
| 3 | import { ToastUtils } from 'wdKit'; | 3 | import { ToastUtils } from 'wdKit'; |
| 4 | import { WDShare } from 'wdShare/Index'; | 4 | import { WDShare } from 'wdShare/Index'; |
| 5 | import { TrackConstants } from 'wdTracking/Index'; | 5 | import { TrackConstants } from 'wdTracking/Index'; |
| 6 | +import font from '@ohos.font'; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 早晚报页面标题bar | 9 | * 早晚报页面标题bar |
| @@ -14,6 +15,10 @@ export struct PaperTitleComponent { | @@ -14,6 +15,10 @@ export struct PaperTitleComponent { | ||
| 14 | @Consume subTitle?: string | 15 | @Consume subTitle?: string |
| 15 | @Consume topicInfo: TopicInfo | 16 | @Consume topicInfo: TopicInfo |
| 16 | aboutToAppear() { | 17 | aboutToAppear() { |
| 18 | + font.registerFont({ | ||
| 19 | + familyName: 'SourceHanSerifSC-Heavy', | ||
| 20 | + familySrc: $rawfile('font/SourceHanSerifSC-Heavy.ttf') | ||
| 21 | + }) | ||
| 17 | } | 22 | } |
| 18 | 23 | ||
| 19 | build() { | 24 | build() { |
| @@ -54,7 +59,7 @@ export struct PaperTitleComponent { | @@ -54,7 +59,7 @@ export struct PaperTitleComponent { | ||
| 54 | .margin({ left: 10 }) | 59 | .margin({ left: 10 }) |
| 55 | .fontSize(22) | 60 | .fontSize(22) |
| 56 | .fontColor($r('app.color.white')) | 61 | .fontColor($r('app.color.white')) |
| 57 | - .fontFamily('Source Han Serif CN') | 62 | + .fontFamily('SourceHanSerifSC-Heavy') |
| 58 | .maxLines(1) | 63 | .maxLines(1) |
| 59 | 64 | ||
| 60 | 65 | ||
| @@ -125,7 +130,7 @@ export struct PaperTitleComponent { | @@ -125,7 +130,7 @@ export struct PaperTitleComponent { | ||
| 125 | @Builder | 130 | @Builder |
| 126 | rightDecorateBuilder() { | 131 | rightDecorateBuilder() { |
| 127 | Row() | 132 | Row() |
| 128 | - .width('100vp') | 133 | + .width('80vp') |
| 129 | .height('18vp') | 134 | .height('18vp') |
| 130 | .clip(new Path({ | 135 | .clip(new Path({ |
| 131 | commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z` | 136 | commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z` |
| @@ -11,6 +11,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | @@ -11,6 +11,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 11 | import { InfomationCardClick } from '../../utils/infomationCardClick'; | 11 | import { InfomationCardClick } from '../../utils/infomationCardClick'; |
| 12 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 12 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 13 | import router from '@ohos.router' | 13 | import router from '@ohos.router' |
| 14 | +import { ToastUtils } from 'wdKit'; | ||
| 15 | +import MinePageDatasModel from '../../model/MinePageDatasModel'; | ||
| 14 | 16 | ||
| 15 | const TAG: string = 'Card2Component' | 17 | const TAG: string = 'Card2Component' |
| 16 | /** | 18 | /** |
| @@ -140,7 +142,22 @@ export struct Card2Component { | @@ -140,7 +142,22 @@ export struct Card2Component { | ||
| 140 | this.clicked = true; | 142 | this.clicked = true; |
| 141 | } | 143 | } |
| 142 | persistentStorage(this.contentDTO.objectId); | 144 | persistentStorage(this.contentDTO.objectId); |
| 143 | - ProcessUtils.processPage(this.contentDTO) | 145 | + this.jumpDetail() |
| 146 | + }) | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + /** | ||
| 150 | + * 是否需要判断某种类型才需要判断内容是否存在的场景,目前测试没发现问题 | ||
| 151 | + */ | ||
| 152 | + jumpDetail(){ | ||
| 153 | + MinePageDatasModel.getAssertDetailData(this.contentDTO.relId,this.contentDTO.objectId,this.contentDTO.relType).then((value) => { | ||
| 154 | + if(value == "1"){ | ||
| 155 | + ProcessUtils.processPage(this.contentDTO) | ||
| 156 | + }else{ | ||
| 157 | + ToastUtils.shortToast("内容不存在") | ||
| 158 | + } | ||
| 159 | + }).catch((err: Error) => { | ||
| 160 | + console.log(TAG, JSON.stringify(err)) | ||
| 144 | }) | 161 | }) |
| 145 | } | 162 | } |
| 146 | } | 163 | } |
| @@ -131,6 +131,7 @@ export struct CommentComponent { | @@ -131,6 +131,7 @@ export struct CommentComponent { | ||
| 131 | 131 | ||
| 132 | Column() { | 132 | Column() { |
| 133 | if (showGapLine) { | 133 | if (showGapLine) { |
| 134 | + Blank().height(12) | ||
| 134 | Divider().strokeWidth(6).color('#f5f5f5') | 135 | Divider().strokeWidth(6).color('#f5f5f5') |
| 135 | } | 136 | } |
| 136 | 137 | ||
| @@ -493,7 +494,11 @@ struct ChildCommentItem { | @@ -493,7 +494,11 @@ struct ChildCommentItem { | ||
| 493 | .onClick(() => { | 494 | .onClick(() => { |
| 494 | this.replyComment() | 495 | this.replyComment() |
| 495 | }) | 496 | }) |
| 496 | - | 497 | + if (this.item.commentPics.length > 0) { |
| 498 | + Image(this.item.commentPics) | ||
| 499 | + .width(88).height(88) | ||
| 500 | + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 95}) | ||
| 501 | + } | ||
| 497 | 502 | ||
| 498 | commentFooterView({ | 503 | commentFooterView({ |
| 499 | item: this.item, | 504 | item: this.item, |
| @@ -712,6 +717,12 @@ struct commentHeaderView { | @@ -712,6 +717,12 @@ struct commentHeaderView { | ||
| 712 | this.replyComment() | 717 | this.replyComment() |
| 713 | }) | 718 | }) |
| 714 | 719 | ||
| 720 | + if (this.item.commentPics.length > 0) { | ||
| 721 | + Image(this.item.commentPics) | ||
| 722 | + .width(88).height(88) | ||
| 723 | + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 60}) | ||
| 724 | + } | ||
| 725 | + | ||
| 715 | commentFooterView({ | 726 | commentFooterView({ |
| 716 | item: this.item, | 727 | item: this.item, |
| 717 | dialogController: this.dialogController, | 728 | dialogController: this.dialogController, |
| @@ -36,6 +36,8 @@ export struct CommentCustomDialog { | @@ -36,6 +36,8 @@ export struct CommentCustomDialog { | ||
| 36 | textInputController: TextAreaController = new TextAreaController() | 36 | textInputController: TextAreaController = new TextAreaController() |
| 37 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } | 37 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } |
| 38 | @State publishButtonOpacity: number = 0.5 | 38 | @State publishButtonOpacity: number = 0.5 |
| 39 | + @State inputViewHeight: number = 80 | ||
| 40 | + @Provide maxInputLength: number = 100 | ||
| 39 | 41 | ||
| 40 | aboutToAppear(): void { | 42 | aboutToAppear(): void { |
| 41 | } | 43 | } |
| @@ -98,15 +100,32 @@ export struct CommentCustomDialog { | @@ -98,15 +100,32 @@ export struct CommentCustomDialog { | ||
| 98 | .width('100%') | 100 | .width('100%') |
| 99 | .backgroundColor($r('app.color.color_transparent')) | 101 | .backgroundColor($r('app.color.color_transparent')) |
| 100 | .caretColor("#ED2800") | 102 | .caretColor("#ED2800") |
| 103 | + .maxLength(this.maxInputLength) | ||
| 104 | + .onWillInsert(data => { | ||
| 105 | + if (this.publishCommentModel.commentContent.length + data.insertValue.length > this.maxInputLength) { | ||
| 106 | + ToastUtils.showToast("已达到输入上限", 3000) | ||
| 107 | + return false | ||
| 108 | + } | ||
| 109 | + return true | ||
| 110 | + }) | ||
| 101 | .onChange(value => { | 111 | .onChange(value => { |
| 102 | this.publishCommentModel.commentContent = value; | 112 | this.publishCommentModel.commentContent = value; |
| 103 | 113 | ||
| 114 | + if ((this.textInputController.getTextContentLineCount() - 3) > 0) { | ||
| 115 | + this.inputViewHeight = 80 + (this.textInputController.getTextContentLineCount() - 3) * 18 | ||
| 116 | + } | ||
| 117 | + | ||
| 104 | if (value.length > 0) { | 118 | if (value.length > 0) { |
| 105 | this.publishButtonOpacity = 1.0 | 119 | this.publishButtonOpacity = 1.0 |
| 106 | } else { | 120 | } else { |
| 107 | this.publishButtonOpacity = 0.5 | 121 | this.publishButtonOpacity = 0.5 |
| 108 | } | 122 | } |
| 109 | }) | 123 | }) |
| 124 | + .onPaste(value => { | ||
| 125 | + if (this.publishCommentModel.commentContent.length + value.length > this.maxInputLength) { | ||
| 126 | + ToastUtils.showToast("已达到输入上限", 3000) | ||
| 127 | + } | ||
| 128 | + }) | ||
| 110 | .onFocus(() => { | 129 | .onFocus(() => { |
| 111 | if (this.emojiSwitch) { | 130 | if (this.emojiSwitch) { |
| 112 | this.emojiSwitch = false | 131 | this.emojiSwitch = false |
| @@ -119,7 +138,7 @@ export struct CommentCustomDialog { | @@ -119,7 +138,7 @@ export struct CommentCustomDialog { | ||
| 119 | .backgroundColor('#F9F9F9') | 138 | .backgroundColor('#F9F9F9') |
| 120 | // .width('100%') | 139 | // .width('100%') |
| 121 | .margin({ top: 12, right: 12, left: 12, bottom:10}) | 140 | .margin({ top: 12, right: 12, left: 12, bottom:10}) |
| 122 | - .height(80) | 141 | + .height(this.inputViewHeight) |
| 123 | .borderRadius(4) | 142 | .borderRadius(4) |
| 124 | 143 | ||
| 125 | Row() { | 144 | Row() { |
| @@ -198,7 +217,24 @@ export struct CommentCustomDialog { | @@ -198,7 +217,24 @@ export struct CommentCustomDialog { | ||
| 198 | } | 217 | } |
| 199 | if (this.voiceSwitch) { | 218 | if (this.voiceSwitch) { |
| 200 | VoiceInputView({voiceRecoginizerResult:(result: string) => { | 219 | VoiceInputView({voiceRecoginizerResult:(result: string) => { |
| 201 | - this.publishCommentModel.commentContent = result; | 220 | + let beforeStr = "" |
| 221 | + let afterStr = "" | ||
| 222 | + const offset = this.textInputController.getCaretOffset().index | ||
| 223 | + if (offset > 0) { | ||
| 224 | + beforeStr = this.publishCommentModel.commentContent.slice(0, offset) | ||
| 225 | + } | ||
| 226 | + if (offset < this.publishCommentModel.commentContent.length) { | ||
| 227 | + afterStr = this.publishCommentModel.commentContent.slice(offset) | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + if (this.publishCommentModel.commentContent.length + result.length > this.maxInputLength) { | ||
| 231 | + let length = this.maxInputLength - this.publishCommentModel.commentContent.length | ||
| 232 | + if (length < result.length) { | ||
| 233 | + result.substring(0, length) | ||
| 234 | + } | ||
| 235 | + ToastUtils.showToast("已达到输入上限", 3000) | ||
| 236 | + } | ||
| 237 | + this.publishCommentModel.commentContent = beforeStr + result + afterStr | ||
| 202 | }}).height(150) | 238 | }}).height(150) |
| 203 | 239 | ||
| 204 | } | 240 | } |
| @@ -213,6 +249,7 @@ export struct CommentCustomDialog { | @@ -213,6 +249,7 @@ export struct CommentCustomDialog { | ||
| 213 | 249 | ||
| 214 | @Component | 250 | @Component |
| 215 | struct emojiView { | 251 | struct emojiView { |
| 252 | + @Consume maxInputLength: number | ||
| 216 | @ObjectLink publishCommentModel: publishCommentModel | 253 | @ObjectLink publishCommentModel: publishCommentModel |
| 217 | /*没找到获取系统emoji的方案*/ | 254 | /*没找到获取系统emoji的方案*/ |
| 218 | private emojiArray = ["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏"] | 255 | private emojiArray = ["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏"] |
| @@ -284,6 +321,10 @@ struct emojiView { | @@ -284,6 +321,10 @@ struct emojiView { | ||
| 284 | 321 | ||
| 285 | } else { | 322 | } else { |
| 286 | Logger.debug(TAG, "charCode: " + emoji.charCodeAt(0) + " ==> " + emoji) | 323 | Logger.debug(TAG, "charCode: " + emoji.charCodeAt(0) + " ==> " + emoji) |
| 324 | + if (this.publishCommentModel.commentContent.length + emoji.length > this.maxInputLength) { | ||
| 325 | + ToastUtils.showToast("已达到输入上限", 3000) | ||
| 326 | + return | ||
| 327 | + } | ||
| 287 | this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji | 328 | this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji |
| 288 | } | 329 | } |
| 289 | 330 |
| 1 | import { ContentDTO } from 'wdBean/Index' | 1 | import { ContentDTO } from 'wdBean/Index' |
| 2 | -import { StringUtils, UserDataLocal } from 'wdKit/Index' | 2 | +import { DateTimeUtils, StringUtils, UserDataLocal } from 'wdKit/Index' |
| 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' |
| 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' |
| @@ -45,7 +45,7 @@ export struct ChildCommentComponent { | @@ -45,7 +45,7 @@ export struct ChildCommentComponent { | ||
| 45 | .fontColor($r('app.color.color_222222')) | 45 | .fontColor($r('app.color.color_222222')) |
| 46 | .margin({ bottom: 1 }) | 46 | .margin({ bottom: 1 }) |
| 47 | .maxLines(1) | 47 | .maxLines(1) |
| 48 | - Text(`${this.data.createTime}`) | 48 | + Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.data.createTime))) |
| 49 | .fontColor($r('app.color.color_B0B0B0')) | 49 | .fontColor($r('app.color.color_B0B0B0')) |
| 50 | .fontSize(12) | 50 | .fontSize(12) |
| 51 | .lineHeight(16) | 51 | .lineHeight(16) |
| @@ -288,7 +288,7 @@ struct ChannelSubscriptionLayout { | @@ -288,7 +288,7 @@ struct ChannelSubscriptionLayout { | ||
| 288 | }else { | 288 | }else { |
| 289 | Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | 289 | Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : |
| 290 | $r('app.media.index_setting_button')) | 290 | $r('app.media.index_setting_button')) |
| 291 | - .objectFit(ImageFit.Contain) | 291 | + .objectFit(ImageFit.Fill) |
| 292 | .rotate({ | 292 | .rotate({ |
| 293 | angle: index === 1 ? 180 : 0 | 293 | angle: index === 1 ? 180 : 0 |
| 294 | }) | 294 | }) |
| @@ -260,7 +260,7 @@ export struct TopNavigationComponentNew { | @@ -260,7 +260,7 @@ export struct TopNavigationComponentNew { | ||
| 260 | buildTabBarItems(mourningCheckFn: (channelId: string) => boolean) { | 260 | buildTabBarItems(mourningCheckFn: (channelId: string) => boolean) { |
| 261 | ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => { | 261 | ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => { |
| 262 | ListItem() { | 262 | ListItem() { |
| 263 | - this.tabBarBuilder(navItem, index) | 263 | + this.tabBarBuilder(navItem, index,true) |
| 264 | } | 264 | } |
| 265 | .grayscale(mourningCheckFn(`${navItem.channelId}`) ? 1 : 0) | 265 | .grayscale(mourningCheckFn(`${navItem.channelId}`) ? 1 : 0) |
| 266 | }); | 266 | }); |
| @@ -374,7 +374,7 @@ export struct TopNavigationComponentNew { | @@ -374,7 +374,7 @@ export struct TopNavigationComponentNew { | ||
| 374 | * @param index | 374 | * @param index |
| 375 | */ | 375 | */ |
| 376 | @Builder | 376 | @Builder |
| 377 | - tabBarBuilder(item: TopNavDTO, index: number) { | 377 | + tabBarBuilder(item: TopNavDTO, index: number,isRmh:boolean = false) { |
| 378 | Column() { | 378 | Column() { |
| 379 | 379 | ||
| 380 | if (item.iconUrl && item.iconCUrl) { | 380 | if (item.iconUrl && item.iconCUrl) { |
| @@ -398,11 +398,17 @@ export struct TopNavigationComponentNew { | @@ -398,11 +398,17 @@ export struct TopNavigationComponentNew { | ||
| 398 | }) | 398 | }) |
| 399 | .maxLines(this.MAX_LINE) | 399 | .maxLines(this.MAX_LINE) |
| 400 | .id(index.toString()) | 400 | .id(index.toString()) |
| 401 | - if (this.currentTopNavSelectedIndex === index) { | 401 | + if(isRmh){ |
| 402 | Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | 402 | Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) |
| 403 | .width(20) | 403 | .width(20) |
| 404 | .height(3) | 404 | .height(3) |
| 405 | - | 405 | + .visibility(this.currentTopNavSelectedIndex === index?Visibility.Visible:Visibility.Hidden) |
| 406 | + }else{ | ||
| 407 | + if (this.currentTopNavSelectedIndex === index) { | ||
| 408 | + Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | ||
| 409 | + .width(20) | ||
| 410 | + .height(3) | ||
| 411 | + } | ||
| 406 | } | 412 | } |
| 407 | } | 413 | } |
| 408 | 414 |
| @@ -89,29 +89,28 @@ export struct PeopleShipMainComponent { | @@ -89,29 +89,28 @@ export struct PeopleShipMainComponent { | ||
| 89 | if (this.viewType == ViewType.LOADING) { | 89 | if (this.viewType == ViewType.LOADING) { |
| 90 | this.LoadingLayout() | 90 | this.LoadingLayout() |
| 91 | } | 91 | } |
| 92 | - // else if (this.viewType == ViewType.ERROR) { | ||
| 93 | - // //缺省页 | ||
| 94 | - // // EmptyComponent({ | ||
| 95 | - // // emptyType: this.pageModel.emptyType, | ||
| 96 | - // // emptyButton: true, | ||
| 97 | - // // retry: () => { | ||
| 98 | - // // this.getData() | ||
| 99 | - // // } | ||
| 100 | - // // }) | ||
| 101 | - // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 102 | - // | ||
| 103 | - // } else if (this.viewType == ViewType.EMPTY) { | ||
| 104 | - // // //缺省页 | ||
| 105 | - // // EmptyComponent({ | ||
| 106 | - // // emptyType: this.pageModel.emptyType, | ||
| 107 | - // // emptyButton: true, | ||
| 108 | - // // retry: () => { | ||
| 109 | - // // this.getData() | ||
| 110 | - // // } | ||
| 111 | - // // }) | ||
| 112 | - // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 113 | - // | ||
| 114 | - // } | 92 | + else if (this.viewType == ViewType.ERROR) { |
| 93 | + //缺省页 | ||
| 94 | + EmptyComponent({ | ||
| 95 | + emptyType: this.pageModel.emptyType, | ||
| 96 | + emptyButton: true, | ||
| 97 | + retry: () => { | ||
| 98 | + this.getData() | ||
| 99 | + } | ||
| 100 | + }) | ||
| 101 | + .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 102 | + | ||
| 103 | + } else if (this.viewType == ViewType.EMPTY) { | ||
| 104 | + // //缺省页 | ||
| 105 | + EmptyComponent({ | ||
| 106 | + emptyType: this.pageModel.emptyType, | ||
| 107 | + emptyButton: true, | ||
| 108 | + retry: () => { | ||
| 109 | + this.getData() | ||
| 110 | + } | ||
| 111 | + }) | ||
| 112 | + .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 113 | + } | ||
| 115 | else { | 114 | else { |
| 116 | if (this.followList.length == 0) { | 115 | if (this.followList.length == 0) { |
| 117 | this.ListLayout() | 116 | this.ListLayout() |
| @@ -12,14 +12,14 @@ export struct detailedSkeleton { | @@ -12,14 +12,14 @@ export struct detailedSkeleton { | ||
| 12 | Column() { | 12 | Column() { |
| 13 | Column() { | 13 | Column() { |
| 14 | textArea('100%', 20) | 14 | textArea('100%', 20) |
| 15 | - textArea('50%', 20) | 15 | + textArea('52.5%', 20) |
| 16 | } | 16 | } |
| 17 | .SkeletonStyle() | 17 | .SkeletonStyle() |
| 18 | .alignItems(HorizontalAlign.Start) | 18 | .alignItems(HorizontalAlign.Start) |
| 19 | 19 | ||
| 20 | Column() { | 20 | Column() { |
| 21 | - textArea('30%', 12) | ||
| 22 | - textArea('30%', 12) | 21 | + textArea('23%', 12) |
| 22 | + textArea('23%', 12) | ||
| 23 | } | 23 | } |
| 24 | .SkeletonStyle() | 24 | .SkeletonStyle() |
| 25 | .alignItems(HorizontalAlign.Start) | 25 | .alignItems(HorizontalAlign.Start) |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit'; | 2 | +import { DateTimeUtils, NetworkUtil, NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import { editModelParams } from '../model/EditInfoModel'; | 4 | import { editModelParams } from '../model/EditInfoModel'; |
| 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; | 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; |
| @@ -154,7 +154,7 @@ struct MineHomePage { | @@ -154,7 +154,7 @@ struct MineHomePage { | ||
| 154 | 154 | ||
| 155 | Row() { | 155 | Row() { |
| 156 | Row() { | 156 | Row() { |
| 157 | - Text(this.handlerNum(this.browseNum.toString())) | 157 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.browseNum)}`) |
| 158 | .textStyle() | 158 | .textStyle() |
| 159 | Text("阅读") | 159 | Text("阅读") |
| 160 | .textStyle2() | 160 | .textStyle2() |
| @@ -168,7 +168,7 @@ struct MineHomePage { | @@ -168,7 +168,7 @@ struct MineHomePage { | ||
| 168 | .vertical(true) | 168 | .vertical(true) |
| 169 | .opacity(0.4) | 169 | .opacity(0.4) |
| 170 | Row() { | 170 | Row() { |
| 171 | - Text(this.handlerNum(this.commentNum.toString())) | 171 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.commentNum)}`) |
| 172 | .textStyle() | 172 | .textStyle() |
| 173 | Text("评论") | 173 | Text("评论") |
| 174 | .textStyle2() | 174 | .textStyle2() |
| @@ -182,7 +182,7 @@ struct MineHomePage { | @@ -182,7 +182,7 @@ struct MineHomePage { | ||
| 182 | .vertical(true) | 182 | .vertical(true) |
| 183 | .opacity(0.4) | 183 | .opacity(0.4) |
| 184 | Row() { | 184 | Row() { |
| 185 | - Text(this.handlerNum(this.attentionNum.toString())) | 185 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.attentionNum)}`) |
| 186 | .textStyle() | 186 | .textStyle() |
| 187 | Text("关注") | 187 | Text("关注") |
| 188 | .textStyle2() | 188 | .textStyle2() |
| @@ -520,23 +520,6 @@ struct MineHomePage { | @@ -520,23 +520,6 @@ struct MineHomePage { | ||
| 520 | }) | 520 | }) |
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | - handlerNum(number: string) { | ||
| 524 | - const num = number??'0'; | ||
| 525 | - if (Number.parseInt(num) <= 9999) { | ||
| 526 | - return Number.parseInt(num).toString() | ||
| 527 | - } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | ||
| 528 | - const num1: string = num.slice(0, -4); // 万 | ||
| 529 | - const num2: string = num.slice(-4, -3); // 千 | ||
| 530 | - return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | ||
| 531 | - } else if (Number.parseInt(num) > 99999999) { | ||
| 532 | - const num1: string = num.slice(0, -8); // 亿 | ||
| 533 | - const num2: string = num.slice(-8, -7); | ||
| 534 | - return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | ||
| 535 | - } | ||
| 536 | - return num | ||
| 537 | - } | ||
| 538 | - | ||
| 539 | - | ||
| 540 | getUserLevel(){ | 523 | getUserLevel(){ |
| 541 | MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{ | 524 | MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{ |
| 542 | if(value!=null){ | 525 | if(value!=null){ |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | -import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; | 3 | +import { DateTimeUtils, NetworkUtil, NumberFormatterUtils, StringUtils } from 'wdKit'; |
| 4 | import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index'; | 4 | import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index'; |
| 5 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; | 5 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; |
| 6 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; | 6 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; |
| @@ -129,7 +129,7 @@ struct OtherNormalUserHomePage { | @@ -129,7 +129,7 @@ struct OtherNormalUserHomePage { | ||
| 129 | 129 | ||
| 130 | Row() { | 130 | Row() { |
| 131 | Row() { | 131 | Row() { |
| 132 | - Text(`${this.browseNum}`) | 132 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.browseNum)}`) |
| 133 | .textStyle() | 133 | .textStyle() |
| 134 | Text("阅读") | 134 | Text("阅读") |
| 135 | .textStyle2() | 135 | .textStyle2() |
| @@ -143,7 +143,7 @@ struct OtherNormalUserHomePage { | @@ -143,7 +143,7 @@ struct OtherNormalUserHomePage { | ||
| 143 | .vertical(true) | 143 | .vertical(true) |
| 144 | .opacity(0.4) | 144 | .opacity(0.4) |
| 145 | Row() { | 145 | Row() { |
| 146 | - Text(`${this.commentNum}`) | 146 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.commentNum)}`) |
| 147 | .textStyle() | 147 | .textStyle() |
| 148 | Text("评论") | 148 | Text("评论") |
| 149 | .textStyle2() | 149 | .textStyle2() |
| @@ -156,7 +156,7 @@ struct OtherNormalUserHomePage { | @@ -156,7 +156,7 @@ struct OtherNormalUserHomePage { | ||
| 156 | .vertical(true) | 156 | .vertical(true) |
| 157 | .opacity(0.4) | 157 | .opacity(0.4) |
| 158 | Row() { | 158 | Row() { |
| 159 | - Text(`${this.attentionNum}`) | 159 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.attentionNum)}`) |
| 160 | .textStyle() | 160 | .textStyle() |
| 161 | Text("关注") | 161 | Text("关注") |
| 162 | .textStyle2() | 162 | .textStyle2() |
| @@ -143,7 +143,7 @@ export struct DetailPlayVLivePage { | @@ -143,7 +143,7 @@ export struct DetailPlayVLivePage { | ||
| 143 | 143 | ||
| 144 | Stack({ alignContent: Alignment.Top }) { | 144 | Stack({ alignContent: Alignment.Top }) { |
| 145 | // 直播背景图,模糊处理 | 145 | // 直播背景图,模糊处理 |
| 146 | - Image(this.liveDetailPageLogic.imgUrl) | 146 | + Image(this.liveDetailPageLogic.getLiveCoverUrl()) |
| 147 | .height('100%') | 147 | .height('100%') |
| 148 | .width('100%') | 148 | .width('100%') |
| 149 | .blur(100) | 149 | .blur(100) |
| @@ -84,4 +84,11 @@ export class LiveDetailPageLogic { | @@ -84,4 +84,11 @@ export class LiveDetailPageLogic { | ||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | } | 86 | } |
| 87 | + | ||
| 88 | + getLiveCoverUrl() { | ||
| 89 | + if (this.contentDetailData.fullColumnImgUrls.length > 0) { | ||
| 90 | + return this.contentDetailData.fullColumnImgUrls[0].url | ||
| 91 | + } | ||
| 92 | + return '' | ||
| 93 | + } | ||
| 87 | } | 94 | } |
| @@ -18,8 +18,8 @@ export struct TabChatItemComponent { | @@ -18,8 +18,8 @@ export struct TabChatItemComponent { | ||
| 18 | 18 | ||
| 19 | build() { | 19 | build() { |
| 20 | Row() { | 20 | Row() { |
| 21 | - Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : | ||
| 22 | - this.item.senderUserAvatarUrl) | 21 | + Image(this.item.senderUserAvatarUrl) |
| 22 | + .alt($r('app.media.default_head')) | ||
| 23 | .borderRadius(90) | 23 | .borderRadius(90) |
| 24 | .width(24) | 24 | .width(24) |
| 25 | .height(24) | 25 | .height(24) |
| @@ -16,7 +16,8 @@ export struct TabLiveItemComponent { | @@ -16,7 +16,8 @@ export struct TabLiveItemComponent { | ||
| 16 | build() { | 16 | build() { |
| 17 | Column() { | 17 | Column() { |
| 18 | Row() { | 18 | Row() { |
| 19 | - Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl) | 19 | + Image(this.item.senderUserAvatarUrl) |
| 20 | + .alt($r('app.media.default_head')) | ||
| 20 | .borderRadius(90) | 21 | .borderRadius(90) |
| 21 | .width(24) | 22 | .width(24) |
| 22 | .height(24) | 23 | .height(24) |
| @@ -258,7 +258,7 @@ export struct PlayUIComponent { | @@ -258,7 +258,7 @@ export struct PlayUIComponent { | ||
| 258 | .fontWeight(400) | 258 | .fontWeight(400) |
| 259 | .fontColor(Color.White) | 259 | .fontColor(Color.White) |
| 260 | 260 | ||
| 261 | - if (this.liveRoomDataBean.pv > 0 && !StringUtils.isEmpty(this.liveUrl)) { | 261 | + if (this.liveRoomDataBean.pv > 0) { |
| 262 | Image($r('app.media.icon_live_player_status_end')) | 262 | Image($r('app.media.icon_live_player_status_end')) |
| 263 | .width(12) | 263 | .width(12) |
| 264 | .height(12) | 264 | .height(12) |
| @@ -164,6 +164,7 @@ export struct PlayerEndView { | @@ -164,6 +164,7 @@ export struct PlayerEndView { | ||
| 164 | .borderRadius(4) | 164 | .borderRadius(4) |
| 165 | if (this.contentDetailData.rmhInfo != null) { | 165 | if (this.contentDetailData.rmhInfo != null) { |
| 166 | Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) | 166 | Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) |
| 167 | + .alt($r('app.media.default_head')) | ||
| 167 | .width(80) | 168 | .width(80) |
| 168 | .height(80) | 169 | .height(80) |
| 169 | .borderRadius(40) | 170 | .borderRadius(40) |
| @@ -88,7 +88,6 @@ export struct DetailVideoListPage { | @@ -88,7 +88,6 @@ export struct DetailVideoListPage { | ||
| 88 | } | 88 | } |
| 89 | await this.getContentDetail(this.contentId, this.relId, this.relType) | 89 | await this.getContentDetail(this.contentId, this.relId, this.relType) |
| 90 | } | 90 | } |
| 91 | - await this.queryVideoList() | ||
| 92 | // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | 91 | // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) |
| 93 | 92 | ||
| 94 | } else { | 93 | } else { |
| @@ -100,7 +99,7 @@ export struct DetailVideoListPage { | @@ -100,7 +99,7 @@ export struct DetailVideoListPage { | ||
| 100 | aboutToAppear() { | 99 | aboutToAppear() { |
| 101 | // 在视频详情页 | 100 | // 在视频详情页 |
| 102 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; | 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; |
| 103 | - // console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) | 102 | + // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) |
| 104 | if (this.peopleShipHomeCreatorId) { | 103 | if (this.peopleShipHomeCreatorId) { |
| 105 | // 从人民号号主传过来的 | 104 | // 从人民号号主传过来的 |
| 106 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); | 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); |
| @@ -246,6 +245,8 @@ export struct DetailVideoListPage { | @@ -246,6 +245,8 @@ export struct DetailVideoListPage { | ||
| 246 | // console.log('获取互动点赞等数据===', JSON.stringify(res)) | 245 | // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 247 | }) | 246 | }) |
| 248 | this.data.push(resDTO.data[0]) | 247 | this.data.push(resDTO.data[0]) |
| 248 | + // console.log(TAG, 'getContentDetail 视频列表===', JSON.stringify(this.data)) | ||
| 249 | + await this.queryVideoList() | ||
| 249 | } | 250 | } |
| 250 | }) | 251 | }) |
| 251 | } | 252 | } |
| @@ -332,7 +333,7 @@ export struct DetailVideoListPage { | @@ -332,7 +333,7 @@ export struct DetailVideoListPage { | ||
| 332 | // console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data)) | 333 | // console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data)) |
| 333 | await this.getContentInteract(res.data) | 334 | await this.getContentInteract(res.data) |
| 334 | this.data = this.data.concat(res.data) | 335 | this.data = this.data.concat(res.data) |
| 335 | - // console.log('视频列表===', JSON.stringify(res.data)) | 336 | + // console.log(TAG, 'queryVideoList 视频列表===', JSON.stringify(this.data)) |
| 336 | } | 337 | } |
| 337 | }) | 338 | }) |
| 338 | } | 339 | } |
| @@ -232,15 +232,15 @@ export struct VideoChannelPage { | @@ -232,15 +232,15 @@ export struct VideoChannelPage { | ||
| 232 | .backgroundColor(Color.Transparent) | 232 | .backgroundColor(Color.Transparent) |
| 233 | 233 | ||
| 234 | } | 234 | } |
| 235 | - //顶部渐变遮罩 | ||
| 236 | - // .linearGradient({ | ||
| 237 | - // colors: [ | ||
| 238 | - // ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] | ||
| 239 | - // ] | ||
| 240 | - // }) | ||
| 241 | .zIndex(20) | 235 | .zIndex(20) |
| 242 | - .height($r('app.float.top_tab_bar_height_common')) | ||
| 243 | - .margin({ | 236 | + .height(44 + px2vp(this.topSafeHeight)) |
| 237 | + //顶部渐变遮罩 | ||
| 238 | + .linearGradient({ | ||
| 239 | + direction: GradientDirection.Top, // 渐变方向 | ||
| 240 | + colors: this.currentTopNavSelectedIndex === 0 ? [['rgba(18, 18, 18, 0)', 0], | ||
| 241 | + ['rgba(18, 18, 18, 0.5)', 1.0]] : []// 数组末尾元素占比小于1时满足重复着色效果 | ||
| 242 | + }) | ||
| 243 | + .padding({ | ||
| 244 | top: px2vp(this.topSafeHeight) | 244 | top: px2vp(this.topSafeHeight) |
| 245 | }) | 245 | }) |
| 246 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 246 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
-
Please register or login to post a comment