陈剑华

Merge remote-tracking branch 'origin/main'

Showing 34 changed files with 314 additions and 187 deletions
@@ -323,6 +323,7 @@ export struct WdWebLocalComponent { @@ -323,6 +323,7 @@ export struct WdWebLocalComponent {
323 }else { 323 }else {
324 Row() { 324 Row() {
325 Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause')) 325 Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
  326 + .interpolation(ImageInterpolation.Medium)
326 .width(24) 327 .width(24)
327 .height(24) 328 .height(24)
328 .onClick(() => { 329 .onClick(() => {
@@ -352,7 +352,6 @@ export struct DynamicDetailComponent { @@ -352,7 +352,6 @@ export struct DynamicDetailComponent {
352 } 352 }
353 .width(48) 353 .width(48)
354 .padding({ bottom: 9 }) 354 .padding({ bottom: 9 })
355 -  
356 } 355 }
357 356
358 } 357 }
@@ -380,6 +379,7 @@ export struct DynamicDetailComponent { @@ -380,6 +379,7 @@ export struct DynamicDetailComponent {
380 GridCol({ 379 GridCol({
381 span: this.onePicW > this.onePicH ? 12 : 8 380 span: this.onePicW > this.onePicH ? 12 : 8
382 }) { 381 }) {
  382 + Stack({alignContent: Alignment.BottomEnd}) {
383 Image(item.picPath) 383 Image(item.picPath)
384 .backgroundColor(0xf5f5f5) 384 .backgroundColor(0xf5f5f5)
385 .width('100%') 385 .width('100%')
@@ -396,23 +396,6 @@ export struct DynamicDetailComponent { @@ -396,23 +396,6 @@ export struct DynamicDetailComponent {
396 this.onePicW = event?.width || 0; 396 this.onePicW = event?.width || 0;
397 this.onePicH = event?.height || 0; 397 this.onePicH = event?.height || 0;
398 }) 398 })
399 - }  
400 - .onClick(async (event: ClickEvent) => {  
401 - let retvalue = await FastClickUtil.isMinDelayTime()  
402 - if(retvalue){  
403 - return  
404 - }  
405 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
406 - })  
407 - }  
408 - } else if (this.contentDetailData.photoList.length === 4) {  
409 - GridCol({  
410 - span: { xs: 4 }  
411 - }) {  
412 - Stack({alignContent: Alignment.BottomEnd}) {  
413 - Image(item.picPath)  
414 - .aspectRatio(1)  
415 - .borderRadius(this.caclImageRadius(index))  
416 if(this.getPicType(item) !== 3){ 399 if(this.getPicType(item) !== 3){
417 Flex({ direction: FlexDirection.Row }) { 400 Flex({ direction: FlexDirection.Row }) {
418 Image($r('app.media.icon_long_pic')) 401 Image($r('app.media.icon_long_pic'))
@@ -444,7 +427,49 @@ export struct DynamicDetailComponent { @@ -444,7 +427,49 @@ export struct DynamicDetailComponent {
444 } 427 }
445 ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index) 428 ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
446 }) 429 })
447 - } else { 430 + }
  431 + }
  432 + // else if (this.contentDetailData.photoList.length === 4) {
  433 + // GridCol({
  434 + // span: { xs: 4 }
  435 + // }) {
  436 + // Stack({alignContent: Alignment.BottomEnd}) {
  437 + // Image(item.picPath)
  438 + // .aspectRatio(1)
  439 + // .borderRadius(this.caclImageRadius(index))
  440 + // if(this.getPicType(item) !== 3){
  441 + // Flex({ direction: FlexDirection.Row }) {
  442 + // Image($r('app.media.icon_long_pic'))
  443 + // .width(12)
  444 + // .height(12)
  445 + // .margin({ right: 4 })
  446 + // Text('长图')
  447 + // .fontSize(10)
  448 + // .fontWeight(400)
  449 + // .textShadow({
  450 + // radius: 1,
  451 + // color: `rgba(0,0,0,0.5)`,
  452 + // offsetY:1,
  453 + // offsetX:1
  454 + // })
  455 + // .fontColor(0xffffff)
  456 + // .fontFamily('PingFang SC')
  457 + // }
  458 + // .width(48)
  459 + // .align(Alignment.BottomEnd)
  460 + // .padding({ bottom: 3 })
  461 + // }
  462 + // }
  463 + // }
  464 + // .onClick(async (event: ClickEvent) => {
  465 + // let retvalue = await FastClickUtil.isMinDelayTime()
  466 + // if(retvalue){
  467 + // return
  468 + // }
  469 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  470 + // })
  471 + // }
  472 + else {
448 GridCol({ 473 GridCol({
449 span: { sm: 4, lg: 3 } 474 span: { sm: 4, lg: 3 }
450 }) { 475 }) {
@@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent { @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent {
65 @State reachEndIncreament: number = 0 65 @State reachEndIncreament: number = 0
66 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 66 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
67 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 67 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
68 - @State isScrollTop: boolean = true  
69 @State offsetY: number = 0 68 @State offsetY: number = 0
70 @State executedStartTime: number = new Date().getTime() 69 @State executedStartTime: number = new Date().getTime()
71 private screenHeight: number = 0 70 private screenHeight: number = 0
@@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent { @@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent {
208 207
209 .onAreaChange((oldValue: Area, newValue: Area) => { 208 .onAreaChange((oldValue: Area, newValue: Area) => {
210 this.info = newValue 209 this.info = newValue
211 - // console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)  
212 - // console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number) 210 + // console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset)
  211 + // console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number)
  212 + // console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight)
213 this.checkToScrollCommentArea() 213 this.checkToScrollCommentArea()
214 }) 214 })
215 // .onMeasureSize() 215 // .onMeasureSize()
@@ -284,7 +284,7 @@ export struct ImageAndTextPageComponent { @@ -284,7 +284,7 @@ export struct ImageAndTextPageComponent {
284 .justifyContent(FlexAlign.SpaceBetween) 284 .justifyContent(FlexAlign.SpaceBetween)
285 .alignItems(VerticalAlign.Bottom) 285 .alignItems(VerticalAlign.Bottom)
286 286
287 - if (this.isNetConnected && !this.detailContentEmpty) { 287 + // if (this.isNetConnected && !this.detailContentEmpty) {
288 Row() { 288 Row() {
289 Image($r('app.media.ic_news_detail_division')) 289 Image($r('app.media.ic_news_detail_division'))
290 .width('100%') 290 .width('100%')
@@ -294,7 +294,7 @@ export struct ImageAndTextPageComponent { @@ -294,7 +294,7 @@ export struct ImageAndTextPageComponent {
294 } 294 }
295 .padding({ left: 15, right: 15 }) 295 .padding({ left: 15, right: 15 })
296 .backgroundColor(Color.White) 296 .backgroundColor(Color.White)
297 - } 297 + // }
298 }.backgroundColor(Color.White) 298 }.backgroundColor(Color.White)
299 } 299 }
300 .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`}) 300 .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
@@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent { @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent {
467 * 查询点赞、收藏数量 467 * 查询点赞、收藏数量
468 */ 468 */
469 queryContentInteractCount() { 469 queryContentInteractCount() {
470 - console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) 470 + // console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
471 471
472 const params: contentInteractParams = { 472 const params: contentInteractParams = {
473 contentId: this.contentDetailData?.newsId + '', 473 contentId: this.contentDetailData?.newsId + '',
@@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent { @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent {
504 504
505 private pageScrollToCommonent() { 505 private pageScrollToCommonent() {
506 const info = componentUtils.getRectangleById('comment'); 506 const info = componentUtils.getRectangleById('comment');
507 - console.log(TAG, "点击滑动页面", JSON.stringify(info))  
508 //评论区当前位置 507 //评论区当前位置
509 - let currentCommonentOffSetY = this.info?.globalPosition.y as number 508 + let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
  509 + // 当前页面滚动位置
  510 + let currentScrollOffSetY = this.scroller.currentOffset().yOffset
510 let offSetY = 0 511 let offSetY = 0
511 if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { 512 if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
512 - offSetY = currentCommonentOffSetY-200 513 + offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
513 } 514 }
514 -  
515 // 定位到评论区域 515 // 定位到评论区域
516 - if (this.isScrollTop) { 516 + if (!this.showMainText) {
517 this.scroller.scrollTo({ 517 this.scroller.scrollTo({
518 xOffset: 0, 518 xOffset: 0,
519 yOffset: offSetY, 519 yOffset: offSetY,
@@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent { @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent {
522 } else { 522 } else {
523 this.scroller.scrollEdge(Edge.Top) 523 this.scroller.scrollEdge(Edge.Top)
524 } 524 }
525 - this.isScrollTop = !this.isScrollTop  
526 } 525 }
527 526
528 aboutToAppear() { 527 aboutToAppear() {
529 - Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); 528 + // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
530 this.getDetail() 529 this.getDetail()
531 this.screenHeight = DisplayUtils.getDeviceHeight() 530 this.screenHeight = DisplayUtils.getDeviceHeight()
532 this.initAnimationConfig(); 531 this.initAnimationConfig();
@@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent { @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent {
576 // 需要评论区位置,调用前 请确保它有值 575 // 需要评论区位置,调用前 请确保它有值
577 return 576 return
578 } 577 }
579 - let offSetY = this.info?.globalPosition.y as number -60  
580 - Logger.debug(TAG, "即将滚动至yOffset: " + offSetY) 578 + let offSetY = this.info?.globalPosition.y as number -70
581 if (offSetY >= (this.screenHeight-this.bottomHeight) ) { 579 if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
582 this.showMainText = false 580 this.showMainText = false
583 }else { 581 }else {
@@ -82,6 +82,8 @@ export struct InteractMComponent { @@ -82,6 +82,8 @@ export struct InteractMComponent {
82 let contentDTO :ContentDTO = new ContentDTO(); 82 let contentDTO :ContentDTO = new ContentDTO();
83 contentDTO.objectType = this.messageModel.InteractMsubM.contentType 83 contentDTO.objectType = this.messageModel.InteractMsubM.contentType
84 contentDTO.objectId = this.messageModel.InteractMsubM.contentId 84 contentDTO.objectId = this.messageModel.InteractMsubM.contentId
  85 + contentDTO.relId = this.messageModel.InteractMsubM.contentRelId
  86 + contentDTO.relType = this.messageModel.InteractMsubM.contentRelType
85 ProcessUtils.processPage(contentDTO) 87 ProcessUtils.processPage(contentDTO)
86 }) 88 })
87 } 89 }
@@ -58,7 +58,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -58,7 +58,7 @@ export default struct MinePageUserSimpleInfoUI {
58 .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) 58 .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
59 .width(63.21) 59 .width(63.21)
60 .height(63.21) 60 .height(63.21)
61 - .objectFit(ImageFit.Cover) 61 + .objectFit(ImageFit.Fill)
62 .borderRadius(50) 62 .borderRadius(50)
63 63
64 if(StringUtils.isNotEmpty(this.levelHead)){ 64 if(StringUtils.isNotEmpty(this.levelHead)){
@@ -147,7 +147,7 @@ export struct AppointmentListChildComponent { @@ -147,7 +147,7 @@ export struct AppointmentListChildComponent {
147 } 147 }
148 } 148 }
149 .height(24) 149 .height(24)
150 - .width(82) 150 + .width(this.item.status == "wait"?150:82)
151 .padding({ left: 10, right: 10}) 151 .padding({ left: 10, right: 10})
152 .alignItems(VerticalAlign.Center) 152 .alignItems(VerticalAlign.Center)
153 .backgroundColor($r('app.color.color_F5F5F5')) 153 .backgroundColor($r('app.color.color_F5F5F5'))
@@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{ @@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{
50 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) 50 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
51 .lineHeight(18) 51 .lineHeight(18)
52 .backgroundImage($r('app.media.ic_collect_mid')) 52 .backgroundImage($r('app.media.ic_collect_mid'))
53 - .backgroundImageSize(ImageSize.Cover) 53 + .backgroundImageSize(ImageSize.FILL)
54 .padding({top:7,bottom:7}) 54 .padding({top:7,bottom:7})
55 55
56 Image(index === 0?$r("app.media.ic_collect_left_right"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_right'):$r('app.media.ic_collect_mid_right'))) 56 Image(index === 0?$r("app.media.ic_collect_left_right"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_right'):$r('app.media.ic_collect_mid_right')))
@@ -9,9 +9,8 @@ export struct SubscribeListChildComponent{ @@ -9,9 +9,8 @@ export struct SubscribeListChildComponent{
9 Row(){ 9 Row(){
10 Text(`${this.item.dealTime}`) 10 Text(`${this.item.dealTime}`)
11 .margin({top:16,bottom:12}) 11 .margin({top:16,bottom:12})
12 - .fontWeight(400)  
13 .fontSize(12) 12 .fontSize(12)
14 - .lineHeight(17) 13 + .lineHeight(16)
15 .fontColor($r('app.color.color_999999')) 14 .fontColor($r('app.color.color_999999'))
16 }.width('100%') 15 }.width('100%')
17 .backgroundColor($r('app.color.color_F5F5F5')) 16 .backgroundColor($r('app.color.color_F5F5F5'))
@@ -45,7 +44,6 @@ export struct SubscribeListChildComponent{ @@ -45,7 +44,6 @@ export struct SubscribeListChildComponent{
45 Text(`${this.item.desc}`) 44 Text(`${this.item.desc}`)
46 .fontSize(14) 45 .fontSize(14)
47 .lineHeight(20) 46 .lineHeight(20)
48 - .fontWeight(400)  
49 .fontColor($r('app.color.color_222222')) 47 .fontColor($r('app.color.color_222222'))
50 .layoutWeight(1) 48 .layoutWeight(1)
51 }.alignItems(VerticalAlign.Center) 49 }.alignItems(VerticalAlign.Center)
1 -import { LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index'; 1 +import { DateTimeUtils, LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index';
2 import { Remark, SubscribeMessageModel, 2 import { Remark, SubscribeMessageModel,
3 WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; 3 WDMessageCenterMessageType } from '../../../../model/InteractMessageModel';
4 import MinePageDatasModel from '../../../../model/MinePageDatasModel'; 4 import MinePageDatasModel from '../../../../model/MinePageDatasModel';
@@ -150,10 +150,11 @@ export struct SubscribeMessageComponent{ @@ -150,10 +150,11 @@ export struct SubscribeMessageComponent{
150 this.hasMore = false 150 this.hasMore = false
151 } else { 151 } else {
152 value.list.forEach((value) => { 152 value.list.forEach((value) => {
153 - let dealTime = this.DealStartTime(value.time,1)  
154 - let dealTime2 = this.DealStartTime(value.time,2)  
155 -  
156 let remark = JSON.parse(value.remark) as Remark 153 let remark = JSON.parse(value.remark) as Remark
  154 + let liveTime = DateTimeUtils.formatDate(Number(remark.planStartTimeLong),'yyyy-MM-dd HH:mm:ss')
  155 +
  156 + let dealTime = this.DealStartTime(liveTime,1)
  157 + let dealTime2 = this.DealStartTime(liveTime,2)
157 158
158 let bean = new SubscribeMessageModel(dealTime,value.message,remark.coverImageUrl,value.title,dealTime2,value.contentId) 159 let bean = new SubscribeMessageModel(dealTime,value.message,remark.coverImageUrl,value.title,dealTime2,value.contentId)
159 bean.relId = remark.relationId 160 bean.relId = remark.relationId
@@ -8,6 +8,7 @@ import { TrackConstants, @@ -8,6 +8,7 @@ import { TrackConstants,
8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; 8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
9 import { WDShare } from 'wdShare/Index'; 9 import { WDShare } from 'wdShare/Index';
10 import { hasClicked, persistentStorage } from '../../utils/persistentStorage'; 10 import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
  11 +import { LottieView } from '../lottie/LottieView';
11 12
12 const TAG: string = 'CardView'; 13 const TAG: string = 'CardView';
13 14
@@ -443,7 +444,7 @@ export struct PaperSingleColumn999CardView { @@ -443,7 +444,7 @@ export struct PaperSingleColumn999CardView {
443 Image(this.item?.coverUrl) 444 Image(this.item?.coverUrl)
444 .borderRadius(5) 445 .borderRadius(5)
445 .objectFit(ImageFit.Cover) 446 .objectFit(ImageFit.Cover)
446 - .aspectRatio(319 / 179) ///图片设计比例 447 + .aspectRatio(319 / 200) ///图片设计比例
447 .padding({ top: 10 }) 448 .padding({ top: 10 })
448 //视频 449 //视频
449 if (this.item?.videoInfo) { 450 if (this.item?.videoInfo) {
@@ -481,6 +482,15 @@ export struct PaperSingleColumn999CardView { @@ -481,6 +482,15 @@ export struct PaperSingleColumn999CardView {
481 .width(14) 482 .width(14)
482 .height(14) 483 .height(14)
483 .objectFit(ImageFit.Contain) 484 .objectFit(ImageFit.Contain)
  485 + // LottieView({
  486 + // name: 'MorningPaper_live_status',
  487 + // path: "lottie/live_detail_living.json",
  488 + // lottieWidth: 14,
  489 + // lottieHeight: 14,
  490 + // autoplay: true,
  491 + // loop: true,
  492 + // })
  493 +
484 Text(this.buildLiveStateString()) 494 Text(this.buildLiveStateString())
485 .fontColor(Color.White) 495 .fontColor(Color.White)
486 .fontSize($r('app.float.vp_12')) 496 .fontSize($r('app.float.vp_12'))
@@ -16,7 +16,7 @@ struct EditUserIntroductionPage { @@ -16,7 +16,7 @@ struct EditUserIntroductionPage {
16 CustomTitleUI({titleName:'修改简介'}) 16 CustomTitleUI({titleName:'修改简介'})
17 17
18 Row(){ 18 Row(){
19 - TextInput({placeholder:'请输入简介',text:this.params.editContent}) 19 + TextArea({placeholder:'请输入简介',text:this.params.editContent})
20 .maxLength(60) 20 .maxLength(60)
21 .width('100%') 21 .width('100%')
22 .height(80) 22 .height(80)
1 -import { Logger} from 'wdKit' 1 +import { Logger, ToastUtils} from 'wdKit'
2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' 2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
3 import { 3 import {
4 ContentDTO, 4 ContentDTO,
@@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent { @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent {
49 // LoadingComponent() 49 // LoadingComponent()
50 this.LoadingLayout() 50 this.LoadingLayout()
51 } else if (this.viewType == 2) { 51 } else if (this.viewType == 2) {
52 - ErrorComponent() 52 + Column(){
  53 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
  54 + }.width('100%')
  55 + .height('100%')
53 }else if(this.viewType == 4){ 56 }else if(this.viewType == 4){
54 Column(){ 57 Column(){
55 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%') 58 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
@@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent {
201 this.isLoading = false 204 this.isLoading = false
202 if (this.arr.length == 0) { 205 if (this.arr.length == 0) {
203 this.viewType = 2 206 this.viewType = 2
  207 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
204 } 208 }
205 } 209 }
206 } 210 }
@@ -318,13 +318,13 @@ export struct PeopleShipHomePageTopComponent { @@ -318,13 +318,13 @@ export struct PeopleShipHomePageTopComponent {
318 this.content = this.subTxt 318 this.content = this.subTxt
319 } 319 }
320 } 320 }
321 - // if (this.detailModel) { 321 + if (this.detailModel) {
322 // this.topFixedHeight = 160 322 // this.topFixedHeight = 160
323 - // if (this.detailModel.region && this.detailModel.region.length > 0) {  
324 - // this.provinceName = this.detailModel.region  
325 - // } else {  
326 - // this.provinceName = await this.computeIPRegion(this.detailModel.province)  
327 - // } 323 + if (this.detailModel.region && this.detailModel.region.length > 0) {
  324 + this.provinceName = this.detailModel.region
  325 + } else {
  326 + this.provinceName = await this.computeIPRegion(this.detailModel.province)
  327 + }
328 // if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { 328 // if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
329 // this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18 329 // this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
330 // this.topFixedHeight += 12 330 // this.topFixedHeight += 12
@@ -362,7 +362,7 @@ export struct PeopleShipHomePageTopComponent { @@ -362,7 +362,7 @@ export struct PeopleShipHomePageTopComponent {
362 // } 362 // }
363 // 363 //
364 // this.topHeight = this.topFixedHeight 364 // this.topHeight = this.topFixedHeight
365 - // } 365 + }
366 } 366 }
367 367
368 private computeShowNum(count: number) { 368 private computeShowNum(count: number) {
@@ -5,8 +5,10 @@ export struct CustomTitleUI { @@ -5,8 +5,10 @@ export struct CustomTitleUI {
5 imgBack:boolean = true 5 imgBack:boolean = true
6 titleName:ResourceStr = "默认标题" 6 titleName:ResourceStr = "默认标题"
7 @Prop percent:number = 1 7 @Prop percent:number = 1
  8 + isShowBottomLine:boolean = false
8 9
9 build() { 10 build() {
  11 + Column(){
10 RelativeContainer() { 12 RelativeContainer() {
11 //标题栏目 13 //标题栏目
12 if(this.imgBack){ 14 if(this.imgBack){
@@ -43,6 +45,13 @@ export struct CustomTitleUI { @@ -43,6 +45,13 @@ export struct CustomTitleUI {
43 .height(44) 45 .height(44)
44 .width('100%') 46 .width('100%')
45 .backgroundColor($r('app.color.white')) 47 .backgroundColor($r('app.color.white'))
  48 +
  49 + if(this.isShowBottomLine){
  50 + Text().backgroundColor($r('app.color.color_EDEDED'))
  51 + .width('100%')
  52 + .height(1)
  53 + }
  54 + }
46 } 55 }
47 56
48 calcHeight(value:number): number{ 57 calcHeight(value:number): number{
@@ -107,6 +107,7 @@ export class SubscribeMessageModel{ @@ -107,6 +107,7 @@ export class SubscribeMessageModel{
107 export class Remark{ 107 export class Remark{
108 relationType:string = "" 108 relationType:string = ""
109 coverImageUrl:string = "" 109 coverImageUrl:string = ""
  110 + planStartTimeLong:string = ""
110 relationId:string = "" 111 relationId:string = ""
111 status:string = "" 112 status:string = ""
112 userName:string = "" 113 userName:string = ""
@@ -26,7 +26,7 @@ export class MineSettingDatasModel { @@ -26,7 +26,7 @@ export class MineSettingDatasModel {
26 mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting")) 26 mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
27 let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean 27 let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean
28 mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch")) 28 mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch"))
29 - let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,false) as boolean 29 + let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,true) as boolean
30 mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch")) 30 mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
31 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean 31 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
32 // mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch")) 32 // mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
@@ -154,7 +154,7 @@ struct MineHomePage { @@ -154,7 +154,7 @@ struct MineHomePage {
154 154
155 Row() { 155 Row() {
156 Row() { 156 Row() {
157 - Text(`${this.browseNum}`) 157 + Text(this.handlerNum(this.browseNum.toString()))
158 .textStyle() 158 .textStyle()
159 Text("阅读") 159 Text("阅读")
160 .textStyle2() 160 .textStyle2()
@@ -168,7 +168,7 @@ struct MineHomePage { @@ -168,7 +168,7 @@ struct MineHomePage {
168 .vertical(true) 168 .vertical(true)
169 .opacity(0.4) 169 .opacity(0.4)
170 Row() { 170 Row() {
171 - Text(`${this.commentNum}`) 171 + Text(this.handlerNum(this.commentNum.toString()))
172 .textStyle() 172 .textStyle()
173 Text("评论") 173 Text("评论")
174 .textStyle2() 174 .textStyle2()
@@ -182,7 +182,7 @@ struct MineHomePage { @@ -182,7 +182,7 @@ struct MineHomePage {
182 .vertical(true) 182 .vertical(true)
183 .opacity(0.4) 183 .opacity(0.4)
184 Row() { 184 Row() {
185 - Text(`${this.attentionNum}`) 185 + Text(this.handlerNum(this.attentionNum.toString()))
186 .textStyle() 186 .textStyle()
187 Text("关注") 187 Text("关注")
188 .textStyle2() 188 .textStyle2()
@@ -401,7 +401,8 @@ struct MineHomePage { @@ -401,7 +401,8 @@ struct MineHomePage {
401 }) 401 })
402 .margin({ left: 10 }) 402 .margin({ left: 10 })
403 .onClick(() => { 403 .onClick(() => {
404 - router.back() 404 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  405 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
405 }) 406 })
406 407
407 Text(`${this.userName}`) 408 Text(`${this.userName}`)
@@ -518,6 +519,24 @@ struct MineHomePage { @@ -518,6 +519,24 @@ struct MineHomePage {
518 console.log(TAG,JSON.stringify(err)) 519 console.log(TAG,JSON.stringify(err))
519 }) 520 })
520 } 521 }
  522 +
  523 + handlerNum(number: string) {
  524 + const num = number??'0';
  525 + if (Number.parseInt(num) <= 9999) {
  526 + return Number.parseInt(num).toString()
  527 + } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
  528 + const num1: string = num.slice(0, -4); // 万
  529 + const num2: string = num.slice(-4, -3); // 千
  530 + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
  531 + } else if (Number.parseInt(num) > 99999999) {
  532 + const num1: string = num.slice(0, -8); // 亿
  533 + const num2: string = num.slice(-8, -7);
  534 + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
  535 + }
  536 + return num
  537 + }
  538 +
  539 +
521 getUserLevel(){ 540 getUserLevel(){
522 MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{ 541 MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{
523 if(value!=null){ 542 if(value!=null){
@@ -14,10 +14,9 @@ struct ShowUserHeaderPage { @@ -14,10 +14,9 @@ struct ShowUserHeaderPage {
14 Row() { 14 Row() {
15 Image(this.headPhotoUrl) 15 Image(this.headPhotoUrl)
16 .alt($r('app.media.default_head')) 16 .alt($r('app.media.default_head'))
17 - .width('720lpx')  
18 - .height('720lpx') 17 + .width('100%')
19 .objectFit(ImageFit.Auto) 18 .objectFit(ImageFit.Auto)
20 - .clip(new Circle({ width: '720lpx', height: '720lpx' })) 19 + // .clip(new Circle({ width: '720lpx', height: '720lpx' }))
21 } 20 }
22 .width('100%') 21 .width('100%')
23 .height('100%') 22 .height('100%')
@@ -16,7 +16,7 @@ async function onlyWifiLoadImg(): Promise<boolean> { @@ -16,7 +16,7 @@ async function onlyWifiLoadImg(): Promise<boolean> {
16 } 16 }
17 17
18 async function onlyWifiLoadVideo(): Promise<boolean> { 18 async function onlyWifiLoadVideo(): Promise<boolean> {
19 - let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH, '') || false; 19 + let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH, true) || false;
20 if (!loadImageOnlyWifiSwitch) { 20 if (!loadImageOnlyWifiSwitch) {
21 // 开关没开,直接让加载视频 21 // 开关没开,直接让加载视频
22 return true 22 return true
@@ -9,6 +9,8 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment @@ -9,6 +9,8 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment
9 import { PictureLoading } from '../widgets/vertical/PictureLoading'; 9 import { PictureLoading } from '../widgets/vertical/PictureLoading';
10 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; 10 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
11 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; 11 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
  12 +import { AudioSuspensionModel } from 'wdComponent'
  13 +import { BusinessError } from '@kit.BasicServicesKit';
12 14
13 const TAG = 'DetailPlayLiveCommon' 15 const TAG = 'DetailPlayLiveCommon'
14 16
@@ -60,15 +62,8 @@ export struct DetailPlayLiveCommon { @@ -60,15 +62,8 @@ export struct DetailPlayLiveCommon {
60 // 是否隐藏Loading view 62 // 是否隐藏Loading view
61 @State isHideLoading: boolean = false 63 @State isHideLoading: boolean = false
62 64
63 - async aboutToAppear(): Promise<void> {  
64 - const par: Action = router.getParams() as Action;  
65 - const params = par?.params;  
66 - this.relId = params?.extra?.relId || '';  
67 - this.relType = params?.extra?.relType || '';  
68 - this.contentId = params?.contentID || '';  
69 - this.getContentDetail()  
70 -  
71 - } 65 + private AudioSuspension = new AudioSuspensionModel()
  66 + @State isShowAudioCom: boolean = false
72 67
73 build() { 68 build() {
74 Column() { 69 Column() {
@@ -92,82 +87,116 @@ export struct DetailPlayLiveCommon { @@ -92,82 +87,116 @@ export struct DetailPlayLiveCommon {
92 /** 87 /**
93 * 查询视频详情用于评论展示 88 * 查询视频详情用于评论展示
94 */ 89 */
95 - getContentDetail() { 90 + getContentDetail(): Promise<void> {
  91 + return new Promise<void>((resolve, reject) => {
96 this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType) 92 this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
97 .then(async (data: Array<ContentDetailDTO>) => { 93 .then(async (data: Array<ContentDetailDTO>) => {
98 - console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))  
99 - if (data) {  
100 - let detailData = data[0]  
101 - //人民号类型单独获取直播地址  
102 - if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { //  
103 - let vliveId = detailData.liveInfo.vlive[0].vliveId as string  
104 - let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean  
105 - if (pullStreamAddressData) {  
106 - // console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))  
107 - let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url  
108 - detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl  
109 - this.playUrl = m3u8uUrl 94 + // console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data));
  95 +
  96 + if (!data || data.length === 0) {
  97 + this.isHideLoading = true;
  98 + ToastUtils.shortToast('内容不存在');
  99 + router.back();
  100 + reject();
  101 + return;
110 } 102 }
111 - }  
112 -  
113 - this.liveState = detailData.liveInfo?.liveState  
114 -  
115 - this.contentDetailData = data[0]  
116 -  
117 - this.liveDetailPageLogic.contentDetailData = this.contentDetailData  
118 -  
119 - this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape  
120 -  
121 - this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState  
122 -  
123 - this.liveDetailPageLogic.resolvingRoomImgSource()  
124 103
125 - this.liveDetailPageLogic.resolvingRoomVliveData(0) 104 + const detailData = data[0];
126 105
127 - this.publishCommentModel.targetId = String(detailData?.newsId || '')  
128 - this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')  
129 - this.publishCommentModel.targetTitle = detailData?.newsTitle  
130 - this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '')  
131 - this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '')  
132 - this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '')  
133 - this.publishCommentModel.targetType = String(detailData?.newsType || '')  
134 - this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')  
135 - this.publishCommentModel.commentContent = ''  
136 - this.liveStyle = detailData.liveInfo?.liveStyle 106 + // 人民号类型单独获取直播地址
  107 + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') {
  108 + const vliveId = detailData.liveInfo.vlive[0].vliveId as string;
  109 + const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean;
137 110
138 - if (detailData.liveInfo.liveState == 'end') {  
139 - this.playUrl = detailData.liveInfo.vlive[0].replayUri 111 + if (pullStreamAddressData) {
  112 + const m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url;
  113 + detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl;
  114 + this.playUrl = m3u8uUrl;
  115 + }
140 } 116 }
141 117
142 - } else {  
143 - this.isHideLoading = true  
144 - ToastUtils.shortToast('内容不存在')  
145 - router.back() 118 + this.liveState = detailData.liveInfo?.liveState;
  119 + this.contentDetailData = detailData;
  120 + this.liveDetailPageLogic.contentDetailData = this.contentDetailData;
  121 + this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape;
  122 + this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState;
  123 + this.liveDetailPageLogic.resolvingRoomImgSource();
  124 + this.liveDetailPageLogic.resolvingRoomVliveData(0);
  125 +
  126 + const publishCommentModel = this.publishCommentModel;
  127 + publishCommentModel.targetId = String(detailData?.newsId || '');
  128 + publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '');
  129 + publishCommentModel.targetTitle = detailData?.newsTitle;
  130 + publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '');
  131 + publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '');
  132 + publishCommentModel.keyArticle = String(detailData?.keyArticle || '');
  133 + publishCommentModel.targetType = String(detailData?.newsType || '');
  134 + publishCommentModel.visitorComment = String(detailData?.visitorComment || '');
  135 + publishCommentModel.commentContent = '';
  136 + this.liveStyle = detailData.liveInfo?.liveStyle;
  137 +
  138 + if (detailData.liveInfo?.liveState === 'end') {
  139 + this.playUrl = detailData.liveInfo.vlive[0].replayUri;
146 } 140 }
147 - }, () => {  
148 - this.isHideLoading = true  
149 - ToastUtils.shortToast('内容不存在')  
150 - router.back()  
151 141
  142 + resolve();
152 }) 143 })
  144 + .catch(() => {
  145 + this.isHideLoading = true;
  146 + ToastUtils.shortToast('内容不存在');
  147 + router.back();
  148 + reject();
  149 + });
  150 + });
153 } 151 }
154 152
155 - onPageShow() { 153 +
  154 + async onPageShow() {
156 this.pageShow = Math.random() 155 this.pageShow = Math.random()
157 - Logger.info(TAG, 'onPageShow') 156 + // Logger.info(TAG, 'onPageShow')
158 this.pageShowTime = DateTimeUtils.getTimeStamp() 157 this.pageShowTime = DateTimeUtils.getTimeStamp()
159 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) 158 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  159 + const par: Action = router.getParams() as Action;
  160 + const params = par?.params;
  161 + this.relId = params?.extra?.relId || '';
  162 + this.relType = params?.extra?.relType || '';
  163 + this.contentId = params?.contentID || '';
  164 + await this.getContentDetail()
  165 + // 判断当前窗口是否已显示,使用callback异步回调。
  166 + // Logger.info(TAG, 'this.liveState', this.liveState)
  167 + if(this.liveState !== 'wait') {
  168 + this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
  169 + const errCode: number = err.code;
  170 + if (errCode) {
  171 + // console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
  172 + return;
  173 + }
  174 + // console.info(TAG, 'window is showing: ' + JSON.stringify(data));
  175 + if(data) {
  176 + this.isShowAudioCom = true
  177 + this.AudioSuspension.playerController.get()?.pause();
  178 + this.AudioSuspension.minimize()
  179 + }
  180 + });
  181 + }
160 } 182 }
161 183
162 onPageHide() { 184 onPageHide() {
163 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'}) 185 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
164 this.pageHide = Math.random() 186 this.pageHide = Math.random()
165 - Logger.info(TAG, 'onPageHide') 187 + // Logger.info(TAG, 'onPageHide')
166 //页面浏览 188 //页面浏览
167 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, 189 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,
168 TrackConstants.PageName.Live_Detail 190 TrackConstants.PageName.Live_Detail
169 , Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000)) 191 , Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000))
170 192
  193 + if(this.liveState !== 'wait') {
  194 + if (this.isShowAudioCom) {
  195 + this.AudioSuspension.showWindow()
  196 + this.isShowAudioCom = false
  197 + }
  198 + }
  199 +
171 } 200 }
172 201
173 onBackPress(): boolean | void { 202 onBackPress(): boolean | void {
@@ -258,7 +258,7 @@ export struct PlayUIComponent { @@ -258,7 +258,7 @@ export struct PlayUIComponent {
258 .fontWeight(400) 258 .fontWeight(400)
259 .fontColor(Color.White) 259 .fontColor(Color.White)
260 260
261 - if (this.liveRoomDataBean.pv > 0) { 261 + if (this.liveRoomDataBean.pv > 0 && !StringUtils.isEmpty(this.liveUrl)) {
262 Image($r('app.media.icon_live_player_status_end')) 262 Image($r('app.media.icon_live_player_status_end'))
263 .width(12) 263 .width(12)
264 .height(12) 264 .height(12)
@@ -91,6 +91,19 @@ export struct PlayerEndView { @@ -91,6 +91,19 @@ export struct PlayerEndView {
91 .padding({ bottom: 40, top: 120 }) 91 .padding({ bottom: 40, top: 120 })
92 92
93 Stack() { 93 Stack() {
  94 + if (this.contentDetailData.rmhInfo != null) {
  95 + Row() {
  96 + Image($r("app.media.live_end_BG_l"))
  97 + .width(307/2.0)
  98 + .height(254)
  99 + Image($r("app.media.live_end_BG_r"))
  100 + .width(307/2.0)
  101 + .height(254)
  102 + }
  103 + // .width(307)
  104 + // .height(254)
  105 + // .backgroundColor(Color.Red)
  106 + }
94 Column() { 107 Column() {
95 if (this.contentDetailData.rmhInfo != null) { 108 if (this.contentDetailData.rmhInfo != null) {
96 Text(this.contentDetailData?.rmhInfo?.rmhName) 109 Text(this.contentDetailData?.rmhInfo?.rmhName)
@@ -104,22 +117,25 @@ export struct PlayerEndView { @@ -104,22 +117,25 @@ export struct PlayerEndView {
104 .fontColor('#B2FFFFFF') 117 .fontColor('#B2FFFFFF')
105 .padding({ top: 8 }) 118 .padding({ top: 8 })
106 } 119 }
  120 + Blank().height(this.contentDetailData.rmhInfo == null ? 26:16)
  121 + Stack() {
107 Row() { 122 Row() {
108 Column() { 123 Column() {
109 - Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)  
110 - Text('直播时长').fontWeight(400).fontSize(13).fontColor(Color.White) 124 + Text(this.duration).fontWeight(600).fontSize(20).fontColor(Color.White)
  125 + Text('直播时长').fontWeight(400).fontSize(12).fontColor(Color.White)
111 } 126 }
112 127
113 - Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF') 128 + Blank().width(1).height(32).margin({ left: 36, right: 36 })
114 Column() { 129 Column() {
115 Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || '')) 130 Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || ''))
116 .fontWeight(600) 131 .fontWeight(600)
117 - .fontSize(24) 132 + .fontSize(20)
118 .fontColor(Color.White) 133 .fontColor(Color.White)
119 - Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White) 134 + Text('观看人数').fontWeight(400).fontSize(12).fontColor(Color.White)
  135 + }
120 } 136 }
  137 + Text('').width(1).height(32).backgroundColor('#33FFFFFF')
121 } 138 }
122 - .padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })  
123 if (this.contentDetailData.rmhInfo != null) { 139 if (this.contentDetailData.rmhInfo != null) {
124 Row() { 140 Row() {
125 Text(this.followStatus == '0' ? '关注' : '已关注') 141 Text(this.followStatus == '0' ? '关注' : '已关注')
@@ -132,7 +148,8 @@ export struct PlayerEndView { @@ -132,7 +148,8 @@ export struct PlayerEndView {
132 left: 122, 148 left: 122,
133 right: 122 149 right: 122
134 }) 150 })
135 - .backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey) 151 + .height(42)
  152 + .backgroundColor(this.followStatus == '0' ? '#FFED2800' : '#CCCCCC')
136 .borderRadius(4) 153 .borderRadius(4)
137 .onClick(() => { 154 .onClick(() => {
138 this.handleAccention() 155 this.handleAccention()
@@ -143,16 +160,16 @@ export struct PlayerEndView { @@ -143,16 +160,16 @@ export struct PlayerEndView {
143 } 160 }
144 .width(307) 161 .width(307)
145 .height(this.contentDetailData.rmhInfo == null ? 100 : 254) 162 .height(this.contentDetailData.rmhInfo == null ? 100 : 254)
146 - .backgroundColor('#999999') 163 + .backgroundColor(this.contentDetailData.rmhInfo == null ? '#12ffffff' : '')
147 .borderRadius(4) 164 .borderRadius(4)
148 if (this.contentDetailData.rmhInfo != null) { 165 if (this.contentDetailData.rmhInfo != null) {
149 Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) 166 Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
150 .width(80) 167 .width(80)
151 .height(80) 168 .height(80)
152 .borderRadius(40) 169 .borderRadius(40)
153 - .borderWidth(1)  
154 - .borderColor(Color.White)  
155 - .borderStyle(BorderStyle.Solid) 170 + // .borderWidth(1)
  171 + // .borderColor(Color.White)
  172 + // .borderStyle(BorderStyle.Solid)
156 .position({ x: '50%', y: 0 }) 173 .position({ x: '50%', y: 0 })
157 .markAnchor({ x: '50%', y: '50%' }) 174 .markAnchor({ x: '50%', y: '50%' })
158 } 175 }
@@ -183,6 +200,8 @@ export struct PlayerEndView { @@ -183,6 +200,8 @@ export struct PlayerEndView {
183 } 200 }
184 .height('100%') 201 .height('100%')
185 .width('100%') 202 .width('100%')
  203 + // .align(Alignment.Center)
  204 + .justifyContent(FlexAlign.Center)
186 } 205 }
187 .height('100%') 206 .height('100%')
188 .width('100%') 207 .width('100%')
@@ -306,9 +306,9 @@ export struct DetailPlayShortVideoPage { @@ -306,9 +306,9 @@ export struct DetailPlayShortVideoPage {
306 onHeightDidChange: (height: number) => { 306 onHeightDidChange: (height: number) => {
307 this.playerWidth = px2vp(this.windowWidth) 307 this.playerWidth = px2vp(this.windowWidth)
308 this.playerHeight = px2vp(this.windowHeight - height) 308 this.playerHeight = px2vp(this.windowHeight - height)
309 - Logger.debug(TAG,  
310 - "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " +  
311 - px2vp(this.windowHeight)) 309 + // Logger.debug(TAG,
  310 + // "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " +
  311 + // px2vp(this.windowHeight))
312 } 312 }
313 }) 313 })
314 this.playerViewBuilder() 314 this.playerViewBuilder()
@@ -332,13 +332,9 @@ export struct DetailPlayShortVideoPage { @@ -332,13 +332,9 @@ export struct DetailPlayShortVideoPage {
332 .layoutWeight(1) 332 .layoutWeight(1)
333 .onClick(() => { 333 .onClick(() => {
334 this.playerController?.switchPlayOrPause(); 334 this.playerController?.switchPlayOrPause();
  335 + this.isPlay = !this.isPlay
335 this.playerController.onStatusChange = (status: number) => { 336 this.playerController.onStatusChange = (status: number) => {
336 this.status = status 337 this.status = status
337 - if (status === PlayerConstants.STATUS_PAUSE) {  
338 - this.isPlay = false  
339 - } else if (status === PlayerConstants.STATUS_START) {  
340 - this.isPlay = true  
341 - }  
342 } 338 }
343 }) 339 })
344 340
@@ -100,7 +100,7 @@ export struct DetailVideoListPage { @@ -100,7 +100,7 @@ export struct DetailVideoListPage {
100 aboutToAppear() { 100 aboutToAppear() {
101 // 在视频详情页 101 // 在视频详情页
102 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; 102 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
103 - console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) 103 + // console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
104 if (this.peopleShipHomeCreatorId) { 104 if (this.peopleShipHomeCreatorId) {
105 // 从人民号号主传过来的 105 // 从人民号号主传过来的
106 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); 106 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
@@ -112,6 +112,10 @@ export struct DetailVideoListPage { @@ -112,6 +112,10 @@ export struct DetailVideoListPage {
112 } 112 }
113 113
114 async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) { 114 async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) {
  115 + // 注册监听网络连接
  116 + this.netStatus = undefined
  117 + let netStatus = NetworkUtil.isNetConnected()
  118 + if (netStatus) {
115 this.openFullScreen(); 119 this.openFullScreen();
116 const action: Action = router.getParams() as Action; 120 const action: Action = router.getParams() as Action;
117 if (action) { 121 if (action) {
@@ -120,10 +124,14 @@ export struct DetailVideoListPage { @@ -120,10 +124,14 @@ export struct DetailVideoListPage {
120 this.relId = action.params.extra.relId || ''; 124 this.relId = action.params.extra.relId || '';
121 this.relType = action.params.extra.relType || ''; 125 this.relType = action.params.extra.relType || '';
122 } 126 }
123 - console.info(`cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)  
124 - await this.getContentDetail(this.contentId, this.relId, this.relType) 127 + // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
  128 + await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
125 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); 129 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
126 } 130 }
  131 + } else {
  132 + // 无网络
  133 + this.netStatus = 1
  134 + }
127 } 135 }
128 136
129 aboutToDisappear(): void { 137 aboutToDisappear(): void {
@@ -249,8 +257,8 @@ export struct DetailVideoListPage { @@ -249,8 +257,8 @@ export struct DetailVideoListPage {
249 relId: relId, 257 relId: relId,
250 relType: relType 258 relType: relType
251 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 259 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
252 - console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))  
253 - this.isOffLine = resDTO.data == null ? true : false 260 + // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  261 + // this.isOffLine = resDTO.data == null ? true : false
254 if (resDTO.data) { 262 if (resDTO.data) {
255 const params: contentListParams = { 263 const params: contentListParams = {
256 contentList: [{ 264 contentList: [{
@@ -288,7 +296,7 @@ export struct DetailVideoListPage { @@ -288,7 +296,7 @@ export struct DetailVideoListPage {
288 pageSize: pageSize, 296 pageSize: pageSize,
289 refreshTime: refreshTime 297 refreshTime: refreshTime
290 }).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => { 298 }).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => {
291 - console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data)) 299 + // console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
292 this.isOffLine = resDTO.data == null ? true : false 300 this.isOffLine = resDTO.data == null ? true : false
293 if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) { 301 if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) {
294 const params: contentListParams = { 302 const params: contentListParams = {
@@ -321,7 +329,7 @@ export struct DetailVideoListPage { @@ -321,7 +329,7 @@ export struct DetailVideoListPage {
321 refreshCnt: 1 329 refreshCnt: 1
322 }).then(async res => { 330 }).then(async res => {
323 if (res.data) { 331 if (res.data) {
324 - console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data)) 332 + // console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
325 await this.getContentInteract(res.data) 333 await this.getContentInteract(res.data)
326 this.data = this.data.concat(res.data) 334 this.data = this.data.concat(res.data)
327 // console.log('视频列表===', JSON.stringify(res.data)) 335 // console.log('视频列表===', JSON.stringify(res.data))
@@ -70,7 +70,12 @@ struct LoginProtocolWebview { @@ -70,7 +70,12 @@ struct LoginProtocolWebview {
70 } 70 }
71 .alignItems(VerticalAlign.Center) 71 .alignItems(VerticalAlign.Center)
72 .width('100%') 72 .width('100%')
73 - .height(44) 73 + .height(43)
  74 +
  75 + Text().backgroundColor("#EDEDED")
  76 + .width('100%')
  77 + .height(1)
  78 +
74 if(this.isConnectNetwork){ 79 if(this.isConnectNetwork){
75 Web({ src: this.webUrl, controller: this.webviewController }) 80 Web({ src: this.webUrl, controller: this.webviewController })
76 .backgroundColor(Color.White) 81 .backgroundColor(Color.White)
@@ -27,7 +27,7 @@ export class BackgroundAudioController { @@ -27,7 +27,7 @@ export class BackgroundAudioController {
27 27
28 public gotContextFunc?: () => Context 28 public gotContextFunc?: () => Context
29 public avplayerController?: WDPlayerController 29 public avplayerController?: WDPlayerController
30 - private lastSession?: AVSessionManager.AVSession 30 + private lastSession?: AVSessionManager.AVSession | null
31 31
32 private applyedLongTaskPlay: boolean = false 32 private applyedLongTaskPlay: boolean = false
33 33
@@ -64,6 +64,7 @@ export class BackgroundAudioController { @@ -64,6 +64,7 @@ export class BackgroundAudioController {
64 if (this.lastSession) { 64 if (this.lastSession) {
65 this.lastSession.deactivate(); 65 this.lastSession.deactivate();
66 this.lastSession.destroy(); 66 this.lastSession.destroy();
  67 + this.lastSession = null
67 } 68 }
68 } 69 }
69 70
@@ -126,7 +126,7 @@ struct LaunchAdvertisingPage { @@ -126,7 +126,7 @@ struct LaunchAdvertisingPage {
126 .fontColor(Color.White) 126 .fontColor(Color.White)
127 .margin({left:14,right:14}) 127 .margin({left:14,right:14})
128 } 128 }
129 - .width(74) 129 + .width(84)
130 .height(28) 130 .height(28)
131 .margin({top:5,right:10}) 131 .margin({top:5,right:10})
132 .backgroundColor('#80000000') 132 .backgroundColor('#80000000')
1 import { AudioSuspensionModel } from 'wdComponent' 1 import { AudioSuspensionModel } from 'wdComponent'
2 -import { PlayerConstants, DateFormatUtil } from 'wdPlayer' 2 +import { PlayerConstants, DateFormatUtil, BackgroundAudioController } from 'wdPlayer'
3 import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index' 3 import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index'
4 import window from '@ohos.window'; 4 import window from '@ohos.window';
5 import lottie from '@ohos/lottie'; 5 import lottie from '@ohos/lottie';
@@ -195,6 +195,7 @@ struct Index { @@ -195,6 +195,7 @@ struct Index {
195 if (this.AudioSuspension.playerController) { 195 if (this.AudioSuspension.playerController) {
196 this.AudioSuspension.playerController.get().pause() 196 this.AudioSuspension.playerController.get().pause()
197 this.AudioSuspension.minimize() 197 this.AudioSuspension.minimize()
  198 + BackgroundAudioController.sharedController().destorySession()
198 } 199 }
199 })) 200 }))
200 } 201 }
@@ -9,8 +9,6 @@ import { VideoChannelPage } from './VideoChannelPage'; @@ -9,8 +9,6 @@ import { VideoChannelPage } from './VideoChannelPage';
9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; 9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
10 import { ALL, ImageKnifeComponent, ImageKnifeOption } from '@ohos/imageknife'; 10 import { ALL, ImageKnifeComponent, ImageKnifeOption } from '@ohos/imageknife';
11 import { ParamType, Tracking } from 'wdTracking/Index'; 11 import { ParamType, Tracking } from 'wdTracking/Index';
12 -import { AudioSuspensionModel } from 'wdComponent'  
13 -import { BusinessError } from '@kit.BasicServicesKit';  
14 import { GrayManageModel } from 'wdComponent/src/main/ets/viewmodel/GrayManageModel'; 12 import { GrayManageModel } from 'wdComponent/src/main/ets/viewmodel/GrayManageModel';
15 13
16 const TAG = 'BottomNavigationComponent'; 14 const TAG = 'BottomNavigationComponent';
@@ -54,8 +52,6 @@ export struct BottomNavigationComponent { @@ -54,8 +52,6 @@ export struct BottomNavigationComponent {
54 @State assignChannel: AssignChannelParam = new AssignChannelParam() 52 @State assignChannel: AssignChannelParam = new AssignChannelParam()
55 // 自动刷新触发(双击tab自动刷新) 53 // 自动刷新触发(双击tab自动刷新)
56 @State autoRefresh: number = 0 54 @State autoRefresh: number = 0
57 - private AudioSuspension = new AudioSuspensionModel()  
58 - @State isShowAudioCom: boolean = false  
59 // 国殇灰度管理 55 // 国殇灰度管理
60 GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') 56 GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
61 57
@@ -157,9 +153,6 @@ export struct BottomNavigationComponent { @@ -157,9 +153,6 @@ export struct BottomNavigationComponent {
157 .hoverEffect(HoverEffect.Highlight) 153 .hoverEffect(HoverEffect.Highlight)
158 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 154 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
159 // .hitTestBehavior(HitTestMode.Block) 155 // .hitTestBehavior(HitTestMode.Block)
160 - .onTouch(() => {  
161 - this.handleAudio(navItem)  
162 - })  
163 .onClick(() => { 156 .onClick(() => {
164 // Logger.info(TAG, `onChange, index: ${index}`); 157 // Logger.info(TAG, `onChange, index: ${index}`);
165 // Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`); 158 // Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`);
@@ -268,32 +261,6 @@ export struct BottomNavigationComponent { @@ -268,32 +261,6 @@ export struct BottomNavigationComponent {
268 return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no') 261 return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no')
269 } 262 }
270 263
271 - // 控制音频悬浮窗显隐  
272 - handleAudio(navItem: BottomNavDTO) {  
273 - if (navItem.name === '视频') {  
274 - // 判断当前窗口是否已显示,使用callback异步回调。  
275 - this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {  
276 - const errCode: number = err.code;  
277 - if (errCode) {  
278 - // console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));  
279 - return;  
280 - }  
281 - // console.info(TAG, 'window is showing: ' + JSON.stringify(data));  
282 - if(data) {  
283 - this.isShowAudioCom = true  
284 - this.AudioSuspension.playerController.get()?.pause();  
285 - this.AudioSuspension.minimize()  
286 - }  
287 - });  
288 - } else {  
289 - // console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);  
290 - if (this.isShowAudioCom) {  
291 - this.AudioSuspension.showWindow()  
292 - this.isShowAudioCom = false  
293 - }  
294 - }  
295 - }  
296 -  
297 // 底导切换函数 264 // 底导切换函数
298 async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) { 265 async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) {
299 // Logger.info(TAG, `onBottomNavigationIndexChange to Index:${index},this.currentNavIndex: ${this.currentNavIndex}`); 266 // Logger.info(TAG, `onBottomNavigationIndexChange to Index:${index},this.currentNavIndex: ${this.currentNavIndex}`);
@@ -13,6 +13,8 @@ import { ParamType, Tracking } from 'wdTracking/Index'; @@ -13,6 +13,8 @@ import { ParamType, Tracking } from 'wdTracking/Index';
13 import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils'; 13 import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
14 import { ImageKnifeComponent } from '@ohos/imageknife'; 14 import { ImageKnifeComponent } from '@ohos/imageknife';
15 import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils'; 15 import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
  16 +import { AudioSuspensionModel } from 'wdComponent'
  17 +import { BusinessError } from '@kit.BasicServicesKit';
16 18
17 const TAG = 'VideoChannelPage' 19 const TAG = 'VideoChannelPage'
18 20
@@ -42,6 +44,8 @@ export struct VideoChannelPage { @@ -42,6 +44,8 @@ export struct VideoChannelPage {
42 // 背景高度 44 // 背景高度
43 @State backgroundImageH: number = 0 45 @State backgroundImageH: number = 0
44 @Consume @Watch('setBarBackgroundColor') pageShow: number 46 @Consume @Watch('setBarBackgroundColor') pageShow: number
  47 + private AudioSuspension = new AudioSuspensionModel()
  48 + @State isShowAudioCom: boolean = false
45 // 国殇灰度管理 49 // 国殇灰度管理
46 GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') 50 GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
47 51
@@ -50,6 +54,9 @@ export struct VideoChannelPage { @@ -50,6 +54,9 @@ export struct VideoChannelPage {
50 this.backgroundImageH = px2vp(this.topSafeHeight) + 44 54 this.backgroundImageH = px2vp(this.topSafeHeight) + 44
51 // console.info(`cj2024 backgroundImageH = ${this.backgroundImageH} this.topSafeHeight = ${this.topSafeHeight}`) 55 // console.info(`cj2024 backgroundImageH = ${this.backgroundImageH} this.topSafeHeight = ${this.topSafeHeight}`)
52 this.setBarBackgroundColor() 56 this.setBarBackgroundColor()
  57 + if (this.currentTopNavSelectedIndex === 0) {
  58 + this.handleAudio(this.topNavList[0])
  59 + }
53 } 60 }
54 61
55 /** 62 /**
@@ -100,6 +107,32 @@ export struct VideoChannelPage { @@ -100,6 +107,32 @@ export struct VideoChannelPage {
100 107
101 } 108 }
102 109
  110 + // 控制音频悬浮窗显隐
  111 + handleAudio(navItem: TopNavDTO) {
  112 + if (navItem.name === '视频') {
  113 + // 判断当前窗口是否已显示,使用callback异步回调。
  114 + this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
  115 + const errCode: number = err.code;
  116 + if (errCode) {
  117 + // console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
  118 + return;
  119 + }
  120 + // console.info(TAG, 'window is showing: ' + JSON.stringify(data));
  121 + if(data) {
  122 + this.isShowAudioCom = true
  123 + this.AudioSuspension.playerController.get()?.pause();
  124 + this.AudioSuspension.minimize()
  125 + }
  126 + });
  127 + } else {
  128 + // console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
  129 + if (this.isShowAudioCom) {
  130 + this.AudioSuspension.showWindow()
  131 + this.isShowAudioCom = false
  132 + }
  133 + }
  134 + }
  135 +
103 build() { 136 build() {
104 Stack({ alignContent: Alignment.Top }) { 137 Stack({ alignContent: Alignment.Top }) {
105 138
@@ -152,6 +185,7 @@ export struct VideoChannelPage { @@ -152,6 +185,7 @@ export struct VideoChannelPage {
152 .onClick(() => { 185 .onClick(() => {
153 // 视频tab埋点 186 // 视频tab埋点
154 const tab = this.topNavList[index] 187 const tab = this.topNavList[index]
  188 + this.handleAudio(tab)
155 Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`); 189 Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
156 const params: ParamType = { 190 const params: ParamType = {
157 "pageName": tab.name, 191 "pageName": tab.name,