Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
9 changed files
with
82 additions
and
39 deletions
| @@ -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 |
| @@ -5,7 +5,8 @@ import { | @@ -5,7 +5,8 @@ import { | ||
| 5 | EmitterUtils, | 5 | EmitterUtils, |
| 6 | EmitterEventId, | 6 | EmitterEventId, |
| 7 | NetworkUtil, | 7 | NetworkUtil, |
| 8 | - DisplayUtils | 8 | + DisplayUtils, |
| 9 | + ToastUtils | ||
| 9 | } from 'wdKit'; | 10 | } from 'wdKit'; |
| 10 | import { | 11 | import { |
| 11 | Action, | 12 | Action, |
| @@ -185,8 +186,10 @@ export struct ImageAndTextPageComponent { | @@ -185,8 +186,10 @@ export struct ImageAndTextPageComponent { | ||
| 185 | .justifyContent(FlexAlign.Center) | 186 | .justifyContent(FlexAlign.Center) |
| 186 | } | 187 | } |
| 187 | if (this.recommendList.length > 0) { | 188 | if (this.recommendList.length > 0) { |
| 188 | - Divider().strokeWidth(8).color('#f5f5f5') | ||
| 189 | - 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 }) | ||
| 190 | } | 193 | } |
| 191 | // 评论 | 194 | // 评论 |
| 192 | if (this.contentDetailData?.openComment) { | 195 | if (this.contentDetailData?.openComment) { |
| @@ -447,22 +450,25 @@ export struct ImageAndTextPageComponent { | @@ -447,22 +450,25 @@ export struct ImageAndTextPageComponent { | ||
| 447 | PageRepository.postExecuteLike(params).then(res => { | 450 | PageRepository.postExecuteLike(params).then(res => { |
| 448 | // console.log(TAG, '点赞、res', JSON.stringify(res)) | 451 | // console.log(TAG, '点赞、res', JSON.stringify(res)) |
| 449 | // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 452 | // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 450 | - if (this.newsStatusOfUser) { | ||
| 451 | - //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 452 | - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | ||
| 453 | - if (this.newsStatusOfUser.likeStatus === '1') { | ||
| 454 | - this.likeNum = Number(this.likeNum) + 1 | 453 | + if (res.code != 0){ |
| 454 | + ToastUtils.showToast(res.message, 1000); | ||
| 455 | + }else { | ||
| 456 | + if (this.newsStatusOfUser) { | ||
| 457 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 458 | + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | ||
| 459 | + if (this.newsStatusOfUser.likeStatus === '1') { | ||
| 460 | + this.likeNum = Number(this.likeNum) + 1 | ||
| 461 | + } else { | ||
| 462 | + this.likeNum = Number(this.likeNum) - 1 | ||
| 463 | + } | ||
| 464 | + // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) | ||
| 465 | + // this.queryContentInteractCount() | ||
| 466 | + TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 455 | } else { | 467 | } else { |
| 456 | - this.likeNum = Number(this.likeNum) - 1 | 468 | + // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 |
| 469 | + this.getInteractDataStatus() | ||
| 457 | } | 470 | } |
| 458 | - // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) | ||
| 459 | - // this.queryContentInteractCount() | ||
| 460 | - TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 461 | - } else { | ||
| 462 | - // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 | ||
| 463 | - this.getInteractDataStatus() | ||
| 464 | } | 471 | } |
| 465 | - | ||
| 466 | }) | 472 | }) |
| 467 | } | 473 | } |
| 468 | 474 |
| @@ -34,7 +34,9 @@ export struct FollowListDetailUI { | @@ -34,7 +34,9 @@ export struct FollowListDetailUI { | ||
| 34 | if (arr[1] == "0") { | 34 | if (arr[1] == "0") { |
| 35 | this.data.getDataArray().forEach((element, index) => { | 35 | this.data.getDataArray().forEach((element, index) => { |
| 36 | if (element.creatorId === arr[0]) { | 36 | if (element.creatorId === arr[0]) { |
| 37 | - this.data.deleteItem(index) | 37 | + animateTo({}, () => { |
| 38 | + this.data.deleteItem(index); | ||
| 39 | + }); | ||
| 38 | this.count = this.data.size() | 40 | this.count = this.data.size() |
| 39 | } | 41 | } |
| 40 | }); | 42 | }); |
| @@ -92,6 +94,7 @@ export struct FollowListDetailUI { | @@ -92,6 +94,7 @@ export struct FollowListDetailUI { | ||
| 92 | ListItem() { | 94 | ListItem() { |
| 93 | FollowChildComponent({ data: item, type: this.type }) | 95 | FollowChildComponent({ data: item, type: this.type }) |
| 94 | } | 96 | } |
| 97 | + .transition(TransitionEffect.OPACITY) | ||
| 95 | }, (item: FollowListDetailItem) => item.creatorId) | 98 | }, (item: FollowListDetailItem) => item.creatorId) |
| 96 | 99 | ||
| 97 | //没有更多数据 显示提示 | 100 | //没有更多数据 显示提示 |
| 1 | -import { NumberFormatterUtils, SPHelper } from 'wdKit'; | 1 | +import { NumberFormatterUtils, SPHelper, ToastUtils } from 'wdKit'; |
| 2 | import promptAction from '@ohos.promptAction'; | 2 | import promptAction from '@ohos.promptAction'; |
| 3 | import { | 3 | import { |
| 4 | batchLikeAndCollectParams, | 4 | batchLikeAndCollectParams, |
| @@ -526,15 +526,19 @@ export struct OperRowListView { | @@ -526,15 +526,19 @@ export struct OperRowListView { | ||
| 526 | 526 | ||
| 527 | console.log(TAG, '收藏点击', JSON.stringify(params)) | 527 | console.log(TAG, '收藏点击', JSON.stringify(params)) |
| 528 | PageRepository.postExecuteCollectRecord(params).then(res => { | 528 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 529 | - if (this.newsStatusOfUser) { | ||
| 530 | - this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | ||
| 531 | - if (this.newsStatusOfUser.collectStatus === 1) { | ||
| 532 | - promptAction.showToast({ message: '收藏成功' }) | ||
| 533 | - TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam) | ||
| 534 | - } else { | ||
| 535 | - TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam) | 529 | + if (res.code != 0){ |
| 530 | + ToastUtils.showToast(res.message, 1000); | ||
| 531 | + }else { | ||
| 532 | + if (this.newsStatusOfUser) { | ||
| 533 | + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | ||
| 534 | + if (this.newsStatusOfUser.collectStatus === 1) { | ||
| 535 | + promptAction.showToast({ message: '收藏成功' }) | ||
| 536 | + TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam) | ||
| 537 | + } else { | ||
| 538 | + TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam) | ||
| 539 | + } | ||
| 540 | + this.queryContentInteractCount() | ||
| 536 | } | 541 | } |
| 537 | - this.queryContentInteractCount() | ||
| 538 | } | 542 | } |
| 539 | console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 543 | console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 540 | }) | 544 | }) |
| @@ -48,6 +48,7 @@ struct OtherNormalUserHomePage { | @@ -48,6 +48,7 @@ struct OtherNormalUserHomePage { | ||
| 48 | @State userName:string = "" | 48 | @State userName:string = "" |
| 49 | @State headPhotoUrl:string = "" | 49 | @State headPhotoUrl:string = "" |
| 50 | @State levelHead:string = "" | 50 | @State levelHead:string = "" |
| 51 | + @State listLevelHead:string = "" | ||
| 51 | @State levelId:number = 0 | 52 | @State levelId:number = 0 |
| 52 | @State browseNum:number = 0//阅读数 | 53 | @State browseNum:number = 0//阅读数 |
| 53 | @State commentNum:number = 0//评论数 | 54 | @State commentNum:number = 0//评论数 |
| @@ -208,7 +209,7 @@ struct OtherNormalUserHomePage { | @@ -208,7 +209,7 @@ struct OtherNormalUserHomePage { | ||
| 208 | Stack({ alignContent: Alignment.Top }){ | 209 | Stack({ alignContent: Alignment.Top }){ |
| 209 | Tabs({controller: this.controller}) { | 210 | Tabs({controller: this.controller}) { |
| 210 | TabContent() { | 211 | TabContent() { |
| 211 | - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | 212 | + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.listLevelHead,commentNum:$commentNum}) |
| 212 | } | 213 | } |
| 213 | TabContent() { | 214 | TabContent() { |
| 214 | OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | 215 | OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) |
| @@ -422,6 +423,7 @@ struct OtherNormalUserHomePage { | @@ -422,6 +423,7 @@ struct OtherNormalUserHomePage { | ||
| 422 | this.levelHead = value[0].levelHead | 423 | this.levelHead = value[0].levelHead |
| 423 | } | 424 | } |
| 424 | } | 425 | } |
| 426 | + this.listLevelHead = value[0].levelHead | ||
| 425 | this.levelId = value[0].level | 427 | this.levelId = value[0].level |
| 426 | } | 428 | } |
| 427 | }).catch((err:Error)=>{ | 429 | }).catch((err:Error)=>{ |
| @@ -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 | //播放错误 |
| @@ -198,6 +200,7 @@ export struct DetailPlayVLivePage { | @@ -198,6 +200,7 @@ export struct DetailPlayVLivePage { | ||
| 198 | playerController: this.playerController, | 200 | playerController: this.playerController, |
| 199 | swiperController: this.swiperController, | 201 | swiperController: this.swiperController, |
| 200 | swiperIndex: $swiperIndex, | 202 | swiperIndex: $swiperIndex, |
| 203 | + showClearButton: $showClearButton | ||
| 201 | }) | 204 | }) |
| 202 | 205 | ||
| 203 | // 直播资源加载失败 | 206 | // 直播资源加载失败 |
| @@ -241,7 +244,7 @@ export struct DetailPlayVLivePage { | @@ -241,7 +244,7 @@ export struct DetailPlayVLivePage { | ||
| 241 | Image($r('app.media.icon_live_more')) | 244 | Image($r('app.media.icon_live_more')) |
| 242 | .width(40) | 245 | .width(40) |
| 243 | .aspectRatio(1) | 246 | .aspectRatio(1) |
| 244 | - .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | 247 | + .visibility(this.showClearButton ? Visibility.Visible : Visibility.Hidden) |
| 245 | .position({ x: '100%', y: '100%' }) | 248 | .position({ x: '100%', y: '100%' }) |
| 246 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) | 249 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) |
| 247 | .onClick(() => { | 250 | .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() |
| @@ -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 | } |
-
Please register or login to post a comment