陈剑华

Merge remote-tracking branch 'origin/main'

@@ -124,4 +124,6 @@ export class WDRouterPage { @@ -124,4 +124,6 @@ export class WDRouterPage {
124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage"); 124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
125 // 栏目页面、频道详情 125 // 栏目页面、频道详情
126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage"); 126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
  127 + //展示头像
  128 + static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
127 } 129 }
@@ -44,9 +44,9 @@ export struct DynamicDetailComponent { @@ -44,9 +44,9 @@ export struct DynamicDetailComponent {
44 /** 44 /**
45 * 关注状态:默认未关注 点击去关注 45 * 关注状态:默认未关注 点击去关注
46 */ 46 */
47 - @State followStatus: String = '0'; 47 + @State followStatus: String = '';
48 48
49 - @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined// 点赞、收藏状态 49 + @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态
50 //跳转 50 //跳转
51 private mJumpInfo: ContentDTO = {} as ContentDTO; 51 private mJumpInfo: ContentDTO = {} as ContentDTO;
52 52
@@ -121,6 +121,7 @@ export struct DynamicDetailComponent { @@ -121,6 +121,7 @@ export struct DynamicDetailComponent {
121 } 121 }
122 .width('63%') 122 .width('63%')
123 .margin({right: $r('app.float.margin_6')}) 123 .margin({right: $r('app.float.margin_6')})
  124 + if(!StringUtils.isEmpty(this.followStatus)){
124 if (this.followStatus == '0') { 125 if (this.followStatus == '0') {
125 Text('关注') 126 Text('关注')
126 .width($r('app.float.margin_54')) 127 .width($r('app.float.margin_54'))
@@ -148,6 +149,7 @@ export struct DynamicDetailComponent { @@ -148,6 +149,7 @@ export struct DynamicDetailComponent {
148 }) 149 })
149 } 150 }
150 } 151 }
  152 + }
151 .width('100%') 153 .width('100%')
152 .margin({ left: $r('app.float.margin_16')}) 154 .margin({ left: $r('app.float.margin_16')})
153 //内容 155 //内容
@@ -330,8 +332,8 @@ export struct DynamicDetailComponent { @@ -330,8 +332,8 @@ export struct DynamicDetailComponent {
330 Image(this.newsStatusOfUser?.likeStatus == '1'? 332 Image(this.newsStatusOfUser?.likeStatus == '1'?
331 $r('app.media.icon_like_selected_redheart') 333 $r('app.media.icon_like_selected_redheart')
332 :$r('app.media.icon_like_unselect_grey_redheart')) 334 :$r('app.media.icon_like_unselect_grey_redheart'))
333 - .width($r('app.float.margin_24'))  
334 - .height($r('app.float.margin_24')) 335 + .width($r('app.float.margin_36'))
  336 + .height($r('app.float.margin_36'))
335 .objectFit(ImageFit.Cover) 337 .objectFit(ImageFit.Cover)
336 if(this.interactDataDTO?.likeNum != 0){ 338 if(this.interactDataDTO?.likeNum != 0){
337 Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum)) 339 Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
@@ -430,12 +432,18 @@ export struct DynamicDetailComponent { @@ -430,12 +432,18 @@ export struct DynamicDetailComponent {
430 432
431 // 已登录->查询用户对作品点赞、收藏状态 433 // 已登录->查询用户对作品点赞、收藏状态
432 private async getInteractDataStatus() { 434 private async getInteractDataStatus() {
  435 + // 未登录,跳转登录
  436 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  437 + if (!user_id) {
  438 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  439 + return
  440 + }
433 try { 441 try {
434 const params: batchLikeAndCollectParams = { 442 const params: batchLikeAndCollectParams = {
435 contentList: [ 443 contentList: [
436 { 444 {
437 - contentId: this.contentDetailData[0]?.newsId + '',  
438 - contentType: this.contentDetailData[0]?.newsType + '', 445 + contentId: this.contentDetailData?.newsId + '',
  446 + contentType: this.contentDetailData?.newsType + '',
439 } 447 }
440 ] 448 ]
441 } 449 }
@@ -453,6 +461,13 @@ export struct DynamicDetailComponent { @@ -453,6 +461,13 @@ export struct DynamicDetailComponent {
453 * 查询当前登录用户是否关注作品号主 461 * 查询当前登录用户是否关注作品号主
454 * */ 462 * */
455 private async getBatchAttentionStatus() { 463 private async getBatchAttentionStatus() {
  464 + // 未登录,跳转登录
  465 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  466 + if (!user_id) {
  467 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  468 + this.followStatus = '0';
  469 + return
  470 + }
456 try { 471 try {
457 const params: postBatchAttentionStatusParams = { 472 const params: postBatchAttentionStatusParams = {
458 creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }] 473 creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
@@ -461,7 +476,7 @@ export struct DynamicDetailComponent { @@ -461,7 +476,7 @@ export struct DynamicDetailComponent {
461 this.followStatus = data[0]?.status; 476 this.followStatus = data[0]?.status;
462 Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) 477 Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
463 } catch (exception) { 478 } catch (exception) {
464 - 479 + this.followStatus = '0';
465 } 480 }
466 } 481 }
467 482
@@ -558,8 +573,6 @@ export struct DynamicDetailComponent { @@ -558,8 +573,6 @@ export struct DynamicDetailComponent {
558 contentType: this.contentDetailData?.newsType + '', 573 contentType: this.contentDetailData?.newsType + '',
559 } 574 }
560 ContentDetailRequest.postExecuteLike(params).then(res => { 575 ContentDetailRequest.postExecuteLike(params).then(res => {
561 -  
562 - if (this.newsStatusOfUser) {  
563 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' 576 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
564 if (this.newsStatusOfUser.likeStatus === '1') { 577 if (this.newsStatusOfUser.likeStatus === '1') {
565 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1 578 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1
@@ -567,9 +580,6 @@ export struct DynamicDetailComponent { @@ -567,9 +580,6 @@ export struct DynamicDetailComponent {
567 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 580 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
568 } 581 }
569 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 582 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
570 - // this.queryContentInteractCount()  
571 - }  
572 -  
573 }) 583 })
574 } 584 }
575 } 585 }
1 -import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit'; 1 +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
3 import { 3 import {
4 ContentDetailDTO, 4 ContentDetailDTO,
@@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent { @@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent {
78 78
79 build() { 79 build() {
80 RelativeContainer() { 80 RelativeContainer() {
81 - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {  
82 - Swiper(this.swiperController) {  
83 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {  
84 - Swiper(this.swiperControllerItem) {  
85 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 81 + this.init()
86 } 82 }
87 .width('100%') 83 .width('100%')
88 .height('100%') 84 .height('100%')
89 - .vertical(true)  
90 - .autoPlay(false)  
91 - .cachedCount(1)  
92 - .indicator(false)  
93 - .displayCount(1)  
94 - .onAnimationEnd(event => {  
95 - router.back()  
96 - })  
97 - }) 85 + .backgroundColor(Color.Black)
  86 + .id('e_picture_container')
  87 + // 设置顶部绘制延伸到状态栏
  88 + // 设置底部绘制延伸到导航条
  89 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
98 } 90 }
99 - .index(this.swiperIndex)  
100 - .width('100%')  
101 - .height(px2vp(this.picHeight) + 32)  
102 - .vertical(false)  
103 - .autoPlay(false)  
104 - .cachedCount(3)  
105 - .indicator(false)  
106 - .displayCount(1)  
107 - .loop(false)  
108 - .id('e_swiper_content')  
109 - .alignRules({  
110 - center: { anchor: "__container__", align: VerticalAlign.Center },  
111 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
112 - })  
113 - .onChange((index: number) => {  
114 - this.swiperIndex = index  
115 - })  
116 91
  92 + @Builder
  93 + init() {
117 if (this.contentDetailData.rmhPlatform == 1) { 94 if (this.contentDetailData.rmhPlatform == 1) {
118 Row() { 95 Row() {
119 Row({ space: 8 }) { 96 Row({ space: 8 }) {
@@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent { @@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent {
154 .height(14) 131 .height(14)
155 .textOverflow({ overflow: TextOverflow.Ellipsis }) 132 .textOverflow({ overflow: TextOverflow.Ellipsis })
156 .margin(0) 133 .margin(0)
  134 + .maxLines(1)
157 } 135 }
158 } 136 }
159 .width('81%') 137 .width('81%')
@@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent { @@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent {
192 .width('100%') 170 .width('100%')
193 .height(44) 171 .height(44)
194 .alignRules({ 172 .alignRules({
195 - top: { anchor: "e_swiper_content", align: VerticalAlign.Top },  
196 - middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center } 173 + top: { anchor: "__container__", align: VerticalAlign.Top },
  174 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
197 }) 175 })
198 .id('e_attention') 176 .id('e_attention')
199 } 177 }
  178 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
  179 + Swiper(this.swiperController) {
  180 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
  181 + Swiper(this.swiperControllerItem) {
  182 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
  183 + }
  184 + .width('100%')
  185 + .height('100%')
  186 + .vertical(true)
  187 + .autoPlay(false)
  188 + .cachedCount(1)
  189 + .indicator(false)
  190 + .displayCount(1)
  191 + .onAnimationEnd(event => {
  192 + router.back()
  193 + })
  194 + })
  195 + }
  196 + .index(this.swiperIndex)
  197 + .width('100%')
  198 + .height(px2vp(this.picHeight) + 32)
  199 + .vertical(false)
  200 + .autoPlay(false)
  201 + .cachedCount(3)
  202 + .indicator(false)
  203 + .displayCount(1)
  204 + .loop(false)
  205 + .id('e_swiper_content')
  206 + .alignRules({
  207 + center: { anchor: "__container__", align: VerticalAlign.Center },
  208 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  209 + })
  210 + .onChange((index: number) => {
  211 + this.swiperIndex = index
  212 + })
  213 +
200 Row() { 214 Row() {
201 Scroll(this.scroller) { 215 Scroll(this.scroller) {
202 Row() { 216 Row() {
@@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent { @@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent {
295 .border({ width: { top: 0.5 }, color: '#FFFFFF' }) 309 .border({ width: { top: 0.5 }, color: '#FFFFFF' })
296 .id('e_oper_row') 310 .id('e_oper_row')
297 } 311 }
298 - .width('100%')  
299 - .height('100%')  
300 - .backgroundColor(Color.Black)  
301 - .id('e_picture_container')  
302 - // 设置顶部绘制延伸到状态栏  
303 - // 设置底部绘制延伸到导航条  
304 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
305 - }  
306 312
307 getContentDetailData() { 313 getContentDetailData() {
308 try { 314 try {
@@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent { @@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent {
318 } 324 }
319 this.netStatus = undefined 325 this.netStatus = undefined
320 this.contentDetailData = resDTO.data?.[0]; 326 this.contentDetailData = resDTO.data?.[0];
  327 + if (this.contentDetailData.rmhPlatform == 1) {
  328 + WindowModel.shared.setWindowSystemBarProperties({
  329 + statusBarContentColor: '#ffffff',
  330 + })
  331 + }
321 // this.contentDetailData.photoList = [] 332 // this.contentDetailData.photoList = []
322 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 333 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
323 // 暂无内容 334 // 暂无内容
@@ -29,13 +29,11 @@ struct MineHomePage { @@ -29,13 +29,11 @@ struct MineHomePage {
29 registTime:number = 0//账号注册时间 29 registTime:number = 0//账号注册时间
30 @State registerTimeForDay:number = 0 30 @State registerTimeForDay:number = 0
31 31
32 - aboutToAppear(){ 32 + onPageShow(): void {
33 this.getUserInfo() 33 this.getUserInfo()
34 this.getUserLevel() 34 this.getUserLevel()
35 } 35 }
36 36
37 -  
38 -  
39 build() { 37 build() {
40 Stack({ alignContent: Alignment.Top }){ 38 Stack({ alignContent: Alignment.Top }){
41 Image($r('app.media.title_bg')) 39 Image($r('app.media.title_bg'))
@@ -65,9 +63,8 @@ struct MineHomePage { @@ -65,9 +63,8 @@ struct MineHomePage {
65 .height('130lpx') 63 .height('130lpx')
66 .objectFit(ImageFit.Cover) 64 .objectFit(ImageFit.Cover)
67 }.onClick(()=>{ 65 }.onClick(()=>{
68 - //TODO 显示头像  
69 - let params = {'userId': "531267787833221"} as Record<string, string>;  
70 - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) 66 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  67 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
71 }).width('135lpx') 68 }).width('135lpx')
72 .height('135lpx') 69 .height('135lpx')
73 70
@@ -370,6 +367,9 @@ struct MineHomePage { @@ -370,6 +367,9 @@ struct MineHomePage {
370 if(StringUtils.isNotEmpty(value.introduction)){ 367 if(StringUtils.isNotEmpty(value.introduction)){
371 this.desc = value.introduction 368 this.desc = value.introduction
372 this.isHasIntroduction = true 369 this.isHasIntroduction = true
  370 + }else{
  371 + this.desc = "点击添加简介,让大家认识你"
  372 + this.isHasIntroduction = false
373 } 373 }
374 this.browseNum = value.browseNum 374 this.browseNum = value.browseNum
375 this.commentNum = value.commentNum 375 this.commentNum = value.commentNum
  1 +import { router } from '@kit.ArkUI';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct ShowUserHeaderPage {
  6 + @State headPhotoUrl: string = '';
  7 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  8 +
  9 + onPageShow() {
  10 + this.headPhotoUrl = this.params?.['headPhotoUrl'];
  11 + }
  12 +
  13 + build() {
  14 + Row() {
  15 + Image(this.headPhotoUrl)
  16 + .alt($r('app.media.default_head'))
  17 + .width('720lpx')
  18 + .height('720lpx')
  19 + .objectFit(ImageFit.Auto)
  20 + .clip(new Circle({ width: '720lpx', height: '720lpx' }))
  21 + }
  22 + .width('100%')
  23 + .height('100%')
  24 + .alignItems(VerticalAlign.Center)
  25 + .backgroundColor($r('app.color.color_000000'))
  26 + .onClick(()=>{
  27 + router.back()
  28 + })
  29 + }
  30 +}
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 "components/page/LiveMorePage", 21 "components/page/LiveMorePage",
22 "components/page/ReserveMorePage", 22 "components/page/ReserveMorePage",
23 "pages/VideoPlayPage", 23 "pages/VideoPlayPage",
24 - "components/page/ThemeListPage" 24 + "components/page/ThemeListPage",
  25 + "pages/ShowUserHeaderPage"
25 ] 26 ]
26 } 27 }
@@ -11,7 +11,7 @@ export struct ChartItemCompereComponent { @@ -11,7 +11,7 @@ export struct ChartItemCompereComponent {
11 ListItem() { 11 ListItem() {
12 Column() { 12 Column() {
13 Row() { 13 Row() {
14 - Image($r('app.media.icon_live_status_running')) 14 + Image($r('app.media.default_head'))
15 .borderRadius(10) 15 .borderRadius(10)
16 .width(20) 16 .width(20)
17 .height(20) 17 .height(20)
@@ -24,13 +24,15 @@ export struct ChartItemCompereComponent { @@ -24,13 +24,15 @@ export struct ChartItemCompereComponent {
24 24
25 Text(' 主持人 ') 25 Text(' 主持人 ')
26 .fontSize(11) 26 .fontSize(11)
27 - .backgroundColor('808562') 27 + .backgroundColor('#FFFFC63F')
28 .fontColor('#FFFFFFFF') 28 .fontColor('#FFFFFFFF')
29 .padding({ top: 2, bottom: 2, left: 4, right: 4 }) 29 .padding({ top: 2, bottom: 2, left: 4, right: 4 })
30 .borderRadius(4) 30 .borderRadius(4)
31 - }.margin({ bottom: 8 }) 31 + }
  32 + .margin({ bottom: 8 })
  33 + .justifyContent(FlexAlign.Start)
32 34
33 - Text(this.liveDetailsBean.newIntroduction).lineHeight(22) 35 + Text(this.liveDetailsBean.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
34 } 36 }
35 .backgroundColor('#4D000000') 37 .backgroundColor('#4D000000')
36 .borderRadius(3) 38 .borderRadius(3)
@@ -41,6 +43,7 @@ export struct ChartItemCompereComponent { @@ -41,6 +43,7 @@ export struct ChartItemCompereComponent {
41 right: 8 43 right: 8
42 }) 44 })
43 .margin({ left: 16, bottom: 4 }) 45 .margin({ left: 16, bottom: 4 })
  46 + .alignItems(HorizontalAlign.Start)
44 } 47 }
45 48
46 } 49 }