wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool: (25 commits)
  fix: 字体调整
  评论与点赞展示
  视频居中
  fix: Card10Component.ets 缺少CompDTO
  fix: Card10Component.ets 缺少CompDTO
  页面全屏代码
  feat(信息流):处理二次请求批查获取的数据 响应稿件页面
  desc:隐藏 系统消息 和 历史推送
  feat(信息流):处理二次请求批查获取的数据 响应稿件页面
  fix:bug[17459] 搜索结果>人民号,只有1个号主信息,号主简介丢失、粉丝数据不对
  fix: 17539 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,时间轴图片未显示
  fix: 添加标签
  fix: 17537 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,精品评论图片显示了
  fix: 17575 单图卡三行标题鸿蒙版显示内容不全,被遮挡
  ref |> 解决内容稿件无法评论问题
  ref |> 修复评论发布不成功问题
  fix:bug[17188] UI还原问题-【uat】登录-账号密码登录,未勾选同意隐私协议,弹窗与设计不符
  fix: 17150
  fix:17071 【uat】精选评论-进入号主页_顶部与鸿蒙系统图标重叠展示
  fix: 17150 debug
  ...
Showing 64 changed files with 988 additions and 550 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;
@@ -37,6 +37,7 @@ export abstract class BasicDataSource<T> implements IDataSource { @@ -37,6 +37,7 @@ export abstract class BasicDataSource<T> implements IDataSource {
37 }) 37 })
38 } 38 }
39 39
  40 +
40 // 通知控制器数据增加 41 // 通知控制器数据增加
41 public notifyDataAdd(index: number): void { 42 public notifyDataAdd(index: number): void {
42 this.listeners.forEach(listener => { 43 this.listeners.forEach(listener => {
@@ -82,4 +82,20 @@ export class DeviceUtil { @@ -82,4 +82,20 @@ export class DeviceUtil {
82 static getRandomUUIDForTraceID(): string { 82 static getRandomUUIDForTraceID(): string {
83 return util.generateRandomUUID().toUpperCase().replace(/-/g, '') 83 return util.generateRandomUUID().toUpperCase().replace(/-/g, '')
84 } 84 }
  85 +
  86 + /**
  87 + * 是否为phone设备(可折叠手机即便完全展开状态也返回true)
  88 + * @returns
  89 + */
  90 + static isPhone(): boolean {
  91 + return deviceInfo.deviceType == 'phone' || deviceInfo.deviceType == 'default';
  92 + }
  93 +
  94 + static isNotPhone(): boolean {
  95 + return !DeviceUtil.isPhone();
  96 + }
  97 +
  98 + static isTablet(): boolean {
  99 + return deviceInfo.deviceType == 'tablet';
  100 + }
85 } 101 }
@@ -255,6 +255,7 @@ export class LazyDataSource<T> extends BasicDataSource<T> { @@ -255,6 +255,7 @@ export class LazyDataSource<T> extends BasicDataSource<T> {
255 this.replaceAll() 255 this.replaceAll()
256 } 256 }
257 257
  258 +
258 // 把数据全部删除,再添加全部新元素 259 // 把数据全部删除,再添加全部新元素
259 public replaceAll(...items: T[]): void { 260 public replaceAll(...items: T[]): void {
260 // 从数组中的0位置开始删除dataArray.length个元素,并在同一位置插入((1个或多个))新元素,返回已删除的元素。 261 // 从数组中的0位置开始删除dataArray.length个元素,并在同一位置插入((1个或多个))新元素,返回已删除的元素。
@@ -262,6 +263,8 @@ export class LazyDataSource<T> extends BasicDataSource<T> { @@ -262,6 +263,8 @@ export class LazyDataSource<T> extends BasicDataSource<T> {
262 this.notifyDataReload() 263 this.notifyDataReload()
263 } 264 }
264 265
  266 +
  267 +
265 // 获取指定元素的下标 268 // 获取指定元素的下标
266 public getIndexOf(element: T): number { 269 public getIndexOf(element: T): number {
267 for (let index = 0; index < this.dataArray.length; index++) { 270 for (let index = 0; index < this.dataArray.length; index++) {
@@ -293,4 +296,13 @@ export class LazyDataSource<T> extends BasicDataSource<T> { @@ -293,4 +296,13 @@ export class LazyDataSource<T> extends BasicDataSource<T> {
293 public reloadData(): void { 296 public reloadData(): void {
294 this.notifyDataReload(); 297 this.notifyDataReload();
295 } 298 }
  299 + //**********************//////////
  300 +
  301 +
  302 + public clearAllData(){
  303 +
  304 + this.dataArray = []
  305 + this.notifyDataReload();
  306 + }
  307 +
296 } 308 }
1 -import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean';  
2 -import { AudioDTO } from '../content/AudioDTO';  
3 -import { ContentDTO } from '../content/ContentDTO';  
4 1
5 export interface BaseDTO { 2 export interface BaseDTO {
6 3
@@ -4,48 +4,88 @@ import { ContentDTO } from '../content/ContentDTO'; @@ -4,48 +4,88 @@ import { ContentDTO } from '../content/ContentDTO';
4 import { BaseDTO } from './BaseDTO'; 4 import { BaseDTO } from './BaseDTO';
5 5
6 @Observed 6 @Observed
7 -export class CompDTO implements BaseDTO{  
8 - backgroundColor: string='';  
9 - backgroundImgUrl: string='';  
10 - cityCode: string='';  
11 - compStyle: string='';  
12 - compType: string='';  
13 - 7 +export class CompDTO implements BaseDTO {
  8 + backgroundColor: string = '';
  9 + backgroundImgUrl: string = '';
  10 + cityCode: string = '';
  11 + compStyle: string = '';
  12 + compType: string = '';
14 // dataSourceRequest: any[]; 13 // dataSourceRequest: any[];
15 - districtCode: string=''; 14 + districtCode: string = '';
16 extraData?: string; 15 extraData?: string;
17 - hasAdInfo: number=-1;  
18 - id: number=0;  
19 - imgSize: string='';  
20 - innerUrl: string='';  
21 - linkUrl: string='';  
22 - 16 + hasAdInfo: number = -1;
  17 + id: number = 0;
  18 + imgSize: string = '';
  19 + innerUrl: string = '';
  20 + linkUrl: string = '';
23 // meddleDataList: any[]; 21 // meddleDataList: any[];
24 - name: string='';  
25 - objectId: string=''; // 跳转页面id?  
26 - objectTitle: string=''; // comp标题 22 + name: string = '';
  23 + objectId: string = ''; // 跳转页面id?
  24 + objectTitle: string = ''; // comp标题
27 // objectType?: string; // 跳转类型,枚举: 25 // objectType?: string; // 跳转类型,枚举:
28 - operDataList: ContentDTO[]=[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 26 + operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
29 // pageId?: any; 27 // pageId?: any;
30 - posterSize: string='';  
31 - posterUrl: string='';  
32 - provinceCode: string='';  
33 - sortValue: number=-1;  
34 - subType: string='';  
35 - imageScale: number=-1; // 封面图比例 1-4:3, 2-16:9, 3-3:2  
36 - audioDataList: AudioDTO[]=[];  
37 - titleShowPolicy: string | number='';  
38 - 28 + posterSize: string = '';
  29 + posterUrl: string = '';
  30 + provinceCode: string = '';
  31 + sortValue: number = -1;
  32 + subType: string = '';
  33 + imageScale: number = -1; // 封面图比例 1-4:3, 2-16:9, 3-3:2
  34 + audioDataList: AudioDTO[] = [];
  35 + titleShowPolicy: string | number = '';
39 /** 36 /**
40 * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) 37 * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
41 */ 38 */
42 - dataSourceType: string='';  
43 - 39 + dataSourceType: string = '';
44 /** 40 /**
45 * 信息流广告素材 41 * 信息流广告素材
46 */ 42 */
47 matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean 43 matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean
48 -  
49 pageId?: string; 44 pageId?: string;
50 objectType?: string; 45 objectType?: string;
  46 + hasMore: number = 1
  47 +
  48 + // keyGenerator相关字符串,用于刷新list布局
  49 + timestamp: String = '1'
  50 + /**
  51 + * 创建新的compbean对象
  52 + * @param old
  53 + * @returns
  54 + */
  55 + static createNewsBean(old: CompDTO): CompDTO {
  56 + let comp: CompDTO = new CompDTO
  57 + comp.compStyle = old.compStyle
  58 + comp.compType = old.compType
  59 + comp.operDataList = old.operDataList
  60 + comp.extraData = old.extraData
  61 + comp.matInfo = old.matInfo
  62 +
  63 + comp.backgroundColor = old.backgroundColor
  64 + comp.backgroundImgUrl = old.backgroundImgUrl
  65 + comp.cityCode = old.cityCode
  66 + comp.districtCode = old.districtCode
  67 + comp.provinceCode = old.provinceCode
  68 + comp.hasAdInfo = old.hasAdInfo
  69 + comp.id = old.id
  70 + comp.imgSize = old.imgSize
  71 + comp.innerUrl = old.innerUrl
  72 + comp.linkUrl = old.linkUrl
  73 + comp.name = old.name
  74 + comp.objectId = old.objectId
  75 + comp.objectTitle = old.objectTitle
  76 + comp.posterSize = old.posterSize
  77 + comp.posterUrl = old.posterUrl
  78 + comp.sortValue = old.sortValue
  79 + comp.subType = old.subType
  80 + comp.imageScale = old.imageScale
  81 + comp.audioDataList = old.audioDataList
  82 + comp.titleShowPolicy = old.titleShowPolicy
  83 + comp.pageId = old.pageId
  84 + comp.extraData = old.extraData
  85 + comp.dataSourceType = old.dataSourceType
  86 + comp.objectType = old.objectType
  87 + comp.hasMore = old.hasMore
  88 +
  89 + return comp
  90 + }
51 } 91 }
1 /** 1 /**
2 * 批查接口查询互动相关数据,返回数据bean 2 * 批查接口查询互动相关数据,返回数据bean
3 */ 3 */
4 -@Observed  
5 export class InteractDataDTO { 4 export class InteractDataDTO {
6 collectNum: number | string = 0; 5 collectNum: number | string = 0;
7 commentNum: number | string = 0; 6 commentNum: number | string = 0;
@@ -25,34 +25,35 @@ import { SearchContentComponent } from './cardview/SearchContentComponent'; @@ -25,34 +25,35 @@ import { SearchContentComponent } from './cardview/SearchContentComponent';
25 @Component 25 @Component
26 export struct CardParser { 26 export struct CardParser {
27 @State contentDTO: ContentDTO = new ContentDTO(); 27 @State contentDTO: ContentDTO = new ContentDTO();
28 - @State compDTO: CompDTO = {} as CompDTO 28 + @ObjectLink compDTO: CompDTO
29 29
30 build() { 30 build() {
31 - this.contentBuilder(this.contentDTO, this.compDTO); 31 + this.contentBuilder(this.contentDTO);
32 } 32 }
33 33
34 @Builder 34 @Builder
35 - contentBuilder(contentDTO: ContentDTO, compDTO: CompDTO) { 35 + contentBuilder(contentDTO: ContentDTO) {
  36 + // Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
36 if (!!contentDTO.contentText) { 37 if (!!contentDTO.contentText) {
37 SearchContentComponent({ contentDTO }) 38 SearchContentComponent({ contentDTO })
38 } else { 39 } else {
39 if (contentDTO.appStyle === CompStyle.Card_02) { 40 if (contentDTO.appStyle === CompStyle.Card_02) {
40 - Card2Component({ contentDTO }) 41 + Card2Component({ compDTO: this.compDTO, contentDTO })
41 } else if (contentDTO.appStyle === CompStyle.Card_03) { 42 } else if (contentDTO.appStyle === CompStyle.Card_03) {
42 - Card3Component({ contentDTO }) 43 + Card3Component({ compDTO: this.compDTO, contentDTO })
43 } else if (contentDTO.appStyle === CompStyle.Card_04) { 44 } else if (contentDTO.appStyle === CompStyle.Card_04) {
44 - Card4Component({ contentDTO }) 45 + Card4Component({ compDTO: this.compDTO, contentDTO })
45 } else if (contentDTO.appStyle === CompStyle.Card_05) { 46 } else if (contentDTO.appStyle === CompStyle.Card_05) {
46 - Card5Component({ contentDTO, titleShowPolicy: compDTO.titleShowPolicy }) 47 + Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy })
47 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle 48 } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
48 .Card_13) { 49 .Card_13) {
49 - Card6Component({ contentDTO }) 50 + Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
50 } else if (contentDTO.appStyle === CompStyle.Card_09) { 51 } else if (contentDTO.appStyle === CompStyle.Card_09) {
51 Card9Component({ contentDTO }) 52 Card9Component({ contentDTO })
52 } else if (contentDTO.appStyle === CompStyle.Card_10) { 53 } else if (contentDTO.appStyle === CompStyle.Card_10) {
53 - Card10Component({ contentDTO }) 54 + Card10Component({ compDTO: this.compDTO, contentDTO })
54 } else if (contentDTO.appStyle === CompStyle.Card_11) { 55 } else if (contentDTO.appStyle === CompStyle.Card_11) {
55 - Card11Component({ contentDTO }) 56 + Card11Component({ compDTO: this.compDTO, contentDTO })
56 } else if (contentDTO.appStyle === CompStyle.Card_12) { 57 } else if (contentDTO.appStyle === CompStyle.Card_12) {
57 Card12Component({ contentDTO }) 58 Card12Component({ contentDTO })
58 } else if (contentDTO.appStyle === CompStyle.Card_14) { 59 } else if (contentDTO.appStyle === CompStyle.Card_14) {
@@ -62,7 +63,7 @@ export struct CardParser { @@ -62,7 +63,7 @@ export struct CardParser {
62 } else if (contentDTO.appStyle === CompStyle.Card_16) { 63 } else if (contentDTO.appStyle === CompStyle.Card_16) {
63 Card16Component({ contentDTO }) 64 Card16Component({ contentDTO })
64 } else if (contentDTO.appStyle === CompStyle.Card_17) { 65 } else if (contentDTO.appStyle === CompStyle.Card_17) {
65 - Card17Component({ contentDTO }) 66 + Card17Component({ compDTO: this.compDTO, contentDTO })
66 } else if (contentDTO.appStyle === CompStyle.Card_19) { 67 } else if (contentDTO.appStyle === CompStyle.Card_19) {
67 Card19Component({ contentDTO }) 68 Card19Component({ contentDTO })
68 } else if (contentDTO.appStyle === CompStyle.Card_20) { 69 } else if (contentDTO.appStyle === CompStyle.Card_20) {
@@ -77,6 +78,5 @@ export struct CardParser { @@ -77,6 +78,5 @@ export struct CardParser {
77 // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle 78 // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle
78 } 79 }
79 } 80 }
80 -  
81 } 81 }
82 } 82 }
1 import { CompDTO } from 'wdBean'; 1 import { CompDTO } from 'wdBean';
2 -import { CommonConstants, CompStyle } from 'wdConstant';  
3 -import { LabelComponent } from './view/LabelComponent'; 2 +import { CommonConstants, CompStyle } from 'wdConstant/Index';
  3 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  4 +import PageModel from '../viewmodel/PageModel';
  5 +import { CardParser } from './CardParser';
  6 +import { Card2Component } from './cardview/Card2Component';
  7 +import { Card5Component } from './cardview/Card5Component';
  8 +import { AdvCardParser } from './cardViewAdv/AdvCardParser';
  9 +import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
  10 +import { ZhGridLayout02 } from './compview/ZhGridLayout02';
  11 +import { ZhGridLayout03 } from './compview/ZhGridLayout03';
  12 +import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';
  13 +import { ZhSingleColumn05 } from './compview/ZhSingleColumn05';
  14 +import { ZhSingleColumn09 } from './compview/ZhSingleColumn09';
  15 +import { ZhSingleRow02 } from './compview/ZhSingleRow02';
  16 +import { ZhSingleRow03 } from './compview/ZhSingleRow03';
  17 +import { ZhSingleRow04 } from './compview/ZhSingleRow04';
  18 +import { ZhSingleRow06 } from './compview/ZhSingleRow06';
4 import { 19 import {
5 HorizontalStrokeCardThreeTwoRadioForMoreComponent 20 HorizontalStrokeCardThreeTwoRadioForMoreComponent
6 } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent'; 21 } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
7 import { 22 import {
8 HorizontalStrokeCardThreeTwoRadioForOneComponent 23 HorizontalStrokeCardThreeTwoRadioForOneComponent
9 } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; 24 } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
10 -import { ZhSingleRow02 } from './compview/ZhSingleRow02';  
11 -import { ZhSingleRow03 } from './compview/ZhSingleRow03';  
12 -import { ZhSingleRow04 } from './compview/ZhSingleRow04';  
13 -import { ZhSingleRow06 } from './compview/ZhSingleRow06';  
14 -import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';  
15 -import { ZhSingleColumn09 } from './compview/ZhSingleColumn09';  
16 -import { ZhGridLayout03 } from './compview/ZhGridLayout03';  
17 -import { CardParser } from './CardParser';  
18 -import { ZhGridLayout02 } from './compview/ZhGridLayout02';  
19 -import { Card2Component } from './cardview/Card2Component';  
20 -import { Card5Component } from './cardview/Card5Component';  
21 -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';  
22 -import { AdvCardParser } from './cardViewAdv/AdvCardParser';  
23 -import PageModel from '../viewmodel/PageModel'; 25 +import { LabelComponent } from './view/LabelComponent';
24 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'; 26 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
25 -import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';  
26 27
27 /** 28 /**
28 * comp适配器. 29 * comp适配器.
29 * 首页楼层comp解析器. 30 * 首页楼层comp解析器.
30 */ 31 */
31 -@Preview  
32 @Component 32 @Component
33 export struct CompParser { 33 export struct CompParser {
34 - @State compDTO: CompDTO = {} as CompDTO 34 + @ObjectLink compDTO: CompDTO
35 @State compIndex: number = 0; 35 @State compIndex: number = 0;
36 @State private pageModel: PageModel = new PageModel(); 36 @State private pageModel: PageModel = new PageModel();
37 37
@@ -39,90 +39,93 @@ export struct CompParser { @@ -39,90 +39,93 @@ export struct CompParser {
39 Column() { 39 Column() {
40 if (this.compDTO.name != "月度排行卡") { 40 if (this.compDTO.name != "月度排行卡") {
41 41
42 - this.componentBuilder(this.compDTO, this.compIndex); 42 + this.componentBuilder();
43 } 43 }
44 } 44 }
45 } 45 }
46 46
47 @Builder 47 @Builder
48 - componentBuilder(compDTO: CompDTO, compIndex: number) {  
49 - //if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口  
50 - if (compDTO.compStyle === CompStyle.Label_03) {  
51 - LabelComponent({ compDTO: compDTO })  
52 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
53 - } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {  
54 - ZhCarouselLayout01({ compDTO: compDTO })  
55 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
56 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&  
57 - compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 48 + componentBuilder() {
  49 +
  50 + //CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO:this.compDTO })
58 51
59 - LiveHorizontalCardComponent({ compDTO: compDTO })  
60 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
61 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) {  
62 - if (compDTO.operDataList.length > 1) {  
63 - HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO }) 52 + if (this.compDTO.operDataList[0]?.objectType !== '3' &&
  53 + this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
  54 + if (this.compDTO.compStyle === CompStyle.Label_03) {
  55 + LabelComponent({ compDTO: this.compDTO })
  56 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  57 + } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
  58 + ZhCarouselLayout01({ compDTO: this.compDTO })
  59 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  60 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
  61 + this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
  62 +
  63 + LiveHorizontalCardComponent({ compDTO: this.compDTO })
  64 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  65 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
  66 + if (this.compDTO.operDataList.length > 1) {
  67 + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO })
  68 + } else {
  69 + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO })
  70 + }
  71 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  72 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
  73 + ZhSingleRow02({ compDTO: this.compDTO })
  74 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  75 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
  76 + ZhSingleRow03({ compDTO: this.compDTO })
  77 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  78 + } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {
  79 + ZhGridLayout02({ compDTO: this.compDTO })
  80 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  81 + } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
  82 + ZhGridLayout03({ compDTO: this.compDTO })
  83 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  84 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
  85 + ZhSingleRow04({ compDTO: this.compDTO })
  86 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  87 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
  88 + // ZhSingleRow05({ compDTO })
  89 + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  90 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
  91 + ZhSingleRow06({ compDTO: this.compDTO })
  92 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  93 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
  94 + //头图卡 和comStyle 2相同,
  95 + Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy })
  96 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  97 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
  98 + // 大图卡
  99 + Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] })
  100 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  101 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
  102 + ZhSingleColumn04({ compDTO: this.compDTO })
  103 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  104 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
  105 + // ZhSingleColumn05({ compDTO: compDTO })
  106 + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  107 + } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
  108 + ZhSingleColumn09({ compDTO: this.compDTO })
  109 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  110 + } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
  111 + AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
  112 + //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
  113 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  114 + } else if (!Number.isNaN(Number(this.compDTO.compStyle))) {
  115 + CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
  116 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
64 } else { 117 } else {
65 - HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) 118 + Text(this.compDTO.compStyle)
  119 + .width(CommonConstants.FULL_PARENT)
  120 + .padding(10)
  121 + .onClick(() => {
  122 + if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论
  123 + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
  124 + }
  125 + })
  126 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
66 } 127 }
67 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
68 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) {  
69 - ZhSingleRow02({ compDTO })  
70 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
71 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) {  
72 - ZhSingleRow03({ compDTO: compDTO })  
73 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
74 - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {  
75 - ZhGridLayout02({ compDTO: compDTO })  
76 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
77 - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {  
78 - ZhGridLayout03({ compDTO: compDTO })  
79 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
80 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) {  
81 - ZhSingleRow04({ compDTO: compDTO })  
82 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
83 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) {  
84 - // ZhSingleRow05({ compDTO })  
85 - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
86 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {  
87 - ZhSingleRow06({ compDTO })  
88 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
89 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {  
90 - //头图卡 和comStyle 2相同,  
91 - Card5Component({ contentDTO: compDTO.operDataList[0], titleShowPolicy: compDTO.titleShowPolicy })  
92 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
93 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_03) {  
94 - // 大图卡  
95 - Card2Component({ contentDTO: compDTO.operDataList[0] })  
96 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
97 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) {  
98 - ZhSingleColumn04({ compDTO: compDTO })  
99 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
100 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) {  
101 - // ZhSingleColumn05({ compDTO: compDTO })  
102 - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
103 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) {  
104 - ZhSingleColumn09({ compDTO })  
105 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
106 - } else if (compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告  
107 - AdvCardParser({ pageModel: this.pageModel, compDTO })  
108 - //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })  
109 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
110 - } else if (!Number.isNaN(Number(compDTO.compStyle))) {  
111 - CardParser({ contentDTO: compDTO.operDataList[0], compDTO });  
112 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
113 - } else {  
114 - Text(compDTO.compStyle)  
115 - .width(CommonConstants.FULL_PARENT)  
116 - .padding(10)  
117 - .onClick(() => {  
118 - if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论  
119 - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)  
120 - }  
121 - })  
122 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
123 } 128 }
124 - }  
125 -  
126 - // }  
127 -}  
128 129
  130 + }
  131 +}
@@ -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 { ContentDTO } from 'wdBean' 1 +import { CompDTO, ContentDTO } from 'wdBean'
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 import { DateTimeUtils } from 'wdKit/Index'; 3 import { DateTimeUtils } from 'wdKit/Index';
4 4
5 @Component 5 @Component
6 export struct CardSourceInfo { 6 export struct CardSourceInfo {
7 @State contentDTO: ContentDTO = new ContentDTO(); 7 @State contentDTO: ContentDTO = new ContentDTO();
  8 + @ObjectLink compDTO: CompDTO
8 9
9 build() { 10 build() {
10 Flex() { 11 Flex() {
@@ -28,13 +29,14 @@ export struct CardSourceInfo { @@ -28,13 +29,14 @@ export struct CardSourceInfo {
28 .textOverflow({ overflow: TextOverflow.Ellipsis }) 29 .textOverflow({ overflow: TextOverflow.Ellipsis })
29 } 30 }
30 // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 31 // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
31 - if (this.contentDTO.isSearch || this.contentDTO.isCollection || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime  
32 - (Number  
33 - .parseFloat(this  
34 - .contentDTO.publishTime))  
35 - .indexOf  
36 - ('-') === -1) {  
37 - if(this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName || this 32 + if (this.contentDTO.isSearch || this.contentDTO.isCollection ||
  33 + !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
  34 + (Number
  35 + .parseFloat(this
  36 + .contentDTO.publishTime))
  37 + .indexOf
  38 + ('-') === -1) {
  39 + if (this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName || this
38 .contentDTO.rmhPlatform !== 1 && this.contentDTO.source) { 40 .contentDTO.rmhPlatform !== 1 && this.contentDTO.source) {
39 Image($r("app.media.point")) 41 Image($r("app.media.point"))
40 .width(16) 42 .width(16)
@@ -45,16 +47,30 @@ export struct CardSourceInfo { @@ -45,16 +47,30 @@ export struct CardSourceInfo {
45 .fontColor($r("app.color.color_B0B0B0")) 47 .fontColor($r("app.color.color_B0B0B0"))
46 .flexShrink(0) 48 .flexShrink(0)
47 } 49 }
48 - if (this.contentDTO?.interactData?.commentNum) {  
49 - Text(`${this.contentDTO.interactData.commentNum}评`) 50 + if (this.getContentDtoBean()?.interactData?.commentNum) {
  51 + Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
50 .fontSize($r("app.float.font_size_12")) 52 .fontSize($r("app.float.font_size_12"))
51 .fontColor($r("app.color.color_B0B0B0")) 53 .fontColor($r("app.color.color_B0B0B0"))
52 .flexShrink(0) 54 .flexShrink(0)
53 .margin({ left: 6 }) 55 .margin({ left: 6 })
54 - .visibility(Number(this.contentDTO?.interactData?.commentNum) === 0 ? Visibility.None : Visibility.Visible) 56 + .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : Visibility.Visible)
55 } 57 }
56 } 58 }
57 .width(CommonConstants.FULL_WIDTH) 59 .width(CommonConstants.FULL_WIDTH)
58 .margin({ top: 8 }) 60 .margin({ top: 8 })
59 } 61 }
  62 +
  63 + /**
  64 + * 获取稿件业务对象
  65 + * @returns
  66 + */
  67 + private getContentDtoBean(): ContentDTO {
  68 + if (this.compDTO == undefined) {
  69 + return new ContentDTO
  70 + }
  71 + if(this.compDTO.operDataList.length == 0){
  72 + return new ContentDTO
  73 + }
  74 + return this.compDTO.operDataList[0]
  75 + }
60 } 76 }
@@ -61,7 +61,6 @@ export struct CardAdvBottom { @@ -61,7 +61,6 @@ export struct CardAdvBottom {
61 } 61 }
62 if (currentIndex >= 0) { 62 if (currentIndex >= 0) {
63 this.pageModel.compList.deleteItem(currentIndex) 63 this.pageModel.compList.deleteItem(currentIndex)
64 - this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
65 } 64 }
66 } 65 }
67 } 66 }
1 //全标题 "appStyle":"2", 1 //全标题 "appStyle":"2",
2 -import { CompDTO, ContentDTO } from 'wdBean'; 2 +import { CompDTO } from 'wdBean';
3 import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/AdvExtraData'; 3 import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/AdvExtraData';
4 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; 4 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
6 import { ProcessUtils } from 'wdRouter'; 6 import { ProcessUtils } from 'wdRouter';
7 import PageModel from '../../viewmodel/PageModel'; 7 import PageModel from '../../viewmodel/PageModel';
8 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo'  
9 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo'  
10 import { CardAdvTop } from './CardAdvTop'; 8 import { CardAdvTop } from './CardAdvTop';
11 9
12 const TAG: string = 'Card2Component'; 10 const TAG: string = 'Card2Component';
1 //全标题 "appStyle":"2", 1 //全标题 "appStyle":"2",
2 -import { CompDTO, ContentDTO } from 'wdBean'; 2 +import { CompDTO } from 'wdBean';
3 import { CommonConstants } from 'wdConstant/Index'; 3 import { CommonConstants } from 'wdConstant/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import PageModel from '../../viewmodel/PageModel'; 5 import PageModel from '../../viewmodel/PageModel';
6 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo'  
7 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo'  
8 import { CardAdvBottom } from './CardAdvBottom'; 6 import { CardAdvBottom } from './CardAdvBottom';
9 7
10 const TAG: string = 'Card2Component'; 8 const TAG: string = 'Card2Component';
@@ -73,7 +73,6 @@ export struct CardAdvTop { @@ -73,7 +73,6 @@ export struct CardAdvTop {
73 } 73 }
74 if (currentIndex >= 0) { 74 if (currentIndex >= 0) {
75 this.pageModel.compList.deleteItem(currentIndex) 75 this.pageModel.compList.deleteItem(currentIndex)
76 - this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
77 } 76 }
78 } 77 }
79 } 78 }
1 //全标题 "appStyle":"2", 1 //全标题 "appStyle":"2",
2 -import { CompDTO, ContentDTO, VideoInfoDTO } from 'wdBean'; 2 +import { CompDTO, ContentDTO } from 'wdBean';
3 import { CommonConstants } from 'wdConstant/Index'; 3 import { CommonConstants } from 'wdConstant/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import PageModel from '../../viewmodel/PageModel'; 5 import PageModel from '../../viewmodel/PageModel';
6 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo'  
7 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 6 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
8 import { CardAdvBottom } from './CardAdvBottom'; 7 import { CardAdvBottom } from './CardAdvBottom';
9 8
10 const TAG: string = 'Card2Component'; 9 const TAG: string = 'Card2Component';
1 -import { ContentDTO, slideShows, VideoInfoDTO } from 'wdBean'; 1 +import { ContentDTO, slideShows, VideoInfoDTO, CompDTO } 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';
@@ -16,16 +16,40 @@ const TAG: string = 'Card10Component'; @@ -16,16 +16,40 @@ const TAG: string = 'Card10Component';
16 export struct Card10Component { 16 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
  20 + @State titleMarked: boolean = false;
  21 + @State str01: string = '';
  22 + @State str02: string = '';
  23 + @State str03: string = '';
19 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() { 40 Column() {
26 // 顶部标题,最多两行 41 // 顶部标题,最多两行
27 if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { 42 if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
28 - 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 + }
29 .width(CommonConstants.FULL_WIDTH) 53 .width(CommonConstants.FULL_WIDTH)
30 .fontSize($r('app.float.font_size_17')) 54 .fontSize($r('app.float.font_size_17'))
31 .fontWeight(600) 55 .fontWeight(600)
@@ -110,8 +134,10 @@ export struct Card10Component { @@ -110,8 +134,10 @@ export struct Card10Component {
110 .textIndent(item.objectType == '5' ? 38 : 0) 134 .textIndent(item.objectType == '5' ? 38 : 0)
111 }.alignContent(Alignment.TopStart) 135 }.alignContent(Alignment.TopStart)
112 136
  137 + //bottom 评论等信息
113 CardSourceInfo( 138 CardSourceInfo(
114 { 139 {
  140 + compDTO: this.compDTO,
115 contentDTO: this.createContent(item) 141 contentDTO: this.createContent(item)
116 } 142 }
117 ) 143 )
1 //缩略标题 1 //缩略标题
2 -import { CommonConstants } from 'wdConstant'  
3 -import { ContentDTO } from 'wdBean' 2 +import { CompDTO, ContentDTO } from 'wdBean'
4 import { DateTimeUtils } from 'wdKit' 3 import { DateTimeUtils } from 'wdKit'
  4 +import { CommonConstants } from 'wdConstant';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 6 +import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
  7 +import { Notes } from './notes';
  8 +
7 const TAG = 'Card11Component'; 9 const TAG = 'Card11Component';
8 10
9 /** 11 /**
@@ -13,17 +15,57 @@ const TAG = 'Card11Component'; @@ -13,17 +15,57 @@ const TAG = 'Card11Component';
13 export struct Card11Component { 15 export struct Card11Component {
14 @State contentDTO: ContentDTO = new ContentDTO(); 16 @State contentDTO: ContentDTO = new ContentDTO();
15 @State clicked: boolean = false; 17 @State clicked: boolean = false;
  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 + }
16 36
17 build() { 37 build() {
18 Column() { 38 Column() {
19 - Text(this.contentDTO.newsTitle) 39 + Stack() {
  40 + if (this.contentDTO.newTags) {
  41 + Notes({ newTags: this.contentDTO.newTags })
  42 + } else if (this.contentDTO.objectType == '5') {
  43 + Notes({ objectType: this.contentDTO.objectType })
  44 + }
  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 + }
20 .fontSize($r("app.float.font_size_16")) 55 .fontSize($r("app.float.font_size_16"))
21 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) 56 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
22 .maxLines(3) 57 .maxLines(3)
23 .textOverflow({ overflow: TextOverflow.Ellipsis }) 58 .textOverflow({ overflow: TextOverflow.Ellipsis })
24 .width(CommonConstants.FULL_WIDTH) 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)
  63 +
  64 + }.alignContent(Alignment.TopStart)
  65 +
  66 +
25 // 评论等信息 67 // 评论等信息
26 - CardSourceInfo({ contentDTO: this.contentDTO }) 68 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
27 }.width(CommonConstants.FULL_WIDTH) 69 }.width(CommonConstants.FULL_WIDTH)
28 .padding({ 70 .padding({
29 left: $r('app.float.card_comp_pagePadding_lf'), 71 left: $r('app.float.card_comp_pagePadding_lf'),
@@ -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)
@@ -13,18 +13,41 @@ const TAG = 'Card17Component'; @@ -13,18 +13,41 @@ const TAG = 'Card17Component';
13 */ 13 */
14 @Component 14 @Component
15 export struct Card17Component { 15 export struct Card17Component {
16 - @State compDTO: CompDTO = {} as CompDTO  
17 @State contentDTO: ContentDTO = new ContentDTO(); 16 @State contentDTO: ContentDTO = new ContentDTO();
18 @State loadImg: boolean = false; 17 @State loadImg: boolean = false;
19 @State clicked: boolean = false; 18 @State clicked: boolean = false;
  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({ space: 8 }) { 40 Column({ space: 8 }) {
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 .textOverflow({ overflow: TextOverflow.Ellipsis }) 51 .textOverflow({ overflow: TextOverflow.Ellipsis })
29 .fontSize($r('app.float.font_size_17')) 52 .fontSize($r('app.float.font_size_17'))
30 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
@@ -97,7 +120,7 @@ export struct Card17Component { @@ -97,7 +120,7 @@ export struct Card17Component {
97 }) 120 })
98 121
99 // 评论等信息 122 // 评论等信息
100 - CardSourceInfo({ contentDTO: this.contentDTO }) 123 + CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO })
101 } 124 }
102 .width(CommonConstants.FULL_WIDTH) 125 .width(CommonConstants.FULL_WIDTH)
103 .padding({ 126 .padding({
@@ -2,7 +2,7 @@ import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean'; @@ -2,7 +2,7 @@ import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
2 import { RmhTitle } from '../cardCommon/RmhTitle' 2 import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 -import {CarderInteraction} from '../CarderInteraction' 5 +import { CarderInteraction } from '../CarderInteraction'
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
7 7
8 const TAG = 'Card19Component'; 8 const TAG = 'Card19Component';
@@ -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)
@@ -45,9 +71,9 @@ export struct Card19Component { @@ -45,9 +71,9 @@ export struct Card19Component {
45 } 71 }
46 return photo 72 return photo
47 }) 73 })
48 - ProcessUtils.gotoMultiPictureListPage(photoList,0) 74 + ProcessUtils.gotoMultiPictureListPage(photoList, 0)
49 }) 75 })
50 - CarderInteraction({contentDTO: this.contentDTO}) 76 + CarderInteraction({ contentDTO: this.contentDTO })
51 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 77 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
52 } 78 }
53 .padding({ 79 .padding({
@@ -79,8 +105,8 @@ struct createImg { @@ -79,8 +105,8 @@ struct createImg {
79 105
80 async aboutToAppear(): Promise<void> { 106 async aboutToAppear(): Promise<void> {
81 this.loadImg = await onlyWifiLoadImg(); 107 this.loadImg = await onlyWifiLoadImg();
82 - if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位  
83 - this.fullColumnImgUrls.splice(2,0, { 108 + if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
  109 + this.fullColumnImgUrls.splice(2, 0, {
84 fullUrl: '' 110 fullUrl: ''
85 } as FullColumnImgUrlDTO) 111 } as FullColumnImgUrlDTO)
86 } 112 }
@@ -123,7 +149,6 @@ struct createImg { @@ -123,7 +149,6 @@ struct createImg {
123 } 149 }
124 } 150 }
125 151
126 -  
127 build() { 152 build() {
128 GridRow({ 153 GridRow({
129 gutter: { x: 2, y: 2 } 154 gutter: { x: 2, y: 2 }
@@ -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)
1 //全标题 "appStyle":"2", 1 //全标题 "appStyle":"2",
2 -import { ContentDTO } from 'wdBean'; 2 +import { CompDTO, ContentDTO } from 'wdBean';
3 import { CommonConstants } from 'wdConstant/Index'; 3 import { CommonConstants } from 'wdConstant/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
@@ -22,23 +22,24 @@ export struct Card2Component { @@ -22,23 +22,24 @@ export struct Card2Component {
22 @State contentDTO: ContentDTO = new ContentDTO(); 22 @State contentDTO: ContentDTO = new ContentDTO();
23 @State loadImg: boolean = false; 23 @State loadImg: boolean = false;
24 @State clicked: boolean = false; 24 @State clicked: boolean = false;
  25 + @ObjectLink compDTO: CompDTO
25 @State titleMarked: boolean = false; 26 @State titleMarked: boolean = false;
26 @State str01: string = ''; 27 @State str01: string = '';
27 @State str02: string = ''; 28 @State str02: string = '';
28 @State str03: string = ''; 29 @State str03: string = '';
29 30
30 async aboutToAppear(): Promise<void> { 31 async aboutToAppear(): Promise<void> {
  32 + this.titleInit();
31 this.loadImg = await onlyWifiLoadImg(); 33 this.loadImg = await onlyWifiLoadImg();
32 // this.clicked = hasClicked(this.contentDTO.objectId) 34 // this.clicked = hasClicked(this.contentDTO.objectId)
33 - this.titleInit();  
34 } 35 }
35 36
36 titleInit() { 37 titleInit() {
37 - if (this.contentDTO.title.includes('<em>') && this.contentDTO.title.includes('</em>')) { 38 + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
38 this.titleMarked = true; 39 this.titleMarked = true;
39 - this.str01 = this.contentDTO.newsTitle?.split('<em>')[0] || '';  
40 - this.str02 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[0] || '';  
41 - 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] || '';
42 } 43 }
43 } 44 }
44 45
@@ -90,7 +91,7 @@ export struct Card2Component { @@ -90,7 +91,7 @@ export struct Card2Component {
90 91
91 //bottom 92 //bottom
92 // 评论等信息 93 // 评论等信息
93 - CardSourceInfo({ contentDTO: this.contentDTO }) 94 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
94 } 95 }
95 .width(CommonConstants.FULL_WIDTH) 96 .width(CommonConstants.FULL_WIDTH)
96 .padding({ 97 .padding({
1 -import { ContentDTO } from 'wdBean';  
2 -import { CommonConstants } from 'wdConstant' 1 +import { CommonConstants } from 'wdConstant';
  2 +import { CompDTO, ContentDTO } from 'wdBean';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 4 +import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
  5 +import { Notes } from './notes';
5 6
6 /** 7 /**
7 * 卡片样式:"appStyle":"3" 8 * 卡片样式:"appStyle":"3"
@@ -11,15 +12,54 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' @@ -11,15 +12,54 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
11 export struct Card3Component { 12 export struct Card3Component {
12 @State contentDTO: ContentDTO = new ContentDTO(); 13 @State contentDTO: ContentDTO = new ContentDTO();
13 @State clicked: boolean = false; 14 @State clicked: boolean = false;
  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 + }
14 34
15 build() { 35 build() {
16 Column() { 36 Column() {
17 - Text(this.contentDTO.newsTitle) 37 + Stack() {
  38 + if (this.contentDTO.newTags) {
  39 + Notes({ newTags: this.contentDTO.newTags })
  40 + } else if (this.contentDTO.objectType == '5') {
  41 + Notes({ objectType: this.contentDTO.objectType })
  42 + }
  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 + }
18 .fontSize($r("app.float.font_size_16")) 53 .fontSize($r("app.float.font_size_16"))
19 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) 54 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
20 .width(CommonConstants.FULL_WIDTH) 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)
  59 + }.alignContent(Alignment.TopStart)
  60 +
21 // 评论等信息 61 // 评论等信息
22 - CardSourceInfo({ contentDTO: this.contentDTO }) 62 + CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO })
23 } 63 }
24 .width(CommonConstants.FULL_WIDTH) 64 .width(CommonConstants.FULL_WIDTH)
25 .padding({ 65 .padding({
1 -import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  7 +
7 const TAG: string = 'Card4Component'; 8 const TAG: string = 'Card4Component';
8 9
9 /** 10 /**
@@ -22,19 +23,19 @@ export struct Card4Component { @@ -22,19 +23,19 @@ export struct Card4Component {
22 @State str01: string = ''; 23 @State str01: string = '';
23 @State str02: string = ''; 24 @State str02: string = '';
24 @State str03: string = ''; 25 @State str03: string = '';
25 - 26 + @ObjectLink compDTO: CompDTO
26 27
27 async aboutToAppear(): Promise<void> { 28 async aboutToAppear(): Promise<void> {
28 - this.loadImg = await onlyWifiLoadImg();  
29 this.titleInit(); 29 this.titleInit();
  30 + this.loadImg = await onlyWifiLoadImg();
30 } 31 }
31 32
32 titleInit() { 33 titleInit() {
33 - if (this.contentDTO.title.includes('<em>') && this.contentDTO.title.includes('</em>')) { 34 + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
34 this.titleMarked = true; 35 this.titleMarked = true;
35 - this.str01 = this.contentDTO.newsTitle?.split('<em>')[0] || '';  
36 - this.str02 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[0] || '';  
37 - 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] || '';
38 } 39 }
39 } 40 }
40 41
@@ -96,7 +97,7 @@ export struct Card4Component { @@ -96,7 +97,7 @@ export struct Card4Component {
96 ProcessUtils.processPage(this.contentDTO) 97 ProcessUtils.processPage(this.contentDTO)
97 }) 98 })
98 //bottom 评论等信息 99 //bottom 评论等信息
99 - CardSourceInfo({ contentDTO: this.contentDTO }) 100 + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
100 } 101 }
101 .width(CommonConstants.FULL_WIDTH) 102 .width(CommonConstants.FULL_WIDTH)
102 .padding({ 103 .padding({
@@ -15,20 +15,34 @@ export struct Card5Component { @@ -15,20 +15,34 @@ 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() {
24 Stack() { 39 Stack() {
25 -  
26 Image(this.loadImg ? this.contentDTO.coverUrl : '') 40 Image(this.loadImg ? this.contentDTO.coverUrl : '')
27 .backgroundColor(0xf5f5f5) 41 .backgroundColor(0xf5f5f5)
28 .width(CommonConstants.FULL_WIDTH) 42 .width(CommonConstants.FULL_WIDTH)
29 .autoResize(true) 43 .autoResize(true)
30 .borderRadius($r('app.float.image_border_radius')) 44 .borderRadius($r('app.float.image_border_radius'))
31 - if (this.titleShowPolicy === 1) { 45 + if (this.titleShowPolicy === 1 || this.titleShowPolicy === null) {
32 Row() 46 Row()
33 .width(CommonConstants.FULL_WIDTH) 47 .width(CommonConstants.FULL_WIDTH)
34 .height(59) 48 .height(59)
@@ -39,18 +53,31 @@ export struct Card5Component { @@ -39,18 +53,31 @@ export struct Card5Component {
39 }) 53 })
40 Row() { 54 Row() {
41 Stack() { 55 Stack() {
42 - if (this.contentDTO.objectType == '5') { 56 + if (this.contentDTO.newTags) {
  57 + Notes({ newTags: this.contentDTO.newTags })
  58 + } else if (this.contentDTO.objectType == '5') {
43 Notes({ objectType: this.contentDTO.objectType }) 59 Notes({ objectType: this.contentDTO.objectType })
44 } 60 }
45 61
46 - Text(this.contentDTO.newsTitle)  
47 - .width(CommonConstants.FULL_WIDTH)  
48 - .fontColor(Color.White)  
49 - .fontSize($r('app.float.normal_text_size'))  
50 - .fontWeight(FontWeight.Bold)  
51 - .maxLines(2)  
52 - .align(Alignment.TopStart)  
53 - .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.font_size_17'))
  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)
54 }.alignContent(Alignment.TopStart) 81 }.alignContent(Alignment.TopStart)
55 } 82 }
56 .justifyContent(FlexAlign.Start) 83 .justifyContent(FlexAlign.Start)
1 -import { ContentDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO } from 'wdBean';
2 import { CommonConstants, CompStyle } from 'wdConstant'; 2 import { CommonConstants, CompStyle } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
6 import { Notes } from './notes'; 6 import { Notes } from './notes';
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 -// import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 8 +import { Logger } from 'wdKit/Index';
9 9
10 const TAG: string = 'Card6Component-Card13Component'; 10 const TAG: string = 'Card6Component-Card13Component';
11 11
@@ -14,15 +14,30 @@ const TAG: string = 'Card6Component-Card13Component'; @@ -14,15 +14,30 @@ const TAG: string = 'Card6Component-Card13Component';
14 */ 14 */
15 @Component 15 @Component
16 export struct Card6Component { 16 export struct Card6Component {
17 - @State contentDTO: ContentDTO = new ContentDTO();  
18 @State loadImg: boolean = false; 17 @State loadImg: boolean = false;
19 @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 = '';
  23 + @ObjectLink compDTO: CompDTO
  24 + @State contentDTO: ContentDTO = new ContentDTO();
20 25
21 async aboutToAppear(): Promise<void> { 26 async aboutToAppear(): Promise<void> {
  27 + this.titleInit();
22 this.loadImg = await onlyWifiLoadImg(); 28 this.loadImg = await onlyWifiLoadImg();
23 // this.clicked = hasClicked(this.contentDTO.objectId) 29 // this.clicked = hasClicked(this.contentDTO.objectId)
24 } 30 }
25 31
  32 + titleInit() {
  33 + if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
  34 + this.titleMarked = true;
  35 + this.str01 = this.contentDTO.title?.split('<em>')[0] || '';
  36 + this.str02 = this.contentDTO.title?.split('<em>')[1].split('</em>')[0] || '';
  37 + this.str03 = this.contentDTO.title?.split('<em>')[1].split('</em>')[1] || '';
  38 + }
  39 + }
  40 +
26 build() { 41 build() {
27 Row() { 42 Row() {
28 Column() { 43 Column() {
@@ -44,7 +59,16 @@ export struct Card6Component { @@ -44,7 +59,16 @@ export struct Card6Component {
44 Notes({ objectType: this.contentDTO.objectType }) 59 Notes({ objectType: this.contentDTO.objectType })
45 } 60 }
46 61
47 - Text(`${this.contentDTO.newsTitle}`) 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 + }
48 .fontColor(this.clicked ? 0x848484 : 0x222222) 72 .fontColor(this.clicked ? 0x848484 : 0x222222)
49 .fontSize(16) 73 .fontSize(16)
50 .lineHeight(24) 74 .lineHeight(24)
@@ -57,12 +81,12 @@ export struct Card6Component { @@ -57,12 +81,12 @@ export struct Card6Component {
57 this.contentDTO.objectType == '5' ? 30 : 0) 81 this.contentDTO.objectType == '5' ? 30 : 0)
58 }.alignContent(Alignment.TopStart) 82 }.alignContent(Alignment.TopStart)
59 83
60 - }.height("75%") 84 + }
61 .justifyContent(FlexAlign.Start) 85 .justifyContent(FlexAlign.Start)
62 86
63 87
64 //bottom 评论等信息 88 //bottom 评论等信息
65 - CardSourceInfo({ contentDTO: this.contentDTO }) 89 + CardSourceInfo({ compDTO: this.compDTO,contentDTO:this.contentDTO })
66 } 90 }
67 .alignItems(HorizontalAlign.Start) 91 .alignItems(HorizontalAlign.Start)
68 .justifyContent(FlexAlign.Start) 92 .justifyContent(FlexAlign.Start)
@@ -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')
1 -import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
@@ -61,7 +61,7 @@ export struct SearchContentComponent { @@ -61,7 +61,7 @@ export struct SearchContentComponent {
61 ProcessUtils.processPage(this.contentDTO) 61 ProcessUtils.processPage(this.contentDTO)
62 }) 62 })
63 //bottom 评论等信息 63 //bottom 评论等信息
64 - CardSourceInfo({ contentDTO: this.contentDTO }) 64 + CardSourceInfo({compDTO:new CompDTO, contentDTO: this.contentDTO })
65 } 65 }
66 .width(CommonConstants.FULL_WIDTH) 66 .width(CommonConstants.FULL_WIDTH)
67 .padding({ 67 .padding({
@@ -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
@@ -190,6 +190,7 @@ export struct CommentIconComponent { @@ -190,6 +190,7 @@ export struct CommentIconComponent {
190 .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + 190 .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) +
191 12)// .backgroundColor(Color.Green) 191 12)// .backgroundColor(Color.Green)
192 .id("Text") 192 .id("Text")
  193 + .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden)
193 // .offset({ 194 // .offset({
194 // x: 3 195 // x: 3
195 // }) 196 // })
@@ -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)
@@ -16,7 +16,7 @@ export struct MessageListUI { @@ -16,7 +16,7 @@ export struct MessageListUI {
16 16
17 aboutToAppear() { 17 aboutToAppear() {
18 this.msgData = MinePageDatasModel.getMessageData() 18 this.msgData = MinePageDatasModel.getMessageData()
19 - this.getHistoryPush() 19 + // this.getHistoryPush()
20 this.getMessagePush() 20 this.getMessagePush()
21 } 21 }
22 22
@@ -58,19 +58,7 @@ export struct MessageListUI { @@ -58,19 +58,7 @@ export struct MessageListUI {
58 if(value.subscribeCount > 0){ 58 if(value.subscribeCount > 0){
59 item.unReadCount = value.subscribeCount 59 item.unReadCount = value.subscribeCount
60 } 60 }
61 - } else if (item.title == "系统消息") {  
62 - if (value.systemInfo != null) {  
63 - if (value.systemInfo.title) {  
64 - item.desc = value.systemInfo.title  
65 - }  
66 - if (value.systemInfo.time) {  
67 - item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "")  
68 - }  
69 - }  
70 - if(value.systemCount > 0){  
71 - item.unReadCount = value.systemCount  
72 - }  
73 - }else if(item.title == "互动消息"){ 61 + } else if(item.title == "互动消息"){
74 if(value.activeCount > 0){ 62 if(value.activeCount > 0){
75 item.unReadCount = value.activeCount 63 item.unReadCount = value.activeCount
76 } 64 }
@@ -82,7 +70,19 @@ export struct MessageListUI { @@ -82,7 +70,19 @@ export struct MessageListUI {
82 item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") 70 item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "")
83 } 71 }
84 } 72 }
85 - } 73 + }/*else if (item.title == "系统消息") {
  74 + if (value.systemInfo != null) {
  75 + if (value.systemInfo.title) {
  76 + item.desc = value.systemInfo.title
  77 + }
  78 + if (value.systemInfo.time) {
  79 + item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "")
  80 + }
  81 + }
  82 + if(value.systemCount > 0){
  83 + item.unReadCount = value.systemCount
  84 + }
  85 + }*/
86 }) 86 })
87 }).catch((err: Error) => { 87 }).catch((err: Error) => {
88 console.log(TAG, JSON.stringify(err)) 88 console.log(TAG, JSON.stringify(err))
@@ -117,7 +117,7 @@ struct BrowsingHistoryPage { @@ -117,7 +117,7 @@ struct BrowsingHistoryPage {
117 .margin({left:16}) 117 .margin({left:16})
118 } 118 }
119 Column() { 119 Column() {
120 - BigPicCardComponent({contentDTO:compDTO}) 120 + BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO})
121 } 121 }
122 } 122 }
123 } 123 }
@@ -62,7 +62,7 @@ export struct MinePageComponent { @@ -62,7 +62,7 @@ export struct MinePageComponent {
62 getMessageData(){ 62 getMessageData(){
63 MinePageDatasModel.getMessageUnReadData().then((value) => { 63 MinePageDatasModel.getMessageUnReadData().then((value) => {
64 if(value !=null) { 64 if(value !=null) {
65 - if(value.activeCount >0 ||value.subscribeCount > 0 || value.systemCount > 0){ 65 + if(value.activeCount >0 ||value.subscribeCount > 0 /*|| value.systemCount > 0*/){
66 this.personalData.forEach((value) => { 66 this.personalData.forEach((value) => {
67 if(value.msg == "消息") 67 if(value.msg == "消息")
68 value.isShowRedPoint = true 68 value.isShowRedPoint = true
@@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel'; @@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' 5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
6 import { ErrorComponent } from '../view/ErrorComponent' 6 import { ErrorComponent } from '../view/ErrorComponent'
7 -import { ContentDTO } from 'wdBean' 7 +import { CompDTO, ContentDTO } from 'wdBean'
8 import NoMoreLayout from './NoMoreLayout' 8 import NoMoreLayout from './NoMoreLayout'
9 import { CustomSelectUI } from '../view/CustomSelectUI'; 9 import { CustomSelectUI } from '../view/CustomSelectUI';
10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@@ -131,7 +131,7 @@ struct MyCollectionListPage { @@ -131,7 +131,7 @@ struct MyCollectionListPage {
131 .margin({left:16}) 131 .margin({left:16})
132 } 132 }
133 Column() { 133 Column() {
134 - BigPicCardComponent({contentDTO:compDTO}) 134 + BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO})
135 } 135 }
136 } 136 }
137 } 137 }
@@ -14,6 +14,7 @@ import PageNoMoreLayout from './PageNoMoreLayout'; @@ -14,6 +14,7 @@ import PageNoMoreLayout from './PageNoMoreLayout';
14 import { NoMoreBean } from './NoMoreBean'; 14 import { NoMoreBean } from './NoMoreBean';
15 import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; 15 import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
16 import RefreshLayout from '../refresh/RefreshLayout'; 16 import RefreshLayout from '../refresh/RefreshLayout';
  17 +import json from '@ohos.util.json';
17 18
18 const TAG = 'PageComponent'; 19 const TAG = 'PageComponent';
19 20
@@ -80,8 +81,7 @@ export struct PageComponent { @@ -80,8 +81,7 @@ export struct PageComponent {
80 } 81 }
81 } 82 }
82 }, 83 },
83 - (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp  
84 - ) 84 + (compDTO: CompDTO, compIndex: number) => JSON.stringify(compDTO))
85 85
86 // 加载更多 86 // 加载更多
87 ListItem() { 87 ListItem() {
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent' 2 import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent'
3 import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent' 3 import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent'
4 -import { Logger } from 'wdKit' 4 +import { Logger, WindowModel } from 'wdKit'
5 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' 5 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
6 import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent' 6 import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent'
7 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' 7 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
@@ -121,8 +121,8 @@ struct PeopleShipHomePage { @@ -121,8 +121,8 @@ struct PeopleShipHomePage {
121 } 121 }
122 122
123 aboutToAppear() { 123 aboutToAppear() {
124 -  
125 - this.getData() 124 + WindowModel.shared.setWindowLayoutFullScreen(false)
  125 + this.getData()
126 } 126 }
127 127
128 private async getData() { 128 private async getData() {
1 -import { ContentDTO , Action,GoldenPositionExtraBean} from 'wdBean'; 1 +import { ContentDTO , Action,GoldenPositionExtraBean, CompDTO} from 'wdBean';
2 import { CommonConstants ,ViewType} from 'wdConstant'; 2 import { CommonConstants ,ViewType} from 'wdConstant';
3 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
4 import PageModel from '../../viewmodel/PageModel'; 4 import PageModel from '../../viewmodel/PageModel';
@@ -128,7 +128,7 @@ struct ThemeListPage { @@ -128,7 +128,7 @@ struct ThemeListPage {
128 LazyForEach(this.pageModel.compList, (contentDTO: ContentDTO, contentIndex: number) => { 128 LazyForEach(this.pageModel.compList, (contentDTO: ContentDTO, contentIndex: number) => {
129 ListItem() { 129 ListItem() {
130 Column() { 130 Column() {
131 - CardParser({ contentDTO }); 131 + CardParser({compDTO:new CompDTO, contentDTO });
132 } 132 }
133 } 133 }
134 }, 134 },
@@ -8,7 +8,8 @@ import { @@ -8,7 +8,8 @@ import {
8 AttentionBatchDTO, 8 AttentionBatchDTO,
9 CreatorDTO, 9 CreatorDTO,
10 contentListParams, 10 contentListParams,
11 - InteractDataDTO 11 + InteractDataDTO,
  12 + CompDTO
12 } from 'wdBean'; 13 } from 'wdBean';
13 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; 14 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
14 import { channelSkeleton } from '../skeleton/channelSkeleton' 15 import { channelSkeleton } from '../skeleton/channelSkeleton'
@@ -150,7 +151,7 @@ export struct PeopleShipMainComponent { @@ -150,7 +151,7 @@ export struct PeopleShipMainComponent {
150 } 151 }
151 ForEach(this.attentionList, (item: ContentDTO) => { 152 ForEach(this.attentionList, (item: ContentDTO) => {
152 ListItem() { 153 ListItem() {
153 - CardParser({ contentDTO: item }) 154 + CardParser({compDTO:new CompDTO, contentDTO: item })
154 }.width("100%") 155 }.width("100%")
155 .backgroundColor(Color.Transparent) 156 .backgroundColor(Color.Transparent)
156 157
@@ -12,7 +12,8 @@ import { @@ -12,7 +12,8 @@ import {
12 InteractDataDTO, 12 InteractDataDTO,
13 ArticleTypeData, 13 ArticleTypeData,
14 ArticleListData, 14 ArticleListData,
15 - PeopleShipUserDetailData 15 + PeopleShipUserDetailData,
  16 + CompDTO
16 } from 'wdBean' 17 } from 'wdBean'
17 import { CardParser } from '../CardParser' 18 import { CardParser } from '../CardParser'
18 import { PageRepository } from '../../repository/PageRepository' 19 import { PageRepository } from '../../repository/PageRepository'
@@ -79,7 +80,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -79,7 +80,7 @@ export struct PeopleShipHomeArticleListComponent {
79 // 下拉刷新 80 // 下拉刷新
80 ForEach(this.arr, (item: ContentDTO) => { 81 ForEach(this.arr, (item: ContentDTO) => {
81 ListItem() { 82 ListItem() {
82 - CardParser({ contentDTO: item }) 83 + CardParser({compDTO:new CompDTO, contentDTO: item })
83 }.width("100%") 84 }.width("100%")
84 .backgroundColor(Color.Transparent) 85 .backgroundColor(Color.Transparent)
85 }, (item: ContentDTO, index: number) => item.objectId + index.toString()) 86 }, (item: ContentDTO, index: number) => item.objectId + index.toString())
1 -import { ContentDTO } from 'wdBean/Index' 1 +import { CompDTO, ContentDTO } from 'wdBean/Index'
2 import { LazyDataSource, UserDataLocal } from 'wdKit/Index' 2 import { LazyDataSource, UserDataLocal } from 'wdKit/Index'
3 import { HttpUtils } from 'wdNetwork/Index' 3 import { HttpUtils } from 'wdNetwork/Index'
4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
@@ -96,7 +96,7 @@ export struct SearchResultComponent { @@ -96,7 +96,7 @@ export struct SearchResultComponent {
96 LazyForEach(this.data, (item: ContentDTO, index: number) => { 96 LazyForEach(this.data, (item: ContentDTO, index: number) => {
97 ListItem() { 97 ListItem() {
98 Column() { 98 Column() {
99 - CardParser({contentDTO:item}) 99 + CardParser({compDTO:new CompDTO,contentDTO:item})
100 if (index != this.data.totalCount() - 1) { 100 if (index != this.data.totalCount() - 1) {
101 Divider() 101 Divider()
102 .width('100%') 102 .width('100%')
1 import { 1 import {
  2 + CompDTO,
2 ContentDTO, 3 ContentDTO,
3 contentListParams, 4 contentListParams,
4 FullColumnImgUrlDTO, 5 FullColumnImgUrlDTO,
@@ -105,7 +106,9 @@ export struct SearchResultContentComponent { @@ -105,7 +106,9 @@ export struct SearchResultContentComponent {
105 } else { 106 } else {
106 this.bean.cnFansNum = item.fansNum + "" 107 this.bean.cnFansNum = item.fansNum + ""
107 } 108 }
108 - this.bean.introduction = item.introduction 109 + let regex:RegExp = new RegExp('\n','g')
  110 + this.bean.introduction = item.introduction.replace(regex,'')
  111 +
109 this.bean.mainControl = item.mainControl 112 this.bean.mainControl = item.mainControl
110 this.bean.banControl = item.banControl 113 this.bean.banControl = item.banControl
111 this.bean.cnUserType = item.userType 114 this.bean.cnUserType = item.userType
@@ -243,7 +246,7 @@ export struct SearchResultContentComponent { @@ -243,7 +246,7 @@ export struct SearchResultContentComponent {
243 if (this.searchType == "activity") { 246 if (this.searchType == "activity") {
244 ActivityItemComponent({ contentDTO: item }) 247 ActivityItemComponent({ contentDTO: item })
245 } else { 248 } else {
246 - CardParser({ contentDTO: item }) 249 + CardParser({compDTO:new CompDTO, contentDTO: item })
247 } 250 }
248 if (index != this.data.totalCount() - 1) { 251 if (index != this.data.totalCount() - 1) {
249 Divider() 252 Divider()
@@ -453,6 +456,7 @@ export struct SearchResultContentComponent { @@ -453,6 +456,7 @@ export struct SearchResultContentComponent {
453 contentDTO.openType = ''; 456 contentDTO.openType = '';
454 contentDTO.extra = ''; 457 contentDTO.extra = '';
455 contentDTO.titleShow = value.data.type == "5" ? 1 : 0; 458 contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
  459 + contentDTO.contentText = value.data.contentText;
456 460
457 return contentDTO; 461 return contentDTO;
458 } 462 }
@@ -14,7 +14,7 @@ const TAG: string = 'BigPicCardComponent'; @@ -14,7 +14,7 @@ const TAG: string = 'BigPicCardComponent';
14 // @Entry 14 // @Entry
15 @Component 15 @Component
16 export struct BigPicCardComponent { 16 export struct BigPicCardComponent {
17 - @State compDTO: CompDTO = {} as CompDTO 17 + @ObjectLink compDTO: CompDTO
18 contentDTO: ContentDTO = new ContentDTO(); 18 contentDTO: ContentDTO = new ContentDTO();
19 19
20 aboutToAppear() { 20 aboutToAppear() {
@@ -110,7 +110,7 @@ export struct BigPicCardComponent { @@ -110,7 +110,7 @@ export struct BigPicCardComponent {
110 110
111 @Builder 111 @Builder
112 cardBuild() { 112 cardBuild() {
113 - CardParser({ contentDTO: this.contentDTO }); 113 + CardParser({ compDTO: this.compDTO, contentDTO: this.contentDTO });
114 } 114 }
115 } 115 }
116 116
@@ -121,7 +121,8 @@ export struct BigPicCardComponent { @@ -121,7 +121,8 @@ export struct BigPicCardComponent {
121 */ 121 */
122 @Component 122 @Component
123 export struct myBigCard_body { 123 export struct myBigCard_body {
124 - private newsSrc: string = "https://k.sinaimg.cn/n/default/crawl/190/w550h440/20240118/6772-7c2385bb2741c6f88906af3514d27343.png/w700d1q75cms.jpg"; 124 + private newsSrc: string =
  125 + "https://k.sinaimg.cn/n/default/crawl/190/w550h440/20240118/6772-7c2385bb2741c6f88906af3514d27343.png/w700d1q75cms.jpg";
125 private newsTitle: string = "时政微观察丨新征程金融工作怎么干?“新年第一课”这样讲"; 126 private newsTitle: string = "时政微观察丨新征程金融工作怎么干?“新年第一课”这样讲";
126 127
127 build() { 128 build() {
@@ -55,10 +55,10 @@ export struct LikeComponent { @@ -55,10 +55,10 @@ export struct LikeComponent {
55 } else if (this.componentType == 4) { 55 } else if (this.componentType == 4) {
56 // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 56 // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量
57 this.likeCompStyle4() 57 this.likeCompStyle4()
58 - } else if (this.componentType == 5) { 58 + } else if (this.componentType == 5) {
59 // 图集点赞,展示标识 59 // 图集点赞,展示标识
60 this.likeCompStyle5() 60 this.likeCompStyle5()
61 - }else { 61 + } else {
62 //1: 底部栏目样式 默认样式 62 //1: 底部栏目样式 默认样式
63 this.likeCompStyle1() 63 this.likeCompStyle1()
64 } 64 }
@@ -188,7 +188,7 @@ export struct LikeComponent { @@ -188,7 +188,7 @@ export struct LikeComponent {
188 .alignItems(VerticalAlign.Center) 188 .alignItems(VerticalAlign.Center)
189 .position({ x: '100%', }) 189 .position({ x: '100%', })
190 .markAnchor({ x: '100%' }) 190 .markAnchor({ x: '100%' })
191 - .backgroundImage(this.likeStatus? $r('app.media.ic_like_back_Select'):$r('app.media.ic_like_back')) 191 + .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back'))
192 .backgroundImageSize(ImageSize.Auto) 192 .backgroundImageSize(ImageSize.Auto)
193 .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) 193 .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
194 }.width(24).height(24) 194 }.width(24).height(24)
@@ -209,7 +209,7 @@ export struct LikeComponent { @@ -209,7 +209,7 @@ export struct LikeComponent {
209 .width(36) 209 .width(36)
210 .height(36) 210 .height(36)
211 .borderRadius(18) 211 .borderRadius(18)
212 - .backgroundColor(this.pageComponentType === 4 ? '#4D000000' : '#FFF5F5F5') 212 + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5')
213 213
214 214
215 Row() { 215 Row() {
1 -import { ContentDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant'; 2 import { CommonConstants } from 'wdConstant';
3 import { CardParser } from '../CardParser'; 3 import { CardParser } from '../CardParser';
4 4
@@ -29,7 +29,7 @@ export struct RecommendList { @@ -29,7 +29,7 @@ export struct RecommendList {
29 } 29 }
30 ForEach(this.recommendList, (item: ContentDTO, index: number) => { 30 ForEach(this.recommendList, (item: ContentDTO, index: number) => {
31 Row() { 31 Row() {
32 - CardParser({ contentDTO: item }); 32 + CardParser({ compDTO:new CompDTO,contentDTO: item });
33 } 33 }
34 if (this.recommendList.length !== index + 1) { 34 if (this.recommendList.length !== index + 1) {
35 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 35 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
@@ -112,13 +112,13 @@ class MinePageDatasModel{ @@ -112,13 +112,13 @@ class MinePageDatasModel{
112 * 包含名字和图标 112 * 包含名字和图标
113 */ 113 */
114 getMessageData():MessageItem[]{ 114 getMessageData():MessageItem[]{
115 - if(this.messageData.length === 4){ 115 + if(this.messageData.length === 2){
116 return this.messageData 116 return this.messageData
117 } 117 }
118 this.messageData.push(new MessageItem($r('app.media.msg_interact'),"互动消息","","")) 118 this.messageData.push(new MessageItem($r('app.media.msg_interact'),"互动消息","",""))
119 this.messageData.push(new MessageItem($r('app.media.msg_reserve'),"预约消息","","")) 119 this.messageData.push(new MessageItem($r('app.media.msg_reserve'),"预约消息","",""))
120 - this.messageData.push(new MessageItem($r('app.media.msg_history'),"历史推送","",""))  
121 - this.messageData.push(new MessageItem($r('app.media.msg_system'),"系统消息","","")) 120 + // this.messageData.push(new MessageItem($r('app.media.msg_history'),"历史推送","",""))
  121 + // this.messageData.push(new MessageItem($r('app.media.msg_system'),"系统消息","",""))
122 return this.messageData 122 return this.messageData
123 } 123 }
124 124
@@ -52,13 +52,13 @@ export class PageHelper { @@ -52,13 +52,13 @@ export class PageHelper {
52 52
53 getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { 53 getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) {
54 pageModel.currentPage = 1; 54 pageModel.currentPage = 1;
55 - if(pageModel.pageType == 1){  
56 - PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => {  
57 - if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){ 55 + if (pageModel.pageType == 1) {
  56 + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => {
  57 + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
58 pageModel.viewType = ViewType.EMPTY; 58 pageModel.viewType = ViewType.EMPTY;
59 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; 59 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
60 return; 60 return;
61 - }else{ 61 + } else {
62 //更新数据 62 //更新数据
63 pageModel.compList.addItems(liveReviewDTO.list); 63 pageModel.compList.addItems(liveReviewDTO.list);
64 closeRefresh(pageModel, true); 64 closeRefresh(pageModel, true);
@@ -66,7 +66,7 @@ export class PageHelper { @@ -66,7 +66,7 @@ export class PageHelper {
66 }).catch((err: string | Resource) => { 66 }).catch((err: string | Resource) => {
67 promptAction.showToast({ message: err }); 67 promptAction.showToast({ message: err });
68 }) 68 })
69 - }else{ 69 + } else {
70 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { 70 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
71 if (pageInfo == null) { 71 if (pageInfo == null) {
72 pageModel.viewType = ViewType.EMPTY; 72 pageModel.viewType = ViewType.EMPTY;
@@ -103,7 +103,7 @@ export class PageHelper { @@ -103,7 +103,7 @@ export class PageHelper {
103 let index = pageInfo.groups.indexOf(group) 103 let index = pageInfo.groups.indexOf(group)
104 if (index == 0) { 104 if (index == 0) {
105 // 清空comp列表 105 // 清空comp列表
106 - pageModel.compList.clear() 106 + pageModel.compList.clearAllData()
107 } 107 }
108 this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) 108 this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1)
109 109
@@ -119,7 +119,6 @@ export class PageHelper { @@ -119,7 +119,6 @@ export class PageHelper {
119 } 119 }
120 120
121 private async getGroupData(pageModel: PageModel, pageDto: PageDTO, isLastGroup: boolean) { 121 private async getGroupData(pageModel: PageModel, pageDto: PageDTO, isLastGroup: boolean) {
122 - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
123 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 122 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
124 pageModel.viewType = ViewType.LOADED; 123 pageModel.viewType = ViewType.LOADED;
125 if (isLastGroup) { 124 if (isLastGroup) {
@@ -135,12 +134,9 @@ export class PageHelper { @@ -135,12 +134,9 @@ export class PageHelper {
135 // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) 134 // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上)
136 // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 135 // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换
137 // 二次请求,批查互动数据 136 // 二次请求,批查互动数据
138 - PageViewModel.getInteractData(pageDto.compList).then((data: InteractDataDTO[]) => {  
139 - // 刷新,替换所有数据  
140 - this.resetInteract(data, pageModel.compList)  
141 - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
142 - pageModel.compList.reloadData()  
143 - }) 137 + this.allCompBatchRequest(pageDto.compList, pageModel)
  138 +
  139 +
144 // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll 140 // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll
145 if (isLastGroup) { 141 if (isLastGroup) {
146 closeRefresh(pageModel, true); 142 closeRefresh(pageModel, true);
@@ -185,7 +181,7 @@ export class PageHelper { @@ -185,7 +181,7 @@ export class PageHelper {
185 let layoutAdvIndex = 0; //稿件投放统计 181 let layoutAdvIndex = 0; //稿件投放统计
186 // 升序排序 182 // 升序排序
187 compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) 183 compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position)
188 - // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); 184 + // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList));
189 //当前日期 185 //当前日期
190 let serverTimeLong: number = DateTimeUtils.getTimeStamp(); 186 let serverTimeLong: number = DateTimeUtils.getTimeStamp();
191 for (let advBean of compAdvList) { 187 for (let advBean of compAdvList) {
@@ -277,11 +273,9 @@ export class PageHelper { @@ -277,11 +273,9 @@ export class PageHelper {
277 // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) 273 // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b)
278 if (b <= pageCompSize && b >= 0) { 274 if (b <= pageCompSize && b >= 0) {
279 275
280 - let advComp: CompDTO = {  
281 - compStyle: CompStyle.Card_Comp_Adv,  
282 - matInfo: matInfo  
283 - } as CompDTO;  
284 - 276 + let advComp: CompDTO = new CompDTO;
  277 + advComp.compStyle = CompStyle.Card_Comp_Adv
  278 + advComp.matInfo = matInfo
285 if (pageCompSize == slotInfo.position) { 279 if (pageCompSize == slotInfo.position) {
286 pageCompList.add(advComp) 280 pageCompList.add(advComp)
287 } else { 281 } else {
@@ -307,12 +301,12 @@ export class PageHelper { @@ -307,12 +301,12 @@ export class PageHelper {
307 */ 301 */
308 private compLoadMore(pageModel: PageModel) { 302 private compLoadMore(pageModel: PageModel) {
309 //聚合页 303 //聚合页
310 - if(pageModel.pageType == 1){  
311 - PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => {  
312 - if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){ 304 + if (pageModel.pageType == 1) {
  305 + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => {
  306 + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
313 pageModel.hasMore = false; 307 pageModel.hasMore = false;
314 return; 308 return;
315 - }else{ 309 + } else {
316 //更新数据 310 //更新数据
317 pageModel.compList.addItems(liveReviewDTO.list); 311 pageModel.compList.addItems(liveReviewDTO.list);
318 // 直接认为有分页,一直加载分页。直到没有数据,再停止 312 // 直接认为有分页,一直加载分页。直到没有数据,再停止
@@ -323,10 +317,9 @@ export class PageHelper { @@ -323,10 +317,9 @@ export class PageHelper {
323 }).catch((err: string | Resource) => { 317 }).catch((err: string | Resource) => {
324 promptAction.showToast({ message: err }); 318 promptAction.showToast({ message: err });
325 }) 319 })
326 - }else{ 320 + } else {
327 PageViewModel.getPageData(pageModel.bizCopy()) 321 PageViewModel.getPageData(pageModel.bizCopy())
328 .then((data: PageDTO) => { 322 .then((data: PageDTO) => {
329 - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
330 if (data == null || data.compList == null || data.compList.length == 0) { 323 if (data == null || data.compList == null || data.compList.length == 0) {
331 pageModel.hasMore = false; 324 pageModel.hasMore = false;
332 } else { 325 } else {
@@ -336,14 +329,8 @@ export class PageHelper { @@ -336,14 +329,8 @@ export class PageHelper {
336 329
337 //移除音频 和 活动 330 //移除音频 和 活动
338 this.collectPageComp(pageModel, data) 331 this.collectPageComp(pageModel, data)
339 -  
340 - // TODO 暂时屏蔽,此处代码会造成 广告逻辑错乱,只有第一页有广告数据,随着加载更多,第二页也会出现广告数据  
341 - PageViewModel.getInteractData(data.compList).then((data: InteractDataDTO[]) => {  
342 - // 刷新,替换所有数据  
343 - this.resetInteract(data, pageModel.compList)  
344 - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
345 - pageModel.compList.reloadData()  
346 - }) 332 + // 参与批查
  333 + this.allCompBatchRequest(data.compList, pageModel)
347 } 334 }
348 }).catch((err: string | Resource) => { 335 }).catch((err: string | Resource) => {
349 promptAction.showToast({ message: err }); 336 promptAction.showToast({ message: err });
@@ -351,6 +338,30 @@ export class PageHelper { @@ -351,6 +338,30 @@ export class PageHelper {
351 } 338 }
352 } 339 }
353 340
  341 + /**
  342 + * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口
  343 + * @param compList
  344 + * @param pageModel
  345 + */
  346 + private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) {
  347 + PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => {
  348 + // 刷新,替换所有数据
  349 + this.resetInteract(data, pageModel.compList)
  350 + })
  351 +
  352 + // 测试数据
  353 + // setTimeout(() => {
  354 + // let index = 1
  355 + // let comp = pageModel.compList.getData(index) as CompDTO
  356 + // comp.hasMore = 0
  357 + // //comp.operDataList[0].newsTitle = '测试111'
  358 + // let con :InteractDataDTO = new InteractDataDTO;
  359 + // con.commentNum=1000
  360 + // comp.operDataList[0].interactData = con
  361 + // Logger.debug("ZZZXXXXX",
  362 + // "-----setTimeout--------->" + comp.hasMore)
  363 + // }, 4 * 1000)
  364 + }
354 365
355 /** 366 /**
356 * 移除comp 367 * 移除comp
@@ -359,9 +370,7 @@ export class PageHelper { @@ -359,9 +370,7 @@ export class PageHelper {
359 370
360 let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 371 let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器
361 372
362 - let datas = pageDto.compList  
363 - for (let index = 0; index < datas.length; index++) {  
364 - const element = datas[index]; 373 + pageDto.compList.forEach((element: CompDTO) => {
365 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); 374 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
366 //移除音频 和 活动 375 //移除音频 和 活动
367 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { 376 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
@@ -372,24 +381,21 @@ export class PageHelper { @@ -372,24 +381,21 @@ export class PageHelper {
372 } else { 381 } else {
373 pageCompList.add(element) 382 pageCompList.add(element)
374 } 383 }
375 -  
376 } 384 }
377 - } 385 +
  386 + })
378 387
379 // 记录 388 // 记录
380 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize 389 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
381 - // console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize);  
382 390
383 // 处理页面广告数据,投放到页面的位置 391 // 处理页面广告数据,投放到页面的位置
384 this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); 392 this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto);
385 393
386 -  
387 //遍历所有组件和稿件数据 push到页面 394 //遍历所有组件和稿件数据 push到页面
388 for (let element of pageCompList) { 395 for (let element of pageCompList) {
389 - pageModel.compList.push(element) 396 + pageModel.compList.push(CompDTO.createNewsBean(element))
390 } 397 }
391 398
392 -  
393 } 399 }
394 400
395 /** 401 /**
@@ -401,6 +407,7 @@ export class PageHelper { @@ -401,6 +407,7 @@ export class PageHelper {
401 if (interact == null || interact.length == 0) { 407 if (interact == null || interact.length == 0) {
402 return 408 return
403 } 409 }
  410 + let time = DateTimeUtils.getTimeStamp().toString()
404 interact.forEach((interactData) => { 411 interact.forEach((interactData) => {
405 let id = interactData.contentId; 412 let id = interactData.contentId;
406 outer: for (let i = 0; i < compList.totalCount(); i++) { 413 outer: for (let i = 0; i < compList.totalCount(); i++) {
@@ -415,6 +422,7 @@ export class PageHelper { @@ -415,6 +422,7 @@ export class PageHelper {
415 } 422 }
416 if (id == content.objectId) { 423 if (id == content.objectId) {
417 content.interactData = interactData; 424 content.interactData = interactData;
  425 + comp.timestamp = time
418 break outer; 426 break outer;
419 } 427 }
420 } 428 }
@@ -13,6 +13,7 @@ import { @@ -13,6 +13,7 @@ import {
13 NavigationDetailDTO, 13 NavigationDetailDTO,
14 LiveRoomDataBean 14 LiveRoomDataBean
15 } from 'wdBean'; 15 } from 'wdBean';
  16 +import { CompStyle } from 'wdConstant/Index';
16 17
17 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; 18 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
18 import { ResponseDTO, } from 'wdNetwork'; 19 import { ResponseDTO, } from 'wdNetwork';
@@ -48,14 +49,15 @@ export class PageViewModel extends BaseViewModel { @@ -48,14 +49,15 @@ export class PageViewModel extends BaseViewModel {
48 return this.getNavData(); 49 return this.getNavData();
49 } 50 }
50 51
51 - async getBottomNavDetailData(id:number): Promise<NavigationDetailDTO> { 52 + async getBottomNavDetailData(id: number): Promise<NavigationDetailDTO> {
52 Logger.info(TAG, `getBottomNavDetailData start`); 53 Logger.info(TAG, `getBottomNavDetailData start`);
53 return this.getNavDetailData(id); 54 return this.getNavDetailData(id);
54 } 55 }
55 56
56 async getBottomNavDataMock(context: Context): Promise<NavigationBodyDTO> { 57 async getBottomNavDataMock(context: Context): Promise<NavigationBodyDTO> {
57 Logger.info(TAG, `getBottomNavDataMock start`); 58 Logger.info(TAG, `getBottomNavDataMock start`);
58 - let compRes: ResponseDTO<NavigationBodyDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<NavigationBodyDTO>>(context, 'bottom_nav.json'); 59 + let compRes: ResponseDTO<NavigationBodyDTO> | null =
  60 + await ResourcesUtils.getResourcesJson<ResponseDTO<NavigationBodyDTO>>(context, 'bottom_nav.json');
59 if (!compRes || !compRes.data) { 61 if (!compRes || !compRes.data) {
60 Logger.info(TAG, `getBottomNavDataMock compRes bottomNavList is empty`); 62 Logger.info(TAG, `getBottomNavDataMock compRes bottomNavList is empty`);
61 return {} as NavigationBodyDTO 63 return {} as NavigationBodyDTO
@@ -88,7 +90,7 @@ export class PageViewModel extends BaseViewModel { @@ -88,7 +90,7 @@ export class PageViewModel extends BaseViewModel {
88 }) 90 })
89 } 91 }
90 92
91 - private getNavDetailData(id:number): Promise<NavigationDetailDTO> { 93 + private getNavDetailData(id: number): Promise<NavigationDetailDTO> {
92 return new Promise<NavigationDetailDTO>((success, error) => { 94 return new Promise<NavigationDetailDTO>((success, error) => {
93 Logger.info(TAG, `getNavData start`); 95 Logger.info(TAG, `getNavData start`);
94 PageRepository.fetchNavigationDetailDataApi(id).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => { 96 PageRepository.fetchNavigationDetailDataApi(id).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => {
@@ -122,7 +124,8 @@ export class PageViewModel extends BaseViewModel { @@ -122,7 +124,8 @@ export class PageViewModel extends BaseViewModel {
122 // 加载更多,返回无数据 124 // 加载更多,返回无数据
123 return {} as PageDTO 125 return {} as PageDTO
124 } 126 }
125 - let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context, 'comp_list0.json'); 127 + let compRes: ResponseDTO<PageDTO> | null =
  128 + await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context, 'comp_list0.json');
126 if (!compRes || !compRes.data) { 129 if (!compRes || !compRes.data) {
127 Logger.info(TAG, `getCompList compRes is empty`); 130 Logger.info(TAG, `getCompList compRes is empty`);
128 return {} as PageDTO 131 return {} as PageDTO
@@ -164,7 +167,8 @@ export class PageViewModel extends BaseViewModel { @@ -164,7 +167,8 @@ export class PageViewModel extends BaseViewModel {
164 } 167 }
165 168
166 private async getPageData2(context: Context): Promise<PageDTO> { 169 private async getPageData2(context: Context): Promise<PageDTO> {
167 - let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context, 'comp_list2.json'); 170 + let compRes: ResponseDTO<PageDTO> | null =
  171 + await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context, 'comp_list2.json');
168 if (!compRes || !compRes.data) { 172 if (!compRes || !compRes.data) {
169 Logger.info(TAG, `getCompList compRes is empty`); 173 Logger.info(TAG, `getCompList compRes is empty`);
170 return {} as PageDTO 174 return {} as PageDTO
@@ -339,15 +343,24 @@ export class PageViewModel extends BaseViewModel { @@ -339,15 +343,24 @@ export class PageViewModel extends BaseViewModel {
339 param.contentList = new Array<ContentBean>(); 343 param.contentList = new Array<ContentBean>();
340 compList.forEach((value) => { 344 compList.forEach((value) => {
341 let contentList = value.operDataList; 345 let contentList = value.operDataList;
342 - if (contentList != null && contentList.length > 0) {  
343 - contentList.forEach((v) => {  
344 - if (StringUtils.isNotEmpty(v.objectId)) {  
345 - let bean = {} as ContentBean;  
346 - bean.contentId = v.objectId;  
347 - bean.contentType = v.objectType;  
348 - param.contentList.push(bean);  
349 - }  
350 - }) 346 +
  347 + let letBatch = false
  348 + // 只有稿件才能批查
  349 + if (!Number.isNaN(Number(value.compStyle))) {
  350 + letBatch = true
  351 + }
  352 +
  353 + if (letBatch) {
  354 + if (contentList != null && contentList.length == 1) { // 对只有一条数据的稿件参与批查
  355 + contentList.forEach((v) => {
  356 + if (StringUtils.isNotEmpty(v.objectId)) {
  357 + let bean = {} as ContentBean;
  358 + bean.contentId = v.objectId;
  359 + bean.contentType = v.objectType;
  360 + param.contentList.push(bean);
  361 + }
  362 + })
  363 + }
351 } 364 }
352 }) 365 })
353 return param; 366 return param;
@@ -414,7 +427,7 @@ export class PageViewModel extends BaseViewModel { @@ -414,7 +427,7 @@ export class PageViewModel extends BaseViewModel {
414 }) 427 })
415 } 428 }
416 429
417 - async postThemeList(pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> { 430 + async postThemeList(pageNum: number, pageSize: number, extra: string): Promise<LiveReviewDTO> {
418 let bean: GoldenPositionExtraBean = JSON.parse(extra) 431 let bean: GoldenPositionExtraBean = JSON.parse(extra)
419 bean.pageNum = pageNum 432 bean.pageNum = pageNum
420 bean.pageSize = pageSize 433 bean.pageSize = pageSize
@@ -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 }
@@ -198,6 +199,7 @@ export struct DetailPlayShortVideoPage { @@ -198,6 +199,7 @@ export struct DetailPlayShortVideoPage {
198 }) 199 })
199 200
200 } 201 }
  202 + .width('100%')
201 .layoutWeight(1) 203 .layoutWeight(1)
202 .onClick(() => { 204 .onClick(() => {
203 this.playerController?.switchPlayOrPause(); 205 this.playerController?.switchPlayOrPause();
@@ -222,9 +224,10 @@ export struct DetailPlayShortVideoPage { @@ -222,9 +224,10 @@ export struct DetailPlayShortVideoPage {
222 } 224 }
223 .height('100%') 225 .height('100%')
224 .width('100%') 226 .width('100%')
225 - .padding({  
226 - top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'  
227 - }) 227 +
  228 + // .padding({
  229 + // top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'
  230 + // })
228 231
229 if (this.showCommentList) { 232 if (this.showCommentList) {
230 CommentComponentPage({}) 233 CommentComponentPage({})
@@ -258,15 +258,12 @@ export struct VideoChannelDetail { @@ -258,15 +258,12 @@ export struct VideoChannelDetail {
258 .visibility(this.isMouted ? Visibility.None : Visibility.Visible) 258 .visibility(this.isMouted ? Visibility.None : Visibility.Visible)
259 Swiper(this.swiperController) { 259 Swiper(this.swiperController) {
260 ForEach(this.data, (item: ContentDetailDTO, index: number) => { 260 ForEach(this.data, (item: ContentDetailDTO, index: number) => {
261 - Column() {  
262 - DetailPlayShortVideoPage({  
263 - contentDetailData: item,  
264 - currentIndex: this.currentIndex,  
265 - index: index,  
266 - interactData: this.interactDataList[index]  
267 - })  
268 - }.width('100%')  
269 - .height('100%') 261 + DetailPlayShortVideoPage({
  262 + contentDetailData: item,
  263 + currentIndex: this.currentIndex,
  264 + index: index,
  265 + interactData: this.interactDataList[index]
  266 + })
270 }, (item: ContentDetailDTO) => item.newsId + '') 267 }, (item: ContentDetailDTO) => item.newsId + '')
271 } 268 }
272 .displayCount(1, true) 269 .displayCount(1, true)
@@ -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%')
1 import AbilityConstant from '@ohos.app.ability.AbilityConstant'; 1 import AbilityConstant from '@ohos.app.ability.AbilityConstant';
  2 +import app from '@system.app';
2 import hilog from '@ohos.hilog'; 3 import hilog from '@ohos.hilog';
3 import UIAbility from '@ohos.app.ability.UIAbility'; 4 import UIAbility from '@ohos.app.ability.UIAbility';
4 import Want from '@ohos.app.ability.Want'; 5 import Want from '@ohos.app.ability.Want';
5 import window from '@ohos.window'; 6 import window from '@ohos.window';
6 import { BusinessError } from '@ohos.base'; 7 import { BusinessError } from '@ohos.base';
7 -import { EmitterEventId, EmitterUtils, WindowModel } from 'wdKit'; 8 +import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit';
8 import { ConfigurationConstant } from '@kit.AbilityKit'; 9 import { ConfigurationConstant } from '@kit.AbilityKit';
9 import { WDPushNotificationManager } from 'wdHwAbility/Index'; 10 import { WDPushNotificationManager } from 'wdHwAbility/Index';
10 import { StartupManager } from '../startupmanager/StartupManager'; 11 import { StartupManager } from '../startupmanager/StartupManager';
@@ -18,6 +19,11 @@ export default class EntryAbility extends UIAbility { @@ -18,6 +19,11 @@ export default class EntryAbility extends UIAbility {
18 19
19 // 还没深色模式需求,暂直接不跟随系统。 20 // 还没深色模式需求,暂直接不跟随系统。
20 this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); 21 this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT);
  22 +
  23 +
  24 + app.setImageRawDataCacheSize(100) // 100 设置内存中缓存解码后图片的数量上限,单位为 number。
  25 + app.setImageCacheCount(100 * 1024 * 1024) // 设置解码前图片数据内存缓存上限为100MB。设置内存中缓存解码前图片数据的大小上限,单位为字节。
  26 + app.setImageFileCacheSize(100 * 1024 * 1024) // 设置图片文件缓存的大小上限,单位为字节
21 } 27 }
22 28
23 // App活着情况下,点击推送通知进入 29 // App活着情况下,点击推送通知进入
@@ -52,16 +58,30 @@ export default class EntryAbility extends UIAbility { @@ -52,16 +58,30 @@ export default class EntryAbility extends UIAbility {
52 console.info('floatWindowClass audioWidth' + audioWidth); 58 console.info('floatWindowClass audioWidth' + audioWidth);
53 59
54 60
55 - // let a = new WindowModel();  
56 - // 设置窗口的显示方向属性  
57 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)  
58 - .then(() => {  
59 - hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded');  
60 - })  
61 - .catch((err: Error) => {  
62 - hilog.error(0x0000, 'testTag',  
63 - `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);  
64 - }) 61 + // 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动
  62 + if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) {
  63 + // 设置窗口的布局是否为沉浸式布局
  64 + // 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。
  65 + // 非沉浸式布局是指布局避让状态栏与导航栏,组件不会与其重叠。
  66 + // windowClass.setWindowLayoutFullScreen(true)
  67 + // 设置窗口全屏模式时窗口内导航栏、状态栏的属性
  68 + // windowClass.setWindowSystemBarProperties({
  69 + // statusBarContentColor: "#FFFFFF"
  70 + // })
  71 +
  72 + // 设置启动时窗口的显示方向属性,
  73 + // 普通phone以PORTRAIT/竖屏显示模式启动
  74 + // 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动
  75 + WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
  76 + .then(() => {
  77 + hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded');
  78 + })
  79 + .catch((err: Error) => {
  80 + hilog.error(0x0000, 'testTag',
  81 + `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
  82 + })
  83 + }
  84 +
65 //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage 85 //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage
66 windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => { 86 windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => {
67 if (err.code) { 87 if (err.code) {
@@ -70,7 +90,7 @@ export default class EntryAbility extends UIAbility { @@ -70,7 +90,7 @@ export default class EntryAbility extends UIAbility {
70 } 90 }
71 hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); 91 hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
72 }); 92 });
73 - // 1.创建悬浮窗 93 + // 1.创建悬浮窗
74 // const config: window.Configuration = { 94 // const config: window.Configuration = {
75 // name: "floatWindow", windowType: window.WindowType.TYPE_FLOAT, ctx: this.context 95 // name: "floatWindow", windowType: window.WindowType.TYPE_FLOAT, ctx: this.context
76 // }; 96 // };