Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
19 changed files
with
154 additions
and
88 deletions
| @@ -50,9 +50,11 @@ export struct CardSourceInfo { | @@ -50,9 +50,11 @@ export struct CardSourceInfo { | ||
| 50 | 50 | ||
| 51 | showCommentNum() { | 51 | showCommentNum() { |
| 52 | const curRouter = router.getState().name; | 52 | const curRouter = router.getState().name; |
| 53 | - return curRouter !== 'PeopleShipHomePage' | 53 | + // return curRouter !== 'PeopleShipHomePage' |
| 54 | + return true | ||
| 54 | } | 55 | } |
| 55 | 56 | ||
| 57 | + | ||
| 56 | /** | 58 | /** |
| 57 | * 全域数字显示规则 | 59 | * 全域数字显示规则 |
| 58 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | 60 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 |
| @@ -154,8 +156,6 @@ export struct CardSourceInfo { | @@ -154,8 +156,6 @@ export struct CardSourceInfo { | ||
| 154 | .fontSize($r("app.float.font_size_11")) | 156 | .fontSize($r("app.float.font_size_11")) |
| 155 | .fontColor($r("app.color.color_B0B0B0")) | 157 | .fontColor($r("app.color.color_B0B0B0")) |
| 156 | .flexShrink(0) | 158 | .flexShrink(0) |
| 157 | - .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | ||
| 158 | - Visibility.Visible) | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | 161 | // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { |
| 1 | /** | 1 | /** |
| 2 | - * 直播详情 关注相关信息 | 2 | + * 直播详情 关注相关信息 直播详情页用户信息行 |
| 3 | */ | 3 | */ |
| 4 | import { | 4 | import { |
| 5 | ContentDetailRequest, | 5 | ContentDetailRequest, |
| @@ -40,6 +40,7 @@ export struct LiveFollowComponent { | @@ -40,6 +40,7 @@ export struct LiveFollowComponent { | ||
| 40 | bottomLeft: 90 | 40 | bottomLeft: 90 |
| 41 | }) | 41 | }) |
| 42 | Row() { | 42 | Row() { |
| 43 | + //号主头像 | ||
| 43 | Image(this.rmhInfo.rmhHeadUrl) | 44 | Image(this.rmhInfo.rmhHeadUrl) |
| 44 | .width(24) | 45 | .width(24) |
| 45 | .height(24) | 46 | .height(24) |
| @@ -54,6 +55,7 @@ export struct LiveFollowComponent { | @@ -54,6 +55,7 @@ export struct LiveFollowComponent { | ||
| 54 | WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | 55 | WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) |
| 55 | } | 56 | } |
| 56 | }) | 57 | }) |
| 58 | + //号主名称 | ||
| 57 | Text(this.rmhInfo.rmhName) | 59 | Text(this.rmhInfo.rmhName) |
| 58 | .fontColor(Color.White) | 60 | .fontColor(Color.White) |
| 59 | .maxLines(1) | 61 | .maxLines(1) |
| @@ -65,6 +67,7 @@ export struct LiveFollowComponent { | @@ -65,6 +67,7 @@ export struct LiveFollowComponent { | ||
| 65 | right: 6 | 67 | right: 6 |
| 66 | }) | 68 | }) |
| 67 | Blank() | 69 | Blank() |
| 70 | + //关注状态 | ||
| 68 | Text(this.followStatus === '0' ? '关注' : '已关注') | 71 | Text(this.followStatus === '0' ? '关注' : '已关注') |
| 69 | .fontColor(Color.White) | 72 | .fontColor(Color.White) |
| 70 | .fontWeight(500) | 73 | .fontWeight(500) |
| @@ -109,7 +109,8 @@ export struct Card6Component { | @@ -109,7 +109,8 @@ export struct Card6Component { | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | .alignItems(HorizontalAlign.Start) | 111 | .alignItems(HorizontalAlign.Start) |
| 112 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 112 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156) |
| 113 | + .constraintSize({minHeight: 78}) | ||
| 113 | .justifyContent(FlexAlign.SpaceBetween) | 114 | .justifyContent(FlexAlign.SpaceBetween) |
| 114 | .width('64%') | 115 | .width('64%') |
| 115 | 116 |
| 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | -import { PublicDialogManager } from 'wdKit/Index' | 2 | +import { Logger, PublicDialogManager } from 'wdKit/Index' |
| 3 | import { TrackConstants } from 'wdTracking/Index' | 3 | import { TrackConstants } from 'wdTracking/Index' |
| 4 | import { OperRowListView } from '../../view/OperRowListView' | 4 | import { OperRowListView } from '../../view/OperRowListView' |
| 5 | import { publishCommentModel } from '../model/PublishCommentModel' | 5 | import { publishCommentModel } from '../model/PublishCommentModel' |
| 6 | import { CommentComponent } from './CommentComponent' | 6 | import { CommentComponent } from './CommentComponent' |
| 7 | 7 | ||
| 8 | +const TAG = "CommentListDialogView" | ||
| 9 | + | ||
| 8 | /// 评论列表弹框 | 10 | /// 评论列表弹框 |
| 9 | @Component | 11 | @Component |
| 10 | export struct CommentListDialogView { | 12 | export struct CommentListDialogView { |
| 11 | - @Link @Watch('showCommentListChange') showCommentList: boolean | 13 | + @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 |
| 14 | + @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0 | ||
| 15 | + @Link showCommentList: boolean | ||
| 12 | @Link contentDetailData: ContentDetailDTO // 详情页传 | 16 | @Link contentDetailData: ContentDetailDTO // 详情页传 |
| 13 | @Link pageInfo: PageInfoDTO // 专题页传 | 17 | @Link pageInfo: PageInfoDTO // 专题页传 |
| 14 | @Link publishCommentModel: publishCommentModel | 18 | @Link publishCommentModel: publishCommentModel |
| 19 | + private maxHeight: number = 0 // px | ||
| 15 | onClose?: () => void | 20 | onClose?: () => void |
| 21 | + onHeightDidChange?: Callback<number> | ||
| 16 | 22 | ||
| 17 | - // @Consume pageId: TrackConstants.PageName | ||
| 18 | - // @Consume pageName: TrackConstants.PageName | ||
| 19 | - | ||
| 20 | - private dialogController: CustomDialogController = new CustomDialogController({ | ||
| 21 | - builder: CommentListDialog({ | ||
| 22 | - contentDetailData: this.contentDetailData, | ||
| 23 | - publishCommentModel:this.publishCommentModel, | ||
| 24 | - pageInfo: this.pageInfo, | ||
| 25 | - onClose: this.onClose | ||
| 26 | - }), | ||
| 27 | - autoCancel: true, | ||
| 28 | - cancel: () => { | ||
| 29 | - PublicDialogManager.shareInstance().closeDialog(this.dialogController) | ||
| 30 | - }, | ||
| 31 | - customStyle: true, | ||
| 32 | - alignment: DialogAlignment.Bottom, | ||
| 33 | - }) | ||
| 34 | - | ||
| 35 | - showCommentListChange(val: boolean) { | ||
| 36 | - if (this.showCommentList) { | ||
| 37 | - PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction.bind(this)) | ||
| 38 | - } else { | ||
| 39 | - PublicDialogManager.shareInstance().closeDialog(this.dialogController) | ||
| 40 | - } | 23 | + aboutToAppear(): void { |
| 24 | + this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16 | ||
| 41 | } | 25 | } |
| 42 | 26 | ||
| 43 | - closeAction() { | ||
| 44 | - if (this.onClose) { | ||
| 45 | - this.onClose() | ||
| 46 | - } else { | ||
| 47 | - this.showCommentList = false | 27 | + build() { |
| 28 | + Row() { | ||
| 48 | } | 29 | } |
| 30 | + .height("100%").width("100%") | ||
| 31 | + .bindSheet($$this.showCommentList, | ||
| 32 | + this.commentListDialog(), | ||
| 33 | + { | ||
| 34 | + height: this.maxHeight + 'px', | ||
| 35 | + preferType: SheetType.BOTTOM, | ||
| 36 | + showClose: false, | ||
| 37 | + dragBar: false, | ||
| 38 | + onDisappear: () => { | ||
| 39 | + this.showCommentList = false | ||
| 40 | + if (this.onClose) { this.onClose() } | ||
| 41 | + }, | ||
| 42 | + shouldDismiss:((sheetDismiss: SheetDismiss)=> { | ||
| 43 | + console.log("bind sheet shouldDismiss") | ||
| 44 | + sheetDismiss.dismiss() | ||
| 45 | + }), | ||
| 46 | + onHeightDidChange: (number: number) => { | ||
| 47 | + Logger.debug(TAG, "onHeightDidChange : " + number) | ||
| 48 | + let height = number | ||
| 49 | + if (height > this.maxHeight) { | ||
| 50 | + height = this.maxHeight | ||
| 51 | + } | ||
| 52 | + if (this.onHeightDidChange) { | ||
| 53 | + this.onHeightDidChange(height) | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + }) | ||
| 49 | } | 57 | } |
| 50 | 58 | ||
| 51 | - build() { | 59 | + @Builder commentListDialog() { |
| 60 | + Column() { | ||
| 61 | + CommentListDialog({ | ||
| 62 | + contentDetailData: this.contentDetailData, | ||
| 63 | + publishCommentModel:this.publishCommentModel, | ||
| 64 | + pageInfo: this.pageInfo, | ||
| 65 | + onClose: this.onClose | ||
| 66 | + }) | ||
| 67 | + }.height("100%").width("100%") | ||
| 52 | } | 68 | } |
| 53 | } | 69 | } |
| 54 | 70 | ||
| 55 | -@CustomDialog | 71 | +@Component |
| 56 | struct CommentListDialog { | 72 | struct CommentListDialog { |
| 57 | 73 | ||
| 58 | /// 内部使用 | 74 | /// 内部使用 |
| 59 | @Link publishCommentModel: publishCommentModel | 75 | @Link publishCommentModel: publishCommentModel |
| 60 | @State private operationButtonList: string[] = [] | 76 | @State private operationButtonList: string[] = [] |
| 61 | - controller?: CustomDialogController | ||
| 62 | - @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 | ||
| 63 | - @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0 | ||
| 64 | 77 | ||
| 65 | /// 外部初始化 | 78 | /// 外部初始化 |
| 66 | @Link contentDetailData: ContentDetailDTO // 详情页传 | 79 | @Link contentDetailData: ContentDetailDTO // 详情页传 |
| @@ -97,6 +110,7 @@ struct CommentListDialog { | @@ -97,6 +110,7 @@ struct CommentListDialog { | ||
| 97 | 110 | ||
| 98 | build() { | 111 | build() { |
| 99 | Column() { | 112 | Column() { |
| 113 | + Row().height(10) | ||
| 100 | this.titleHeaderView() | 114 | this.titleHeaderView() |
| 101 | 115 | ||
| 102 | CommentComponent({ | 116 | CommentComponent({ |
| @@ -117,11 +131,11 @@ struct CommentListDialog { | @@ -117,11 +131,11 @@ struct CommentListDialog { | ||
| 117 | styleType: 1, | 131 | styleType: 1, |
| 118 | inDialog: true, | 132 | inDialog: true, |
| 119 | dialogBeforeJumpOtherPageAction: () => { | 133 | dialogBeforeJumpOtherPageAction: () => { |
| 120 | - PublicDialogManager.shareInstance().closeLastDialog() | 134 | + // PublicDialogManager.shareInstance().closeLastDialog() |
| 121 | } | 135 | } |
| 122 | }) | 136 | }) |
| 123 | } | 137 | } |
| 124 | - .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px') | 138 | + .height("100%").width("100%") |
| 125 | .backgroundColor(Color.White) | 139 | .backgroundColor(Color.White) |
| 126 | } | 140 | } |
| 127 | 141 |
| @@ -58,7 +58,6 @@ export struct HomePageBottomCommentComponent { | @@ -58,7 +58,6 @@ export struct HomePageBottomCommentComponent { | ||
| 58 | this.curPageNum = 1; | 58 | this.curPageNum = 1; |
| 59 | this.hasMore = true | 59 | this.hasMore = true |
| 60 | this.isGetRequest = false | 60 | this.isGetRequest = false |
| 61 | - this.data_comment.clear() | ||
| 62 | 61 | ||
| 63 | if (!this.isLoading){ | 62 | if (!this.isLoading){ |
| 64 | this.getNewPageData() | 63 | this.getNewPageData() |
| @@ -71,6 +70,7 @@ export struct HomePageBottomCommentComponent { | @@ -71,6 +70,7 @@ export struct HomePageBottomCommentComponent { | ||
| 71 | this.isLoading = true | 70 | this.isLoading = true |
| 72 | //加载分页数据 | 71 | //加载分页数据 |
| 73 | this.getNewPageData() | 72 | this.getNewPageData() |
| 73 | + if(resolve) resolve('刷新成功') | ||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | }) | 76 | }) |
| @@ -98,7 +98,7 @@ export struct HomePageBottomCommentComponent { | @@ -98,7 +98,7 @@ export struct HomePageBottomCommentComponent { | ||
| 98 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 98 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 99 | if (isVisible) { | 99 | if (isVisible) { |
| 100 | let contentDTO = getParams(item) | 100 | let contentDTO = getParams(item) |
| 101 | - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO)) | 101 | + // TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO)) |
| 102 | } | 102 | } |
| 103 | }) | 103 | }) |
| 104 | }, (item: CommentListItem, index: number) => index.toString()) | 104 | }, (item: CommentListItem, index: number) => index.toString()) |
| @@ -127,6 +127,7 @@ export struct HomePageBottomCommentComponent { | @@ -127,6 +127,7 @@ export struct HomePageBottomCommentComponent { | ||
| 127 | let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum) | 127 | let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum) |
| 128 | 128 | ||
| 129 | MinePageDatasModel.getMineCommentListData(time, object, getContext(this)).then((value) => { | 129 | MinePageDatasModel.getMineCommentListData(time, object, getContext(this)).then((value) => { |
| 130 | + if (this.curPageNum === 1) this.data_comment.clear() | ||
| 130 | if (!this.data_comment || value.list.length == 0) { | 131 | if (!this.data_comment || value.list.length == 0) { |
| 131 | this.hasMore = false | 132 | this.hasMore = false |
| 132 | this.isLoading = false | 133 | this.isLoading = false |
| @@ -185,7 +186,7 @@ export struct HomePageBottomCommentComponent { | @@ -185,7 +186,7 @@ export struct HomePageBottomCommentComponent { | ||
| 185 | 186 | ||
| 186 | this.count = this.data_comment.totalCount() | 187 | this.count = this.data_comment.totalCount() |
| 187 | this.commentNum = value.totalCount | 188 | this.commentNum = value.totalCount |
| 188 | - if (value.pageNum === 1) { | 189 | + if (value.hasNext === 1) { |
| 189 | this.curPageNum++ | 190 | this.curPageNum++ |
| 190 | } else { | 191 | } else { |
| 191 | this.hasMore = false | 192 | this.hasMore = false |
| @@ -218,7 +219,7 @@ export struct HomePageBottomCommentComponent { | @@ -218,7 +219,7 @@ export struct HomePageBottomCommentComponent { | ||
| 218 | 219 | ||
| 219 | this.count = this.data_comment.totalCount() | 220 | this.count = this.data_comment.totalCount() |
| 220 | this.commentNum = value.totalCount | 221 | this.commentNum = value.totalCount |
| 221 | - if (value.pageNum === 1) { | 222 | + if (value.hasNext === 1) { |
| 222 | this.curPageNum++ | 223 | this.curPageNum++ |
| 223 | } else { | 224 | } else { |
| 224 | this.hasMore = false | 225 | this.hasMore = false |
| @@ -99,7 +99,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -99,7 +99,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 99 | if (isVisible) { | 99 | if (isVisible) { |
| 100 | let contentDTO = getParams(item) | 100 | let contentDTO = getParams(item) |
| 101 | //埋点crash 后面看看 | 101 | //埋点crash 后面看看 |
| 102 | - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO)) | 102 | + // TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO)) |
| 103 | } | 103 | } |
| 104 | }) | 104 | }) |
| 105 | }, (item: CommentListItem, index: number) => index.toString()) | 105 | }, (item: CommentListItem, index: number) => index.toString()) |
| @@ -61,6 +61,8 @@ export struct TopNavigationComponentNew { | @@ -61,6 +61,8 @@ export struct TopNavigationComponentNew { | ||
| 61 | @State indicatorLeftMargin: number = 0 | 61 | @State indicatorLeftMargin: number = 0 |
| 62 | @State indicatorWidth: number = 0 | 62 | @State indicatorWidth: number = 0 |
| 63 | 63 | ||
| 64 | + @State isClickMorningEveningPaper: boolean = false | ||
| 65 | + | ||
| 64 | build() { | 66 | build() { |
| 65 | Column() { | 67 | Column() { |
| 66 | // 频道分类list | 68 | // 频道分类list |
| @@ -171,15 +173,22 @@ export struct TopNavigationComponentNew { | @@ -171,15 +173,22 @@ export struct TopNavigationComponentNew { | ||
| 171 | .height(30) | 173 | .height(30) |
| 172 | .width(124) | 174 | .width(124) |
| 173 | .onClick(() => { | 175 | .onClick(() => { |
| 176 | + //防止多次点击 | ||
| 177 | + if(!this.isClickMorningEveningPaper) { | ||
| 178 | + this.isClickMorningEveningPaper = true; | ||
| 179 | + let c = setInterval(() => { | ||
| 180 | + this.isClickMorningEveningPaper = false | ||
| 181 | + }, 1000); | ||
| 182 | + | ||
| 183 | + // 早晚报埋点 | ||
| 184 | + const params: ParamType = { | ||
| 185 | + "pageName": this.pageName, | ||
| 186 | + "pageId": this.pageId, | ||
| 187 | + } | ||
| 188 | + Tracking.event("morning_evening_news_click", params) | ||
| 174 | 189 | ||
| 175 | - // 早晚报埋点 | ||
| 176 | - const params: ParamType = { | ||
| 177 | - "pageName": this.pageName, | ||
| 178 | - "pageId": this.pageId, | 190 | + this.clickMorningEveningPaper() |
| 179 | } | 191 | } |
| 180 | - Tracking.event("morning_evening_news_click", params) | ||
| 181 | - | ||
| 182 | - this.clickMorningEveningPaper() | ||
| 183 | }) | 192 | }) |
| 184 | }.width('100%') | 193 | }.width('100%') |
| 185 | .justifyContent(FlexAlign.SpaceBetween) | 194 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -189,7 +189,7 @@ export struct LiveOperRowListView { | @@ -189,7 +189,7 @@ export struct LiveOperRowListView { | ||
| 189 | Stack({ alignContent: Alignment.Start }) { | 189 | Stack({ alignContent: Alignment.Start }) { |
| 190 | RelativeContainer() { | 190 | RelativeContainer() { |
| 191 | 191 | ||
| 192 | - Image($r('app.media.comment_img_input_hui')) | 192 | + Image(this.styleType == 1 ? $r('app.media.comment_img_input_hui'):$r('app.media.comment_img_input_black')) |
| 193 | .objectFit(ImageFit.Fill) | 193 | .objectFit(ImageFit.Fill) |
| 194 | .resizable({ | 194 | .resizable({ |
| 195 | slice: { | 195 | slice: { |
| @@ -208,7 +208,7 @@ export struct LiveOperRowListView { | @@ -208,7 +208,7 @@ export struct LiveOperRowListView { | ||
| 208 | .id("Image") | 208 | .id("Image") |
| 209 | Text("说两句...") | 209 | Text("说两句...") |
| 210 | .fontSize(12) | 210 | .fontSize(12) |
| 211 | - .fontColor('#999999') | 211 | + .fontColor(this.styleType == 1 ? '#999999':'#CCFFFFFF') |
| 212 | .margin({ left: 10 }) | 212 | .margin({ left: 10 }) |
| 213 | .alignRules({ | 213 | .alignRules({ |
| 214 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 214 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| @@ -73,6 +73,7 @@ struct MineHomePage { | @@ -73,6 +73,7 @@ struct MineHomePage { | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | build() { | 75 | build() { |
| 76 | + Column(){ | ||
| 76 | if(this.isConnectNetwork){ | 77 | if(this.isConnectNetwork){ |
| 77 | Stack({ alignContent: Alignment.Top }){ | 78 | Stack({ alignContent: Alignment.Top }){ |
| 78 | Stack({ alignContent: Alignment.Top }){ | 79 | Stack({ alignContent: Alignment.Top }){ |
| @@ -299,7 +300,7 @@ struct MineHomePage { | @@ -299,7 +300,7 @@ struct MineHomePage { | ||
| 299 | } | 300 | } |
| 300 | .margin({top:px2vp(this.topSafeHeight)}) | 301 | .margin({top:px2vp(this.topSafeHeight)}) |
| 301 | }.width('100%') | 302 | }.width('100%') |
| 302 | - .padding({bottom:px2vp(this.bottomSafeHeight)}) | 303 | + // .padding({bottom:px2vp(this.bottomSafeHeight)}) |
| 303 | .layoutWeight(1) | 304 | .layoutWeight(1) |
| 304 | }else{ | 305 | }else{ |
| 305 | Column(){ | 306 | Column(){ |
| @@ -316,6 +317,8 @@ struct MineHomePage { | @@ -316,6 +317,8 @@ struct MineHomePage { | ||
| 316 | } | 317 | } |
| 317 | } | 318 | } |
| 318 | 319 | ||
| 320 | + }.padding({bottom:px2vp(this.bottomSafeHeight)}) | ||
| 321 | + | ||
| 319 | } | 322 | } |
| 320 | @Builder MineHomeTitleTransparent() { | 323 | @Builder MineHomeTitleTransparent() { |
| 321 | RelativeContainer() { | 324 | RelativeContainer() { |
| @@ -13,6 +13,7 @@ import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; | @@ -13,6 +13,7 @@ import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; | ||
| 13 | const TAG = 'DetailPlayLiveCommon' | 13 | const TAG = 'DetailPlayLiveCommon' |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | + * 直播详情页 | ||
| 16 | * @Description: 沉浸式和非沉浸式直播页面 | 17 | * @Description: 沉浸式和非沉浸式直播页面 |
| 17 | * @Author: | 18 | * @Author: |
| 18 | * @Email: | 19 | * @Email: |
| @@ -10,6 +10,7 @@ import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | @@ -10,6 +10,7 @@ import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | ||
| 10 | import { TrackConstants, TrackingButton } from 'wdTracking/Index'; | 10 | import { TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 11 | import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; | 11 | import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; |
| 12 | import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg'; | 12 | import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg'; |
| 13 | +import { StringUtils } from 'wdKit'; | ||
| 13 | 14 | ||
| 14 | const storage = LocalStorage.getShared(); | 15 | const storage = LocalStorage.getShared(); |
| 15 | const TAG = 'DetailPlayVLivePage' | 16 | const TAG = 'DetailPlayVLivePage' |
| @@ -97,7 +98,7 @@ export struct DetailPlayVLivePage { | @@ -97,7 +98,7 @@ export struct DetailPlayVLivePage { | ||
| 97 | .blur(100) | 98 | .blur(100) |
| 98 | .renderFit(RenderFit.RESIZE_COVER) | 99 | .renderFit(RenderFit.RESIZE_COVER) |
| 99 | // 直播结束且无回看 | 100 | // 直播结束且无回看 |
| 100 | - if (this.liveState === 'end' && !this.playUrl) { | 101 | + if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) { |
| 101 | PlayerEndView() | 102 | PlayerEndView() |
| 102 | } else { | 103 | } else { |
| 103 | // 直播暂停,仍然可以评论 | 104 | // 直播暂停,仍然可以评论 |
| @@ -6,7 +6,7 @@ import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer | @@ -6,7 +6,7 @@ import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer | ||
| 6 | import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | 6 | import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; |
| 7 | import { DisplayDirection } from 'wdConstant/Index'; | 7 | import { DisplayDirection } from 'wdConstant/Index'; |
| 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; | 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; |
| 9 | - | 9 | +//直播间播放器上层覆盖物 |
| 10 | @Component | 10 | @Component |
| 11 | export struct PlayUIComponent { | 11 | export struct PlayUIComponent { |
| 12 | playerController?: WDAliPlayerController; | 12 | playerController?: WDAliPlayerController; |
| @@ -84,11 +84,12 @@ export struct PlayUIComponent { | @@ -84,11 +84,12 @@ export struct PlayUIComponent { | ||
| 84 | .height('100%') | 84 | .height('100%') |
| 85 | .alignItems(HorizontalAlign.Start) | 85 | .alignItems(HorizontalAlign.Start) |
| 86 | } | 86 | } |
| 87 | - | 87 | + //最顶部UI |
| 88 | @Builder | 88 | @Builder |
| 89 | getTopUIComponent() { | 89 | getTopUIComponent() { |
| 90 | Column() { | 90 | Column() { |
| 91 | Row() { | 91 | Row() { |
| 92 | + //返回键 | ||
| 92 | Image($r('app.media.icon_arrow_left_white')) | 93 | Image($r('app.media.icon_arrow_left_white')) |
| 93 | .width(24) | 94 | .width(24) |
| 94 | .aspectRatio(1) | 95 | .aspectRatio(1) |
| @@ -105,6 +106,7 @@ export struct PlayUIComponent { | @@ -105,6 +106,7 @@ export struct PlayUIComponent { | ||
| 105 | 106 | ||
| 106 | }) | 107 | }) |
| 107 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { | 108 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 109 | + //标题 | ||
| 108 | Text(this.contentDetailData.newsTitle) | 110 | Text(this.contentDetailData.newsTitle) |
| 109 | .maxLines(1) | 111 | .maxLines(1) |
| 110 | .textOverflow({ overflow: TextOverflow.MARQUEE }) | 112 | .textOverflow({ overflow: TextOverflow.MARQUEE }) |
| @@ -116,6 +118,7 @@ export struct PlayUIComponent { | @@ -116,6 +118,7 @@ export struct PlayUIComponent { | ||
| 116 | } else { | 118 | } else { |
| 117 | Blank() | 119 | Blank() |
| 118 | } | 120 | } |
| 121 | + //分享按钮 | ||
| 119 | Image($r('app.media.icon_share')) | 122 | Image($r('app.media.icon_share')) |
| 120 | .width(24) | 123 | .width(24) |
| 121 | .aspectRatio(1) | 124 | .aspectRatio(1) |
| @@ -126,16 +129,18 @@ export struct PlayUIComponent { | @@ -126,16 +129,18 @@ export struct PlayUIComponent { | ||
| 126 | .margin({ | 129 | .margin({ |
| 127 | bottom: 10 | 130 | bottom: 10 |
| 128 | }) | 131 | }) |
| 129 | - | 132 | + //第二行左边号主信息 |
| 130 | Row() { | 133 | Row() { |
| 131 | if (this.contentDetailData?.rmhInfo) { | 134 | if (this.contentDetailData?.rmhInfo) { |
| 132 | LiveFollowComponent({ | 135 | LiveFollowComponent({ |
| 133 | rmhInfo: this.contentDetailData.rmhInfo | 136 | rmhInfo: this.contentDetailData.rmhInfo |
| 134 | }) | 137 | }) |
| 135 | .margin({ | 138 | .margin({ |
| 139 | + top:-7, | ||
| 136 | right: 10 | 140 | right: 10 |
| 137 | }) | 141 | }) |
| 138 | } | 142 | } |
| 143 | + //第二行右边直播状态参与人数 | ||
| 139 | this.getLiveStatusView() | 144 | this.getLiveStatusView() |
| 140 | } | 145 | } |
| 141 | } | 146 | } |
| 1 | import { WDAliPlayerController } from 'wdPlayer/Index' | 1 | import { WDAliPlayerController } from 'wdPlayer/Index' |
| 2 | import { PlayerUIComponent } from './PlayerUIComponent' | 2 | import { PlayerUIComponent } from './PlayerUIComponent' |
| 3 | - | 3 | +//竖屏直播详情页左右滑动浮层 |
| 4 | @Component | 4 | @Component |
| 5 | export struct PlayerInfoComponent { | 5 | export struct PlayerInfoComponent { |
| 6 | swiperController?: SwiperController | 6 | swiperController?: SwiperController |
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | postInteractBrowsOperateParams | 8 | postInteractBrowsOperateParams |
| 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 10 | import { HttpUtils } from 'wdNetwork/Index'; | 10 | import { HttpUtils } from 'wdNetwork/Index'; |
| 11 | -import { DateTimeUtils, WindowModel } from 'wdKit/Index'; | 11 | +import { DateTimeUtils, Logger, WindowModel } from 'wdKit/Index'; |
| 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; | 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; |
| 13 | import { PlayerRightView } from '../view/PlayerRightView'; | 13 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 14 | import { DisplayDirection } from 'wdConstant/Index'; | 14 | import { DisplayDirection } from 'wdConstant/Index'; |
| @@ -248,7 +248,7 @@ export struct DetailPlayShortVideoPage { | @@ -248,7 +248,7 @@ export struct DetailPlayShortVideoPage { | ||
| 248 | showCommentListChanged() { | 248 | showCommentListChanged() { |
| 249 | if (this.showCommentList) { | 249 | if (this.showCommentList) { |
| 250 | this.playerWidth = px2vp(this.windowWidth) | 250 | this.playerWidth = px2vp(this.windowWidth) |
| 251 | - this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) | 251 | + // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) |
| 252 | } else { | 252 | } else { |
| 253 | this.calculatePlayerRect() | 253 | this.calculatePlayerRect() |
| 254 | } | 254 | } |
| @@ -264,6 +264,11 @@ export struct DetailPlayShortVideoPage { | @@ -264,6 +264,11 @@ export struct DetailPlayShortVideoPage { | ||
| 264 | showCommentList: $showCommentList, | 264 | showCommentList: $showCommentList, |
| 265 | publishCommentModel: $publishCommentModel, | 265 | publishCommentModel: $publishCommentModel, |
| 266 | interactData: $interactData, | 266 | interactData: $interactData, |
| 267 | + onHeightDidChange: (height: number) => { | ||
| 268 | + this.playerWidth = px2vp(this.windowWidth) | ||
| 269 | + this.playerHeight = px2vp(this.windowHeight - height) | ||
| 270 | + Logger.debug(TAG, "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " + px2vp(this.windowHeight)) | ||
| 271 | + } | ||
| 267 | }) | 272 | }) |
| 268 | this.playerViewBuilder() | 273 | this.playerViewBuilder() |
| 269 | 274 | ||
| @@ -406,7 +411,7 @@ export struct DetailPlayShortVideoPage { | @@ -406,7 +411,7 @@ export struct DetailPlayShortVideoPage { | ||
| 406 | 411 | ||
| 407 | // 横屏-全屏观看 | 412 | // 横屏-全屏观看 |
| 408 | // 点击查看详情 不展示 | 413 | // 点击查看详情 不展示 |
| 409 | - if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL) { | 414 | + if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL && !this.showCommentList) { |
| 410 | this.playerFullscreenBuilder() | 415 | this.playerFullscreenBuilder() |
| 411 | } | 416 | } |
| 412 | 417 |
| @@ -12,6 +12,7 @@ export struct CommentDialogView { | @@ -12,6 +12,7 @@ export struct CommentDialogView { | ||
| 12 | @Link interactData: InteractDataDTO | 12 | @Link interactData: InteractDataDTO |
| 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| 15 | + onHeightDidChange?: Callback<number> | ||
| 15 | 16 | ||
| 16 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false | 17 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false |
| 17 | 18 | ||
| @@ -38,7 +39,8 @@ export struct CommentDialogView { | @@ -38,7 +39,8 @@ export struct CommentDialogView { | ||
| 38 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { | 39 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { |
| 39 | this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) | 40 | this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) |
| 40 | } | 41 | } |
| 41 | - } | 42 | + }, |
| 43 | + onHeightDidChange: this.onHeightDidChange | ||
| 42 | }) | 44 | }) |
| 43 | } | 45 | } |
| 44 | } | 46 | } |
| @@ -141,7 +141,27 @@ export struct WDPlayerRenderView { | @@ -141,7 +141,27 @@ export struct WDPlayerRenderView { | ||
| 141 | 141 | ||
| 142 | this.xComponentController.setXComponentSurfaceRect({ | 142 | this.xComponentController.setXComponentSurfaceRect({ |
| 143 | surfaceWidth: info.size.height * ratio, | 143 | surfaceWidth: info.size.height * ratio, |
| 144 | - surfaceHeight: info.size.height | 144 | + surfaceHeight: info.size.height, |
| 145 | + offsetY: 0 | ||
| 146 | + }); | ||
| 147 | + return | ||
| 148 | + } | ||
| 149 | + } else { | ||
| 150 | + // 横屏 | ||
| 151 | + let ratio = this.videoWidth / this.videoHeight | ||
| 152 | + const height = info.size.width / ratio | ||
| 153 | + | ||
| 154 | + // 横屏,缩放高度小 视频区域高度 | ||
| 155 | + if (height < info.size.height) { | ||
| 156 | + | ||
| 157 | + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height) | ||
| 158 | + | ||
| 159 | + Logger.debug(TAG, "宽度固定,求高度: " + height) | ||
| 160 | + | ||
| 161 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 162 | + surfaceWidth: info.size.width, | ||
| 163 | + surfaceHeight: height, | ||
| 164 | + offsetY: (info.size.height - height) / 2 | ||
| 145 | }); | 165 | }); |
| 146 | return | 166 | return |
| 147 | } | 167 | } |
| @@ -149,7 +169,8 @@ export struct WDPlayerRenderView { | @@ -149,7 +169,8 @@ export struct WDPlayerRenderView { | ||
| 149 | 169 | ||
| 150 | this.xComponentController.setXComponentSurfaceRect({ | 170 | this.xComponentController.setXComponentSurfaceRect({ |
| 151 | surfaceWidth: info.size.width, | 171 | surfaceWidth: info.size.width, |
| 152 | - surfaceHeight: info.size.height | 172 | + surfaceHeight: info.size.height, |
| 173 | + offsetY: 0 | ||
| 153 | }); | 174 | }); |
| 154 | } | 175 | } |
| 155 | 176 |
| @@ -18,23 +18,23 @@ export class Tracking { | @@ -18,23 +18,23 @@ export class Tracking { | ||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | //TODO: 添加运行单独线程? | 20 | //TODO: 添加运行单独线程? |
| 21 | - taskpool.execute(doTrack, eventId, params).then(() => { | ||
| 22 | - Logger.error('yyyy','event track success') | ||
| 23 | - }).catch(()=>{ | ||
| 24 | - Logger.error('yyyy','event track failed') | ||
| 25 | - }) | ||
| 26 | - | ||
| 27 | - // let publicParams = new PublicParams() | ||
| 28 | - // publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | - // | ||
| 30 | - // if (params) { | ||
| 31 | - // for (const obj of Object.entries(params)) { | ||
| 32 | - // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | - // pubParams[obj[0]] = obj[1] | ||
| 34 | - // } | ||
| 35 | - // } | ||
| 36 | - // sensors.track(eventId, pubParams) | 21 | + // taskpool.execute(doTrack, eventId, params).then(() => { |
| 22 | + // Logger.error('yyyy','event track success') | ||
| 23 | + // }).catch(()=>{ | ||
| 24 | + // Logger.error('yyyy','event track failed') | ||
| 37 | // }) | 25 | // }) |
| 26 | + | ||
| 27 | + let publicParams = new PublicParams() | ||
| 28 | + publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | + | ||
| 30 | + if (params) { | ||
| 31 | + for (const obj of Object.entries(params)) { | ||
| 32 | + // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | + pubParams[obj[0]] = obj[1] | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + sensors.track(eventId, pubParams) | ||
| 37 | + }) | ||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 |
| @@ -80,7 +80,7 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility { | @@ -80,7 +80,7 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility { | ||
| 80 | Logger.debug(TAG, ` xFailed to updateForm. Code: ${err.code}, message: ${err.message}`); | 80 | Logger.debug(TAG, ` xFailed to updateForm. Code: ${err.code}, message: ${err.message}`); |
| 81 | }); | 81 | }); |
| 82 | 82 | ||
| 83 | - let fileDir = this.context.getApplicationContext().filesDir + "/widget-daily-newspaper" | 83 | + let fileDir = this.context.getApplicationContext().tempDir + "/widget-daily-newspaper" |
| 84 | await FileUtils.makeDirIfNotExsit(fileDir) | 84 | await FileUtils.makeDirIfNotExsit(fileDir) |
| 85 | 85 | ||
| 86 | NewspaperDataFetcher.dealWithPictures(data, formId, fileDir, (data) => { | 86 | NewspaperDataFetcher.dealWithPictures(data, formId, fileDir, (data) => { |
| @@ -92,7 +92,7 @@ export class NewspaperDataFetcher { | @@ -92,7 +92,7 @@ export class NewspaperDataFetcher { | ||
| 92 | 92 | ||
| 93 | CrptoUtils.md5(data.paperInfo.leftImageUrl).then((md5String) => { | 93 | CrptoUtils.md5(data.paperInfo.leftImageUrl).then((md5String) => { |
| 94 | 94 | ||
| 95 | - const fileName = formId + "file" + md5String; | 95 | + const fileName = formId + "file" + Date.now(); |
| 96 | const filePath = tempDir + "/" + fileName | 96 | const filePath = tempDir + "/" + fileName |
| 97 | NewspaperDataFetcher.downloadUrlToPath(data.paperInfo.leftImageUrl!, filePath).then(() => { | 97 | NewspaperDataFetcher.downloadUrlToPath(data.paperInfo.leftImageUrl!, filePath).then(() => { |
| 98 | let file = fs.openSync(filePath) | 98 | let file = fs.openSync(filePath) |
| @@ -119,7 +119,7 @@ export class NewspaperDataFetcher { | @@ -119,7 +119,7 @@ export class NewspaperDataFetcher { | ||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | CrptoUtils.md5(content.coverUrl).then((md5String) => { | 121 | CrptoUtils.md5(content.coverUrl).then((md5String) => { |
| 122 | - const fileName = formId + "file" + md5String; | 122 | + const fileName = formId + "file" + Date.now() + index; |
| 123 | const filePath = tempDir + "/" + fileName | 123 | const filePath = tempDir + "/" + fileName |
| 124 | NewspaperDataFetcher.downloadUrlToPath(content.coverUrl!, filePath).then(() => { | 124 | NewspaperDataFetcher.downloadUrlToPath(content.coverUrl!, filePath).then(() => { |
| 125 | Logger.debug(TAG, "open file for display "); | 125 | Logger.debug(TAG, "open file for display "); |
-
Please register or login to post a comment