Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix |> 19984 图文稿件详情页,播放稿件中的视频,进度滑块与已播放进度条重叠 fix: 17669 早晚报>多图类型稿件详情页-评论数据样式与安卓不一致 ref |> 修复竖屏直播后台结束直播,未显示直播结束页面问题 fix: 20364 人民号>推荐,推荐动态内容,号主简介较长时缺少省略,与关注按钮重叠。 fix |> 20377 个人评论列表,点击已评论图文稿件,进入稿件情页,未锚定评论区 fix |> 18815 互动消息-点击历史评论,鸿蒙版视频和图集详情页无法直接跳转到对应详情页的评论区 fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级 fix: 图集替换ir单方案,修改了部分,方案还有问题 fix |> 20448 不能评论的稿件详情页面,最下方的推荐阅读,展示不完整 ref |> 修复缺陷 19128-进入热点-大图卡-姜尚竖屏直播,向右滑动,点击清屏按钮,返回卡顿,清屏按钮没立马消失 ref |> 解决多次点击需要登录的按钮时,会多次弹窗登录页面问题 ref |> 调整横屏直播直播直播标题滚动实现,滚动速度和安卓保持基本一致 fix |> 20479 图文稿件详情页中视频播放器控件,播放按钮与右侧进度条要居中对齐,播放按钮与视频时长间距过大
Showing
18 changed files
with
264 additions
and
64 deletions
| @@ -257,9 +257,9 @@ export struct WdWebLocalComponent { | @@ -257,9 +257,9 @@ export struct WdWebLocalComponent { | ||
| 257 | 257 | ||
| 258 | startProgressTimer() { | 258 | startProgressTimer() { |
| 259 | this.progressTimerNumber = setTimeout(() => { | 259 | this.progressTimerNumber = setTimeout(() => { |
| 260 | - animateTo({duration: 1000}, () => { | 260 | + // animateTo({duration: 1000}, () => { |
| 261 | this.progressOpacity = 0 | 261 | this.progressOpacity = 0 |
| 262 | - }) | 262 | + // }) |
| 263 | }, 3000) | 263 | }, 3000) |
| 264 | } | 264 | } |
| 265 | cancelProgressTimer() { | 265 | cancelProgressTimer() { |
| @@ -313,13 +313,13 @@ export struct WdWebLocalComponent { | @@ -313,13 +313,13 @@ export struct WdWebLocalComponent { | ||
| 313 | } | 313 | } |
| 314 | }) | 314 | }) |
| 315 | .onClick(() => { | 315 | .onClick(() => { |
| 316 | - animateTo({duration: 1000}, () => { | 316 | + // animateTo({duration: 1000}, () => { |
| 317 | if (this.progressOpacity <= 0) { | 317 | if (this.progressOpacity <= 0) { |
| 318 | this.progressOpacity = 1 | 318 | this.progressOpacity = 1 |
| 319 | } else { | 319 | } else { |
| 320 | this.progressOpacity = 0 | 320 | this.progressOpacity = 0 |
| 321 | } | 321 | } |
| 322 | - }) | 322 | + // }) |
| 323 | }) | 323 | }) |
| 324 | 324 | ||
| 325 | if (this.isEndPlay){ | 325 | if (this.isEndPlay){ |
| @@ -350,12 +350,14 @@ export struct WdWebLocalComponent { | @@ -350,12 +350,14 @@ export struct WdWebLocalComponent { | ||
| 350 | this.controller.pause() | 350 | this.controller.pause() |
| 351 | this.cancelProgressTimer() | 351 | this.cancelProgressTimer() |
| 352 | } | 352 | } |
| 353 | - }) | 353 | + }).margin({right:16}) |
| 354 | + | ||
| 354 | Row() { | 355 | Row() { |
| 355 | Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000)) | 356 | Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000)) |
| 356 | .fontSize(12) | 357 | .fontSize(12) |
| 357 | .fontColor(Color.White) | 358 | .fontColor(Color.White) |
| 358 | .fontWeight(600) | 359 | .fontWeight(600) |
| 360 | + | ||
| 359 | Slider({ | 361 | Slider({ |
| 360 | value: this.currentTime, | 362 | value: this.currentTime, |
| 361 | min: 0, | 363 | min: 0, |
| @@ -385,8 +387,8 @@ export struct WdWebLocalComponent { | @@ -385,8 +387,8 @@ export struct WdWebLocalComponent { | ||
| 385 | .fontSize(12) | 387 | .fontSize(12) |
| 386 | .fontColor(Color.White) | 388 | .fontColor(Color.White) |
| 387 | .fontWeight(600) | 389 | .fontWeight(600) |
| 388 | - } | ||
| 389 | - .justifyContent(FlexAlign.Center) | 390 | + }.alignItems(VerticalAlign.Center) |
| 391 | + .height(48) | ||
| 390 | 392 | ||
| 391 | // Image($r('app.media.icon_full_screen')) | 393 | // Image($r('app.media.icon_full_screen')) |
| 392 | // .width(24) | 394 | // .width(24) |
| @@ -401,7 +403,9 @@ export struct WdWebLocalComponent { | @@ -401,7 +403,9 @@ export struct WdWebLocalComponent { | ||
| 401 | colors: [[0x20000000, 0.0], [Color.Transparent, 1.0]] // [0x80000000, 0.5], | 403 | colors: [[0x20000000, 0.0], [Color.Transparent, 1.0]] // [0x80000000, 0.5], |
| 402 | }) | 404 | }) |
| 403 | .width("100%") | 405 | .width("100%") |
| 404 | - .justifyContent(FlexAlign.SpaceAround) | 406 | + .height(48) |
| 407 | + .padding({left:16}) | ||
| 408 | + .alignItems(VerticalAlign.Center) | ||
| 405 | } | 409 | } |
| 406 | } | 410 | } |
| 407 | 411 |
| 1 | +import display from '@ohos.display'; | ||
| 2 | + | ||
| 3 | +const TAG = 'GalleryImage' | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export struct GalleryImage { | ||
| 7 | + private url: string = ""; | ||
| 8 | + private index: number = 0; | ||
| 9 | + @State downLoadEnable: boolean = true; | ||
| 10 | + @Link isScaling: boolean | ||
| 11 | + @State showLoading: boolean = false; | ||
| 12 | + @State rotateAngle: number = 0; | ||
| 13 | + @State showError: boolean = false; | ||
| 14 | + @State scaleValue: number = 1; | ||
| 15 | + @State pinchValue: number = 1; | ||
| 16 | + @State pinchX: number | string = '50%'; | ||
| 17 | + @State pinchY: number | string = '50%'; | ||
| 18 | + private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.None, fingers: 1 }) | ||
| 19 | + @State offsetX: number = 0 | ||
| 20 | + @State offsetY: number = 0 | ||
| 21 | + @State positionX: number = 0 | ||
| 22 | + @State positionY: number = 0 | ||
| 23 | + private imageWith: number = 0; | ||
| 24 | + @State sizeValue: number = 0; | ||
| 25 | + | ||
| 26 | + //alt app.media.picture_loading 设计稿尺寸 | ||
| 27 | + @State imageWidth:string | number = 167 | ||
| 28 | + | ||
| 29 | + aboutToAppear(): void { | ||
| 30 | + this.showLoading = true; | ||
| 31 | + this.downLoadEnable = false; | ||
| 32 | + console.info(TAG); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + aboutToDisAppear(): void { | ||
| 36 | + console.info(""); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + aboutToReuse(): void { | ||
| 40 | + console.info(""); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + build() { | ||
| 44 | + Column() { | ||
| 45 | + Image(this.url) | ||
| 46 | + .width(this.imageWidth) | ||
| 47 | + .height("100%") | ||
| 48 | + .objectFit(ImageFit.Contain)//todo 加载失败时占位图没隐藏 | ||
| 49 | + .alt($r("app.media.datail_imageLoading_w")) | ||
| 50 | + .interpolation(ImageInterpolation.High) | ||
| 51 | + .onComplete(msg => { | ||
| 52 | + if (msg) { | ||
| 53 | + this.imageWidth = '100%' | ||
| 54 | + console.info(TAG, "index:" + this.index + ", loadingStatus:" + msg.loadingStatus) | ||
| 55 | + // 图片数据加载成功 | ||
| 56 | + if (msg.loadingStatus === 0) { | ||
| 57 | + this.showLoading = true; | ||
| 58 | + this.downLoadEnable = false; | ||
| 59 | + } else if (msg.loadingStatus === 1) { | ||
| 60 | + // 图片数据解码成功 | ||
| 61 | + this.showLoading = false; | ||
| 62 | + this.downLoadEnable = true; | ||
| 63 | + this.imageWith = px2vp(display.getDefaultDisplaySync().width) | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + }) | ||
| 67 | + .onError(() => { | ||
| 68 | + console.info(TAG, "图片加载异常") | ||
| 69 | + this.showLoading = false; | ||
| 70 | + this.showError = true; | ||
| 71 | + })// 在组件上绑定缩放比例,可以通过修改缩放比例来实现组件的缩小或者放大 | ||
| 72 | + .scale({ | ||
| 73 | + x: this.scaleValue, | ||
| 74 | + y: this.scaleValue, | ||
| 75 | + z: 1, | ||
| 76 | + centerX: this.pinchX, | ||
| 77 | + centerY: this.pinchY | ||
| 78 | + })// 以组件左上角为坐标原点进行移动 | ||
| 79 | + .translate({ x: this.offsetX, y: this.offsetY, z: 0 }) | ||
| 80 | + .gesture( | ||
| 81 | + GestureGroup(GestureMode.Parallel, | ||
| 82 | + // 两指或以上的捏合手势 | ||
| 83 | + PinchGesture({ fingers: 2 }) | ||
| 84 | + .onActionStart(() => { | ||
| 85 | + console.info(TAG, 'Pinch start'); | ||
| 86 | + })// 当捏合手势触发时,可以通过回调函数获取缩放比例,从而修改组件的缩放比例 | ||
| 87 | + .onActionUpdate((event: GestureEvent) => { | ||
| 88 | + const scaleValue = this.pinchValue * event.scale; | ||
| 89 | + if (scaleValue <= 3 && scaleValue >= 0.8) { | ||
| 90 | + this.scaleValue = scaleValue; | ||
| 91 | + this.pinchX = event.pinchCenterX; | ||
| 92 | + this.pinchY = event.pinchCenterY; | ||
| 93 | + } | ||
| 94 | + }) | ||
| 95 | + .onActionEnd(() => { | ||
| 96 | + this.pinchValue = this.scaleValue; | ||
| 97 | + console.info(TAG, 'Pinch end'); | ||
| 98 | + if (this.pinchValue > 1) { | ||
| 99 | + this.panOption.setDirection(PanDirection.Horizontal) | ||
| 100 | + this.isScaling = true; | ||
| 101 | + } else { | ||
| 102 | + this.panOption.setDirection(PanDirection.None) | ||
| 103 | + this.isScaling = false; | ||
| 104 | + } | ||
| 105 | + }), | ||
| 106 | + // 绑定count为1的TapGesture | ||
| 107 | + TapGesture({ count: 1 }) | ||
| 108 | + .onAction(() => { | ||
| 109 | + }), | ||
| 110 | + // 绑定count为2的TapGesture | ||
| 111 | + TapGesture({ count: 2 }) | ||
| 112 | + .onAction(() => { | ||
| 113 | + console.info(TAG, '双击 start') | ||
| 114 | + animateTo({ | ||
| 115 | + duration: 400, | ||
| 116 | + }, () => { | ||
| 117 | + this.scaleValue = 1; | ||
| 118 | + this.pinchX = '50%'; | ||
| 119 | + this.pinchY = '50%'; | ||
| 120 | + this.pinchValue = this.scaleValue; | ||
| 121 | + this.offsetX = 0; | ||
| 122 | + this.offsetY = 0; | ||
| 123 | + this.positionX = 0; | ||
| 124 | + this.positionY = 0; | ||
| 125 | + this.panOption.setDirection(PanDirection.None); | ||
| 126 | + this.isScaling = false; | ||
| 127 | + }) | ||
| 128 | + }), | ||
| 129 | + PanGesture(this.panOption) | ||
| 130 | + .onActionStart(() => { | ||
| 131 | + console.info(TAG, 'Pan start') | ||
| 132 | + }) | ||
| 133 | + .onActionUpdate((event?: GestureEvent) => { | ||
| 134 | + if (event) { | ||
| 135 | + if (this.scaleValue > 1) { | ||
| 136 | + this.offsetX = this.positionX + event.offsetX | ||
| 137 | + this.offsetY = this.positionY + event.offsetY | ||
| 138 | + this.sizeValue = this.imageWith | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + }) | ||
| 142 | + .onActionEnd(() => { | ||
| 143 | + this.positionX = this.offsetX | ||
| 144 | + this.positionY = this.offsetY | ||
| 145 | + console.info(TAG, 'Pan end') | ||
| 146 | + }) | ||
| 147 | + )) | ||
| 148 | + } | ||
| 149 | + .width('100%') | ||
| 150 | + .height('100%') | ||
| 151 | + .justifyContent(FlexAlign.Center) | ||
| 152 | + } | ||
| 153 | +} |
| @@ -186,8 +186,10 @@ export struct ImageAndTextPageComponent { | @@ -186,8 +186,10 @@ export struct ImageAndTextPageComponent { | ||
| 186 | .justifyContent(FlexAlign.Center) | 186 | .justifyContent(FlexAlign.Center) |
| 187 | } | 187 | } |
| 188 | if (this.recommendList.length > 0) { | 188 | if (this.recommendList.length > 0) { |
| 189 | - Divider().strokeWidth(8).color('#f5f5f5') | ||
| 190 | - RecommendList({ recommendList: this.recommendList }) | 189 | + Column(){ |
| 190 | + Divider().strokeWidth(8).color('#f5f5f5') | ||
| 191 | + RecommendList({ recommendList: this.recommendList }) | ||
| 192 | + }.padding({bottom:this.contentDetailData?.openComment ? 0 : 44 }) | ||
| 191 | } | 193 | } |
| 192 | // 评论 | 194 | // 评论 |
| 193 | if (this.contentDetailData?.openComment) { | 195 | if (this.contentDetailData?.openComment) { |
| @@ -84,6 +84,8 @@ export struct InteractMComponent { | @@ -84,6 +84,8 @@ export struct InteractMComponent { | ||
| 84 | contentDTO.objectId = this.messageModel.InteractMsubM.contentId | 84 | contentDTO.objectId = this.messageModel.InteractMsubM.contentId |
| 85 | contentDTO.relId = this.messageModel.InteractMsubM.contentRelId | 85 | contentDTO.relId = this.messageModel.InteractMsubM.contentRelId |
| 86 | contentDTO.relType = this.messageModel.InteractMsubM.contentRelType | 86 | contentDTO.relType = this.messageModel.InteractMsubM.contentRelType |
| 87 | + contentDTO.customParamTargetLayout = "comment" | ||
| 88 | + | ||
| 87 | ProcessUtils.processPage(contentDTO) | 89 | ProcessUtils.processPage(contentDTO) |
| 88 | }) | 90 | }) |
| 89 | } | 91 | } |
| @@ -114,8 +114,16 @@ export struct MultiPictureDetailItemComponent { | @@ -114,8 +114,16 @@ export struct MultiPictureDetailItemComponent { | ||
| 114 | calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size { | 114 | calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size { |
| 115 | let width = 0 | 115 | let width = 0 |
| 116 | let height = 0; | 116 | let height = 0; |
| 117 | - width = size.width; | ||
| 118 | - height = size.width / imageWHRatio; | 117 | + // width = size.width; |
| 118 | + // height = size.width / imageWHRatio; | ||
| 119 | + if (imageWHRatio > size.width / size.height) { | ||
| 120 | + // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示 | ||
| 121 | + width = size.width; | ||
| 122 | + height = size.width / imageWHRatio; | ||
| 123 | + } else { | ||
| 124 | + height = size.height; | ||
| 125 | + width = size.height * imageWHRatio; | ||
| 126 | + } | ||
| 119 | return { width: width, height: height }; | 127 | return { width: width, height: height }; |
| 120 | } | 128 | } |
| 121 | 129 | ||
| @@ -179,7 +187,9 @@ export struct MultiPictureDetailItemComponent { | @@ -179,7 +187,9 @@ export struct MultiPictureDetailItemComponent { | ||
| 179 | Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | 187 | Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 |
| 180 | .alt($r('app.media.datail_imageLoading_w')) | 188 | .alt($r('app.media.datail_imageLoading_w')) |
| 181 | .width(this.imageWidth) | 189 | .width(this.imageWidth) |
| 190 | + .aspectRatio(this.imageWHRatio) | ||
| 182 | .objectFit(ImageFit.Cover)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | 191 | .objectFit(ImageFit.Cover)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 |
| 192 | + .autoResize(false) | ||
| 183 | .interpolation(ImageInterpolation.High) | 193 | .interpolation(ImageInterpolation.High) |
| 184 | .autoResize(false) | 194 | .autoResize(false) |
| 185 | .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | 195 | .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 |
| @@ -229,11 +239,6 @@ export struct MultiPictureDetailItemComponent { | @@ -229,11 +239,6 @@ export struct MultiPictureDetailItemComponent { | ||
| 229 | .gesture( | 239 | .gesture( |
| 230 | GestureGroup( | 240 | GestureGroup( |
| 231 | GestureMode.Exclusive, | 241 | GestureMode.Exclusive, |
| 232 | - // 单击返回上一层 | ||
| 233 | - // TapGesture({ count: 1 }) | ||
| 234 | - // .onAction(() => { | ||
| 235 | - // router.back() | ||
| 236 | - // }), | ||
| 237 | // TODO:知识点:双击切换图片大小 | 242 | // TODO:知识点:双击切换图片大小 |
| 238 | TapGesture({ count: 2 }) | 243 | TapGesture({ count: 2 }) |
| 239 | .onAction(() => { | 244 | .onAction(() => { |
| @@ -315,9 +320,10 @@ export struct MultiPictureDetailItemComponent { | @@ -315,9 +320,10 @@ export struct MultiPictureDetailItemComponent { | ||
| 315 | } | 320 | } |
| 316 | this.imageScaleInfo.stash(); | 321 | this.imageScaleInfo.stash(); |
| 317 | }), | 322 | }), |
| 318 | - // // TODO:知识点:滑动图片 | 323 | + // TODO:知识点:滑动图片 |
| 319 | // PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片 | 324 | // PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片 |
| 320 | // .onActionUpdate((event: GestureEvent) => { | 325 | // .onActionUpdate((event: GestureEvent) => { |
| 326 | + // console.log(TAG, "PanGesture", JSON.stringify(event)) | ||
| 321 | // if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) { | 327 | // if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) { |
| 322 | // // 默认大小下不允许移动 | 328 | // // 默认大小下不允许移动 |
| 323 | // return; | 329 | // return; |
| @@ -100,12 +100,6 @@ export struct CardSourceInfo { | @@ -100,12 +100,6 @@ export struct CardSourceInfo { | ||
| 100 | return flag; | 100 | return flag; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | - showCommentNum() { | ||
| 104 | - const curRouter = router.getState().name; | ||
| 105 | - // return curRouter !== 'PeopleShipHomePage' | ||
| 106 | - return true | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | /** | 103 | /** |
| 110 | * 全域数字显示规则 | 104 | * 全域数字显示规则 |
| 111 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | 105 | * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 |
| @@ -150,25 +144,12 @@ export struct CardSourceInfo { | @@ -150,25 +144,12 @@ export struct CardSourceInfo { | ||
| 150 | } | 144 | } |
| 151 | 145 | ||
| 152 | showDot() { | 146 | showDot() { |
| 153 | - // return (this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | ||
| 154 | - // this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 155 | - // (this.getContentDtoBean()?.interactData?.commentNum | ||
| 156 | - // // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | ||
| 157 | - // || (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 158 | - // !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | ||
| 159 | - // (Number | ||
| 160 | - // .parseFloat(this | ||
| 161 | - // .contentDTO.publishTime)) | ||
| 162 | - // .indexOf | ||
| 163 | - // ('-') === -1) | ||
| 164 | - // ) | ||
| 165 | let flag = false; | 147 | let flag = false; |
| 166 | if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { | 148 | if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { |
| 167 | if (this.showTime() && !this.isEllipsisActive) { | 149 | if (this.showTime() && !this.isEllipsisActive) { |
| 168 | flag = true | 150 | flag = true |
| 169 | } else if (!this.isEllipsisActive) { | 151 | } else if (!this.isEllipsisActive) { |
| 170 | - if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 171 | - this.showCommentNum()) { | 152 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) { |
| 172 | flag = true; | 153 | flag = true; |
| 173 | } else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 154 | } else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 174 | flag = true; | 155 | flag = true; |
| @@ -271,10 +252,8 @@ export struct CardSourceInfo { | @@ -271,10 +252,8 @@ export struct CardSourceInfo { | ||
| 271 | } | 252 | } |
| 272 | 253 | ||
| 273 | // 评论数 | 254 | // 评论数 |
| 274 | - // if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) { | ||
| 275 | if (!this.isEllipsisActive) { | 255 | if (!this.isEllipsisActive) { |
| 276 | - if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 277 | - this.showCommentNum()) { | 256 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) { |
| 278 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 257 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 279 | .fontSize(12) | 258 | .fontSize(12) |
| 280 | .fontColor($r("app.color.color_B0B0B0")) | 259 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -328,17 +307,11 @@ export struct CardSourceInfo { | @@ -328,17 +307,11 @@ export struct CardSourceInfo { | ||
| 328 | * @returns | 307 | * @returns |
| 329 | */ | 308 | */ |
| 330 | private getContentDtoBean(): ContentDTO { | 309 | private getContentDtoBean(): ContentDTO { |
| 331 | - let content = new ContentDTO | ||
| 332 | - if (this.compDTO == undefined) { | ||
| 333 | - content = this.contentDTO | ||
| 334 | - } | ||
| 335 | - if (this.compDTO.operDataList.length == 0) { | ||
| 336 | - content = this.contentDTO | ||
| 337 | - } | ||
| 338 | - if (!content) { | ||
| 339 | - content = this.compDTO.operDataList[0] | 310 | + if (this.compDTO.operDataList.length > 0) { |
| 311 | + return this.compDTO.operDataList[0] | ||
| 312 | + } else { | ||
| 313 | + return this.contentDTO | ||
| 340 | } | 314 | } |
| 341 | - return content; | ||
| 342 | } | 315 | } |
| 343 | 316 | ||
| 344 | /** | 317 | /** |
| @@ -366,8 +339,7 @@ export struct CardSourceInfo { | @@ -366,8 +339,7 @@ export struct CardSourceInfo { | ||
| 366 | } | 339 | } |
| 367 | 340 | ||
| 368 | // 评论数 | 341 | // 评论数 |
| 369 | - if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 370 | - this.showCommentNum()) { | 342 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) { |
| 371 | have = true | 343 | have = true |
| 372 | } else { | 344 | } else { |
| 373 | if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 345 | if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| @@ -196,7 +196,7 @@ export struct RmhTitle { | @@ -196,7 +196,7 @@ export struct RmhTitle { | ||
| 196 | .textAlign(TextAlign.Start) | 196 | .textAlign(TextAlign.Start) |
| 197 | .height(14) | 197 | .height(14) |
| 198 | .lineHeight(14) | 198 | .lineHeight(14) |
| 199 | - .width('calc(100% - 54vp)') | 199 | + .width('calc(100% - 65vp)') |
| 200 | // .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))}) | 200 | // .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))}) |
| 201 | } | 201 | } |
| 202 | 202 |
| @@ -300,6 +300,7 @@ function getParams(item: CommentListItem) : ContentDTO{ | @@ -300,6 +300,7 @@ function getParams(item: CommentListItem) : ContentDTO{ | ||
| 300 | contentDTO.objectType = item.targetType + ""; | 300 | contentDTO.objectType = item.targetType + ""; |
| 301 | contentDTO.newsTitle = item.targetTitle | 301 | contentDTO.newsTitle = item.targetTitle |
| 302 | contentDTO.showComment = true | 302 | contentDTO.showComment = true |
| 303 | + contentDTO.customParamTargetLayout = "comment" | ||
| 303 | 304 | ||
| 304 | return contentDTO | 305 | return contentDTO |
| 305 | } | 306 | } |
| @@ -361,7 +361,7 @@ export struct LikeComponent { | @@ -361,7 +361,7 @@ export struct LikeComponent { | ||
| 361 | .height(24) | 361 | .height(24) |
| 362 | if (this.likeCount > 0){ | 362 | if (this.likeCount > 0){ |
| 363 | RelativeContainer() { | 363 | RelativeContainer() { |
| 364 | - Image($r('app.media.ic_like_white_Select')) | 364 | + Image(this.styleType == 1 ? $r('app.media.ic_like_white_Select') : $r('app.media.ic_like_back_Select')) |
| 365 | .objectFit(ImageFit.Fill) | 365 | .objectFit(ImageFit.Fill) |
| 366 | .resizable({ | 366 | .resizable({ |
| 367 | slice: { | 367 | slice: { |
| @@ -100,6 +100,7 @@ export struct MultiPictureListPage { | @@ -100,6 +100,7 @@ export struct MultiPictureListPage { | ||
| 100 | .vertical(false) | 100 | .vertical(false) |
| 101 | .autoPlay(false) | 101 | .autoPlay(false) |
| 102 | .loop(false) | 102 | .loop(false) |
| 103 | + .disableSwipe(!this.isEnableSwipe) | ||
| 103 | .effectMode(EdgeEffect.None) | 104 | .effectMode(EdgeEffect.None) |
| 104 | .cachedCount(3) | 105 | .cachedCount(3) |
| 105 | .indicator(false) | 106 | .indicator(false) |
| 1 | +import { | ||
| 2 | + PhotoListBean, | ||
| 3 | +} from 'wdBean'; | ||
| 4 | + | ||
| 5 | +export class MyDataSource implements IDataSource { | ||
| 6 | + | ||
| 7 | + private list: PhotoListBean[] = [] | ||
| 8 | + | ||
| 9 | + // private listener: DataChangeListener | ||
| 10 | + | ||
| 11 | + constructor(list: PhotoListBean[]) { | ||
| 12 | + this.list = list | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + totalCount(): number { | ||
| 16 | + return this.list.length | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + getData(index: number): PhotoListBean { | ||
| 20 | + return this.list[index] | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + getList(): PhotoListBean[] { | ||
| 24 | + return this.list; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + registerDataChangeListener(listener: DataChangeListener): void { | ||
| 28 | + // this.listener = listener | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + unregisterDataChangeListener() { | ||
| 32 | + } | ||
| 33 | +} |
| @@ -41,6 +41,8 @@ export struct DetailPlayVLivePage { | @@ -41,6 +41,8 @@ export struct DetailPlayVLivePage { | ||
| 41 | @Consume @Watch('closeFullScreen') pageHide: number | 41 | @Consume @Watch('closeFullScreen') pageHide: number |
| 42 | @Consume contentId: string | 42 | @Consume contentId: string |
| 43 | @State swiperIndex: number = 1 | 43 | @State swiperIndex: number = 1 |
| 44 | + ///是否展示清屏按钮 | ||
| 45 | + @State showClearButton: boolean = false | ||
| 44 | @Consume liveDetailPageLogic: LiveDetailPageLogic | 46 | @Consume liveDetailPageLogic: LiveDetailPageLogic |
| 45 | @Provide lastInputedComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的消息 | 47 | @Provide lastInputedComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的消息 |
| 46 | //播放错误 | 48 | //播放错误 |
| @@ -124,6 +126,7 @@ export struct DetailPlayVLivePage { | @@ -124,6 +126,7 @@ export struct DetailPlayVLivePage { | ||
| 124 | } break | 126 | } break |
| 125 | case LiveMessageOptType.ZH_STOP_LIVE: { | 127 | case LiveMessageOptType.ZH_STOP_LIVE: { |
| 126 | this.liveState = "end" | 128 | this.liveState = "end" |
| 129 | + this.playUrl = "" | ||
| 127 | this.contentDetailData.liveInfo.liveState = "end" | 130 | this.contentDetailData.liveInfo.liveState = "end" |
| 128 | } break | 131 | } break |
| 129 | case LiveMessageOptType.ZH_CHANGE_PAD: { | 132 | case LiveMessageOptType.ZH_CHANGE_PAD: { |
| @@ -198,6 +201,7 @@ export struct DetailPlayVLivePage { | @@ -198,6 +201,7 @@ export struct DetailPlayVLivePage { | ||
| 198 | playerController: this.playerController, | 201 | playerController: this.playerController, |
| 199 | swiperController: this.swiperController, | 202 | swiperController: this.swiperController, |
| 200 | swiperIndex: $swiperIndex, | 203 | swiperIndex: $swiperIndex, |
| 204 | + showClearButton: $showClearButton | ||
| 201 | }) | 205 | }) |
| 202 | 206 | ||
| 203 | // 直播资源加载失败 | 207 | // 直播资源加载失败 |
| @@ -241,7 +245,7 @@ export struct DetailPlayVLivePage { | @@ -241,7 +245,7 @@ export struct DetailPlayVLivePage { | ||
| 241 | Image($r('app.media.icon_live_more')) | 245 | Image($r('app.media.icon_live_more')) |
| 242 | .width(40) | 246 | .width(40) |
| 243 | .aspectRatio(1) | 247 | .aspectRatio(1) |
| 244 | - .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | 248 | + .visibility(this.showClearButton ? Visibility.Visible : Visibility.Hidden) |
| 245 | .position({ x: '100%', y: '100%' }) | 249 | .position({ x: '100%', y: '100%' }) |
| 246 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) | 250 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) |
| 247 | .onClick(() => { | 251 | .onClick(() => { |
| @@ -130,13 +130,14 @@ export struct PlayUIComponent { | @@ -130,13 +130,14 @@ export struct PlayUIComponent { | ||
| 130 | }) | 130 | }) |
| 131 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { | 131 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 132 | //标题 | 132 | //标题 |
| 133 | - Text(this.contentDetailData.newsTitle) | ||
| 134 | - .maxLines(1) | ||
| 135 | - .textOverflow({ overflow: TextOverflow.MARQUEE }) | 133 | + Marquee({ |
| 134 | + start:true, | ||
| 135 | + loop: 1, | ||
| 136 | + src:this.contentDetailData.newsTitle | ||
| 137 | + }) | ||
| 136 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') | 138 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') |
| 137 | .fontWeight(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 600 : 500) | 139 | .fontWeight(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 600 : 500) |
| 138 | .fontColor(Color.White) | 140 | .fontColor(Color.White) |
| 139 | - .textAlign(TextAlign.Start) | ||
| 140 | .layoutWeight(1) | 141 | .layoutWeight(1) |
| 141 | } else { | 142 | } else { |
| 142 | Blank() | 143 | Blank() |
| @@ -28,7 +28,7 @@ export struct PlayerEndView { | @@ -28,7 +28,7 @@ export struct PlayerEndView { | ||
| 28 | DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) | 28 | DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) |
| 29 | let en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) | 29 | let en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) |
| 30 | if (this.contentDetailData.liveInfo?.endTime == null) { | 30 | if (this.contentDetailData.liveInfo?.endTime == null) { |
| 31 | - en = DateTimeUtils.getTimeStamp() | 31 | + en = DateTimeUtils.parseDate(DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) |
| 32 | } | 32 | } |
| 33 | const sd = DateTimeUtils.getDuration(sn, en) | 33 | const sd = DateTimeUtils.getDuration(sn, en) |
| 34 | this.duration = DateTimeUtils.liveDurationSecondToTime(sd / 1000) | 34 | this.duration = DateTimeUtils.liveDurationSecondToTime(sd / 1000) |
| @@ -10,9 +10,9 @@ export struct PlayerInfoComponent { | @@ -10,9 +10,9 @@ export struct PlayerInfoComponent { | ||
| 10 | @Consume liveState: string | 10 | @Consume liveState: string |
| 11 | @Consume isShowControl: boolean | 11 | @Consume isShowControl: boolean |
| 12 | @Link swiperIndex: number | 12 | @Link swiperIndex: number |
| 13 | + @Link showClearButton: boolean | ||
| 13 | @Provide isFullScreen: boolean = false // 判断是否全屏,全屏状态下swiper禁止切换 | 14 | @Provide isFullScreen: boolean = false // 判断是否全屏,全屏状态下swiper禁止切换 |
| 14 | 15 | ||
| 15 | - | ||
| 16 | build() { | 16 | build() { |
| 17 | Column() { | 17 | Column() { |
| 18 | Swiper(this.swiperController) { | 18 | Swiper(this.swiperController) { |
| @@ -35,12 +35,23 @@ export struct PlayerInfoComponent { | @@ -35,12 +35,23 @@ export struct PlayerInfoComponent { | ||
| 35 | this.isShowControl = !this.isShowControl | 35 | this.isShowControl = !this.isShowControl |
| 36 | } | 36 | } |
| 37 | }) | 37 | }) |
| 38 | - .onChange((index) => { | ||
| 39 | - this.swiperIndex = index | 38 | + .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { |
| 39 | + this.dealShowClearButton(index,extraInfo.currentOffset) | ||
| 40 | + }) | ||
| 41 | + .onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => { | ||
| 42 | + this.dealShowClearButton(index,extraInfo.currentOffset) | ||
| 40 | }) | 43 | }) |
| 41 | .disableSwipe(this.isFullScreen) | 44 | .disableSwipe(this.isFullScreen) |
| 42 | } | 45 | } |
| 43 | .height('100%') | 46 | .height('100%') |
| 44 | .width('100%') | 47 | .width('100%') |
| 45 | } | 48 | } |
| 49 | + dealShowClearButton(index:number, currentOffset: number) { | ||
| 50 | + this.swiperIndex = index | ||
| 51 | + if (index == 0) { | ||
| 52 | + this.showClearButton = currentOffset >= 0; | ||
| 53 | + }else if (index == 1) { | ||
| 54 | + this.showClearButton = false | ||
| 55 | + } | ||
| 56 | + } | ||
| 46 | } | 57 | } |
| @@ -9,15 +9,24 @@ import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo' | @@ -9,15 +9,24 @@ import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo' | ||
| 9 | import { common } from '@kit.AbilityKit' | 9 | import { common } from '@kit.AbilityKit' |
| 10 | 10 | ||
| 11 | class LoginJumpHandler implements JumpInterceptorAction { | 11 | class LoginJumpHandler implements JumpInterceptorAction { |
| 12 | + | ||
| 13 | + private logining = false | ||
| 12 | 14 | ||
| 13 | /// 说明是调用了跳转 WDRouterPage.loginPage 页面的行为 | 15 | /// 说明是调用了跳转 WDRouterPage.loginPage 页面的行为 |
| 14 | on(params?: object | undefined, singleMode?: boolean | undefined): boolean { | 16 | on(params?: object | undefined, singleMode?: boolean | undefined): boolean { |
| 15 | 17 | ||
| 18 | + if (this.logining) { | ||
| 19 | + return true | ||
| 20 | + } | ||
| 21 | + this.logining = true | ||
| 22 | + | ||
| 16 | HuaweiAuth.sharedInstance().fetchAnonymousPhone().then((anonymousPhone) => { | 23 | HuaweiAuth.sharedInstance().fetchAnonymousPhone().then((anonymousPhone) => { |
| 17 | 24 | ||
| 18 | router.pushUrl({url: WDRouterPage.oneKeyLoginPage.url()}) | 25 | router.pushUrl({url: WDRouterPage.oneKeyLoginPage.url()}) |
| 26 | + this.logining = false | ||
| 19 | }).catch((error: string) => { | 27 | }).catch((error: string) => { |
| 20 | router.pushUrl({url: WDRouterPage.loginPage.url()}) | 28 | router.pushUrl({url: WDRouterPage.loginPage.url()}) |
| 29 | + this.logining = false | ||
| 21 | }) | 30 | }) |
| 22 | return true | 31 | return true |
| 23 | } | 32 | } |
| @@ -337,6 +337,7 @@ export struct MultiPictureDetailPageComponent { | @@ -337,6 +337,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 337 | .indicator(false) | 337 | .indicator(false) |
| 338 | .displayCount(1) | 338 | .displayCount(1) |
| 339 | .loop(false) | 339 | .loop(false) |
| 340 | + .disableSwipe(!this.isEnableSwipe) | ||
| 340 | .effectMode(EdgeEffect.Spring) | 341 | .effectMode(EdgeEffect.Spring) |
| 341 | .id('e_swiper_content') | 342 | .id('e_swiper_content') |
| 342 | .alignRules({ | 343 | .alignRules({ |
-
Please register or login to post a comment