Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
16 changed files
with
276 additions
and
77 deletions
| @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; | @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; | ||
| 15 | export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' | 15 | export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' |
| 16 | 16 | ||
| 17 | export { AppInnerLink } from './src/main/ets/utils/AppInnerLink' | 17 | export { AppInnerLink } from './src/main/ets/utils/AppInnerLink' |
| 18 | + | ||
| 19 | +export { ContentType } from './src/main/ets/common/ContentType' |
| 1 | +export enum ContentType { | ||
| 2 | + | ||
| 3 | + /// 不跳转 | ||
| 4 | + Unknown = 0, | ||
| 5 | + ///点播 | ||
| 6 | + Video = 1, | ||
| 7 | + | ||
| 8 | + ///直播 | ||
| 9 | + Live = 2, | ||
| 10 | + | ||
| 11 | + ///活动 | ||
| 12 | + Activity = 3, | ||
| 13 | + | ||
| 14 | + ///信息流广告 | ||
| 15 | + InfoflowAD = 4, | ||
| 16 | + | ||
| 17 | + ///专题 | ||
| 18 | + Subject = 5, | ||
| 19 | + | ||
| 20 | + ///链接 | ||
| 21 | + Link = 6, | ||
| 22 | + | ||
| 23 | + ///榜单 | ||
| 24 | + RankList = 7, | ||
| 25 | + | ||
| 26 | + /// 图文 | ||
| 27 | + ImageText = 8, | ||
| 28 | + /// 组图 | ||
| 29 | + Pictures = 9, | ||
| 30 | + | ||
| 31 | + /// H5新闻 (仅海外版存在,视界和中文端无此类型。中文端按照图文8类型+link) | ||
| 32 | + H5News = 10, | ||
| 33 | + /// 频道 | ||
| 34 | + Channel = 11, | ||
| 35 | + ///组件 | ||
| 36 | + Module = 12, | ||
| 37 | + ///音频 | ||
| 38 | + Audio = 13, | ||
| 39 | + ///动态图文 | ||
| 40 | + DynamicImageText = 14, | ||
| 41 | + | ||
| 42 | + ///动态视频 | ||
| 43 | + DynamicVideo = 15, | ||
| 44 | + | ||
| 45 | + ///问政留言 | ||
| 46 | + Ask = 16, | ||
| 47 | + | ||
| 48 | + /// 金刚位 | ||
| 49 | + KeyPosition = 30, | ||
| 50 | + | ||
| 51 | + /// 合集 | ||
| 52 | + Serials = 101, | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + | ||
| 56 | +} |
| @@ -39,6 +39,8 @@ export interface ShareContentLink { | @@ -39,6 +39,8 @@ export interface ShareContentLink { | ||
| 39 | desc?: string | 39 | desc?: string |
| 40 | link: string | 40 | link: string |
| 41 | icon?: string | 41 | icon?: string |
| 42 | + deeplink: string // 根据内容详情,生成的深度链接 如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1 | ||
| 43 | + | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink | 46 | export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink |
| @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit'; | @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit'; | ||
| 6 | import { common } from '@kit.AbilityKit'; | 6 | import { common } from '@kit.AbilityKit'; |
| 7 | import { systemShare } from '@kit.ShareKit'; | 7 | import { systemShare } from '@kit.ShareKit'; |
| 8 | import { uniformTypeDescriptor as utd } from '@kit.ArkData'; | 8 | import { uniformTypeDescriptor as utd } from '@kit.ArkData'; |
| 9 | +import { JSON } from '@kit.ArkTS'; | ||
| 10 | + | ||
| 11 | +const TAG = "WDSystemShare" | ||
| 9 | 12 | ||
| 10 | export class WDSystemShare implements WDShareInterface { | 13 | export class WDSystemShare implements WDShareInterface { |
| 11 | 14 | ||
| @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface { | @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface { | ||
| 14 | return new Promise((resolve, fail) => { | 17 | return new Promise((resolve, fail) => { |
| 15 | try { | 18 | try { |
| 16 | 19 | ||
| 17 | - let controller: systemShare.ShareController = new systemShare.ShareController(this.getShareData(content, contentType)); | 20 | + let data = this.getShareData(content, contentType) |
| 21 | + let controller: systemShare.ShareController = new systemShare.ShareController(data); | ||
| 18 | let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext | 22 | let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext |
| 19 | 23 | ||
| 20 | controller.on('dismiss', () => { | 24 | controller.on('dismiss', () => { |
| @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface { | @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface { | ||
| 53 | }); | 57 | }); |
| 54 | data.addRecord({ | 58 | data.addRecord({ |
| 55 | utd: utd.UniformDataType.PNG, | 59 | utd: utd.UniformDataType.PNG, |
| 56 | - uri: imageAndText.imgURI | 60 | + uri: imageAndText.imgURI // 这里必须为本地连接 |
| 57 | }); | 61 | }); |
| 58 | return data | 62 | return data |
| 59 | } | 63 | } |
| @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface { | @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface { | ||
| 64 | utd: utd.UniformDataType.PLAIN_TEXT, | 68 | utd: utd.UniformDataType.PLAIN_TEXT, |
| 65 | content: link.title | 69 | content: link.title |
| 66 | }); | 70 | }); |
| 71 | + let shareLink = this.generateShareLink(link) | ||
| 72 | + console.log("分享 shareLink ==> " + shareLink) | ||
| 67 | data.addRecord({ | 73 | data.addRecord({ |
| 68 | utd: utd.UniformDataType.HYPERLINK, | 74 | utd: utd.UniformDataType.HYPERLINK, |
| 69 | - uri: link.link | 75 | + // uri: link.link // SDK 设计 不能传这里 |
| 76 | + content: link.link | ||
| 70 | }); | 77 | }); |
| 71 | return data | 78 | return data |
| 72 | } | 79 | } |
| 73 | 80 | ||
| 81 | + generateShareLink(shareContent: ShareContentLink) { | ||
| 82 | + let link = "https://peopledailychinahosactivity.drcn.agconnect.link?deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 83 | + | ||
| 84 | + link += "&harmonyos_deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 85 | + link += "&harmonyos_package_name=com.peopledailychina.hosactivity" | ||
| 86 | + link += "&harmonyos_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 74 | 87 | ||
| 88 | + // link += "&android_deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 89 | + // link += "&android_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 90 | + // | ||
| 91 | + // link += "&ios_link=" + encodeURIComponent(shareContent.deeplink) | ||
| 92 | + // link += "&ios_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 93 | + | ||
| 94 | + link += "&preview_type=1" | ||
| 95 | + link += "&landing_page_type=1" | ||
| 96 | + // link += "&social_desc=" + encodeURIComponent(shareContent.desc || " ") | ||
| 97 | + // link += "&social_image=" + encodeURIComponent(shareContent.icon || " ") | ||
| 98 | + // link += "&social_title=" + encodeURIComponent(shareContent.title) | ||
| 99 | + link += "®ion_id=0" | ||
| 100 | + return link | ||
| 101 | + } | ||
| 75 | } | 102 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -112,13 +112,12 @@ export struct QualityCommentsComponent { | @@ -112,13 +112,12 @@ export struct QualityCommentsComponent { | ||
| 112 | Image($r('app.media.comment_img_banner')).width('100%') | 112 | Image($r('app.media.comment_img_banner')).width('100%') |
| 113 | .height(283) | 113 | .height(283) |
| 114 | // .aspectRatio(375 / 283); | 114 | // .aspectRatio(375 / 283); |
| 115 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 116 | } | 115 | } |
| 117 | .onAreaChange((oldValue: Area, newValue: Area) => { | 116 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 118 | - if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) { | ||
| 119 | - this.firstPositionY = Number(newValue.globalPosition.y) | ||
| 120 | - return | ||
| 121 | - } | 117 | + // if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) { |
| 118 | + // this.firstPositionY = Number(newValue.globalPosition.y) | ||
| 119 | + // return | ||
| 120 | + // } | ||
| 122 | Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) | 121 | Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) |
| 123 | Logger.debug(TAG, | 122 | Logger.debug(TAG, |
| 124 | "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight) | 123 | "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight) |
| @@ -128,9 +127,16 @@ export struct QualityCommentsComponent { | @@ -128,9 +127,16 @@ export struct QualityCommentsComponent { | ||
| 128 | persent = 1 | 127 | persent = 1 |
| 129 | } | 128 | } |
| 130 | this.tileOpacity = persent | 129 | this.tileOpacity = persent |
| 131 | - | 130 | + this.topOpacityChange() |
| 132 | }) | 131 | }) |
| 133 | } | 132 | } |
| 133 | + topOpacityChange(){ | ||
| 134 | + if(this.tileOpacity > 0.8){ | ||
| 135 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 136 | + }else{ | ||
| 137 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 138 | + } | ||
| 139 | + } | ||
| 134 | 140 | ||
| 135 | /*透明导航栏*/ | 141 | /*透明导航栏*/ |
| 136 | @Builder | 142 | @Builder |
| @@ -164,16 +170,20 @@ export struct QualityCommentsComponent { | @@ -164,16 +170,20 @@ export struct QualityCommentsComponent { | ||
| 164 | @Builder | 170 | @Builder |
| 165 | TabbarNormal() { | 171 | TabbarNormal() { |
| 166 | Stack({ alignContent: Alignment.Top }) { | 172 | Stack({ alignContent: Alignment.Top }) { |
| 173 | + //// 默认显示的白色返回按钮 | ||
| 167 | Row() { | 174 | Row() { |
| 168 | - } | ||
| 169 | - .width('100%') | ||
| 170 | - .height(px2vp(this.topSafeHeight)) | ||
| 171 | - .backgroundColor($r('app.color.white')) | ||
| 172 | - .opacity(this.tileOpacity) | ||
| 173 | - .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 174 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 175 | + Image($r('app.media.icon_arrow_left_white')) |
| 176 | + .width(24).height(24) | ||
| 177 | + .objectFit(ImageFit.Auto) | ||
| 178 | + .margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2}) | ||
| 179 | + .onClick(() => { | ||
| 180 | + router.back() | ||
| 181 | + }) | ||
| 182 | + }.width('100%').height(px2vp(this.topSafeHeight) + 44) | ||
| 183 | + .opacity(1- this.tileOpacity) | ||
| 175 | 184 | ||
| 176 | - Stack({ alignContent: Alignment.Start }) { | 185 | + //// 上滑显示的黑色按钮和标题 |
| 186 | + Stack({ alignContent: Alignment.Top }) { | ||
| 177 | Row() { | 187 | Row() { |
| 178 | Text('精选评论')// .height('42lpx') | 188 | Text('精选评论')// .height('42lpx') |
| 179 | .maxLines(1) | 189 | .maxLines(1) |
| @@ -182,25 +192,25 @@ export struct QualityCommentsComponent { | @@ -182,25 +192,25 @@ export struct QualityCommentsComponent { | ||
| 182 | .fontWeight(400) | 192 | .fontWeight(400) |
| 183 | .fontColor($r('app.color.color_222222')) | 193 | .fontColor($r('app.color.color_222222')) |
| 184 | .lineHeight('42lpx') | 194 | .lineHeight('42lpx') |
| 185 | - .visibility(this.tileOpacity < 0.8 ? 1 : 0) | ||
| 186 | } | 195 | } |
| 187 | - .height(44) | ||
| 188 | - .width('100%') | 196 | + .height(44).width('100%') |
| 189 | .justifyContent(FlexAlign.Center) | 197 | .justifyContent(FlexAlign.Center) |
| 190 | .alignItems(VerticalAlign.Center) | 198 | .alignItems(VerticalAlign.Center) |
| 191 | - .opacity(this.tileOpacity) | ||
| 192 | - .backgroundColor($r('app.color.white')) | ||
| 193 | - | ||
| 194 | - Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left')) | ||
| 195 | - .width(24) | ||
| 196 | - .height(24) | ||
| 197 | - .objectFit(ImageFit.Auto) | ||
| 198 | - .margin({ left: 16 }) | ||
| 199 | - .onClick(() => { | ||
| 200 | - router.back() | ||
| 201 | - }) | ||
| 202 | 199 | ||
| 200 | + Row() { | ||
| 201 | + Image($r('app.media.icon_arrow_left')) | ||
| 202 | + .width(24).height(24) | ||
| 203 | + .objectFit(ImageFit.Auto) | ||
| 204 | + .margin({ left: 16, top: (44-24)/2}) | ||
| 205 | + .onClick(() => { | ||
| 206 | + router.back() | ||
| 207 | + }) | ||
| 208 | + }.height(44).width('100%') | ||
| 203 | } | 209 | } |
| 210 | + .width('100%').height(px2vp(this.topSafeHeight) + 44) | ||
| 211 | + .backgroundColor($r('app.color.white')) | ||
| 212 | + .opacity(this.tileOpacity) | ||
| 213 | + .padding({top:px2vp(this.topSafeHeight)}) | ||
| 204 | } | 214 | } |
| 205 | 215 | ||
| 206 | } | 216 | } |
| @@ -113,9 +113,11 @@ export struct TopNavigationComponentNew { | @@ -113,9 +113,11 @@ export struct TopNavigationComponentNew { | ||
| 113 | 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, | 113 | 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, |
| 114 | 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } | 114 | 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } |
| 115 | }) | 115 | }) |
| 116 | - .onChange((index) => { | ||
| 117 | - Logger.info(TAG, `onChange index : ${index}`); | ||
| 118 | - | 116 | + .onAnimationStart((curIndex: number, index: number)=>{ |
| 117 | + Logger.info(TAG, `onAnimationStart ${curIndex} ${index}`); | ||
| 118 | + if (curIndex === index) { | ||
| 119 | + return | ||
| 120 | + } | ||
| 119 | if (this.isBroadcastByIndex(index)) { | 121 | if (this.isBroadcastByIndex(index)) { |
| 120 | // 跳转到播报页面 | 122 | // 跳转到播报页面 |
| 121 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 123 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -133,7 +135,12 @@ export struct TopNavigationComponentNew { | @@ -133,7 +135,12 @@ export struct TopNavigationComponentNew { | ||
| 133 | this.currentTopNavSelectedIndex = index; | 135 | this.currentTopNavSelectedIndex = index; |
| 134 | this.changePage(this.currentTopNavSelectedIndex) | 136 | this.changePage(this.currentTopNavSelectedIndex) |
| 135 | } | 137 | } |
| 136 | - | 138 | + }) |
| 139 | + // .onAnimationEnd((index: number)=>{ | ||
| 140 | + // Logger.info(TAG, `onAnimationEnd ${index}`); | ||
| 141 | + // }) | ||
| 142 | + .onChange((index) => { | ||
| 143 | + Logger.info(TAG, `onChange index : ${index}`); | ||
| 137 | }) | 144 | }) |
| 138 | } | 145 | } |
| 139 | .width('100%') | 146 | .width('100%') |
| @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery'; | @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery'; | ||
| 7 | import { Logger, WindowModel } from 'wdKit/Index'; | 7 | import { Logger, WindowModel } from 'wdKit/Index'; |
| 8 | import { router, window } from '@kit.ArkUI'; | 8 | import { router, window } from '@kit.ArkUI'; |
| 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; | 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 10 | -import { LiveEmptyComponent, LiveOperRowListView } from 'wdComponent'; | 10 | +import { LiveOperRowListView } from 'wdComponent'; |
| 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 12 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; | 12 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; |
| 13 | -import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; | ||
| 14 | 13 | ||
| 15 | let TAG: string = 'DetailPlayLivePage'; | 14 | let TAG: string = 'DetailPlayLivePage'; |
| 16 | 15 | ||
| @@ -57,7 +56,6 @@ export struct DetailPlayLivePage { | @@ -57,7 +56,6 @@ export struct DetailPlayLivePage { | ||
| 57 | this.getLiveDetails() | 56 | this.getLiveDetails() |
| 58 | this.getLiveRoomData() | 57 | this.getLiveRoomData() |
| 59 | 58 | ||
| 60 | - console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId) | ||
| 61 | } | 59 | } |
| 62 | 60 | ||
| 63 | async aboutToDisappear() { | 61 | async aboutToDisappear() { |
| @@ -306,12 +306,13 @@ export struct PlayUIComponent { | @@ -306,12 +306,13 @@ export struct PlayUIComponent { | ||
| 306 | .width(24) | 306 | .width(24) |
| 307 | .height(24) | 307 | .height(24) |
| 308 | .onClick(() => { | 308 | .onClick(() => { |
| 309 | + | ||
| 310 | + WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 311 | + | ||
| 309 | this.displayDirection = | 312 | this.displayDirection = |
| 310 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : | 313 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : |
| 311 | DisplayDirection.VERTICAL | 314 | DisplayDirection.VERTICAL |
| 312 | 315 | ||
| 313 | - WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 314 | - | ||
| 315 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 316 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 316 | window.Orientation.PORTRAIT : | 317 | window.Orientation.PORTRAIT : |
| 317 | window.Orientation.LANDSCAPE_INVERTED) | 318 | window.Orientation.LANDSCAPE_INVERTED) |
| @@ -35,6 +35,17 @@ export struct TopPlayComponent { | @@ -35,6 +35,17 @@ export struct TopPlayComponent { | ||
| 35 | private playUrl: string = "" | 35 | private playUrl: string = "" |
| 36 | private xComponentIsLoaded: boolean = false | 36 | private xComponentIsLoaded: boolean = false |
| 37 | @Consume liveDetailPageLogic: LiveDetailPageLogic | 37 | @Consume liveDetailPageLogic: LiveDetailPageLogic |
| 38 | + @Consume @Watch('pageShowChange') pageShow: number | ||
| 39 | + @Consume @Watch('pageHideChange') pageHide: number | ||
| 40 | + init: boolean = false | ||
| 41 | + | ||
| 42 | + pageShowChange() { | ||
| 43 | + this.playerController?.play() | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + pageHideChange() { | ||
| 47 | + this.playerController?.pause() | ||
| 48 | + } | ||
| 38 | 49 | ||
| 39 | aboutToAppear(): void { | 50 | aboutToAppear(): void { |
| 40 | if (this.playerController) { | 51 | if (this.playerController) { |
| @@ -71,7 +82,7 @@ export struct TopPlayComponent { | @@ -71,7 +82,7 @@ export struct TopPlayComponent { | ||
| 71 | updateData() { | 82 | updateData() { |
| 72 | 83 | ||
| 73 | // 检测垫片 | 84 | // 检测垫片 |
| 74 | - if (this.liveDetailPageLogic.showPad){ | 85 | + if (this.liveDetailPageLogic.showPad) { |
| 75 | this.isHideLoading = true | 86 | this.isHideLoading = true |
| 76 | this.isWait = true | 87 | this.isWait = true |
| 77 | this.previewUrl = this.liveDetailPageLogic.imgUrl | 88 | this.previewUrl = this.liveDetailPageLogic.imgUrl |
| @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage" | @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage" | ||
| 13 | @Entry | 13 | @Entry |
| 14 | @Component | 14 | @Component |
| 15 | struct OneKeyLoginPage { | 15 | struct OneKeyLoginPage { |
| 16 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 16 | anonymousPhone: string = '' | 17 | anonymousPhone: string = '' |
| 17 | @State agreeProtocol: boolean = false | 18 | @State agreeProtocol: boolean = false |
| 18 | viewModel: LoginViewModel = new LoginViewModel() | 19 | viewModel: LoginViewModel = new LoginViewModel() |
| @@ -121,6 +122,7 @@ struct OneKeyLoginPage { | @@ -121,6 +122,7 @@ struct OneKeyLoginPage { | ||
| 121 | }) | 122 | }) |
| 122 | } | 123 | } |
| 123 | .backgroundColor("#FFFFFF") | 124 | .backgroundColor("#FFFFFF") |
| 125 | + .padding({top: `${this.topSafeHeight}px`}) | ||
| 124 | } | 126 | } |
| 125 | 127 | ||
| 126 | @Builder ProtocolRow() { | 128 | @Builder ProtocolRow() { |
| @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView { | @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView { | ||
| 43 | private playerController?: WDAliPlayerController; | 43 | private playerController?: WDAliPlayerController; |
| 44 | private xComponentController: XComponentController = new XComponentController(); | 44 | private xComponentController: XComponentController = new XComponentController(); |
| 45 | onLoad?: ((event?: object) => void); | 45 | onLoad?: ((event?: object) => void); |
| 46 | - videoWidth: number = 0 | ||
| 47 | - videoHeight: number = 0 | 46 | + @State videoWidth: number = 0 |
| 47 | + @State videoHeight: number = 0 | ||
| 48 | + @State videoRatio: number = 16 / 9 | ||
| 48 | @State selfSize: Size = new Size('100%', '100%'); | 49 | @State selfSize: Size = new Size('100%', '100%'); |
| 49 | private insId: string = "WDPlayerRenderLiveView" + insIndex; | 50 | private insId: string = "WDPlayerRenderLiveView" + insIndex; |
| 50 | 51 | ||
| 52 | + | ||
| 53 | + | ||
| 51 | aboutToAppear() { | 54 | aboutToAppear() { |
| 52 | MGPlayRenderViewIns.add(); | 55 | MGPlayRenderViewIns.add(); |
| 53 | insIndex++; | 56 | insIndex++; |
| 54 | if (!this.playerController) { | 57 | if (!this.playerController) { |
| 55 | return | 58 | return |
| 56 | } | 59 | } |
| 57 | - | 60 | + //this.init = true |
| 58 | this.playerController.onVideoSizeChange = (width: number, height: number) => { | 61 | this.playerController.onVideoSizeChange = (width: number, height: number) => { |
| 59 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | 62 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) |
| 60 | this.videoWidth = width; | 63 | this.videoWidth = width; |
| 61 | this.videoHeight = height; | 64 | this.videoHeight = height; |
| 65 | + this.videoRatio = width / height | ||
| 62 | this.updateLayout() | 66 | this.updateLayout() |
| 63 | } | 67 | } |
| 64 | } | 68 | } |
| @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView { | @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView { | ||
| 80 | .onLoad(async (event) => { | 84 | .onLoad(async (event) => { |
| 81 | Logger.info(TAG, 'onLoad') | 85 | Logger.info(TAG, 'onLoad') |
| 82 | let surfaceId = this.xComponentController.getXComponentSurfaceId() | 86 | let surfaceId = this.xComponentController.getXComponentSurfaceId() |
| 83 | - this.xComponentController.setXComponentSurfaceSize({ | ||
| 84 | - surfaceWidth: 1920, | ||
| 85 | - surfaceHeight: 720 | 87 | + this.xComponentController.setXComponentSurfaceRect({ |
| 88 | + surfaceWidth: this.videoWidth, | ||
| 89 | + surfaceHeight: this.videoHeight | ||
| 86 | }); | 90 | }); |
| 87 | if (enableAliPlayer) { | 91 | if (enableAliPlayer) { |
| 88 | this.playerController?.setSurfaceId(this.insId) | 92 | this.playerController?.setSurfaceId(this.insId) |
| @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView { | @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView { | ||
| 93 | this.onLoad(event) | 97 | this.onLoad(event) |
| 94 | } | 98 | } |
| 95 | }) | 99 | }) |
| 96 | - .width(this.selfSize.width) | ||
| 97 | - .height(this.selfSize.height) | 100 | + // .width(this.selfSize.width) |
| 101 | + // .height(this.selfSize.height) | ||
| 98 | } | 102 | } |
| 99 | .id(this.insId) | 103 | .id(this.insId) |
| 100 | .onAreaChange(() => { | 104 | .onAreaChange(() => { |
| @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView { | @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView { | ||
| 107 | } | 111 | } |
| 108 | 112 | ||
| 109 | updateLayout() { | 113 | updateLayout() { |
| 114 | + | ||
| 110 | let info = componentUtils.getRectangleById(this.insId); | 115 | let info = componentUtils.getRectangleById(this.insId); |
| 111 | - if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { | ||
| 112 | - if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) { | ||
| 113 | - let scale = info.size.height / this.videoHeight; | ||
| 114 | - this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%'); | ||
| 115 | - } else { | ||
| 116 | - let scale = info.size.width / this.videoWidth; | ||
| 117 | - this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%"); | 116 | + Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info)) |
| 117 | + | ||
| 118 | + Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect())) | ||
| 119 | + | ||
| 120 | + if (info.size.width > 0 && info.size.height > 0) { | ||
| 121 | + | ||
| 122 | + // 竖屏 | ||
| 123 | + if (this.videoHeight > 0 && this.videoWidth > 0 && this.videoWidth < this.videoHeight) { | ||
| 124 | + let ratio = this.videoWidth / this.videoHeight | ||
| 125 | + const height = info.size.width / ratio | ||
| 126 | + | ||
| 127 | + // 竖屏,缩放高度大于 视频区域高度 | ||
| 128 | + if (height > info.size.height) { | ||
| 129 | + | ||
| 130 | + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height) | ||
| 131 | + | ||
| 132 | + Logger.debug(TAG, "高度固定,求宽度: " + info.size.height * ratio) | ||
| 133 | + | ||
| 134 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 135 | + surfaceWidth: info.size.height * ratio, | ||
| 136 | + surfaceHeight: info.size.height | ||
| 137 | + }); | ||
| 138 | + return | ||
| 139 | + } | ||
| 118 | } | 140 | } |
| 141 | + | ||
| 142 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 143 | + surfaceWidth: info.size.width, | ||
| 144 | + surfaceHeight: info.size.height | ||
| 145 | + }); | ||
| 119 | } | 146 | } |
| 120 | } | 147 | } |
| 148 | + | ||
| 149 | + | ||
| 121 | } | 150 | } |
| @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr | @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr | ||
| 2 | import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; | 2 | import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; |
| 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; | 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; |
| 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; | 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; |
| 5 | +import { DeepLinkUtil } from './utils/DeepLinkUtil'; | ||
| 5 | 6 | ||
| 6 | export class WDShare { | 7 | export class WDShare { |
| 7 | 8 | ||
| @@ -17,6 +18,7 @@ export class WDShare { | @@ -17,6 +18,7 @@ export class WDShare { | ||
| 17 | title: content.shareInfo.shareTitle, | 18 | title: content.shareInfo.shareTitle, |
| 18 | desc: content.shareInfo.shareSummary, | 19 | desc: content.shareInfo.shareSummary, |
| 19 | link: content.shareInfo.shareUrl, | 20 | link: content.shareInfo.shareUrl, |
| 21 | + deeplink:DeepLinkUtil.generateDeepLinkWithConent(content), | ||
| 20 | } | 22 | } |
| 21 | }) | 23 | }) |
| 22 | } | 24 | } |
| @@ -32,6 +34,7 @@ export class WDShare { | @@ -32,6 +34,7 @@ export class WDShare { | ||
| 32 | title: program.shareInfo.shareTitle, | 34 | title: program.shareInfo.shareTitle, |
| 33 | desc: program.shareInfo.shareSummary, | 35 | desc: program.shareInfo.shareSummary, |
| 34 | link: program.shareInfo.shareUrl, | 36 | link: program.shareInfo.shareUrl, |
| 37 | + deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program), | ||
| 35 | } | 38 | } |
| 36 | }) | 39 | }) |
| 37 | } | 40 | } |
| 1 | +import { ContentDetailDTO, ContentDTO } from 'wdBean/Index'; | ||
| 2 | +import { BreakpointSystem } from 'wdKit/Index'; | ||
| 3 | +import { ContentType } from 'wdRouter/Index'; | ||
| 4 | + | ||
| 5 | +export class DeepLinkUtil { | ||
| 6 | + | ||
| 7 | + private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith" | ||
| 8 | + | ||
| 9 | + static generateDeepLinkWithConent(content: ContentDetailDTO): string { | ||
| 10 | + | ||
| 11 | + return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl) | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + static generateDeepLinkWithProgram(content: ContentDTO) { | ||
| 15 | + | ||
| 16 | + return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl) | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string { | ||
| 20 | + let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX | ||
| 21 | + | ||
| 22 | + let pubParam = `&contentId=${contentId}}&relId=${relId}&skipType=1` | ||
| 23 | + | ||
| 24 | + let type: ContentType = Number(contentType) | ||
| 25 | + switch (type) { | ||
| 26 | + case ContentType.Video: | ||
| 27 | + deeplink += "?type=video&subType=vod_video" | ||
| 28 | + break | ||
| 29 | + case ContentType.Live: | ||
| 30 | + deeplink += "?type=live" | ||
| 31 | + break | ||
| 32 | + case ContentType.ImageText: | ||
| 33 | + if (link && link.length) { | ||
| 34 | + deeplink += "?type=article&subType=h5" | ||
| 35 | + deeplink += "&url=" + encodeURIComponent(link) | ||
| 36 | + } else { | ||
| 37 | + deeplink += "type=article&subType=h5_template_article" | ||
| 38 | + } | ||
| 39 | + break | ||
| 40 | + case ContentType.DynamicImageText: | ||
| 41 | + deeplink += "?type=dynamic" | ||
| 42 | + break | ||
| 43 | + case ContentType.DynamicVideo: | ||
| 44 | + deeplink += "?type=dynamic" | ||
| 45 | + break | ||
| 46 | + case ContentType.Pictures: | ||
| 47 | + deeplink += "?type=picture" | ||
| 48 | + break | ||
| 49 | + case ContentType.Audio: | ||
| 50 | + deeplink += "?type=audio" | ||
| 51 | + break | ||
| 52 | + case ContentType.Ask: | ||
| 53 | + deeplink += "?type=ask" | ||
| 54 | + break | ||
| 55 | + default: | ||
| 56 | + pubParam = "" | ||
| 57 | + break; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + deeplink += pubParam | ||
| 61 | + return deeplink | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 65 | +} |
| @@ -65,7 +65,7 @@ struct LaunchInterestsHobbiesPage { | @@ -65,7 +65,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 65 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | 65 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ |
| 66 | GridItem(){ | 66 | GridItem(){ |
| 67 | Stack({alignContent:Alignment.TopStart}){ | 67 | Stack({alignContent:Alignment.TopStart}){ |
| 68 | - ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic,mainScaleType:ScaleType.FIT_XY}}) | 68 | + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}}) |
| 69 | .width('100%') | 69 | .width('100%') |
| 70 | .height('100%') | 70 | .height('100%') |
| 71 | .backgroundColor(Color.White) | 71 | .backgroundColor(Color.White) |
| @@ -123,30 +123,16 @@ export struct BottomNavigationComponent { | @@ -123,30 +123,16 @@ export struct BottomNavigationComponent { | ||
| 123 | 123 | ||
| 124 | @Builder | 124 | @Builder |
| 125 | tabBarBuilder(navItem: BottomNavDTO, index: number) { | 125 | tabBarBuilder(navItem: BottomNavDTO, index: number) { |
| 126 | - Stack({ alignContent: Alignment.Bottom }) { | ||
| 127 | - // Image(this.getBottomIcon(navItem, this.currentNavIndex === index)) | ||
| 128 | - // .height(CommonConstants.FULL_PARENT) | ||
| 129 | - // .padding({ | ||
| 130 | - // bottom: 15, | ||
| 131 | - // left: 10, | ||
| 132 | - // right: 10, | ||
| 133 | - // top: 2 | ||
| 134 | - // }) | ||
| 135 | - // .aspectRatio(this.ASPECT_RATIO_1_1) | ||
| 136 | - // .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) | 126 | + Column() { |
| 137 | ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) | 127 | ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) |
| 138 | - .padding({ | ||
| 139 | - bottom: 15, | ||
| 140 | - left: 10, | ||
| 141 | - right: 10, | ||
| 142 | - top: 2 | ||
| 143 | - }) | ||
| 144 | - .width('100%') | ||
| 145 | - .height('100%') | 128 | + .padding(1) |
| 129 | + .margin({ top: 2 }) | ||
| 130 | + .width(32) | ||
| 131 | + .height(32) | ||
| 146 | .enabled(false) | 132 | .enabled(false) |
| 147 | 133 | ||
| 148 | Text(navItem.name) | 134 | Text(navItem.name) |
| 149 | - .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 135 | + .margin({ top: 2 }) |
| 150 | .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal) | 136 | .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal) |
| 151 | .textAlign(TextAlign.Center) | 137 | .textAlign(TextAlign.Center) |
| 152 | .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray) | 138 | .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray) |
-
Please register or login to post a comment