Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
74 changed files
with
857 additions
and
621 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 | } |
| @@ -18,7 +18,6 @@ export function handleJsCallAppService(data: Message, callback: (res: string) => | @@ -18,7 +18,6 @@ export function handleJsCallAppService(data: Message, callback: (res: string) => | ||
| 18 | if (queryString) { | 18 | if (queryString) { |
| 19 | url = url + `?${queryString}` | 19 | url = url + `?${queryString}` |
| 20 | } | 20 | } |
| 21 | - console.log('yzl', queryString, url) | ||
| 22 | WDHttp.get(url).then((res) => { | 21 | WDHttp.get(url).then((res) => { |
| 23 | callback(JSON.stringify({ | 22 | callback(JSON.stringify({ |
| 24 | netError: '0', | 23 | netError: '0', |
| @@ -10,73 +10,74 @@ | @@ -10,73 +10,74 @@ | ||
| 10 | /* | 10 | /* |
| 11 | 信息流广告素材解析累 | 11 | 信息流广告素材解析累 |
| 12 | */ | 12 | */ |
| 13 | -export interface CompAdvMatInfoBean { | 13 | +export class CompAdvMatInfoBean { |
| 14 | 14 | ||
| 15 | + id:number = 0 | ||
| 15 | /** | 16 | /** |
| 16 | * 广告标题 | 17 | * 广告标题 |
| 17 | */ | 18 | */ |
| 18 | - advTitle: string | 19 | + advTitle: string = '' |
| 19 | /** | 20 | /** |
| 20 | * 3:信息流广告 | 21 | * 3:信息流广告 |
| 21 | */ | 22 | */ |
| 22 | - advType: string | 23 | + advType: string ='' |
| 23 | /** | 24 | /** |
| 24 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) | 25 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) |
| 25 | */ | 26 | */ |
| 26 | - advSubType: number | 27 | + advSubType: number = 0 |
| 27 | /** | 28 | /** |
| 28 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 | 29 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 |
| 29 | */ | 30 | */ |
| 30 | - matImageUrl: string[] | 31 | + matImageUrl: string[] = [] |
| 31 | /** | 32 | /** |
| 32 | * 视频广告地址(adv_subtype=9) | 33 | * 视频广告地址(adv_subtype=9) |
| 33 | */ | 34 | */ |
| 34 | - matVideoUrl: string | 35 | + matVideoUrl: string = '' |
| 35 | /** | 36 | /** |
| 36 | * 扩展信息:advSubType=10,11时使用,字段示例见接口备注。 | 37 | * 扩展信息:advSubType=10,11时使用,字段示例见接口备注。 |
| 37 | */ | 38 | */ |
| 38 | - extraData: string | 39 | + extraData: string = '' |
| 39 | /** | 40 | /** |
| 40 | * 链接类型: 0:无链接;1:内链(文章);2:外链 | 41 | * 链接类型: 0:无链接;1:内链(文章);2:外链 |
| 41 | */ | 42 | */ |
| 42 | - linkType: string | 43 | + linkType: string = '' |
| 43 | /** | 44 | /** |
| 44 | * 链接跳转类型 :0-没链接,不用打开,1-端内打开,2-端外打开 | 45 | * 链接跳转类型 :0-没链接,不用打开,1-端内打开,2-端外打开 |
| 45 | */ | 46 | */ |
| 46 | - openType: string | 47 | + openType: string = '' |
| 47 | /** | 48 | /** |
| 48 | * 广告跳转链接 | 49 | * 广告跳转链接 |
| 49 | */ | 50 | */ |
| 50 | - linkUrl: string | 51 | + linkUrl: string = '' |
| 51 | /** | 52 | /** |
| 52 | * 素材类型(0:图片 1:视频) | 53 | * 素材类型(0:图片 1:视频) |
| 53 | */ | 54 | */ |
| 54 | - matType: string | 55 | + matType: string = '' |
| 55 | /** | 56 | /** |
| 56 | * 开屏样式(1:全屏样式 0:底部固定Logo) | 57 | * 开屏样式(1:全屏样式 0:底部固定Logo) |
| 57 | */ | 58 | */ |
| 58 | - startStyle: string | 59 | + startStyle: string = '' |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | /** | 62 | /** |
| 62 | * 信息流广告位 | 63 | * 信息流广告位 |
| 63 | */ | 64 | */ |
| 64 | -export interface CompAdvSlotInfoBean { | 65 | +export class CompAdvSlotInfoBean { |
| 65 | 66 | ||
| 66 | 67 | ||
| 67 | /** | 68 | /** |
| 68 | * 组件id | 69 | * 组件id |
| 69 | */ | 70 | */ |
| 70 | - compId: string; | 71 | + compId: string = ''; |
| 71 | 72 | ||
| 72 | /** | 73 | /** |
| 73 | * 广告位位置 从1开始 | 74 | * 广告位位置 从1开始 |
| 74 | */ | 75 | */ |
| 75 | - position: number; | 76 | + position: number = 0; |
| 76 | 77 | ||
| 77 | /** | 78 | /** |
| 78 | * 频道id | 79 | * 频道id |
| 79 | */ | 80 | */ |
| 80 | - channelId: string; | 81 | + channelId: string = ''; |
| 81 | 82 | ||
| 82 | } | 83 | } |
| @@ -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 | ||
| 48 | - | 43 | + matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean |
| 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 | } |
| @@ -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,95 @@ export struct CompParser { | @@ -39,90 +39,95 @@ 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 | + Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({top: -3}) | ||
| 109 | + Divider().strokeWidth(6).color('#f5f5f5') | ||
| 110 | + ZhSingleColumn09({ compDTO: this.compDTO }) | ||
| 111 | + Divider().strokeWidth(6).color('#f5f5f5') | ||
| 112 | + } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | ||
| 113 | + AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | ||
| 114 | + //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) | ||
| 115 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 116 | + } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { | ||
| 117 | + CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | ||
| 118 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 64 | } else { | 119 | } else { |
| 65 | - HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) | 120 | + Text(this.compDTO.compStyle) |
| 121 | + .width(CommonConstants.FULL_PARENT) | ||
| 122 | + .padding(10) | ||
| 123 | + .onClick(() => { | ||
| 124 | + if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论 | ||
| 125 | + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 126 | + } | ||
| 127 | + }) | ||
| 128 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 66 | } | 129 | } |
| 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 | } | 130 | } |
| 124 | - } | ||
| 125 | - | ||
| 126 | - // } | ||
| 127 | -} | ||
| 128 | 131 | ||
| 132 | + } | ||
| 133 | +} |
| @@ -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) { |
| @@ -23,7 +23,6 @@ export struct ImageAndTextWebComponent { | @@ -23,7 +23,6 @@ export struct ImageAndTextWebComponent { | ||
| 23 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | 23 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean |
| 24 | private webPrepared = false; | 24 | private webPrepared = false; |
| 25 | private dataPrepared = false; | 25 | private dataPrepared = false; |
| 26 | - | ||
| 27 | async onDetailDataUpdated() { | 26 | async onDetailDataUpdated() { |
| 28 | if (this.action) { | 27 | if (this.action) { |
| 29 | let contentId: string = '' | 28 | let contentId: string = '' |
| @@ -21,6 +21,8 @@ import { effectKit } from '@kit.ArkGraphics2D'; | @@ -21,6 +21,8 @@ import { effectKit } from '@kit.ArkGraphics2D'; | ||
| 21 | import { window } from '@kit.ArkUI'; | 21 | import { window } from '@kit.ArkUI'; |
| 22 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; | 22 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; |
| 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' | 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' |
| 24 | +import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare' | ||
| 25 | +import { common } from '@kit.AbilityKit'; | ||
| 24 | 26 | ||
| 25 | const TAG = 'MorningEveningPaperComponent'; | 27 | const TAG = 'MorningEveningPaperComponent'; |
| 26 | 28 | ||
| @@ -126,6 +128,10 @@ export struct MorningEveningPaperComponent { | @@ -126,6 +128,10 @@ export struct MorningEveningPaperComponent { | ||
| 126 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) | 128 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) |
| 127 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" | 129 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" |
| 128 | this.pageInfoBean = pageInfoBean; | 130 | this.pageInfoBean = pageInfoBean; |
| 131 | + //早晚报意图上报 | ||
| 132 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 133 | + viewColumInsightIntentShare(context,String(dailyPaperTopicPageId), this.pageInfoBean) | ||
| 134 | + | ||
| 129 | this.title = this.pageInfoBean?.topicInfo?.title | 135 | this.title = this.pageInfoBean?.topicInfo?.title |
| 130 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) | 136 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) |
| 131 | const dateShow = new Date(dateTime) | 137 | const dateShow = new Date(dateTime) |
| @@ -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 | } |
| @@ -54,14 +54,13 @@ export struct CardAdvBottom { | @@ -54,14 +54,13 @@ export struct CardAdvBottom { | ||
| 54 | let currentIndex = -1 | 54 | let currentIndex = -1 |
| 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { | 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { |
| 56 | let b = this.pageModel.compList.getData(i) as CompDTO | 56 | let b = this.pageModel.compList.getData(i) as CompDTO |
| 57 | - if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | 57 | + if (a.compStyle == b.compStyle && a.matInfo.id == b.matInfo.id) { |
| 58 | currentIndex = i | 58 | currentIndex = i |
| 59 | break; | 59 | break; |
| 60 | } | 60 | } |
| 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,6 +16,7 @@ const TAG: string = 'Card10Component'; | @@ -16,6 +16,7 @@ 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 | ||
| 19 | @State titleMarked: boolean = false; | 20 | @State titleMarked: boolean = false; |
| 20 | @State str01: string = ''; | 21 | @State str01: string = ''; |
| 21 | @State str02: string = ''; | 22 | @State str02: string = ''; |
| @@ -133,8 +134,10 @@ export struct Card10Component { | @@ -133,8 +134,10 @@ export struct Card10Component { | ||
| 133 | .textIndent(item.objectType == '5' ? 38 : 0) | 134 | .textIndent(item.objectType == '5' ? 38 : 0) |
| 134 | }.alignContent(Alignment.TopStart) | 135 | }.alignContent(Alignment.TopStart) |
| 135 | 136 | ||
| 137 | + //bottom 评论等信息 | ||
| 136 | CardSourceInfo( | 138 | CardSourceInfo( |
| 137 | { | 139 | { |
| 140 | + compDTO: this.compDTO, | ||
| 138 | contentDTO: this.createContent(item) | 141 | contentDTO: this.createContent(item) |
| 139 | } | 142 | } |
| 140 | ) | 143 | ) |
| 1 | //缩略标题 | 1 | //缩略标题 |
| 2 | +import { CompDTO, ContentDTO } from 'wdBean' | ||
| 3 | +import { DateTimeUtils } from 'wdKit' | ||
| 2 | import { CommonConstants } from 'wdConstant'; | 4 | import { CommonConstants } from 'wdConstant'; |
| 3 | -import { ContentDTO } from 'wdBean'; | ||
| 4 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 5 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 6 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| @@ -14,6 +15,7 @@ const TAG = 'Card11Component'; | @@ -14,6 +15,7 @@ const TAG = 'Card11Component'; | ||
| 14 | export struct Card11Component { | 15 | export struct Card11Component { |
| 15 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 16 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | + @ObjectLink compDTO: CompDTO | ||
| 17 | @State titleMarked: boolean = false; | 19 | @State titleMarked: boolean = false; |
| 18 | @State str01: string = ''; | 20 | @State str01: string = ''; |
| 19 | @State str02: string = ''; | 21 | @State str02: string = ''; |
| @@ -35,7 +37,9 @@ export struct Card11Component { | @@ -35,7 +37,9 @@ export struct Card11Component { | ||
| 35 | build() { | 37 | build() { |
| 36 | Column() { | 38 | Column() { |
| 37 | Stack() { | 39 | Stack() { |
| 38 | - if (this.contentDTO.objectType == '5') { | 40 | + if (this.contentDTO.newTags) { |
| 41 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 42 | + } else if (this.contentDTO.objectType == '5') { | ||
| 39 | Notes({ objectType: this.contentDTO.objectType }) | 43 | Notes({ objectType: this.contentDTO.objectType }) |
| 40 | } | 44 | } |
| 41 | Text() { | 45 | Text() { |
| @@ -48,18 +52,20 @@ export struct Card11Component { | @@ -48,18 +52,20 @@ export struct Card11Component { | ||
| 48 | Span(this.contentDTO.newsTitle) | 52 | Span(this.contentDTO.newsTitle) |
| 49 | } | 53 | } |
| 50 | } | 54 | } |
| 51 | - .fontSize($r("app.float.font_size_16")) | ||
| 52 | - .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 53 | - .maxLines(3) | ||
| 54 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 55 | - .width(CommonConstants.FULL_WIDTH) | ||
| 56 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 55 | + .fontSize($r("app.float.font_size_16")) |
| 56 | + .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 57 | + .maxLines(3) | ||
| 58 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 59 | + .width(CommonConstants.FULL_WIDTH) | ||
| 60 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 61 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 62 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 57 | 63 | ||
| 58 | }.alignContent(Alignment.TopStart) | 64 | }.alignContent(Alignment.TopStart) |
| 59 | 65 | ||
| 60 | 66 | ||
| 61 | // 评论等信息 | 67 | // 评论等信息 |
| 62 | - CardSourceInfo({ contentDTO: this.contentDTO }) | 68 | + CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 63 | }.width(CommonConstants.FULL_WIDTH) | 69 | }.width(CommonConstants.FULL_WIDTH) |
| 64 | .padding({ | 70 | .padding({ |
| 65 | left: $r('app.float.card_comp_pagePadding_lf'), | 71 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -13,10 +13,10 @@ const TAG = 'Card17Component'; | @@ -13,10 +13,10 @@ 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; | 20 | @State titleMarked: boolean = false; |
| 21 | @State str01: string = ''; | 21 | @State str01: string = ''; |
| 22 | @State str02: string = ''; | 22 | @State str02: string = ''; |
| @@ -120,7 +120,7 @@ export struct Card17Component { | @@ -120,7 +120,7 @@ export struct Card17Component { | ||
| 120 | }) | 120 | }) |
| 121 | 121 | ||
| 122 | // 评论等信息 | 122 | // 评论等信息 |
| 123 | - CardSourceInfo({ contentDTO: this.contentDTO }) | 123 | + CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO }) |
| 124 | } | 124 | } |
| 125 | .width(CommonConstants.FULL_WIDTH) | 125 | .width(CommonConstants.FULL_WIDTH) |
| 126 | .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'; |
| @@ -72,9 +72,9 @@ export struct Card19Component { | @@ -72,9 +72,9 @@ export struct Card19Component { | ||
| 72 | } | 72 | } |
| 73 | return photo | 73 | return photo |
| 74 | }) | 74 | }) |
| 75 | - ProcessUtils.gotoMultiPictureListPage(photoList,0) | 75 | + ProcessUtils.gotoMultiPictureListPage(photoList, 0) |
| 76 | }) | 76 | }) |
| 77 | - CarderInteraction({contentDTO: this.contentDTO}) | 77 | + CarderInteraction({ contentDTO: this.contentDTO }) |
| 78 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 78 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 79 | } | 79 | } |
| 80 | .padding({ | 80 | .padding({ |
| @@ -106,8 +106,8 @@ struct createImg { | @@ -106,8 +106,8 @@ struct createImg { | ||
| 106 | 106 | ||
| 107 | async aboutToAppear(): Promise<void> { | 107 | async aboutToAppear(): Promise<void> { |
| 108 | this.loadImg = await onlyWifiLoadImg(); | 108 | this.loadImg = await onlyWifiLoadImg(); |
| 109 | - if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 | ||
| 110 | - this.fullColumnImgUrls.splice(2,0, { | 109 | + if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 |
| 110 | + this.fullColumnImgUrls.splice(2, 0, { | ||
| 111 | fullUrl: '' | 111 | fullUrl: '' |
| 112 | } as FullColumnImgUrlDTO) | 112 | } as FullColumnImgUrlDTO) |
| 113 | } | 113 | } |
| @@ -151,7 +151,6 @@ struct createImg { | @@ -151,7 +151,6 @@ struct createImg { | ||
| 151 | } | 151 | } |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | - | ||
| 155 | build() { | 154 | build() { |
| 156 | GridRow({ | 155 | GridRow({ |
| 157 | gutter: { x: 2, y: 2 } | 156 | gutter: { x: 2, y: 2 } |
| 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,6 +22,7 @@ export struct Card2Component { | @@ -22,6 +22,7 @@ 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 = ''; |
| @@ -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 | import { Notes } from './notes'; |
| @@ -12,6 +12,7 @@ import { Notes } from './notes'; | @@ -12,6 +12,7 @@ import { Notes } from './notes'; | ||
| 12 | export struct Card3Component { | 12 | export struct Card3Component { |
| 13 | @State contentDTO: ContentDTO = new ContentDTO(); | 13 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 14 | @State clicked: boolean = false; | 14 | @State clicked: boolean = false; |
| 15 | + @ObjectLink compDTO: CompDTO | ||
| 15 | @State titleMarked: boolean = false; | 16 | @State titleMarked: boolean = false; |
| 16 | @State str01: string = ''; | 17 | @State str01: string = ''; |
| 17 | @State str02: string = ''; | 18 | @State str02: string = ''; |
| @@ -34,7 +35,9 @@ export struct Card3Component { | @@ -34,7 +35,9 @@ export struct Card3Component { | ||
| 34 | build() { | 35 | build() { |
| 35 | Column() { | 36 | Column() { |
| 36 | Stack() { | 37 | Stack() { |
| 37 | - if (this.contentDTO.objectType == '5') { | 38 | + if (this.contentDTO.newTags) { |
| 39 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 40 | + } else if (this.contentDTO.objectType == '5') { | ||
| 38 | Notes({ objectType: this.contentDTO.objectType }) | 41 | Notes({ objectType: this.contentDTO.objectType }) |
| 39 | } | 42 | } |
| 40 | Text() { | 43 | Text() { |
| @@ -47,14 +50,16 @@ export struct Card3Component { | @@ -47,14 +50,16 @@ export struct Card3Component { | ||
| 47 | Span(this.contentDTO.newsTitle) | 50 | Span(this.contentDTO.newsTitle) |
| 48 | } | 51 | } |
| 49 | } | 52 | } |
| 50 | - .fontSize($r("app.float.font_size_16")) | ||
| 51 | - .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 52 | - .width(CommonConstants.FULL_WIDTH) | ||
| 53 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 53 | + .fontSize($r("app.float.font_size_16")) |
| 54 | + .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | ||
| 55 | + .width(CommonConstants.FULL_WIDTH) | ||
| 56 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 57 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 58 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 54 | }.alignContent(Alignment.TopStart) | 59 | }.alignContent(Alignment.TopStart) |
| 55 | 60 | ||
| 56 | // 评论等信息 | 61 | // 评论等信息 |
| 57 | - CardSourceInfo({ contentDTO: this.contentDTO }) | 62 | + CardSourceInfo({compDTO:this.compDTO, contentDTO: this.contentDTO }) |
| 58 | } | 63 | } |
| 59 | .width(CommonConstants.FULL_WIDTH) | 64 | .width(CommonConstants.FULL_WIDTH) |
| 60 | .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,7 +23,7 @@ export struct Card4Component { | @@ -22,7 +23,7 @@ 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.titleInit(); | 29 | this.titleInit(); |
| @@ -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({ |
| @@ -53,7 +53,9 @@ export struct Card5Component { | @@ -53,7 +53,9 @@ export struct Card5Component { | ||
| 53 | }) | 53 | }) |
| 54 | Row() { | 54 | Row() { |
| 55 | Stack() { | 55 | Stack() { |
| 56 | - if (this.contentDTO.objectType == '5') { | 56 | + if (this.contentDTO.newTags) { |
| 57 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 58 | + } else if (this.contentDTO.objectType == '5') { | ||
| 57 | Notes({ objectType: this.contentDTO.objectType }) | 59 | Notes({ objectType: this.contentDTO.objectType }) |
| 58 | } | 60 | } |
| 59 | 61 | ||
| @@ -67,13 +69,15 @@ export struct Card5Component { | @@ -67,13 +69,15 @@ export struct Card5Component { | ||
| 67 | Span(this.contentDTO.newsTitle) | 69 | Span(this.contentDTO.newsTitle) |
| 68 | } | 70 | } |
| 69 | } | 71 | } |
| 70 | - .width(CommonConstants.FULL_WIDTH) | ||
| 71 | - .fontColor(Color.White) | ||
| 72 | - .fontSize($r('app.float.normal_text_size')) | ||
| 73 | - .fontWeight(FontWeight.Bold) | ||
| 74 | - .maxLines(2) | ||
| 75 | - .align(Alignment.TopStart) | ||
| 76 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 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) | ||
| 77 | }.alignContent(Alignment.TopStart) | 81 | }.alignContent(Alignment.TopStart) |
| 78 | } | 82 | } |
| 79 | .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'; | ||
| 9 | import { Logger } from 'wdKit/Index'; | 8 | import { Logger } from 'wdKit/Index'; |
| 10 | 9 | ||
| 11 | const TAG: string = 'Card6Component-Card13Component'; | 10 | const TAG: string = 'Card6Component-Card13Component'; |
| @@ -15,13 +14,14 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -15,13 +14,14 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 15 | */ | 14 | */ |
| 16 | @Component | 15 | @Component |
| 17 | export struct Card6Component { | 16 | export struct Card6Component { |
| 18 | - @State contentDTO: ContentDTO = new ContentDTO(); | ||
| 19 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 20 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 21 | @State titleMarked: boolean = false; | 19 | @State titleMarked: boolean = false; |
| 22 | @State str01: string = ''; | 20 | @State str01: string = ''; |
| 23 | @State str02: string = ''; | 21 | @State str02: string = ''; |
| 24 | @State str03: string = ''; | 22 | @State str03: string = ''; |
| 23 | + @ObjectLink compDTO: CompDTO | ||
| 24 | + @State contentDTO: ContentDTO = new ContentDTO(); | ||
| 25 | 25 | ||
| 26 | async aboutToAppear(): Promise<void> { | 26 | async aboutToAppear(): Promise<void> { |
| 27 | this.titleInit(); | 27 | this.titleInit(); |
| @@ -81,12 +81,12 @@ export struct Card6Component { | @@ -81,12 +81,12 @@ export struct Card6Component { | ||
| 81 | this.contentDTO.objectType == '5' ? 30 : 0) | 81 | this.contentDTO.objectType == '5' ? 30 : 0) |
| 82 | }.alignContent(Alignment.TopStart) | 82 | }.alignContent(Alignment.TopStart) |
| 83 | 83 | ||
| 84 | - }.height("75%") | 84 | + } |
| 85 | .justifyContent(FlexAlign.Start) | 85 | .justifyContent(FlexAlign.Start) |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | //bottom 评论等信息 | 88 | //bottom 评论等信息 |
| 89 | - CardSourceInfo({ contentDTO: this.contentDTO }) | 89 | + CardSourceInfo({ compDTO: this.compDTO,contentDTO:this.contentDTO }) |
| 90 | } | 90 | } |
| 91 | .alignItems(HorizontalAlign.Start) | 91 | .alignItems(HorizontalAlign.Start) |
| 92 | .justifyContent(FlexAlign.Start) | 92 | .justifyContent(FlexAlign.Start) |
| @@ -61,6 +61,7 @@ export struct Card9Component { | @@ -61,6 +61,7 @@ export struct Card9Component { | ||
| 61 | Image(this.loadImg ? this.contentDTO.coverUrl : '') | 61 | Image(this.loadImg ? this.contentDTO.coverUrl : '') |
| 62 | .backgroundColor(0xf5f5f5) | 62 | .backgroundColor(0xf5f5f5) |
| 63 | .width('100%') | 63 | .width('100%') |
| 64 | + .height(133) | ||
| 64 | .borderRadius({ | 65 | .borderRadius({ |
| 65 | topLeft: $r('app.float.image_border_radius'), | 66 | topLeft: $r('app.float.image_border_radius'), |
| 66 | 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({ |
| @@ -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> = {}; |
| @@ -55,7 +55,7 @@ export struct ZhGridLayout02 { | @@ -55,7 +55,7 @@ export struct ZhGridLayout02 { | ||
| 55 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 56 | 56 | ||
| 57 | GridRow({ | 57 | GridRow({ |
| 58 | - gutter: { x: 12, y: 15 }, | 58 | + gutter: { x: 12, y: 13 }, |
| 59 | columns: { sm: listSize, md: 2 }, | 59 | columns: { sm: listSize, md: 2 }, |
| 60 | breakpoints: { value: ['320vp', '520vp', '840vp'] } | 60 | breakpoints: { value: ['320vp', '520vp', '840vp'] } |
| 61 | }) { | 61 | }) { |
| @@ -120,7 +120,7 @@ export struct ZhGridLayout02 { | @@ -120,7 +120,7 @@ export struct ZhGridLayout02 { | ||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | Text(item.newsTitle) | 122 | Text(item.newsTitle) |
| 123 | - .margin({ top: '5' }) | 123 | + .margin({top:'6'}) |
| 124 | .fontSize(13) | 124 | .fontSize(13) |
| 125 | .maxLines(2) | 125 | .maxLines(2) |
| 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -59,12 +59,16 @@ export struct ZhGridLayout03 { | @@ -59,12 +59,16 @@ export struct ZhGridLayout03 { | ||
| 59 | .backgroundColor(0xf5f5f5) | 59 | .backgroundColor(0xf5f5f5) |
| 60 | .width(44) | 60 | .width(44) |
| 61 | .aspectRatio(1 / 1) | 61 | .aspectRatio(1 / 1) |
| 62 | - .margin({ | ||
| 63 | - bottom: 16 | ||
| 64 | - }) | 62 | + // .margin({ |
| 63 | + // bottom: 16 | ||
| 64 | + // }) | ||
| 65 | Text(item.newsTitle) | 65 | Text(item.newsTitle) |
| 66 | .fontSize(13) | 66 | .fontSize(13) |
| 67 | .maxLines(1) | 67 | .maxLines(1) |
| 68 | + .margin({ | ||
| 69 | + top: 8, | ||
| 70 | + bottom:11 | ||
| 71 | + }) | ||
| 68 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 72 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 69 | } | 73 | } |
| 70 | .width('100%') | 74 | .width('100%') |
| @@ -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 | } |
| @@ -27,7 +27,7 @@ struct EditUserInfoPage { | @@ -27,7 +27,7 @@ struct EditUserInfoPage { | ||
| 27 | } | 27 | } |
| 28 | }), | 28 | }), |
| 29 | alignment: DialogAlignment.Bottom, | 29 | alignment: DialogAlignment.Bottom, |
| 30 | - offset:{dx:0,dy:-20} | 30 | + offset:{dx:0,dy:-20}, |
| 31 | }) | 31 | }) |
| 32 | 32 | ||
| 33 | aboutToAppear() { | 33 | aboutToAppear() { |
| @@ -97,14 +97,14 @@ struct EditUserInfoPage { | @@ -97,14 +97,14 @@ struct EditUserInfoPage { | ||
| 97 | Row(){ | 97 | Row(){ |
| 98 | Text(r.title) | 98 | Text(r.title) |
| 99 | .fontSize(15) | 99 | .fontSize(15) |
| 100 | - .fontColor(Color.Gray) | 100 | + .fontColor('#666666') |
| 101 | Blank() | 101 | Blank() |
| 102 | 102 | ||
| 103 | Text(r.subTitle) | 103 | Text(r.subTitle) |
| 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) | 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) |
| 105 | .maxLines(1) | 105 | .maxLines(1) |
| 106 | .fontSize(14) | 106 | .fontSize(14) |
| 107 | - .fontColor(Color.Gray) | 107 | + .fontColor(r.subTitle === '待完善'?'#999999':'#666666') |
| 108 | .padding({right:10}) | 108 | .padding({right:10}) |
| 109 | .width('70%') | 109 | .width('70%') |
| 110 | .textAlign(TextAlign.End) | 110 | .textAlign(TextAlign.End) |
| @@ -45,7 +45,7 @@ struct EditUserIntroductionPage { | @@ -45,7 +45,7 @@ struct EditUserIntroductionPage { | ||
| 45 | Divider() | 45 | Divider() |
| 46 | .margin(20) | 46 | .margin(20) |
| 47 | 47 | ||
| 48 | - Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。') | 48 | + Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。') |
| 49 | .fontSize(13) | 49 | .fontSize(13) |
| 50 | .padding(12) | 50 | .padding(12) |
| 51 | .fontColor(Color.Gray).lineHeight(25) | 51 | .fontColor(Color.Gray).lineHeight(25) |
| @@ -54,6 +54,8 @@ struct EditUserIntroductionPage { | @@ -54,6 +54,8 @@ struct EditUserIntroductionPage { | ||
| 54 | .type(ButtonType.Normal) | 54 | .type(ButtonType.Normal) |
| 55 | .width('90%') | 55 | .width('90%') |
| 56 | .backgroundColor('#ED2800') | 56 | .backgroundColor('#ED2800') |
| 57 | + .opacity(this.numCount === 0 ? 0.6 : 1) | ||
| 58 | + .fontColor(this.numCount === 0 ? '#999999' : Color.White) | ||
| 57 | .borderRadius(5) | 59 | .borderRadius(5) |
| 58 | .margin(30) | 60 | .margin(30) |
| 59 | .onClick(()=>{ | 61 | .onClick(()=>{ |
| @@ -47,7 +47,7 @@ struct EditUserNikeNamePage { | @@ -47,7 +47,7 @@ struct EditUserNikeNamePage { | ||
| 47 | Divider() | 47 | Divider() |
| 48 | .margin(20) | 48 | .margin(20) |
| 49 | 49 | ||
| 50 | - Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') | 50 | + Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') |
| 51 | .fontSize(13) | 51 | .fontSize(13) |
| 52 | .padding(12) | 52 | .padding(12) |
| 53 | .fontColor(Color.Gray).lineHeight(25) | 53 | .fontColor(Color.Gray).lineHeight(25) |
| @@ -56,6 +56,8 @@ struct EditUserNikeNamePage { | @@ -56,6 +56,8 @@ struct EditUserNikeNamePage { | ||
| 56 | .type(ButtonType.Normal) | 56 | .type(ButtonType.Normal) |
| 57 | .width('90%') | 57 | .width('90%') |
| 58 | .backgroundColor('#ED2800') | 58 | .backgroundColor('#ED2800') |
| 59 | + .opacity(this.numCount === 0 ? 0.6 : 1) | ||
| 60 | + .fontColor(this.numCount === 0 ? '#999999' : Color.White) | ||
| 59 | .borderRadius(5) | 61 | .borderRadius(5) |
| 60 | .margin(30) | 62 | .margin(30) |
| 61 | .onClick(()=>{ | 63 | .onClick(()=>{ |
| @@ -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,13 +4,14 @@ import PageModel from '../../viewmodel/PageModel'; | @@ -4,13 +4,14 @@ 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'; |
| 11 | import { BigPicCardComponent } from '../view/BigPicCardComponent'; | 11 | import { BigPicCardComponent } from '../view/BigPicCardComponent'; |
| 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; | 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; |
| 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 14 | +import { MyCustomDialog } from '../reusable/MyCustomDialog' | ||
| 14 | 15 | ||
| 15 | @Entry | 16 | @Entry |
| 16 | @Component | 17 | @Component |
| @@ -26,6 +27,19 @@ struct MyCollectionListPage { | @@ -26,6 +27,19 @@ struct MyCollectionListPage { | ||
| 26 | @State currentPage: number = 1; | 27 | @State currentPage: number = 1; |
| 27 | private scroller: Scroller = new Scroller(); | 28 | private scroller: Scroller = new Scroller(); |
| 28 | 29 | ||
| 30 | + dialogController: CustomDialogController = new CustomDialogController({ | ||
| 31 | + builder: MyCustomDialog({ | ||
| 32 | + confirm: () => { | ||
| 33 | + this.deleteDatas() | ||
| 34 | + }, | ||
| 35 | + titleShow:false, | ||
| 36 | + tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏' | ||
| 37 | + }), | ||
| 38 | + autoCancel: true, | ||
| 39 | + alignment: DialogAlignment.Center, | ||
| 40 | + customStyle: true | ||
| 41 | + }) | ||
| 42 | + | ||
| 29 | aboutToAppear(){ | 43 | aboutToAppear(){ |
| 30 | this.getData() | 44 | this.getData() |
| 31 | } | 45 | } |
| @@ -73,7 +87,7 @@ struct MyCollectionListPage { | @@ -73,7 +87,7 @@ struct MyCollectionListPage { | ||
| 73 | this.allSelectDatas(isAllSelect) | 87 | this.allSelectDatas(isAllSelect) |
| 74 | }, | 88 | }, |
| 75 | confirmCallback:()=>{ | 89 | confirmCallback:()=>{ |
| 76 | - this.deleteDatas() | 90 | + this.dialogController.open() |
| 77 | } | 91 | } |
| 78 | }) | 92 | }) |
| 79 | } | 93 | } |
| @@ -117,7 +131,7 @@ struct MyCollectionListPage { | @@ -117,7 +131,7 @@ struct MyCollectionListPage { | ||
| 117 | .margin({left:16}) | 131 | .margin({left:16}) |
| 118 | } | 132 | } |
| 119 | Column() { | 133 | Column() { |
| 120 | - BigPicCardComponent({contentDTO:compDTO}) | 134 | + BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) |
| 121 | } | 135 | } |
| 122 | } | 136 | } |
| 123 | } | 137 | } |
| @@ -14,7 +14,9 @@ import PageNoMoreLayout from './PageNoMoreLayout'; | @@ -14,7 +14,9 @@ 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 | - | 17 | +import json from '@ohos.util.json'; |
| 18 | +import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 19 | +import { common } from '@kit.AbilityKit'; | ||
| 18 | const TAG = 'PageComponent'; | 20 | const TAG = 'PageComponent'; |
| 19 | 21 | ||
| 20 | @Component | 22 | @Component |
| @@ -30,7 +32,6 @@ export struct PageComponent { | @@ -30,7 +32,6 @@ export struct PageComponent { | ||
| 30 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | 32 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 |
| 31 | private listScroller: Scroller = new Scroller(); | 33 | private listScroller: Scroller = new Scroller(); |
| 32 | needload: boolean = true; | 34 | needload: boolean = true; |
| 33 | - | ||
| 34 | build() { | 35 | build() { |
| 35 | Column() { | 36 | Column() { |
| 36 | if (this.pageModel.viewType == ViewType.LOADING) { | 37 | if (this.pageModel.viewType == ViewType.LOADING) { |
| @@ -77,11 +78,13 @@ export struct PageComponent { | @@ -77,11 +78,13 @@ export struct PageComponent { | ||
| 77 | ListItem() { | 78 | ListItem() { |
| 78 | Column() { | 79 | Column() { |
| 79 | CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex }); | 80 | CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex }); |
| 80 | - } | 81 | + }.onClick(()=>{ |
| 82 | + this.viewBlogInsightIntentShare(compDTO) | ||
| 83 | + }) | ||
| 84 | + | ||
| 81 | } | 85 | } |
| 82 | }, | 86 | }, |
| 83 | - (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp | ||
| 84 | - ) | 87 | + (compDTO: CompDTO, compIndex: number) => JSON.stringify(compDTO)) |
| 85 | 88 | ||
| 86 | // 加载更多 | 89 | // 加载更多 |
| 87 | ListItem() { | 90 | ListItem() { |
| @@ -257,7 +260,13 @@ export struct PageComponent { | @@ -257,7 +260,13 @@ export struct PageComponent { | ||
| 257 | this.pageModel.pageTotalCompSize = 0; | 260 | this.pageModel.pageTotalCompSize = 0; |
| 258 | PageHelper.getInitData(this.pageModel, this.pageAdvModel) | 261 | PageHelper.getInitData(this.pageModel, this.pageAdvModel) |
| 259 | }, 100) | 262 | }, 100) |
| 263 | + } | ||
| 260 | 264 | ||
| 265 | + viewBlogInsightIntentShare(compDTO:CompDTO){ | ||
| 266 | + if (this.channelId === '2001' || this.channelId === '2002') { | ||
| 267 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 268 | + viewBlogInsightIntentShare(context, this.channelId, [compDTO], ActionMode.EXECUTED) | ||
| 269 | + } | ||
| 261 | } | 270 | } |
| 262 | } | 271 | } |
| 263 | 272 |
| 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 | }, |
| 1 | -import { insightIntent } from '@kit.IntentsKit'; | ||
| 2 | import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; | 1 | import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; |
| 3 | import { SpConstants } from 'wdConstant'; | 2 | import { SpConstants } from 'wdConstant'; |
| 4 | import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; | 3 | import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; |
| @@ -9,8 +8,6 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | @@ -9,8 +8,6 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | ||
| 9 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; | 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; |
| 10 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 11 | import { channelSkeleton } from '../skeleton/channelSkeleton'; | 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; |
| 12 | -import { common } from '@kit.AbilityKit'; | ||
| 13 | - | ||
| 14 | 11 | ||
| 15 | const TAG = 'TopNavigationComponent'; | 12 | const TAG = 'TopNavigationComponent'; |
| 16 | 13 | ||
| @@ -61,8 +58,6 @@ export struct TopNavigationComponent { | @@ -61,8 +58,6 @@ export struct TopNavigationComponent { | ||
| 61 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | 58 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 |
| 62 | // 传递给page的自动刷新通知 | 59 | // 传递给page的自动刷新通知 |
| 63 | @State autoRefresh2Page: number = 0 | 60 | @State autoRefresh2Page: number = 0 |
| 64 | - //保存当前导航选中时的时间戳 意图开始时间 | ||
| 65 | - @State executedStartTime: number = new Date().getTime() | ||
| 66 | // 当前底导index | 61 | // 当前底导index |
| 67 | @State navIndex: number = 0 | 62 | @State navIndex: number = 0 |
| 68 | @State animationDuration: number = 0 | 63 | @State animationDuration: number = 0 |
| @@ -190,48 +185,6 @@ export struct TopNavigationComponent { | @@ -190,48 +185,6 @@ export struct TopNavigationComponent { | ||
| 190 | return item.channelType === 3 | 185 | return item.channelType === 3 |
| 191 | } | 186 | } |
| 192 | 187 | ||
| 193 | - //意图共享 | ||
| 194 | - topNavInsightIntentShare(item: TopNavDTO){ | ||
| 195 | - let tapNavIntent: insightIntent.InsightIntent = { | ||
| 196 | - intentName: 'ViewBlog', | ||
| 197 | - intentVersion: '1.0.1', | ||
| 198 | - identifier: '52dac3b0-6520-4974-81e5-25f0879449b5', | ||
| 199 | - intentActionInfo: { | ||
| 200 | - actionMode: 'EXPECTED', | ||
| 201 | - currentPercentage: 50, | ||
| 202 | - executedTimeSlots: { | ||
| 203 | - executedEndTime: new Date().getTime(), | ||
| 204 | - executedStartTime: this.executedStartTime | ||
| 205 | - } | ||
| 206 | - }, | ||
| 207 | - intentEntityInfo: { | ||
| 208 | - entityName: 'Blog', | ||
| 209 | - entityId: String(item.pageId) || '', | ||
| 210 | - displayName: item.name, | ||
| 211 | - logoURL: 'https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png', | ||
| 212 | - rankingHint: 99, | ||
| 213 | - isPublicData: true | ||
| 214 | - } | ||
| 215 | - } | ||
| 216 | - console.log('yzl',JSON.stringify(tapNavIntent)) | ||
| 217 | - try { | ||
| 218 | - let context = getContext(this) as common.UIAbilityContext; | ||
| 219 | - // 共享数据 | ||
| 220 | - insightIntent.shareIntent(context, [tapNavIntent], (error) => { | ||
| 221 | - if (error?.code) { | ||
| 222 | - // 处理业务逻辑错误 | ||
| 223 | - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 224 | - return; | ||
| 225 | - } | ||
| 226 | - // 执行正常业务 | ||
| 227 | - console.log('shareIntent succeed'); | ||
| 228 | - }); | ||
| 229 | - } catch (error) { | ||
| 230 | - // 处理异常 | ||
| 231 | - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 232 | - } | ||
| 233 | - } | ||
| 234 | - | ||
| 235 | 188 | ||
| 236 | build() { | 189 | build() { |
| 237 | Column() { | 190 | Column() { |
| @@ -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, |
| @@ -106,7 +107,9 @@ export struct SearchResultContentComponent { | @@ -106,7 +107,9 @@ export struct SearchResultContentComponent { | ||
| 106 | } else { | 107 | } else { |
| 107 | this.bean.cnFansNum = item.fansNum + "" | 108 | this.bean.cnFansNum = item.fansNum + "" |
| 108 | } | 109 | } |
| 109 | - this.bean.introduction = item.introduction | 110 | + let regex:RegExp = new RegExp('\n','g') |
| 111 | + this.bean.introduction = item.introduction.replace(regex,'') | ||
| 112 | + | ||
| 110 | this.bean.mainControl = item.mainControl | 113 | this.bean.mainControl = item.mainControl |
| 111 | this.bean.banControl = item.banControl | 114 | this.bean.banControl = item.banControl |
| 112 | this.bean.cnUserType = item.userType | 115 | this.bean.cnUserType = item.userType |
| @@ -256,7 +259,7 @@ export struct SearchResultContentComponent { | @@ -256,7 +259,7 @@ export struct SearchResultContentComponent { | ||
| 256 | if (this.searchType == "activity") { | 259 | if (this.searchType == "activity") { |
| 257 | ActivityItemComponent({ contentDTO: item }) | 260 | ActivityItemComponent({ contentDTO: item }) |
| 258 | } else { | 261 | } else { |
| 259 | - CardParser({ contentDTO: item }) | 262 | + CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 260 | } | 263 | } |
| 261 | if (index != this.data.totalCount() - 1) { | 264 | if (index != this.data.totalCount() - 1) { |
| 262 | Divider() | 265 | Divider() |
| @@ -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 }) |
| @@ -9,7 +9,7 @@ export struct AreaPickerDialog { | @@ -9,7 +9,7 @@ export struct AreaPickerDialog { | ||
| 9 | @Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[]) | 9 | @Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[]) |
| 10 | @Provide currentThirdBean: AreaListManageModel = new AreaListManageModel('','','',[]) | 10 | @Provide currentThirdBean: AreaListManageModel = new AreaListManageModel('','','',[]) |
| 11 | controller: CustomDialogController | 11 | controller: CustomDialogController |
| 12 | - title: string = '地区选择' | 12 | + title: string = '修改地区' |
| 13 | @Provide dataSource: AreaListModel[] = [] | 13 | @Provide dataSource: AreaListModel[] = [] |
| 14 | result: JSON[] = []; | 14 | result: JSON[] = []; |
| 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { |
| @@ -33,7 +33,7 @@ export struct AreaPickerDialog { | @@ -33,7 +33,7 @@ export struct AreaPickerDialog { | ||
| 33 | 33 | ||
| 34 | Blank() | 34 | Blank() |
| 35 | 35 | ||
| 36 | - Button('确定',{type:ButtonType.Normal}) | 36 | + Button('提交',{type:ButtonType.Normal}) |
| 37 | .onClick(()=> { | 37 | .onClick(()=> { |
| 38 | this.controller.close() | 38 | this.controller.close() |
| 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| @@ -28,9 +28,11 @@ export struct FirstLevelComponent { | @@ -28,9 +28,11 @@ export struct FirstLevelComponent { | ||
| 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) | 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) |
| 29 | }) | 29 | }) |
| 30 | .backgroundColor(Color.White) | 30 | .backgroundColor(Color.White) |
| 31 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 31 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 32 | .width('100%') | 32 | .width('100%') |
| 33 | .layoutWeight(1) | 33 | .layoutWeight(1) |
| 34 | + .selectedTextStyle({color:'#666666'}) | ||
| 35 | + .textStyle({color:'#999999'}) | ||
| 34 | } | 36 | } |
| 35 | } | 37 | } |
| 36 | .justifyContent(FlexAlign.Center) | 38 | .justifyContent(FlexAlign.Center) |
| @@ -21,9 +21,11 @@ export struct SecondLevelComponent { | @@ -21,9 +21,11 @@ export struct SecondLevelComponent { | ||
| 21 | this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number]) | 21 | this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number]) |
| 22 | }) | 22 | }) |
| 23 | .backgroundColor(Color.White) | 23 | .backgroundColor(Color.White) |
| 24 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 24 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 25 | .width('100%') | 25 | .width('100%') |
| 26 | .layoutWeight(1) | 26 | .layoutWeight(1) |
| 27 | + .selectedTextStyle({color:'#666666'}) | ||
| 28 | + .textStyle({color:'#999999'}) | ||
| 27 | } | 29 | } |
| 28 | } | 30 | } |
| 29 | .justifyContent(FlexAlign.Center) | 31 | .justifyContent(FlexAlign.Center) |
| @@ -22,9 +22,11 @@ export struct ThirdLevelComponent { | @@ -22,9 +22,11 @@ export struct ThirdLevelComponent { | ||
| 22 | this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number]) | 22 | this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number]) |
| 23 | }) | 23 | }) |
| 24 | .backgroundColor(Color.White) | 24 | .backgroundColor(Color.White) |
| 25 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 25 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 26 | .width('100%') | 26 | .width('100%') |
| 27 | .layoutWeight(1) | 27 | .layoutWeight(1) |
| 28 | + .selectedTextStyle({color:'#666666'}) | ||
| 29 | + .textStyle({color:'#999999'}) | ||
| 28 | } | 30 | } |
| 29 | } | 31 | } |
| 30 | .justifyContent(FlexAlign.Center) | 32 | .justifyContent(FlexAlign.Center) |
| @@ -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 |
| 1 | +import { common } from '@kit.AbilityKit'; | ||
| 2 | +import { insightIntent } from '@kit.IntentsKit'; | ||
| 3 | +import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; | ||
| 4 | + | ||
| 5 | +function generateUniqueId() { | ||
| 6 | + // 生成当前时间戳 | ||
| 7 | + let timestamp = new Date().getTime(); | ||
| 8 | + | ||
| 9 | + // 将时间戳转换成16进制字符串 | ||
| 10 | + let hexString = timestamp.toString(16); | ||
| 11 | + | ||
| 12 | + // 确保字符串长度为16位,不足的话在前面补0 | ||
| 13 | + while (hexString.length < 16) { | ||
| 14 | + hexString = '0' + hexString; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + // 格式化为UUID样式 | ||
| 18 | + let uuid = hexString.substring(0, 8) + '-' + | ||
| 19 | + hexString.substring(8, 12) + '-' + | ||
| 20 | + hexString.substring(12, 16) + '-' + | ||
| 21 | + hexString.substring(16, 20) + '-' + | ||
| 22 | + hexString.substring(20); | ||
| 23 | + | ||
| 24 | + return uuid; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +export const enum ActionMode { | ||
| 28 | + // 将来时 | ||
| 29 | + EXPECTED = 'EXPECTED', | ||
| 30 | + // 完成时 | ||
| 31 | + EXECUTED = 'EXECUTED', | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +//ViewBlog意图共享-频道列表 | ||
| 35 | +export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, | ||
| 36 | + compList: CompDTO[] | CompList[], actionMode: ActionMode) { | ||
| 37 | + console.log('viewBlogInsightIntentShare',actionMode) | ||
| 38 | + let insightIntentArray: insightIntent.InsightIntent [] = [] | ||
| 39 | + if (compList?.length > 0) { | ||
| 40 | + compList?.forEach((item: CompDTO | CompList) => { | ||
| 41 | + item.operDataList.forEach((_item: ContentDTO) => { | ||
| 42 | + let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | ||
| 43 | + intentName: 'ViewBlog', | ||
| 44 | + intentVersion: '1.0.1', | ||
| 45 | + identifier: generateUniqueId(), | ||
| 46 | + intentActionInfo: { | ||
| 47 | + actionMode, | ||
| 48 | + currentPercentage: 50, | ||
| 49 | + //目前不考虑发生时段 | ||
| 50 | + // executedTimeSlots: { | ||
| 51 | + // executedEndTime: new Date().getTime(), | ||
| 52 | + // executedStartTime: pageModel.executedStartTime | ||
| 53 | + // } | ||
| 54 | + }, | ||
| 55 | + intentEntityInfo: { | ||
| 56 | + entityName: 'Blog', | ||
| 57 | + entityId: _item?.objectId, | ||
| 58 | + displayName: _item?.newsTitle, | ||
| 59 | + entityGroupId, //channelId | ||
| 60 | + logoURL: _item?.coverUrl, | ||
| 61 | + metadataModificationTime: _item?.publishTimestamp, | ||
| 62 | + blogTitle: _item?.newsTitle, | ||
| 63 | + blogType: 'Normal', | ||
| 64 | + blogCategory: item.name, | ||
| 65 | + categoryDisplayName: item.name, | ||
| 66 | + blogSubTitle: _item?.newsSummary.length > 20 ? | ||
| 67 | + _item?.newsSummary.substring(0, 20) : _item?.newsSummary, | ||
| 68 | + blogAuthor: _item?.source, | ||
| 69 | + blogPublishTime: _item?.publishTimestamp, | ||
| 70 | + tag: _item?.newTags, | ||
| 71 | + likeCount: _item?.interactData?.likeNum || 0, | ||
| 72 | + forwardCount: _item?.interactData?.shareNum || 0, | ||
| 73 | + commentCount: _item?.interactData?.commentNum || 0, | ||
| 74 | + favorites: _item?.interactData?.collectNum || 0, | ||
| 75 | + viewCount: _item?.interactData?.readNum || 0, | ||
| 76 | + rankingHint: 99, | ||
| 77 | + isPublicData: true | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + insightIntentArray.push(viewBlogInsightIntentItem) | ||
| 81 | + }) | ||
| 82 | + | ||
| 83 | + }) | ||
| 84 | + console.log('yzl', JSON.stringify(insightIntentArray[0])) | ||
| 85 | + try { | ||
| 86 | + // 共享数据 | ||
| 87 | + insightIntent.shareIntent(context, insightIntentArray, (error) => { | ||
| 88 | + if (error?.code) { | ||
| 89 | + // 处理业务逻辑错误 | ||
| 90 | + console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | + // 执行正常业务 | ||
| 94 | + console.log('shareIntent succeed'); | ||
| 95 | + }); | ||
| 96 | + } catch (error) { | ||
| 97 | + // 处理异常 | ||
| 98 | + console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | + | ||
| 104 | +//ViewBlog意图共享-早晚报 | ||
| 105 | +export function viewColumInsightIntentShare(context: common.UIAbilityContext, entityId: string, | ||
| 106 | + pageInfoBean: PageInfoBean) { | ||
| 107 | + console.log('viewColumInsightIntentShare') | ||
| 108 | + let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | ||
| 109 | + intentName: 'ViewColumn', | ||
| 110 | + intentVersion: '1.0.1', | ||
| 111 | + identifier: generateUniqueId(), | ||
| 112 | + intentActionInfo: { | ||
| 113 | + actionMode: ActionMode.EXECUTED, | ||
| 114 | + currentPercentage: 50, | ||
| 115 | + }, | ||
| 116 | + intentEntityInfo: { | ||
| 117 | + entityName: 'Column', | ||
| 118 | + entityId, | ||
| 119 | + displayName:pageInfoBean?.topicInfo?.title, | ||
| 120 | + description: pageInfoBean?.shareSummary, | ||
| 121 | + logoURL:pageInfoBean?.shareCoverUrl, | ||
| 122 | + activityType:['RecentViews'], | ||
| 123 | + columnTitle: pageInfoBean?.topicInfo?.title, | ||
| 124 | + columnSubTitle: pageInfoBean?.shareSummary, | ||
| 125 | + rankingHint: 99, | ||
| 126 | + isPublicData: true | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + try { | ||
| 131 | + // 共享数据 | ||
| 132 | + insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => { | ||
| 133 | + if (error?.code) { | ||
| 134 | + // 处理业务逻辑错误 | ||
| 135 | + console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 136 | + return; | ||
| 137 | + } | ||
| 138 | + // 执行正常业务 | ||
| 139 | + console.log('shareIntent succeed'); | ||
| 140 | + }); | ||
| 141 | + } catch (error) { | ||
| 142 | + // 处理异常 | ||
| 143 | + console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 144 | + } | ||
| 145 | +} |
| @@ -125,7 +125,7 @@ class EditInfoViewModel { | @@ -125,7 +125,7 @@ class EditInfoViewModel { | ||
| 125 | this.BasePostRequest(item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname?HttpUrlUtils.APPOINTMENT_editUserDetail1_PATH:HttpUrlUtils.APPOINTMENT_editUserDetail_PATH,this.params) | 125 | this.BasePostRequest(item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname?HttpUrlUtils.APPOINTMENT_editUserDetail1_PATH:HttpUrlUtils.APPOINTMENT_editUserDetail_PATH,this.params) |
| 126 | .then((navResDTO: ResponseDTO) => { | 126 | .then((navResDTO: ResponseDTO) => { |
| 127 | if (navResDTO.code == 0) { | 127 | if (navResDTO.code == 0) { |
| 128 | - promptAction.showToast({ message: '修改成功' }) | 128 | + promptAction.showToast({ message: '您的资料已提交' }) |
| 129 | success(navResDTO) | 129 | success(navResDTO) |
| 130 | }else { | 130 | }else { |
| 131 | promptAction.showToast({ message: navResDTO.message }) | 131 | promptAction.showToast({ message: navResDTO.message }) |
| @@ -11,7 +11,8 @@ import { ArrayList } from '@kit.ArkTS'; | @@ -11,7 +11,8 @@ import { ArrayList } from '@kit.ArkTS'; | ||
| 11 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; | 11 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; |
| 12 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 12 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| 13 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | 13 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; |
| 14 | - | 14 | +import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' |
| 15 | +import { common } from '@kit.AbilityKit'; | ||
| 15 | const TAG = 'PageHelper'; | 16 | const TAG = 'PageHelper'; |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| @@ -52,13 +53,13 @@ export class PageHelper { | @@ -52,13 +53,13 @@ export class PageHelper { | ||
| 52 | 53 | ||
| 53 | getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { | 54 | getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 54 | pageModel.currentPage = 1; | 55 | 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){ | 56 | + if (pageModel.pageType == 1) { |
| 57 | + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { | ||
| 58 | + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | ||
| 58 | pageModel.viewType = ViewType.EMPTY; | 59 | pageModel.viewType = ViewType.EMPTY; |
| 59 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; | 60 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 60 | return; | 61 | return; |
| 61 | - }else{ | 62 | + } else { |
| 62 | //更新数据 | 63 | //更新数据 |
| 63 | pageModel.compList.addItems(liveReviewDTO.list); | 64 | pageModel.compList.addItems(liveReviewDTO.list); |
| 64 | closeRefresh(pageModel, true); | 65 | closeRefresh(pageModel, true); |
| @@ -66,7 +67,7 @@ export class PageHelper { | @@ -66,7 +67,7 @@ export class PageHelper { | ||
| 66 | }).catch((err: string | Resource) => { | 67 | }).catch((err: string | Resource) => { |
| 67 | promptAction.showToast({ message: err }); | 68 | promptAction.showToast({ message: err }); |
| 68 | }) | 69 | }) |
| 69 | - }else{ | 70 | + } else { |
| 70 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { | 71 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { |
| 71 | if (pageInfo == null) { | 72 | if (pageInfo == null) { |
| 72 | pageModel.viewType = ViewType.EMPTY; | 73 | pageModel.viewType = ViewType.EMPTY; |
| @@ -103,7 +104,7 @@ export class PageHelper { | @@ -103,7 +104,7 @@ export class PageHelper { | ||
| 103 | let index = pageInfo.groups.indexOf(group) | 104 | let index = pageInfo.groups.indexOf(group) |
| 104 | if (index == 0) { | 105 | if (index == 0) { |
| 105 | // 清空comp列表 | 106 | // 清空comp列表 |
| 106 | - pageModel.compList.clear() | 107 | + pageModel.compList.clearAllData() |
| 107 | } | 108 | } |
| 108 | this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) | 109 | this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) |
| 109 | 110 | ||
| @@ -119,7 +120,6 @@ export class PageHelper { | @@ -119,7 +120,6 @@ export class PageHelper { | ||
| 119 | } | 120 | } |
| 120 | 121 | ||
| 121 | private async getGroupData(pageModel: PageModel, pageDto: PageDTO, isLastGroup: boolean) { | 122 | private async getGroupData(pageModel: PageModel, pageDto: PageDTO, isLastGroup: boolean) { |
| 122 | - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 123 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | 123 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { |
| 124 | pageModel.viewType = ViewType.LOADED; | 124 | pageModel.viewType = ViewType.LOADED; |
| 125 | if (isLastGroup) { | 125 | if (isLastGroup) { |
| @@ -135,12 +135,9 @@ export class PageHelper { | @@ -135,12 +135,9 @@ export class PageHelper { | ||
| 135 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | 135 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) |
| 136 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 | 136 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 |
| 137 | // 二次请求,批查互动数据 | 137 | // 二次请求,批查互动数据 |
| 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 | - }) | 138 | + this.allCompBatchRequest(pageDto.compList, pageModel) |
| 139 | + | ||
| 140 | + | ||
| 144 | // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll | 141 | // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll |
| 145 | if (isLastGroup) { | 142 | if (isLastGroup) { |
| 146 | closeRefresh(pageModel, true); | 143 | closeRefresh(pageModel, true); |
| @@ -185,7 +182,7 @@ export class PageHelper { | @@ -185,7 +182,7 @@ export class PageHelper { | ||
| 185 | let layoutAdvIndex = 0; //稿件投放统计 | 182 | let layoutAdvIndex = 0; //稿件投放统计 |
| 186 | // 升序排序 | 183 | // 升序排序 |
| 187 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) | 184 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) |
| 188 | - // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); | 185 | + // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); |
| 189 | //当前日期 | 186 | //当前日期 |
| 190 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); | 187 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); |
| 191 | for (let advBean of compAdvList) { | 188 | for (let advBean of compAdvList) { |
| @@ -276,11 +273,10 @@ export class PageHelper { | @@ -276,11 +273,10 @@ export class PageHelper { | ||
| 276 | let b = advPosition - a; | 273 | let b = advPosition - a; |
| 277 | // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) | 274 | // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) |
| 278 | if (b <= pageCompSize && b >= 0) { | 275 | if (b <= pageCompSize && b >= 0) { |
| 279 | - | ||
| 280 | - let advComp: CompDTO = { | ||
| 281 | - compStyle: CompStyle.Card_Comp_Adv, | ||
| 282 | - matInfo: matInfo | ||
| 283 | - } as CompDTO; | 276 | + // 创建广告稿件 |
| 277 | + let advComp: CompDTO = new CompDTO; | ||
| 278 | + advComp.compStyle = CompStyle.Card_Comp_Adv | ||
| 279 | + advComp.matInfo = matInfo | ||
| 284 | 280 | ||
| 285 | if (pageCompSize == slotInfo.position) { | 281 | if (pageCompSize == slotInfo.position) { |
| 286 | pageCompList.add(advComp) | 282 | pageCompList.add(advComp) |
| @@ -307,12 +303,12 @@ export class PageHelper { | @@ -307,12 +303,12 @@ export class PageHelper { | ||
| 307 | */ | 303 | */ |
| 308 | private compLoadMore(pageModel: PageModel) { | 304 | private compLoadMore(pageModel: PageModel) { |
| 309 | //聚合页 | 305 | //聚合页 |
| 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){ | 306 | + if (pageModel.pageType == 1) { |
| 307 | + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { | ||
| 308 | + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | ||
| 313 | pageModel.hasMore = false; | 309 | pageModel.hasMore = false; |
| 314 | return; | 310 | return; |
| 315 | - }else{ | 311 | + } else { |
| 316 | //更新数据 | 312 | //更新数据 |
| 317 | pageModel.compList.addItems(liveReviewDTO.list); | 313 | pageModel.compList.addItems(liveReviewDTO.list); |
| 318 | // 直接认为有分页,一直加载分页。直到没有数据,再停止 | 314 | // 直接认为有分页,一直加载分页。直到没有数据,再停止 |
| @@ -323,10 +319,9 @@ export class PageHelper { | @@ -323,10 +319,9 @@ export class PageHelper { | ||
| 323 | }).catch((err: string | Resource) => { | 319 | }).catch((err: string | Resource) => { |
| 324 | promptAction.showToast({ message: err }); | 320 | promptAction.showToast({ message: err }); |
| 325 | }) | 321 | }) |
| 326 | - }else{ | 322 | + } else { |
| 327 | PageViewModel.getPageData(pageModel.bizCopy()) | 323 | PageViewModel.getPageData(pageModel.bizCopy()) |
| 328 | .then((data: PageDTO) => { | 324 | .then((data: PageDTO) => { |
| 329 | - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 330 | if (data == null || data.compList == null || data.compList.length == 0) { | 325 | if (data == null || data.compList == null || data.compList.length == 0) { |
| 331 | pageModel.hasMore = false; | 326 | pageModel.hasMore = false; |
| 332 | } else { | 327 | } else { |
| @@ -336,14 +331,8 @@ export class PageHelper { | @@ -336,14 +331,8 @@ export class PageHelper { | ||
| 336 | 331 | ||
| 337 | //移除音频 和 活动 | 332 | //移除音频 和 活动 |
| 338 | this.collectPageComp(pageModel, data) | 333 | 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 | - }) | 334 | + // 参与批查 |
| 335 | + this.allCompBatchRequest(data.compList, pageModel) | ||
| 347 | } | 336 | } |
| 348 | }).catch((err: string | Resource) => { | 337 | }).catch((err: string | Resource) => { |
| 349 | promptAction.showToast({ message: err }); | 338 | promptAction.showToast({ message: err }); |
| @@ -351,6 +340,35 @@ export class PageHelper { | @@ -351,6 +340,35 @@ export class PageHelper { | ||
| 351 | } | 340 | } |
| 352 | } | 341 | } |
| 353 | 342 | ||
| 343 | + /** | ||
| 344 | + * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 | ||
| 345 | + * @param compList | ||
| 346 | + * @param pageModel | ||
| 347 | + */ | ||
| 348 | + private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) { | ||
| 349 | + PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { | ||
| 350 | + // 刷新,替换所有数据 | ||
| 351 | + this.resetInteract(data, pageModel.compList) | ||
| 352 | + if(pageModel?.channelId !== '2001' && pageModel?.channelId !== '2002'){ | ||
| 353 | + //早晚报意图上报 | ||
| 354 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 355 | + viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED) | ||
| 356 | + } | ||
| 357 | + }) | ||
| 358 | + | ||
| 359 | + // 测试数据 | ||
| 360 | + // setTimeout(() => { | ||
| 361 | + // let index = 1 | ||
| 362 | + // let comp = pageModel.compList.getData(index) as CompDTO | ||
| 363 | + // comp.hasMore = 0 | ||
| 364 | + // //comp.operDataList[0].newsTitle = '测试111' | ||
| 365 | + // let con :InteractDataDTO = new InteractDataDTO; | ||
| 366 | + // con.commentNum=1000 | ||
| 367 | + // comp.operDataList[0].interactData = con | ||
| 368 | + // Logger.debug("ZZZXXXXX", | ||
| 369 | + // "-----setTimeout--------->" + comp.hasMore) | ||
| 370 | + // }, 4 * 1000) | ||
| 371 | + } | ||
| 354 | 372 | ||
| 355 | /** | 373 | /** |
| 356 | * 移除comp | 374 | * 移除comp |
| @@ -359,9 +377,7 @@ export class PageHelper { | @@ -359,9 +377,7 @@ export class PageHelper { | ||
| 359 | 377 | ||
| 360 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | 378 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 |
| 361 | 379 | ||
| 362 | - let datas = pageDto.compList | ||
| 363 | - for (let index = 0; index < datas.length; index++) { | ||
| 364 | - const element = datas[index]; | 380 | + pageDto.compList.forEach((element: CompDTO) => { |
| 365 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | 381 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); |
| 366 | //移除音频 和 活动 | 382 | //移除音频 和 活动 |
| 367 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 383 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| @@ -372,24 +388,21 @@ export class PageHelper { | @@ -372,24 +388,21 @@ export class PageHelper { | ||
| 372 | } else { | 388 | } else { |
| 373 | pageCompList.add(element) | 389 | pageCompList.add(element) |
| 374 | } | 390 | } |
| 375 | - | ||
| 376 | } | 391 | } |
| 377 | - } | 392 | + |
| 393 | + }) | ||
| 378 | 394 | ||
| 379 | // 记录 | 395 | // 记录 |
| 380 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | 396 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize |
| 381 | - // console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize); | ||
| 382 | 397 | ||
| 383 | // 处理页面广告数据,投放到页面的位置 | 398 | // 处理页面广告数据,投放到页面的位置 |
| 384 | this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); | 399 | this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); |
| 385 | 400 | ||
| 386 | - | ||
| 387 | //遍历所有组件和稿件数据 push到页面 | 401 | //遍历所有组件和稿件数据 push到页面 |
| 388 | for (let element of pageCompList) { | 402 | for (let element of pageCompList) { |
| 389 | - pageModel.compList.push(element) | 403 | + pageModel.compList.push(CompDTO.createNewsBean(element)) |
| 390 | } | 404 | } |
| 391 | 405 | ||
| 392 | - | ||
| 393 | } | 406 | } |
| 394 | 407 | ||
| 395 | /** | 408 | /** |
| @@ -401,6 +414,7 @@ export class PageHelper { | @@ -401,6 +414,7 @@ export class PageHelper { | ||
| 401 | if (interact == null || interact.length == 0) { | 414 | if (interact == null || interact.length == 0) { |
| 402 | return | 415 | return |
| 403 | } | 416 | } |
| 417 | + let time = DateTimeUtils.getTimeStamp().toString() | ||
| 404 | interact.forEach((interactData) => { | 418 | interact.forEach((interactData) => { |
| 405 | let id = interactData.contentId; | 419 | let id = interactData.contentId; |
| 406 | outer: for (let i = 0; i < compList.totalCount(); i++) { | 420 | outer: for (let i = 0; i < compList.totalCount(); i++) { |
| @@ -415,6 +429,7 @@ export class PageHelper { | @@ -415,6 +429,7 @@ export class PageHelper { | ||
| 415 | } | 429 | } |
| 416 | if (id == content.objectId) { | 430 | if (id == content.objectId) { |
| 417 | content.interactData = interactData; | 431 | content.interactData = interactData; |
| 432 | + comp.timestamp = time | ||
| 418 | break outer; | 433 | break outer; |
| 419 | } | 434 | } |
| 420 | } | 435 | } |
| @@ -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 | // }; |
| @@ -47,7 +47,7 @@ struct LaunchInterestsHobbiesPage { | @@ -47,7 +47,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 47 | .width('100%') | 47 | .width('100%') |
| 48 | .height('61lpx') | 48 | .height('61lpx') |
| 49 | .margin({top:'84lpx'}) | 49 | .margin({top:'84lpx'}) |
| 50 | - Text('完善信息,将为您推荐个性化的内容') | 50 | + Text('完善信息,将为您推荐个性化的内容') |
| 51 | .fontSize('27lpx') | 51 | .fontSize('27lpx') |
| 52 | .textAlign(TextAlign.Center) | 52 | .textAlign(TextAlign.Center) |
| 53 | .fontColor('#9E9E9E') | 53 | .fontColor('#9E9E9E') |
| @@ -69,8 +69,8 @@ struct LaunchInterestsHobbiesPage { | @@ -69,8 +69,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 69 | Image('') | 69 | Image('') |
| 70 | .width('100%') | 70 | .width('100%') |
| 71 | .height('100%') | 71 | .height('100%') |
| 72 | - .backgroundColor(Color.Gray) | ||
| 73 | - .opacity(item.choose?0.85:0) | 72 | + .backgroundColor(Color.Black) |
| 73 | + .opacity(item.choose?0.5:0) | ||
| 74 | .borderRadius(5) | 74 | .borderRadius(5) |
| 75 | } | 75 | } |
| 76 | 76 | ||
| @@ -134,14 +134,14 @@ struct LaunchInterestsHobbiesPage { | @@ -134,14 +134,14 @@ struct LaunchInterestsHobbiesPage { | ||
| 134 | .width('662lpx') | 134 | .width('662lpx') |
| 135 | .height('84lpx') | 135 | .height('84lpx') |
| 136 | .backgroundColor(Color.White) | 136 | .backgroundColor(Color.White) |
| 137 | - .opacity(this.selectCount == 0 ? 0.3 : 0) | 137 | + .opacity(this.selectCount == 0 ? 0.6 : 0) |
| 138 | .borderRadius('10lpx') | 138 | .borderRadius('10lpx') |
| 139 | .onClick(()=>{ | 139 | .onClick(()=>{ |
| 140 | if (this.selectCount == 0) { | 140 | if (this.selectCount == 0) { |
| 141 | promptAction.showToast({ | 141 | promptAction.showToast({ |
| 142 | message : '请先选择您感兴趣的内容哦', | 142 | message : '请先选择您感兴趣的内容哦', |
| 143 | duration: 2000, | 143 | duration: 2000, |
| 144 | - bottom: '50%' | 144 | + bottom: '50%', |
| 145 | }) | 145 | }) |
| 146 | return | 146 | return |
| 147 | } | 147 | } |
-
Please register or login to post a comment