douaojie

Merge remote-tracking branch 'origin/main'

@@ -2,46 +2,30 @@ import { StringUtils } from './StringUtils'; @@ -2,46 +2,30 @@ import { StringUtils } from './StringUtils';
2 import { SPHelper } from './SPHelper'; 2 import { SPHelper } from './SPHelper';
3 import { Logger } from './Logger'; 3 import { Logger } from './Logger';
4 4
5 -const KEY_USER_TOKEN = 'userToken';  
6 -  
7 const TAG: string = 'AccountManagerUtils'; 5 const TAG: string = 'AccountManagerUtils';
8 6
9 // 是否已登录hadLogin 7 // 是否已登录hadLogin
10 let hasLogin: boolean = false; 8 let hasLogin: boolean = false;
11 9
12 export class AccountManagerUtils { 10 export class AccountManagerUtils {
13 - // 是否已登录hadLogin  
14 - // private static hasLogin: boolean = undefined; 11 +
  12 + // 这里需要和其他模块value值一致 !!!!
  13 + // TODO: 以前清楚谁写的遗留代码,后续考虑删除
  14 + static readonly USER_ID = "userId"
15 15
16 constructor() { 16 constructor() {
17 } 17 }
18 18
19 - static async getUserToken(): Promise<string> {  
20 - let userToken = await SPHelper.default.get(KEY_USER_TOKEN, '') as string; 19 + static async getUserId(): Promise<string> {
  20 + let userId = await SPHelper.default.get(AccountManagerUtils.USER_ID, '') as string;
21 // Logger.info(TAG, 'getUserToken UserToken.' + userToken); 21 // Logger.info(TAG, 'getUserToken UserToken.' + userToken);
22 - return userToken; 22 + return userId;
23 } 23 }
24 24
25 - static getUserTokenSync(): string {  
26 - let userToken = SPHelper.default.getSync(KEY_USER_TOKEN, '') as string; 25 + static getUserIdSync(): string {
  26 + let userId = SPHelper.default.getSync(AccountManagerUtils.USER_ID, '') as string;
27 // Logger.info(TAG, 'getUserToken UserToken.' + userToken); 27 // Logger.info(TAG, 'getUserToken UserToken.' + userToken);
28 - return userToken;  
29 - }  
30 -  
31 - static async putUserToken(value: string) {  
32 - await SPHelper.default.save(KEY_USER_TOKEN, value);  
33 - }  
34 -  
35 - static putUserTokenSync(value: string) {  
36 - SPHelper.default.saveSync(KEY_USER_TOKEN, value);  
37 - }  
38 -  
39 - static async deleteUserToken() {  
40 - await SPHelper.default.delete(KEY_USER_TOKEN);  
41 - }  
42 -  
43 - static deleteUserTokenSync() {  
44 - SPHelper.default.deleteSync(KEY_USER_TOKEN); 28 + return userId;
45 } 29 }
46 30
47 /** 31 /**
@@ -51,7 +35,7 @@ export class AccountManagerUtils { @@ -51,7 +35,7 @@ export class AccountManagerUtils {
51 */ 35 */
52 static async isLogin() { 36 static async isLogin() {
53 Logger.info(TAG, 'isLogin hasLogin1:' + hasLogin); 37 Logger.info(TAG, 'isLogin hasLogin1:' + hasLogin);
54 - let lastUserToken = await AccountManagerUtils.getUserToken() 38 + let lastUserToken = await AccountManagerUtils.getUserId()
55 Logger.info(TAG, 'isLogin lastUserToken:' + lastUserToken); 39 Logger.info(TAG, 'isLogin lastUserToken:' + lastUserToken);
56 if (StringUtils.isEmpty(lastUserToken)) { 40 if (StringUtils.isEmpty(lastUserToken)) {
57 hasLogin = false; 41 hasLogin = false;
@@ -72,7 +56,7 @@ export class AccountManagerUtils { @@ -72,7 +56,7 @@ export class AccountManagerUtils {
72 */ 56 */
73 static isLoginSync() { 57 static isLoginSync() {
74 Logger.info(TAG, 'isLogin hasLogin1:' + hasLogin); 58 Logger.info(TAG, 'isLogin hasLogin1:' + hasLogin);
75 - let lastUserToken = AccountManagerUtils.getUserTokenSync() 59 + let lastUserToken = AccountManagerUtils.getUserIdSync()
76 Logger.info(TAG, 'isLogin lastUserToken:' + lastUserToken); 60 Logger.info(TAG, 'isLogin lastUserToken:' + lastUserToken);
77 if (StringUtils.isEmpty(lastUserToken)) { 61 if (StringUtils.isEmpty(lastUserToken)) {
78 hasLogin = false; 62 hasLogin = false;
@@ -70,6 +70,7 @@ export struct DynamicDetailComponent { @@ -70,6 +70,7 @@ export struct DynamicDetailComponent {
70 @State isPageEnd: boolean = false 70 @State isPageEnd: boolean = false
71 @State publishCommentModel: publishCommentModel = new publishCommentModel() 71 @State publishCommentModel: publishCommentModel = new publishCommentModel()
72 @State reachEndIncreament: number = 0 72 @State reachEndIncreament: number = 0
  73 + @State operationButtonList: string[] = []
73 74
74 async aboutToAppear() { 75 async aboutToAppear() {
75 await this.getContentDetailData() 76 await this.getContentDetailData()
@@ -532,15 +533,7 @@ export struct DynamicDetailComponent { @@ -532,15 +533,7 @@ export struct DynamicDetailComponent {
532 if (this.contentDetailData?.openComment) { 533 if (this.contentDetailData?.openComment) {
533 Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') }) 534 Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') })
534 CommentComponent({ 535 CommentComponent({
535 - publishCommentModel: {  
536 - targetId: String(this.contentDetailData?.newsId || ''),  
537 - targetRelId: this.contentDetailData?.reLInfo?.relId,  
538 - targetTitle: this.contentDetailData?.newsTitle,  
539 - targetRelType: this.contentDetailData?.reLInfo?.relType,  
540 - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),  
541 - keyArticle: String(this.contentDetailData?.keyArticle),  
542 - targetType: String(this.contentDetailData?.newsType),  
543 - } as publishCommentModel 536 + publishCommentModel: this.publishCommentModel
544 }) 537 })
545 } 538 }
546 Blank().layoutWeight(1) 539 Blank().layoutWeight(1)
@@ -557,7 +550,7 @@ export struct DynamicDetailComponent { @@ -557,7 +550,7 @@ export struct DynamicDetailComponent {
557 OperRowListView({ 550 OperRowListView({
558 contentDetailData: this.contentDetailData, 551 contentDetailData: this.contentDetailData,
559 publishCommentModel: this.publishCommentModel, 552 publishCommentModel: this.publishCommentModel,
560 - operationButtonList: ['comment', 'collect', 'share'], 553 + operationButtonList: this.operationButtonList,
561 styleType: 1, 554 styleType: 1,
562 }) 555 })
563 556
@@ -574,13 +567,6 @@ export struct DynamicDetailComponent { @@ -574,13 +567,6 @@ export struct DynamicDetailComponent {
574 * */ 567 * */
575 private async getContentDetailData() { 568 private async getContentDetailData() {
576 this.isNetConnected = NetworkUtil.isNetConnected() 569 this.isNetConnected = NetworkUtil.isNetConnected()
577 - this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')  
578 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)  
579 - this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle  
580 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
581 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
582 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
583 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
584 try { 570 try {
585 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 571 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
586 this.isPageEnd = true; 572 this.isPageEnd = true;
@@ -590,6 +576,20 @@ export struct DynamicDetailComponent { @@ -590,6 +576,20 @@ export struct DynamicDetailComponent {
590 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) 576 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
591 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) 577 this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
592 console.log('动态详情', JSON.stringify(this.contentDetailData)) 578 console.log('动态详情', JSON.stringify(this.contentDetailData))
  579 +
  580 + if (this.contentDetailData?.openComment) {
  581 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  582 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
  583 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  584 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  585 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  586 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  587 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  588 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
  589 + }
  590 +
  591 + this.operationButtonList = ['comment', 'collect', 'share']
  592 +
593 } catch (exception) { 593 } catch (exception) {
594 console.log('请求失败', JSON.stringify(exception)) 594 console.log('请求失败', JSON.stringify(exception))
595 this.isPageEnd = true; 595 this.isPageEnd = true;
@@ -234,13 +234,13 @@ export struct ImageAndTextPageComponent { @@ -234,13 +234,13 @@ export struct ImageAndTextPageComponent {
234 } 234 }
235 if (this.contentDetailData?.openComment) { 235 if (this.contentDetailData?.openComment) {
236 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 236 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
237 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 237 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
238 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 238 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
239 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
240 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
241 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
242 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
243 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) 239 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  240 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  241 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  242 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  243 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
244 } 244 }
245 if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && 245 if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
246 this.contentDetailData?.audioList[0].audioUrl) { 246 this.contentDetailData?.audioList[0].audioUrl) {
@@ -445,13 +445,13 @@ export struct MultiPictureDetailPageComponent { @@ -445,13 +445,13 @@ export struct MultiPictureDetailPageComponent {
445 // } 445 // }
446 if (this.contentDetailData?.openComment) { 446 if (this.contentDetailData?.openComment) {
447 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 447 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
448 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 448 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
449 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 449 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
450 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
451 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
452 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
453 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
454 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) 450 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  451 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  452 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  453 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  454 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
455 } 455 }
456 // this.contentDetailData.photoList = [] 456 // this.contentDetailData.photoList = []
457 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 457 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
@@ -72,13 +72,13 @@ export struct SpacialTopicPageComponent { @@ -72,13 +72,13 @@ export struct SpacialTopicPageComponent {
72 this.contentDetailData = detailBeans[0]; 72 this.contentDetailData = detailBeans[0];
73 // if (this.contentDetailData[0]?.openComment) { 73 // if (this.contentDetailData[0]?.openComment) {
74 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 74 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
75 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 75 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
76 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 76 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
77 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
78 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
79 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
80 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
81 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) 77 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  78 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  79 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  80 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  81 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
82 // } 82 // }
83 this.trySendData2H5() 83 this.trySendData2H5()
84 } 84 }
@@ -81,7 +81,7 @@ export struct Card6Component { @@ -81,7 +81,7 @@ export struct Card6Component {
81 this.contentDTO.objectType == '5' ? 30 : 0) 81 this.contentDTO.objectType == '5' ? 30 : 0)
82 }.alignContent(Alignment.TopStart) 82 }.alignContent(Alignment.TopStart)
83 83
84 - }.height("75%") 84 + }
85 .justifyContent(FlexAlign.Start) 85 .justifyContent(FlexAlign.Start)
86 86
87 87
@@ -93,6 +93,9 @@ export struct CommentComponent { @@ -93,6 +93,9 @@ export struct CommentComponent {
93 } 93 }
94 }); 94 });
95 } 95 }
  96 + if (model) {
  97 + this.isComments = true
  98 + }
96 99
97 } 100 }
98 101
@@ -164,7 +164,7 @@ class CommentViewModel { @@ -164,7 +164,7 @@ class CommentViewModel {
164 publishComment(model: publishCommentModel) { 164 publishComment(model: publishCommentModel) {
165 165
166 return new Promise<commentItemModel>((success, fail) => { 166 return new Promise<commentItemModel>((success, fail) => {
167 - const visitorMode = model.visitorComment == "1" && AccountManagerUtils.isLoginSync() == false 167 + const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false
168 let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl() 168 let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl()
169 169
170 let bean: Record<string, string> = {}; 170 let bean: Record<string, string> = {};
@@ -9,6 +9,7 @@ import { @@ -9,6 +9,7 @@ import {
9 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 9 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
10 import commentViewModel from '../../components/comment/viewmodel/CommentViewModel'; 10 import commentViewModel from '../../components/comment/viewmodel/CommentViewModel';
11 import { commentItemModel } from '../../components/comment/model/CommentModel' 11 import { commentItemModel } from '../../components/comment/model/CommentModel'
  12 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
12 13
13 /** 14 /**
14 * 精选评论卡 15 * 精选评论卡
@@ -22,9 +23,11 @@ export struct ZhSingleRow06 { @@ -22,9 +23,11 @@ export struct ZhSingleRow06 {
22 @State newsStatusOfUser: batchLikeAndCollectResult = { 23 @State newsStatusOfUser: batchLikeAndCollectResult = {
23 likeStatus: '0' 24 likeStatus: '0'
24 } as batchLikeAndCollectResult // 点赞、收藏状态 25 } as batchLikeAndCollectResult // 点赞、收藏状态
  26 + @State loadImg: boolean = false;
25 27
26 - aboutToAppear(): void { 28 + async aboutToAppear(): Promise<void> {
27 this.getInteractDataStatus() 29 this.getInteractDataStatus()
  30 + this.loadImg = await onlyWifiLoadImg();
28 } 31 }
29 32
30 /** 33 /**
@@ -160,7 +163,12 @@ export struct ZhSingleRow06 { @@ -160,7 +163,12 @@ export struct ZhSingleRow06 {
160 CompHeader(item: CompDTO) { 163 CompHeader(item: CompDTO) {
161 Row() { 164 Row() {
162 Row() { 165 Row() {
163 - Image(item.operDataList[0]?.commentInfo?.userHeaderUrl ? item.operDataList[0].commentInfo.userHeaderUrl : $r('app.media.default_head')) 166 + Image(
  167 + this.loadImg
  168 + ? item.operDataList[0]?.commentInfo?.userHeaderUrl
  169 + ? item.operDataList[0].commentInfo.userHeaderUrl
  170 + : $r('app.media.default_head')
  171 + : '')
164 .width(32) 172 .width(32)
165 .height(32) 173 .height(32)
166 .borderRadius(16) 174 .borderRadius(16)
@@ -64,13 +64,13 @@ export struct DetailPlayLiveCommon { @@ -64,13 +64,13 @@ export struct DetailPlayLiveCommon {
64 // if (this.contentDetailData.openComment === 1) { 64 // if (this.contentDetailData.openComment === 1) {
65 console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment) 65 console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment)
66 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 66 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
67 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 67 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
68 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 68 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
69 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
70 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
71 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
72 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
73 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) 69 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  70 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  71 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  72 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  73 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
74 this.publishCommentModel.commentContent = '' 74 this.publishCommentModel.commentContent = ''
75 // } 75 // }
76 } 76 }
@@ -166,12 +166,13 @@ export struct DetailPlayShortVideoPage { @@ -166,12 +166,13 @@ export struct DetailPlayShortVideoPage {
166 this.queryNewsInfoOfUser() 166 this.queryNewsInfoOfUser()
167 167
168 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 168 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
169 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 169 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
170 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 170 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
171 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
172 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
173 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
174 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) 171 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  172 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  173 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  174 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  175 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
175 this.publishCommentModel.commentContent = '' 176 this.publishCommentModel.commentContent = ''
176 177
177 } 178 }
@@ -17,13 +17,13 @@ export struct CommentComponentPage { @@ -17,13 +17,13 @@ export struct CommentComponentPage {
17 aboutToAppear(): void { 17 aboutToAppear(): void {
18 18
19 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') 19 this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
20 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) 20 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
21 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle 21 this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
22 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)  
23 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)  
24 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)  
25 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)  
26 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) 22 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  23 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  24 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  25 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  26 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
27 } 27 }
28 28
29 build() { 29 build() {