Merge remote-tracking branch 'origin/main'
# Conflicts: # sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets # sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets # sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets # sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
Showing
31 changed files
with
509 additions
and
246 deletions
| @@ -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; |
| @@ -17,7 +17,6 @@ import { Card19Component } from './cardview/Card19Component'; | @@ -17,7 +17,6 @@ import { Card19Component } from './cardview/Card19Component'; | ||
| 17 | import { Card20Component } from './cardview/Card20Component'; | 17 | import { Card20Component } from './cardview/Card20Component'; |
| 18 | import { Card21Component } from './cardview/Card21Component'; | 18 | import { Card21Component } from './cardview/Card21Component'; |
| 19 | import { SearchContentComponent } from './cardview/SearchContentComponent'; | 19 | import { SearchContentComponent } from './cardview/SearchContentComponent'; |
| 20 | -import { Logger } from 'wdKit/Index'; | ||
| 21 | 20 | ||
| 22 | /** | 21 | /** |
| 23 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle | 22 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle |
| @@ -28,10 +27,6 @@ export struct CardParser { | @@ -28,10 +27,6 @@ export struct CardParser { | ||
| 28 | @State contentDTO: ContentDTO = new ContentDTO(); | 27 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 29 | @ObjectLink compDTO: CompDTO | 28 | @ObjectLink compDTO: CompDTO |
| 30 | 29 | ||
| 31 | - aboutToAppear(): void { | ||
| 32 | - Logger.info('contentDTO.contentText', JSON.stringify(this.contentDTO)) | ||
| 33 | - } | ||
| 34 | - | ||
| 35 | build() { | 30 | build() { |
| 36 | this.contentBuilder(this.contentDTO); | 31 | this.contentBuilder(this.contentDTO); |
| 37 | } | 32 | } |
| @@ -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 | } |
| 1 | -import { CompDTO, ContentDTO, slideShows, VideoInfoDTO } from 'wdBean'; | 1 | +import { ContentDTO, slideShows, VideoInfoDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| @@ -17,16 +17,39 @@ export struct Card10Component { | @@ -17,16 +17,39 @@ export struct Card10Component { | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 17 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 18 | @State loadImg: boolean = false; |
| 19 | @ObjectLink compDTO: CompDTO | 19 | @ObjectLink compDTO: CompDTO |
| 20 | + @State titleMarked: boolean = false; | ||
| 21 | + @State str01: string = ''; | ||
| 22 | + @State str02: string = ''; | ||
| 23 | + @State str03: string = ''; | ||
| 20 | 24 | ||
| 21 | async aboutToAppear(): Promise<void> { | 25 | async aboutToAppear(): Promise<void> { |
| 26 | + this.titleInit(); | ||
| 22 | this.loadImg = await onlyWifiLoadImg(); | 27 | this.loadImg = await onlyWifiLoadImg(); |
| 23 | } | 28 | } |
| 24 | 29 | ||
| 30 | + titleInit() { | ||
| 31 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 32 | + this.titleMarked = true; | ||
| 33 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 34 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 35 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + | ||
| 25 | build() { | 39 | build() { |
| 26 | Column() { | 40 | Column() { |
| 27 | // 顶部标题,最多两行 | 41 | // 顶部标题,最多两行 |
| 28 | if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { | 42 | if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { |
| 29 | - Text(this.contentDTO.newsTitle) | 43 | + Text() { |
| 44 | + if (this.titleMarked) { | ||
| 45 | + Span(this.str01) | ||
| 46 | + Span(this.str02) | ||
| 47 | + .fontColor(0xED2800) | ||
| 48 | + Span(this.str03) | ||
| 49 | + } else { | ||
| 50 | + Span(this.contentDTO.newsTitle) | ||
| 51 | + } | ||
| 52 | + } | ||
| 30 | .width(CommonConstants.FULL_WIDTH) | 53 | .width(CommonConstants.FULL_WIDTH) |
| 31 | .fontSize($r('app.float.font_size_17')) | 54 | .fontSize($r('app.float.font_size_17')) |
| 32 | .fontWeight(600) | 55 | .fontWeight(600) |
| @@ -16,20 +16,50 @@ export struct Card11Component { | @@ -16,20 +16,50 @@ export struct Card11Component { | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | @ObjectLink compDTO: CompDTO | 18 | @ObjectLink compDTO: CompDTO |
| 19 | + @State titleMarked: boolean = false; | ||
| 20 | + @State str01: string = ''; | ||
| 21 | + @State str02: string = ''; | ||
| 22 | + @State str03: string = ''; | ||
| 23 | + | ||
| 24 | + async aboutToAppear(): Promise<void> { | ||
| 25 | + this.titleInit(); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + titleInit() { | ||
| 29 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 30 | + this.titleMarked = true; | ||
| 31 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 32 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 33 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 34 | + } | ||
| 35 | + } | ||
| 19 | 36 | ||
| 20 | build() { | 37 | build() { |
| 21 | Column() { | 38 | Column() { |
| 22 | Stack() { | 39 | Stack() { |
| 23 | - if (this.contentDTO.objectType == '5') { | 40 | + if (this.contentDTO.newTags) { |
| 41 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 42 | + } else if (this.contentDTO.objectType == '5') { | ||
| 24 | Notes({ objectType: this.contentDTO.objectType }) | 43 | Notes({ objectType: this.contentDTO.objectType }) |
| 25 | } | 44 | } |
| 26 | - Text(this.contentDTO.newsTitle) | ||
| 27 | - .fontSize($r("app.float.font_size_16")) | ||
| 28 | - .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 29 | - .maxLines(3) | ||
| 30 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 31 | - .width(CommonConstants.FULL_WIDTH) | ||
| 32 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 45 | + Text() { |
| 46 | + if (this.titleMarked) { | ||
| 47 | + Span(this.str01) | ||
| 48 | + Span(this.str02) | ||
| 49 | + .fontColor(0xED2800) | ||
| 50 | + Span(this.str03) | ||
| 51 | + } else { | ||
| 52 | + Span(this.contentDTO.newsTitle) | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + .fontSize($r("app.float.font_size_16")) | ||
| 56 | + .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 57 | + .maxLines(3) | ||
| 58 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 59 | + .width(CommonConstants.FULL_WIDTH) | ||
| 60 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 61 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 62 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 33 | 63 | ||
| 34 | }.alignContent(Alignment.TopStart) | 64 | }.alignContent(Alignment.TopStart) |
| 35 | 65 |
| @@ -14,8 +14,22 @@ const TAG = 'Card12Component'; | @@ -14,8 +14,22 @@ const TAG = 'Card12Component'; | ||
| 14 | export struct Card12Component { | 14 | export struct Card12Component { |
| 15 | @State contentDTO: ContentDTO = new ContentDTO(); | 15 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 16 | @State clicked: boolean = false; | 16 | @State clicked: boolean = false; |
| 17 | + @State titleMarked: boolean = false; | ||
| 18 | + @State str01: string = ''; | ||
| 19 | + @State str02: string = ''; | ||
| 20 | + @State str03: string = ''; | ||
| 17 | 21 | ||
| 18 | aboutToAppear(): void { | 22 | aboutToAppear(): void { |
| 23 | + this.titleInit(); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + titleInit() { | ||
| 27 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 28 | + this.titleMarked = true; | ||
| 29 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 30 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 31 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 32 | + } | ||
| 19 | } | 33 | } |
| 20 | 34 | ||
| 21 | build() { | 35 | build() { |
| @@ -26,7 +40,16 @@ export struct Card12Component { | @@ -26,7 +40,16 @@ export struct Card12Component { | ||
| 26 | } | 40 | } |
| 27 | // 标题 | 41 | // 标题 |
| 28 | if (this.contentDTO.newsTitle) { | 42 | if (this.contentDTO.newsTitle) { |
| 29 | - Text(this.contentDTO.newsTitle) | 43 | + Text() { |
| 44 | + if (this.titleMarked) { | ||
| 45 | + Span(this.str01) | ||
| 46 | + Span(this.str02) | ||
| 47 | + .fontColor(0xED2800) | ||
| 48 | + Span(this.str03) | ||
| 49 | + } else { | ||
| 50 | + Span(this.contentDTO.newsTitle) | ||
| 51 | + } | ||
| 52 | + } | ||
| 30 | .fontSize($r('app.float.font_size_17')) | 53 | .fontSize($r('app.float.font_size_17')) |
| 31 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 32 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| @@ -37,7 +60,6 @@ export struct Card12Component { | @@ -37,7 +60,6 @@ export struct Card12Component { | ||
| 37 | .fontFamily('PingFang SC-Regular') | 60 | .fontFamily('PingFang SC-Regular') |
| 38 | } | 61 | } |
| 39 | CarderInteraction({contentDTO: this.contentDTO}) | 62 | CarderInteraction({contentDTO: this.contentDTO}) |
| 40 | - //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | ||
| 41 | } | 63 | } |
| 42 | .padding({ | 64 | .padding({ |
| 43 | left: $r('app.float.card_comp_pagePadding_lf'), | 65 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -16,11 +16,25 @@ export struct Card14Component { | @@ -16,11 +16,25 @@ export struct Card14Component { | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | + @State titleMarked: boolean = false; | ||
| 20 | + @State str01: string = ''; | ||
| 21 | + @State str02: string = ''; | ||
| 22 | + @State str03: string = ''; | ||
| 19 | 23 | ||
| 20 | async aboutToAppear(): Promise<void> { | 24 | async aboutToAppear(): Promise<void> { |
| 25 | + this.titleInit(); | ||
| 21 | this.loadImg = await onlyWifiLoadImg(); | 26 | this.loadImg = await onlyWifiLoadImg(); |
| 22 | } | 27 | } |
| 23 | 28 | ||
| 29 | + titleInit() { | ||
| 30 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 31 | + this.titleMarked = true; | ||
| 32 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 33 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 34 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + | ||
| 24 | build() { | 38 | build() { |
| 25 | Column() { | 39 | Column() { |
| 26 | // rmh信息 | 40 | // rmh信息 |
| @@ -30,7 +44,16 @@ export struct Card14Component { | @@ -30,7 +44,16 @@ export struct Card14Component { | ||
| 30 | // 左标题,右图 | 44 | // 左标题,右图 |
| 31 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { | 45 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { |
| 32 | 46 | ||
| 33 | - Text(this.contentDTO.newsTitle) | 47 | + Text() { |
| 48 | + if (this.titleMarked) { | ||
| 49 | + Span(this.str01) | ||
| 50 | + Span(this.str02) | ||
| 51 | + .fontColor(0xED2800) | ||
| 52 | + Span(this.str03) | ||
| 53 | + } else { | ||
| 54 | + Span(this.contentDTO.newsTitle) | ||
| 55 | + } | ||
| 56 | + } | ||
| 34 | .fontSize($r('app.float.font_size_17')) | 57 | .fontSize($r('app.float.font_size_17')) |
| 35 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 58 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 36 | .textOverflowStyle(3) | 59 | .textOverflowStyle(3) |
| @@ -20,11 +20,24 @@ export struct Card15Component { | @@ -20,11 +20,24 @@ export struct Card15Component { | ||
| 20 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 21 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| 22 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| 23 | + @State titleMarked: boolean = false; | ||
| 24 | + @State str01: string = ''; | ||
| 25 | + @State str02: string = ''; | ||
| 26 | + @State str03: string = ''; | ||
| 23 | 27 | ||
| 24 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 29 | + this.titleInit(); | ||
| 25 | this.loadImg = await onlyWifiLoadImg(); | 30 | this.loadImg = await onlyWifiLoadImg(); |
| 26 | } | 31 | } |
| 27 | 32 | ||
| 33 | + titleInit() { | ||
| 34 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 35 | + this.titleMarked = true; | ||
| 36 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 37 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 38 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 39 | + } | ||
| 40 | + } | ||
| 28 | 41 | ||
| 29 | build() { | 42 | build() { |
| 30 | Column() { | 43 | Column() { |
| @@ -32,7 +45,16 @@ export struct Card15Component { | @@ -32,7 +45,16 @@ export struct Card15Component { | ||
| 32 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 45 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) |
| 33 | //新闻标题 | 46 | //新闻标题 |
| 34 | if (this.contentDTO.newsTitle) { | 47 | if (this.contentDTO.newsTitle) { |
| 35 | - Text(this.contentDTO.newsTitle) | 48 | + Text() { |
| 49 | + if (this.titleMarked) { | ||
| 50 | + Span(this.str01) | ||
| 51 | + Span(this.str02) | ||
| 52 | + .fontColor(0xED2800) | ||
| 53 | + Span(this.str03) | ||
| 54 | + } else { | ||
| 55 | + Span(this.contentDTO.newsTitle) | ||
| 56 | + } | ||
| 57 | + } | ||
| 36 | .fontSize($r('app.float.font_size_17')) | 58 | .fontSize($r('app.float.font_size_17')) |
| 37 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 59 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 38 | .width(CommonConstants.FULL_WIDTH) | 60 | .width(CommonConstants.FULL_WIDTH) |
| @@ -21,11 +21,25 @@ export struct Card16Component { | @@ -21,11 +21,25 @@ export struct Card16Component { | ||
| 21 | @State contentDTO: ContentDTO = new ContentDTO(); | 21 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 22 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 23 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| 24 | + @State titleMarked: boolean = false; | ||
| 25 | + @State str01: string = ''; | ||
| 26 | + @State str02: string = ''; | ||
| 27 | + @State str03: string = ''; | ||
| 24 | 28 | ||
| 25 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 30 | + this.titleInit(); | ||
| 26 | this.loadImg = await onlyWifiLoadImg(); | 31 | this.loadImg = await onlyWifiLoadImg(); |
| 27 | } | 32 | } |
| 28 | 33 | ||
| 34 | + titleInit() { | ||
| 35 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 36 | + this.titleMarked = true; | ||
| 37 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 38 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 39 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + | ||
| 29 | build() { | 43 | build() { |
| 30 | Column() { | 44 | Column() { |
| 31 | // rmh信息 | 45 | // rmh信息 |
| @@ -34,7 +48,16 @@ export struct Card16Component { | @@ -34,7 +48,16 @@ export struct Card16Component { | ||
| 34 | } | 48 | } |
| 35 | // 标题 | 49 | // 标题 |
| 36 | if (this.contentDTO.newsTitle) { | 50 | if (this.contentDTO.newsTitle) { |
| 37 | - Text(this.contentDTO.newsTitle) | 51 | + Text() { |
| 52 | + if (this.titleMarked) { | ||
| 53 | + Span(this.str01) | ||
| 54 | + Span(this.str02) | ||
| 55 | + .fontColor(0xED2800) | ||
| 56 | + Span(this.str03) | ||
| 57 | + } else { | ||
| 58 | + Span(this.contentDTO.newsTitle) | ||
| 59 | + } | ||
| 60 | + } | ||
| 38 | .fontSize($r('app.float.font_size_17')) | 61 | .fontSize($r('app.float.font_size_17')) |
| 39 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 62 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 40 | .width(CommonConstants.FULL_WIDTH) | 63 | .width(CommonConstants.FULL_WIDTH) |
| @@ -17,13 +17,37 @@ export struct Card17Component { | @@ -17,13 +17,37 @@ export struct Card17Component { | ||
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | @ObjectLink compDTO: CompDTO | 19 | @ObjectLink compDTO: CompDTO |
| 20 | + @State titleMarked: boolean = false; | ||
| 21 | + @State str01: string = ''; | ||
| 22 | + @State str02: string = ''; | ||
| 23 | + @State str03: string = ''; | ||
| 24 | + | ||
| 20 | async aboutToAppear(): Promise<void> { | 25 | async aboutToAppear(): Promise<void> { |
| 26 | + this.titleInit(); | ||
| 21 | this.loadImg = await onlyWifiLoadImg(); | 27 | this.loadImg = await onlyWifiLoadImg(); |
| 22 | } | 28 | } |
| 23 | 29 | ||
| 30 | + titleInit() { | ||
| 31 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 32 | + this.titleMarked = true; | ||
| 33 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 34 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 35 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + | ||
| 24 | build() { | 39 | build() { |
| 25 | Column({ space: 8 }) { | 40 | Column({ space: 8 }) { |
| 26 | - Text(this.contentDTO.newsTitle) | 41 | + Text() { |
| 42 | + if (this.titleMarked) { | ||
| 43 | + Span(this.str01) | ||
| 44 | + Span(this.str02) | ||
| 45 | + .fontColor(0xED2800) | ||
| 46 | + Span(this.str03) | ||
| 47 | + } else { | ||
| 48 | + Span(this.contentDTO.newsTitle) | ||
| 49 | + } | ||
| 50 | + } | ||
| 27 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 51 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 28 | .fontSize($r('app.float.font_size_17')) | 52 | .fontSize($r('app.float.font_size_17')) |
| 29 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 53 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| @@ -14,6 +14,23 @@ const TAG = 'Card19Component'; | @@ -14,6 +14,23 @@ const TAG = 'Card19Component'; | ||
| 14 | export struct Card19Component { | 14 | export struct Card19Component { |
| 15 | @State contentDTO: ContentDTO = new ContentDTO() | 15 | @State contentDTO: ContentDTO = new ContentDTO() |
| 16 | @State clicked: boolean = false; | 16 | @State clicked: boolean = false; |
| 17 | + @State titleMarked: boolean = false; | ||
| 18 | + @State str01: string = ''; | ||
| 19 | + @State str02: string = ''; | ||
| 20 | + @State str03: string = ''; | ||
| 21 | + | ||
| 22 | + async aboutToAppear(): Promise<void> { | ||
| 23 | + this.titleInit(); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + titleInit() { | ||
| 27 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 28 | + this.titleMarked = true; | ||
| 29 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 30 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 31 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 32 | + } | ||
| 33 | + } | ||
| 17 | 34 | ||
| 18 | build() { | 35 | build() { |
| 19 | Column() { | 36 | Column() { |
| @@ -21,7 +38,16 @@ export struct Card19Component { | @@ -21,7 +38,16 @@ export struct Card19Component { | ||
| 21 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 38 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) |
| 22 | // 标题 | 39 | // 标题 |
| 23 | if (this.contentDTO.newsTitle) { | 40 | if (this.contentDTO.newsTitle) { |
| 24 | - Text(this.contentDTO.newsTitle) | 41 | + Text() { |
| 42 | + if (this.titleMarked) { | ||
| 43 | + Span(this.str01) | ||
| 44 | + Span(this.str02) | ||
| 45 | + .fontColor(0xED2800) | ||
| 46 | + Span(this.str03) | ||
| 47 | + } else { | ||
| 48 | + Span(this.contentDTO.newsTitle) | ||
| 49 | + } | ||
| 50 | + } | ||
| 25 | .fontSize($r('app.float.font_size_17')) | 51 | .fontSize($r('app.float.font_size_17')) |
| 26 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 52 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 27 | .textOverflowStyle(3) | 53 | .textOverflowStyle(3) |
| @@ -15,8 +15,22 @@ const TAG = 'Card20Component'; | @@ -15,8 +15,22 @@ const TAG = 'Card20Component'; | ||
| 15 | export struct Card20Component { | 15 | export struct Card20Component { |
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | + @State titleMarked: boolean = false; | ||
| 19 | + @State str01: string = ''; | ||
| 20 | + @State str02: string = ''; | ||
| 21 | + @State str03: string = ''; | ||
| 18 | 22 | ||
| 19 | aboutToAppear(): void { | 23 | aboutToAppear(): void { |
| 24 | + this.titleInit(); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + titleInit() { | ||
| 28 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 29 | + this.titleMarked = true; | ||
| 30 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 31 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 32 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 33 | + } | ||
| 20 | } | 34 | } |
| 21 | 35 | ||
| 22 | build() { | 36 | build() { |
| @@ -25,7 +39,17 @@ export struct Card20Component { | @@ -25,7 +39,17 @@ export struct Card20Component { | ||
| 25 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 39 | RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) |
| 26 | // 标题 | 40 | // 标题 |
| 27 | if (this.contentDTO.newsTitle) { | 41 | if (this.contentDTO.newsTitle) { |
| 28 | - Text(this.contentDTO.newsTitle) | 42 | + Text() { |
| 43 | + | ||
| 44 | + if (this.titleMarked) { | ||
| 45 | + Span(this.str01) | ||
| 46 | + Span(this.str02) | ||
| 47 | + .fontColor(0xED2800) | ||
| 48 | + Span(this.str03) | ||
| 49 | + } else { | ||
| 50 | + Span(this.contentDTO.newsTitle) | ||
| 51 | + } | ||
| 52 | + } | ||
| 29 | .fontSize($r('app.float.font_size_17')) | 53 | .fontSize($r('app.float.font_size_17')) |
| 30 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 31 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| @@ -16,11 +16,25 @@ export struct Card21Component { | @@ -16,11 +16,25 @@ export struct Card21Component { | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | + @State titleMarked: boolean = false; | ||
| 20 | + @State str01: string = ''; | ||
| 21 | + @State str02: string = ''; | ||
| 22 | + @State str03: string = ''; | ||
| 19 | 23 | ||
| 20 | async aboutToAppear(): Promise<void> { | 24 | async aboutToAppear(): Promise<void> { |
| 25 | + this.titleInit(); | ||
| 21 | this.loadImg = await onlyWifiLoadImg(); | 26 | this.loadImg = await onlyWifiLoadImg(); |
| 22 | } | 27 | } |
| 23 | 28 | ||
| 29 | + titleInit() { | ||
| 30 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 31 | + this.titleMarked = true; | ||
| 32 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 33 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 34 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + | ||
| 24 | build() { | 38 | build() { |
| 25 | Column() { | 39 | Column() { |
| 26 | // 顶部 rmh信息 | 40 | // 顶部 rmh信息 |
| @@ -28,7 +42,16 @@ export struct Card21Component { | @@ -28,7 +42,16 @@ export struct Card21Component { | ||
| 28 | // 中间内容 | 42 | // 中间内容 |
| 29 | Grid() { | 43 | Grid() { |
| 30 | GridItem() { | 44 | GridItem() { |
| 31 | - Text(`${this.contentDTO.newsTitle}`) | 45 | + Text() { |
| 46 | + if (this.titleMarked) { | ||
| 47 | + Span(this.str01) | ||
| 48 | + Span(this.str02) | ||
| 49 | + .fontColor(0xED2800) | ||
| 50 | + Span(this.str03) | ||
| 51 | + } else { | ||
| 52 | + Span(this.contentDTO.newsTitle) | ||
| 53 | + } | ||
| 54 | + } | ||
| 32 | .fontSize($r('app.float.selected_text_size')) | 55 | .fontSize($r('app.float.selected_text_size')) |
| 33 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 56 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 34 | .width(CommonConstants.FULL_WIDTH) | 57 | .width(CommonConstants.FULL_WIDTH) |
| @@ -35,11 +35,11 @@ export struct Card2Component { | @@ -35,11 +35,11 @@ export struct Card2Component { | ||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | titleInit() { | 37 | titleInit() { |
| 38 | - if (this.contentDTO.title.includes('<em>') && this.contentDTO.title.includes('</em>')) { | 38 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { |
| 39 | this.titleMarked = true; | 39 | this.titleMarked = true; |
| 40 | - this.str01 = this.contentDTO.newsTitle?.split('<em>')[0] || ''; | ||
| 41 | - this.str02 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 42 | - this.str03 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[1] || ''; | 40 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; |
| 41 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 42 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | 45 |
| @@ -13,17 +13,49 @@ export struct Card3Component { | @@ -13,17 +13,49 @@ export struct Card3Component { | ||
| 13 | @State contentDTO: ContentDTO = new ContentDTO(); | 13 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 14 | @State clicked: boolean = false; | 14 | @State clicked: boolean = false; |
| 15 | @ObjectLink compDTO: CompDTO | 15 | @ObjectLink compDTO: CompDTO |
| 16 | + @State titleMarked: boolean = false; | ||
| 17 | + @State str01: string = ''; | ||
| 18 | + @State str02: string = ''; | ||
| 19 | + @State str03: string = ''; | ||
| 20 | + | ||
| 21 | + async aboutToAppear(): Promise<void> { | ||
| 22 | + this.titleInit(); | ||
| 23 | + // this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + titleInit() { | ||
| 27 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 28 | + this.titleMarked = true; | ||
| 29 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 30 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 31 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 16 | build() { | 35 | build() { |
| 17 | Column() { | 36 | Column() { |
| 18 | Stack() { | 37 | Stack() { |
| 19 | - if (this.contentDTO.objectType == '5') { | 38 | + if (this.contentDTO.newTags) { |
| 39 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 40 | + } else if (this.contentDTO.objectType == '5') { | ||
| 20 | Notes({ objectType: this.contentDTO.objectType }) | 41 | Notes({ objectType: this.contentDTO.objectType }) |
| 21 | } | 42 | } |
| 22 | - Text(this.contentDTO.newsTitle) | ||
| 23 | - .fontSize($r("app.float.font_size_16")) | ||
| 24 | - .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 25 | - .width(CommonConstants.FULL_WIDTH) | ||
| 26 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 43 | + Text() { |
| 44 | + if (this.titleMarked) { | ||
| 45 | + Span(this.str01) | ||
| 46 | + Span(this.str02) | ||
| 47 | + .fontColor(0xED2800) | ||
| 48 | + Span(this.str03) | ||
| 49 | + } else { | ||
| 50 | + Span(this.contentDTO.newsTitle) | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + .fontSize($r("app.float.font_size_16")) | ||
| 54 | + .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 55 | + .width(CommonConstants.FULL_WIDTH) | ||
| 56 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 57 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 58 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 27 | }.alignContent(Alignment.TopStart) | 59 | }.alignContent(Alignment.TopStart) |
| 28 | 60 | ||
| 29 | // 评论等信息 | 61 | // 评论等信息 |
| @@ -31,11 +31,11 @@ export struct Card4Component { | @@ -31,11 +31,11 @@ export struct Card4Component { | ||
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | titleInit() { | 33 | titleInit() { |
| 34 | - if (this.contentDTO.title.includes('<em>') && this.contentDTO.title.includes('</em>')) { | 34 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { |
| 35 | this.titleMarked = true; | 35 | this.titleMarked = true; |
| 36 | - this.str01 = this.contentDTO.newsTitle?.split('<em>')[0] || ''; | ||
| 37 | - this.str02 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 38 | - this.str03 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[1] || ''; | 36 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; |
| 37 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 38 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | 41 |
| @@ -15,9 +15,24 @@ export struct Card5Component { | @@ -15,9 +15,24 @@ export struct Card5Component { | ||
| 15 | @Prop titleShowPolicy: number | string | 15 | @Prop titleShowPolicy: number | string |
| 16 | @State loadImg: boolean = false; | 16 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | + @State titleMarked: boolean = false; | ||
| 19 | + @State str01: string = ''; | ||
| 20 | + @State str02: string = ''; | ||
| 21 | + @State str03: string = ''; | ||
| 18 | 22 | ||
| 19 | async aboutToAppear(): Promise<void> { | 23 | async aboutToAppear(): Promise<void> { |
| 20 | this.loadImg = await onlyWifiLoadImg(); | 24 | this.loadImg = await onlyWifiLoadImg(); |
| 25 | + | ||
| 26 | + this.titleInit(); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + titleInit() { | ||
| 30 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 31 | + this.titleMarked = true; | ||
| 32 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 33 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 34 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 35 | + } | ||
| 21 | } | 36 | } |
| 22 | 37 | ||
| 23 | build() { | 38 | build() { |
| @@ -38,18 +53,31 @@ export struct Card5Component { | @@ -38,18 +53,31 @@ export struct Card5Component { | ||
| 38 | }) | 53 | }) |
| 39 | Row() { | 54 | Row() { |
| 40 | Stack() { | 55 | Stack() { |
| 41 | - if (this.contentDTO.objectType == '5') { | 56 | + if (this.contentDTO.newTags) { |
| 57 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 58 | + } else if (this.contentDTO.objectType == '5') { | ||
| 42 | Notes({ objectType: this.contentDTO.objectType }) | 59 | Notes({ objectType: this.contentDTO.objectType }) |
| 43 | } | 60 | } |
| 44 | 61 | ||
| 45 | - Text(this.contentDTO.newsTitle) | ||
| 46 | - .width(CommonConstants.FULL_WIDTH) | ||
| 47 | - .fontColor(Color.White) | ||
| 48 | - .fontSize($r('app.float.normal_text_size')) | ||
| 49 | - .fontWeight(FontWeight.Bold) | ||
| 50 | - .maxLines(2) | ||
| 51 | - .align(Alignment.TopStart) | ||
| 52 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 62 | + Text() { |
| 63 | + if (this.titleMarked) { | ||
| 64 | + Span(this.str01) | ||
| 65 | + Span(this.str02) | ||
| 66 | + .fontColor(0xED2800) | ||
| 67 | + Span(this.str03) | ||
| 68 | + } else { | ||
| 69 | + Span(this.contentDTO.newsTitle) | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + .width(CommonConstants.FULL_WIDTH) | ||
| 73 | + .fontColor(Color.White) | ||
| 74 | + .fontSize($r('app.float.normal_text_size')) | ||
| 75 | + .fontWeight(FontWeight.Bold) | ||
| 76 | + .maxLines(2) | ||
| 77 | + .align(Alignment.TopStart) | ||
| 78 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 79 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 80 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 53 | }.alignContent(Alignment.TopStart) | 81 | }.alignContent(Alignment.TopStart) |
| 54 | } | 82 | } |
| 55 | .justifyContent(FlexAlign.Start) | 83 | .justifyContent(FlexAlign.Start) |
| @@ -24,7 +24,6 @@ export struct Card6Component { | @@ -24,7 +24,6 @@ export struct Card6Component { | ||
| 24 | @State contentDTO: ContentDTO = new ContentDTO(); | 24 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 25 | 25 | ||
| 26 | async aboutToAppear(): Promise<void> { | 26 | async aboutToAppear(): Promise<void> { |
| 27 | - Logger.info('titleInit', JSON.stringify(this.contentDTO)) | ||
| 28 | this.titleInit(); | 27 | this.titleInit(); |
| 29 | this.loadImg = await onlyWifiLoadImg(); | 28 | this.loadImg = await onlyWifiLoadImg(); |
| 30 | // this.clicked = hasClicked(this.contentDTO.objectId) | 29 | // this.clicked = hasClicked(this.contentDTO.objectId) |
| @@ -82,7 +81,7 @@ export struct Card6Component { | @@ -82,7 +81,7 @@ export struct Card6Component { | ||
| 82 | this.contentDTO.objectType == '5' ? 30 : 0) | 81 | this.contentDTO.objectType == '5' ? 30 : 0) |
| 83 | }.alignContent(Alignment.TopStart) | 82 | }.alignContent(Alignment.TopStart) |
| 84 | 83 | ||
| 85 | - }.height("75%") | 84 | + } |
| 86 | .justifyContent(FlexAlign.Start) | 85 | .justifyContent(FlexAlign.Start) |
| 87 | 86 | ||
| 88 | 87 |
| @@ -15,16 +15,39 @@ export struct Card9Component { | @@ -15,16 +15,39 @@ export struct Card9Component { | ||
| 15 | @State contentDTO: ContentDTO = new ContentDTO(); | 15 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 16 | @State loadImg: boolean = false; | 16 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | + @State titleMarked: boolean = false; | ||
| 19 | + @State str01: string = ''; | ||
| 20 | + @State str02: string = ''; | ||
| 21 | + @State str03: string = ''; | ||
| 18 | 22 | ||
| 19 | async aboutToAppear(): Promise<void> { | 23 | async aboutToAppear(): Promise<void> { |
| 24 | + this.titleInit(); | ||
| 20 | this.loadImg = await onlyWifiLoadImg(); | 25 | this.loadImg = await onlyWifiLoadImg(); |
| 21 | } | 26 | } |
| 22 | 27 | ||
| 28 | + titleInit() { | ||
| 29 | + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | ||
| 30 | + this.titleMarked = true; | ||
| 31 | + this.str01 = this.contentDTO.title?.split('<em>')[0] || ''; | ||
| 32 | + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || ''; | ||
| 33 | + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || ''; | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 23 | build() { | 37 | build() { |
| 24 | Column() { | 38 | Column() { |
| 25 | // 顶部标题,最多两行 | 39 | // 顶部标题,最多两行 |
| 26 | if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { | 40 | if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { |
| 27 | - Text(this.contentDTO.newsTitle) | 41 | + Text() { |
| 42 | + if (this.titleMarked) { | ||
| 43 | + Span(this.str01) | ||
| 44 | + Span(this.str02) | ||
| 45 | + .fontColor(0xED2800) | ||
| 46 | + Span(this.str03) | ||
| 47 | + } else { | ||
| 48 | + Span(this.contentDTO.newsTitle) | ||
| 49 | + } | ||
| 50 | + } | ||
| 28 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 51 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 29 | .width(CommonConstants.FULL_WIDTH) | 52 | .width(CommonConstants.FULL_WIDTH) |
| 30 | .fontSize($r('app.float.font_size_17')) | 53 | .fontSize($r('app.float.font_size_17')) |
| @@ -38,6 +61,7 @@ export struct Card9Component { | @@ -38,6 +61,7 @@ export struct Card9Component { | ||
| 38 | Image(this.loadImg ? this.contentDTO.coverUrl : '') | 61 | Image(this.loadImg ? this.contentDTO.coverUrl : '') |
| 39 | .backgroundColor(0xf5f5f5) | 62 | .backgroundColor(0xf5f5f5) |
| 40 | .width('100%') | 63 | .width('100%') |
| 64 | + .height(133) | ||
| 41 | .borderRadius({ | 65 | .borderRadius({ |
| 42 | topLeft: $r('app.float.image_border_radius'), | 66 | topLeft: $r('app.float.image_border_radius'), |
| 43 | topRight: $r('app.float.image_border_radius') | 67 | topRight: $r('app.float.image_border_radius') |
| @@ -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) |
| @@ -106,7 +106,9 @@ export struct SearchResultContentComponent { | @@ -106,7 +106,9 @@ export struct SearchResultContentComponent { | ||
| 106 | } else { | 106 | } else { |
| 107 | this.bean.cnFansNum = item.fansNum + "" | 107 | this.bean.cnFansNum = item.fansNum + "" |
| 108 | } | 108 | } |
| 109 | - this.bean.introduction = item.introduction | 109 | + let regex:RegExp = new RegExp('\n','g') |
| 110 | + this.bean.introduction = item.introduction.replace(regex,'') | ||
| 111 | + | ||
| 110 | this.bean.mainControl = item.mainControl | 112 | this.bean.mainControl = item.mainControl |
| 111 | this.bean.banControl = item.banControl | 113 | this.bean.banControl = item.banControl |
| 112 | this.bean.cnUserType = item.userType | 114 | this.bean.cnUserType = item.userType |
| @@ -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() { |
| 1 | -import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage' | ||
| 2 | -import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule' | ||
| 3 | -import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index' | ||
| 4 | - | ||
| 5 | -@CustomDialog | ||
| 6 | -export struct CustomProtocolDialog { | ||
| 7 | - controller: CustomDialogController | ||
| 8 | - | ||
| 9 | - cancel: () => void = () => { | ||
| 10 | - } | ||
| 11 | - | ||
| 12 | - confirm: () => void = () => { | ||
| 13 | - } | ||
| 14 | - | ||
| 15 | - build() { | ||
| 16 | - Column() { | ||
| 17 | - Text("温馨提示") | ||
| 18 | - .fontColor("#222222") | ||
| 19 | - .fontSize(18) | ||
| 20 | - .width("100%") | ||
| 21 | - .fontWeight(FontWeight.Bold) | ||
| 22 | - .textAlign(TextAlign.Center) | ||
| 23 | - .margin({ top: 20 }) | ||
| 24 | - Text() { | ||
| 25 | - Span("为保障您的合法权益,请阅读并同意").fontSize(14).fontColor("#666666") | ||
| 26 | - Span("《用户协议》").fontSize(14).fontColor("#ED2800").onClick(()=>{ | ||
| 27 | - let bean={contentID:"1",pageID:""} as Params | ||
| 28 | - WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | ||
| 29 | - this.controller.close() | ||
| 30 | - }) | ||
| 31 | - Span("及").fontSize(14).fontColor("#666666") | ||
| 32 | - Span("《隐私政策》").fontSize(14).fontColor("#ED2800").onClick(()=>{ | ||
| 33 | - let bean={contentID:"2",pageID:""} as Params | ||
| 34 | - WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | ||
| 35 | - this.controller.close() | ||
| 36 | - }) | ||
| 37 | - Span("后进行登录").fontSize(14).fontColor("#666666") | ||
| 38 | - }.margin({ top: 12, left: 16, right: 16 }) | ||
| 39 | - | ||
| 40 | - Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp') | ||
| 41 | - Row() { | ||
| 42 | - Text('放弃登录') | ||
| 43 | - .fontSize(16) | ||
| 44 | - .fontColor("#999999") | ||
| 45 | - .layoutWeight(1) | ||
| 46 | - .fontWeight(FontWeight.Medium) | ||
| 47 | - .textAlign(TextAlign.Center) | ||
| 48 | - .onClick(() => { | ||
| 49 | - this.controller.close() | ||
| 50 | - if (this.cancel) { | ||
| 51 | - this.cancel() | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - }) | ||
| 55 | - .height('100%') | ||
| 56 | - // Divider().color("#999999").height('100%').width('0.5vp') | ||
| 57 | - Text('同意并登录') | ||
| 58 | - .fontSize(16) | ||
| 59 | - .fontColor("#ED2800") | ||
| 60 | - .layoutWeight(1) | ||
| 61 | - .fontWeight(FontWeight.Medium) | ||
| 62 | - .textAlign(TextAlign.Center) | ||
| 63 | - .border({ | ||
| 64 | - width: { left: 1 }, | ||
| 65 | - color: "#999999", | ||
| 66 | - style: { left: BorderStyle.Solid } | ||
| 67 | - | ||
| 68 | - }) | ||
| 69 | - .onClick(() => { | ||
| 70 | - this.controller.close() | ||
| 71 | - if (this.confirm) { | ||
| 72 | - this.confirm() | ||
| 73 | - } | ||
| 74 | - }) | ||
| 75 | - .height('100%') | ||
| 76 | - }.layoutWeight(1).justifyContent(FlexAlign.Center) | ||
| 77 | - }.height(161).backgroundColor(Color.White).borderRadius(6).width('74%') | ||
| 78 | - } | ||
| 79 | -} |
| 1 | import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit' | 1 | import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit' |
| 2 | -import { CustomProtocolDialog } from './CustomProtocolDialog' | ||
| 3 | import router from '@ohos.router' | 2 | import router from '@ohos.router' |
| 4 | import { LoginViewModel } from './LoginViewModel' | 3 | import { LoginViewModel } from './LoginViewModel' |
| 5 | import { LoginInputComponent } from './LoginInputComponent' | 4 | import { LoginInputComponent } from './LoginInputComponent' |
| @@ -57,18 +56,6 @@ struct LoginPage { | @@ -57,18 +56,6 @@ struct LoginPage { | ||
| 57 | maskColor:"#00000000" | 56 | maskColor:"#00000000" |
| 58 | }) | 57 | }) |
| 59 | 58 | ||
| 60 | - dialogController: CustomDialogController = new CustomDialogController({ | ||
| 61 | - builder: CustomProtocolDialog({ | ||
| 62 | - cancel: () => { | ||
| 63 | - | ||
| 64 | - }, | ||
| 65 | - confirm: () => { | ||
| 66 | - this.requestLogin() | ||
| 67 | - } | ||
| 68 | - }), | ||
| 69 | - customStyle: true, | ||
| 70 | - alignment:DialogAlignment.Center | ||
| 71 | - }) | ||
| 72 | loginViewModel = new LoginViewModel() | 59 | loginViewModel = new LoginViewModel() |
| 73 | @State isProtocol:boolean=false | 60 | @State isProtocol:boolean=false |
| 74 | onCodeSend() { | 61 | onCodeSend() { |
| @@ -467,32 +454,58 @@ struct ProtocolComponent { | @@ -467,32 +454,58 @@ struct ProtocolComponent { | ||
| 467 | Column() { | 454 | Column() { |
| 468 | Text("温馨提示") | 455 | Text("温馨提示") |
| 469 | .fontColor("#222222") | 456 | .fontColor("#222222") |
| 470 | - .fontSize(18) | 457 | + .fontSize("35lpx") |
| 458 | + .lineHeight("50lpx") | ||
| 471 | .width("100%") | 459 | .width("100%") |
| 472 | - .fontWeight(FontWeight.Bold) | 460 | + .fontWeight(500) |
| 473 | .textAlign(TextAlign.Center) | 461 | .textAlign(TextAlign.Center) |
| 474 | - .margin({ top: 20 }) | 462 | + .margin({ top: "38lpx" }) |
| 475 | Text() { | 463 | Text() { |
| 476 | - Span("为保障您的合法权益,请阅读并同意").fontSize(14).fontColor("#666666") | ||
| 477 | - Span("《用户协议》").fontSize(14).fontColor("#ED2800").onClick(() => { | 464 | + Span("为保障您的合法权益,请阅读并同意") |
| 465 | + .fontSize("27lpx") | ||
| 466 | + .lineHeight("42lpx") | ||
| 467 | + .fontWeight(400) | ||
| 468 | + .fontColor("#666666") | ||
| 469 | + | ||
| 470 | + Span("《用户协议》") | ||
| 471 | + .fontSize("27lpx") | ||
| 472 | + .lineHeight("42lpx") | ||
| 473 | + .fontWeight(400) | ||
| 474 | + .fontColor("#ED2800") | ||
| 475 | + .onClick(() => { | ||
| 478 | let bean = { contentID: "1", pageID: "" } as Params | 476 | let bean = { contentID: "1", pageID: "" } as Params |
| 479 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 477 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 480 | }) | 478 | }) |
| 481 | - Span("及").fontSize(14).fontColor("#666666") | ||
| 482 | - Span("《隐私政策》").fontSize(14).fontColor("#ED2800").onClick(() => { | 479 | + Span("及").fontSize("27lpx") |
| 480 | + .lineHeight("42lpx") | ||
| 481 | + .fontWeight(400) | ||
| 482 | + .fontColor("#666666") | ||
| 483 | + Span("《隐私政策》") | ||
| 484 | + .fontSize("27lpx") | ||
| 485 | + .lineHeight("42lpx") | ||
| 486 | + .fontWeight(400) | ||
| 487 | + .fontColor("#ED2800") | ||
| 488 | + .onClick(() => { | ||
| 483 | let bean = { contentID: "2", pageID: "" } as Params | 489 | let bean = { contentID: "2", pageID: "" } as Params |
| 484 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 490 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 485 | }) | 491 | }) |
| 486 | - Span("后进行登录").fontSize(14).fontColor("#666666") | ||
| 487 | - }.margin({ top: 12, left: 16, right: 16 }) | ||
| 488 | - | ||
| 489 | - Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp') | 492 | + Span("后进行登录") |
| 493 | + .fontSize("27lpx") | ||
| 494 | + .lineHeight("42lpx") | ||
| 495 | + .fontWeight(400) | ||
| 496 | + .fontColor("#666666") | ||
| 497 | + }.margin({ top: "23lpx", left: "31lpx", right: "31lpx" }) | ||
| 498 | + .wordBreak(WordBreak.BREAK_ALL) | ||
| 499 | + .textAlign(TextAlign.Start) | ||
| 500 | + | ||
| 501 | + Divider().color("#f5f5f5").width("100%").margin({ top: "27lpx" }).height('1lpx').strokeWidth('1lpx') | ||
| 490 | Row() { | 502 | Row() { |
| 491 | Text('放弃登录') | 503 | Text('放弃登录') |
| 492 | - .fontSize(16) | 504 | + .fontSize("31lpx") |
| 505 | + .fontWeight(500) | ||
| 506 | + .lineHeight("42lpx") | ||
| 493 | .fontColor("#999999") | 507 | .fontColor("#999999") |
| 494 | .layoutWeight(1) | 508 | .layoutWeight(1) |
| 495 | - .fontWeight(FontWeight.Medium) | ||
| 496 | .textAlign(TextAlign.Center) | 509 | .textAlign(TextAlign.Center) |
| 497 | .onClick(() => { | 510 | .onClick(() => { |
| 498 | if (this.cancelMethod) { | 511 | if (this.cancelMethod) { |
| @@ -500,18 +513,26 @@ struct ProtocolComponent { | @@ -500,18 +513,26 @@ struct ProtocolComponent { | ||
| 500 | } | 513 | } |
| 501 | }) | 514 | }) |
| 502 | .height('100%') | 515 | .height('100%') |
| 503 | - // Divider().color("#999999").height('100%').width('0.5vp') | 516 | + |
| 517 | + Divider() | ||
| 518 | + .width("1lpx") | ||
| 519 | + .strokeWidth('1lpx') | ||
| 520 | + .vertical(true) | ||
| 521 | + .height('100%') | ||
| 522 | + .color("#F5F5F5") | ||
| 523 | + | ||
| 524 | + | ||
| 504 | Text('同意并登录') | 525 | Text('同意并登录') |
| 505 | - .fontSize(16) | 526 | + .fontSize("31lpx") |
| 527 | + .fontWeight(500) | ||
| 528 | + .lineHeight("42lpx") | ||
| 506 | .fontColor("#ED2800") | 529 | .fontColor("#ED2800") |
| 507 | .layoutWeight(1) | 530 | .layoutWeight(1) |
| 508 | - .fontWeight(FontWeight.Medium) | ||
| 509 | .textAlign(TextAlign.Center) | 531 | .textAlign(TextAlign.Center) |
| 510 | .border({ | 532 | .border({ |
| 511 | width: { left: 1 }, | 533 | width: { left: 1 }, |
| 512 | - color: "#999999", | 534 | + color: "#F5F5F5", |
| 513 | style: { left: BorderStyle.Solid } | 535 | style: { left: BorderStyle.Solid } |
| 514 | - | ||
| 515 | }) | 536 | }) |
| 516 | .onClick(() => { | 537 | .onClick(() => { |
| 517 | if (this.agreeMethod) { | 538 | if (this.agreeMethod) { |
| @@ -519,8 +540,13 @@ struct ProtocolComponent { | @@ -519,8 +540,13 @@ struct ProtocolComponent { | ||
| 519 | } | 540 | } |
| 520 | }) | 541 | }) |
| 521 | .height('100%') | 542 | .height('100%') |
| 522 | - }.layoutWeight(1).justifyContent(FlexAlign.Center) | ||
| 523 | - }.height(161).backgroundColor(Color.White).borderRadius(6).width('74%') | 543 | + }.layoutWeight(1) |
| 544 | + .justifyContent(FlexAlign.Center) | ||
| 545 | + } | ||
| 546 | + .backgroundColor(Color.White) | ||
| 547 | + .borderRadius("12lpx") | ||
| 548 | + .width("528lpx") | ||
| 549 | + .height("309lpx") | ||
| 524 | 550 | ||
| 525 | }.width('100%') | 551 | }.width('100%') |
| 526 | .height('100%') | 552 | .height('100%') |
-
Please register or login to post a comment