王士厅

图文、动态详情页点赞,返回重新进入文章详情页,未展示已点赞状态。

@@ -648,7 +648,7 @@ export struct DynamicDetailComponent { @@ -648,7 +648,7 @@ export struct DynamicDetailComponent {
648 { 648 {
649 contentId: this.contentDetailData?.newsId + '', 649 contentId: this.contentDetailData?.newsId + '',
650 contentType: this.contentDetailData?.newsType + '', 650 contentType: this.contentDetailData?.newsType + '',
651 - contentRelId: this.contentDetailData?.reLInfo?.relId + '', 651 + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
652 } 652 }
653 ] 653 ]
654 } 654 }
@@ -95,7 +95,7 @@ export struct ImageAndTextPageComponent { @@ -95,7 +95,7 @@ export struct ImageAndTextPageComponent {
95 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { 95 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
96 Row() { 96 Row() {
97 Row() { 97 Row() {
98 - if (this.newsStatusOfUser?.likeStatus === '1') { 98 + if (this.newsStatusOfUser?.likeStatus == '1') {
99 Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') : 99 Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') :
100 (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : 100 (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') :
101 $r('app.media.icon_candle_active'))) 101 $r('app.media.icon_candle_active')))
@@ -112,7 +112,7 @@ export struct ImageAndTextPageComponent { @@ -112,7 +112,7 @@ export struct ImageAndTextPageComponent {
112 if (this.likeNum > 0) { 112 if (this.likeNum > 0) {
113 Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum)) 113 Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
114 .fontSize(16) 114 .fontSize(16)
115 - .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') 115 + .fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
116 .fontWeight(500) 116 .fontWeight(500)
117 .margin({ left: 5 }) 117 .margin({ left: 5 })
118 } 118 }
@@ -343,7 +343,7 @@ export struct ImageAndTextPageComponent { @@ -343,7 +343,7 @@ export struct ImageAndTextPageComponent {
343 { 343 {
344 contentId: this.contentDetailData?.newsId + '', 344 contentId: this.contentDetailData?.newsId + '',
345 contentType: this.contentDetailData?.newsType + '', 345 contentType: this.contentDetailData?.newsType + '',
346 - contentRelId: this.contentDetailData?.reLInfo?.relId + '', 346 + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
347 } 347 }
348 ] 348 ]
349 } 349 }
@@ -367,7 +367,7 @@ export struct ImageAndTextPageComponent { @@ -367,7 +367,7 @@ export struct ImageAndTextPageComponent {
367 return 367 return
368 } 368 }
369 const params: postExecuteLikeParams = { 369 const params: postExecuteLikeParams = {
370 - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', 370 + status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1',
371 contentId: this.contentDetailData?.newsId + '', 371 contentId: this.contentDetailData?.newsId + '',
372 contentType: this.contentDetailData?.newsType + '', 372 contentType: this.contentDetailData?.newsType + '',
373 } 373 }
@@ -375,7 +375,7 @@ export struct ImageAndTextPageComponent { @@ -375,7 +375,7 @@ export struct ImageAndTextPageComponent {
375 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) 375 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
376 if (this.newsStatusOfUser) { 376 if (this.newsStatusOfUser) {
377 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 377 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
378 - TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My) 378 + TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
379 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 379 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
380 this.queryContentInteractCount() 380 this.queryContentInteractCount()
381 } 381 }
@@ -395,6 +395,7 @@ export struct ImageAndTextPageComponent { @@ -395,6 +395,7 @@ export struct ImageAndTextPageComponent {
395 }] 395 }]
396 } 396 }
397 PageRepository.getContentInteract(params).then(res => { 397 PageRepository.getContentInteract(params).then(res => {
  398 + console.error(TAG, 'res', JSON.stringify(res))
398 if (res.data) { 399 if (res.data) {
399 this.interactData = res.data[0] 400 this.interactData = res.data[0]
400 this.likeNum = Number(res.data[0]?.likeNum) || 0 401 this.likeNum = Number(res.data[0]?.likeNum) || 0