Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (32 commits) desc:热门评论相关 50% 绑定手机号 h5专题跳转 H5详情 环境切换 新增样式卡-小视频卡人民号 desc:搜索结果 desc:搜索结果 comp 展现 样式卡作者信息展示优化 权限管理工具类 isFirstIn注释 webview高度自适应 删除冗余样式卡,样式卡集中在cardView和compView文件夹中 样式卡底部来源、评论、发布日期抽离组件 wdComponent Index.ets修改 音频dialog开发抽取工具类 视频频道入口修改 优化通信工具 播放器修改 人民号单图卡ui 直播与视频冲突,分开写 ...
Showing
128 changed files
with
4575 additions
and
2003 deletions
| @@ -13,6 +13,11 @@ export class SpConstants{ | @@ -13,6 +13,11 @@ export class SpConstants{ | ||
| 13 | //协议相关 | 13 | //协议相关 |
| 14 | static USER_PROTOCOL = "user_protocol" //用户协议 | 14 | static USER_PROTOCOL = "user_protocol" //用户协议 |
| 15 | static PRIVATE_PROTOCOL = "private_protocol" //隐私协议 | 15 | static PRIVATE_PROTOCOL = "private_protocol" //隐私协议 |
| 16 | + static LOGOUT_PROTOCOL = "logout_protocol" //人民日报客户端app注销协议 | ||
| 17 | + static MESSAGE_BOARD_USER_PROTOCOL = "message_board_user_protocol" //"留言板-用户协议" | ||
| 18 | + static MESSAGE_BOARD_NOTICE_PROTOCOL = "message_board_notice_protocol" //留言板-留言须知 | ||
| 19 | + static MESSAGE_BOARD_QUESTION_PROTOCOL = "message_board_question_protocol" //"留言板-发布提问规定"" | ||
| 20 | + static MESSAGE_BOARD_PRIVATE_PROTOCOL = "message_board_private_protocol" //"留言板-隐私政策" | ||
| 16 | //设置页面 | 21 | //设置页面 |
| 17 | static SETTING_WIFI_IMAGE_SWITCH = "setting_wifi_switch" //wifi 图片开关 | 22 | static SETTING_WIFI_IMAGE_SWITCH = "setting_wifi_switch" //wifi 图片开关 |
| 18 | static SETTING_WIFI_VIDEO_SWITCH = "setting_wifi_switch" //wifi 视频开关 | 23 | static SETTING_WIFI_VIDEO_SWITCH = "setting_wifi_switch" //wifi 视频开关 |
| 1 | +/** | ||
| 2 | + * https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-window-0000001820880785#ZH-CN_TOPIC_0000001811317218__systembarproperties | ||
| 3 | + * 状态栏、导航栏的属性。 | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 状态栏背景颜色 statusBarColor | ||
| 8 | + * 导航栏背景颜色 navigationBarColor | ||
| 9 | + */ | ||
| 10 | +export const enum SysStatusBarColor { | ||
| 11 | + WHITE = '#ffffff', | ||
| 12 | + BLACK = '#000000', | ||
| 13 | + DEFAULT = '#0x66000000' | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 状态栏文字颜色 statusBarContentColor8 | ||
| 19 | + * 导航栏文字颜色 navigationBarContentColor8 | ||
| 20 | + */ | ||
| 21 | +export const enum SysBarContentColor { | ||
| 22 | + WHITE = '#ffffff', | ||
| 23 | + BLACK = '#000000', | ||
| 24 | + DEFAULT = '0xE5FFFFFF' | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + |
| 1 | import { Action } from './Action'; | 1 | import { Action } from './Action'; |
| 2 | - | 2 | +interface dataObject { |
| 3 | + webViewHeight?: string | ||
| 4 | + dataJson?: string | ||
| 5 | +} | ||
| 3 | /** | 6 | /** |
| 4 | * 消息Message | 7 | * 消息Message |
| 5 | */ | 8 | */ |
| @@ -7,7 +10,7 @@ export class Message { | @@ -7,7 +10,7 @@ export class Message { | ||
| 7 | callbackId: string = ""; //callbackId | 10 | callbackId: string = ""; //callbackId |
| 8 | responseId: string = ""; //responseId | 11 | responseId: string = ""; //responseId |
| 9 | responseData: string = ""; //responseData | 12 | responseData: string = ""; //responseData |
| 10 | - data?: object; //data of message | 13 | + data?: dataObject; //data of message |
| 11 | handlerName: string = ""; //name of handler | 14 | handlerName: string = ""; //name of handler |
| 12 | 15 | ||
| 13 | /** | 16 | /** |
| @@ -36,6 +36,10 @@ export { UserDataLocal } from './src/main/ets/utils/UserDataLocal' | @@ -36,6 +36,10 @@ export { UserDataLocal } from './src/main/ets/utils/UserDataLocal' | ||
| 36 | 36 | ||
| 37 | export { NumberFormatterUtils } from './src/main/ets/utils/NumberFormatterUtils' | 37 | export { NumberFormatterUtils } from './src/main/ets/utils/NumberFormatterUtils' |
| 38 | 38 | ||
| 39 | -// export { PermissionUtils } from './src/main/ets/utils/PermissionUtils' | 39 | +export { PermissionUtils } from './src/main/ets/utils/PermissionUtils' |
| 40 | 40 | ||
| 41 | -export { ErrorToastUtils } from './src/main/ets/utils/ErrorToastUtils' | ||
| 41 | +export { ErrorToastUtils } from './src/main/ets/utils/ErrorToastUtils' | ||
| 42 | + | ||
| 43 | +export { EmitterUtils } from './src/main/ets/utils/EmitterUtils' | ||
| 44 | + | ||
| 45 | +export { EmitterEventId } from './src/main/ets/utils/EmitterEventId' |
| 1 | +import emitter from '@ohos.events.emitter'; | ||
| 2 | + | ||
| 3 | +const TAG: string = 'EmitterUtils'; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 线程间通信简单工具 | ||
| 7 | + */ | ||
| 8 | +export class EmitterUtils { | ||
| 9 | + /** | ||
| 10 | + * 发送空消息 | ||
| 11 | + * @param eventId 事件id | ||
| 12 | + */ | ||
| 13 | + static sendEmptyEvent(eventId: number) { | ||
| 14 | + let event: emitter.InnerEvent = { | ||
| 15 | + eventId: eventId, | ||
| 16 | + priority: emitter.EventPriority.LOW | ||
| 17 | + }; | ||
| 18 | + emitter.emit(event); | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 发送消息 | ||
| 23 | + * @param eventId 事件id | ||
| 24 | + * @param str 字符串数据 | ||
| 25 | + */ | ||
| 26 | + static sendEvent(eventId: number, str?: string) { | ||
| 27 | + let event: emitter.InnerEvent = { | ||
| 28 | + eventId: eventId, | ||
| 29 | + priority: emitter.EventPriority.LOW | ||
| 30 | + }; | ||
| 31 | + let eventData: emitter.EventData = { | ||
| 32 | + data: { | ||
| 33 | + jsonStr: str | ||
| 34 | + } | ||
| 35 | + }; | ||
| 36 | + emitter.emit(event, eventData); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 接收消息 | ||
| 41 | + * @param eventId 事件id | ||
| 42 | + * @param callback 回调函数 | ||
| 43 | + */ | ||
| 44 | + static receiveEvent(eventId: number, callback: (str?: string) => void) { | ||
| 45 | + let event: emitter.InnerEvent = { | ||
| 46 | + eventId: eventId | ||
| 47 | + }; | ||
| 48 | + | ||
| 49 | + // 收到eventId事件后执行该回调 | ||
| 50 | + let callback1 = (eventData?: emitter.EventData): void => { | ||
| 51 | + if (eventData && eventData.data) { | ||
| 52 | + try { | ||
| 53 | + let jsonObject: EmitterBean = JSON.parse(JSON.stringify(eventData.data)) | ||
| 54 | + callback(jsonObject.jsonStr) | ||
| 55 | + } catch (err) { | ||
| 56 | + callback() | ||
| 57 | + } | ||
| 58 | + } else { | ||
| 59 | + callback() | ||
| 60 | + } | ||
| 61 | + }; | ||
| 62 | + // 订阅eventId事件 | ||
| 63 | + emitter.on(event, callback1); | ||
| 64 | + } | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +interface EmitterBean { | ||
| 68 | + jsonStr: string | ||
| 69 | +} |
| 1 | -// import { abilityAccessCtrl, bundleManager, common, Permissions, Want } from '@kit.AbilityKit' | ||
| 2 | -// import { BusinessError } from '@kit.BasicServicesKit' | ||
| 3 | -// import { AppUtils } from './AppUtils' | ||
| 4 | -// import { Logger } from './Logger' | ||
| 5 | -// | ||
| 6 | -// /** | ||
| 7 | -// * 权限工具类 | ||
| 8 | -// * */ | ||
| 9 | -// export class PermissionUtils { | ||
| 10 | -// //相机权限 | ||
| 11 | -// static CAMERA: Permissions = 'ohos.permission.CAMERA' | ||
| 12 | -// //文件权限 | ||
| 13 | -// static READ_MEDIA: Permissions = 'ohos.permission.READ_MEDIA' | ||
| 14 | -// static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_MEDIA' | ||
| 15 | -// private static tokenId: number = 0 | ||
| 16 | -// | ||
| 17 | -// /**检查权限是否授权*/ | ||
| 18 | -// static async checkPermissions(permission: Permissions): Promise<boolean> { | ||
| 19 | -// let hasPermissions = false; | ||
| 20 | -// let grantStatus: abilityAccessCtrl.GrantStatus = await PermissionUtils.checkAccessToken(permission); | ||
| 21 | -// | ||
| 22 | -// if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { | ||
| 23 | -// // 已经授权,可以继续访问目标操作 | ||
| 24 | -// hasPermissions = true; | ||
| 25 | -// } else { | ||
| 26 | -// hasPermissions = false; | ||
| 27 | -// // 申请日历权限 | ||
| 28 | -// } | ||
| 29 | -// return hasPermissions; | ||
| 30 | -// } | ||
| 31 | -// | ||
| 32 | -// /**动态申请权限*/ | ||
| 33 | -// static reqPermissionsFromUser(permissions: Array<Permissions>, component: Object): Promise<boolean> { | ||
| 34 | -// | ||
| 35 | -// return new Promise((resolve, fail) => { | ||
| 36 | -// let context = getContext(component) as common.UIAbilityContext; | ||
| 37 | -// let atManager = abilityAccessCtrl.createAtManager(); | ||
| 38 | -// atManager.requestPermissionsFromUser(context, permissions).then((data) => { | ||
| 39 | -// let grantStatus: Array<number> = data.authResults; | ||
| 40 | -// let length: number = grantStatus.length; | ||
| 41 | -// | ||
| 42 | -// for (let i = 0; i < length; i++) { | ||
| 43 | -// if (grantStatus[i] === 0) { | ||
| 44 | -// // 用户授权,可以继续访问目标操作 | ||
| 45 | -// resolve(true); | ||
| 46 | -// } else { | ||
| 47 | -// resolve(false) | ||
| 48 | -// } | ||
| 49 | -// } | ||
| 50 | -// }).catch((err: Error) => { | ||
| 51 | -// fail(err) | ||
| 52 | -// }) | ||
| 53 | -// }); | ||
| 54 | -// } | ||
| 55 | -// | ||
| 56 | -// /**跳转设置页面*/ | ||
| 57 | -// static openPermissionsInSystemSettings(context: Object): void { | ||
| 58 | -// let uiContext = getContext(context) as common.UIAbilityContext; | ||
| 59 | -// let wantInfo: Want = { | ||
| 60 | -// bundleName: 'com.huawei.hmos.settings', | ||
| 61 | -// abilityName: 'com.huawei.hmos.settings.MainAbility', | ||
| 62 | -// uri: 'application_info_entry', | ||
| 63 | -// parameters: { | ||
| 64 | -// pushParams: AppUtils.getPackageName(uiContext) // 打开指定应用的设置页面 | ||
| 65 | -// } | ||
| 66 | -// } | ||
| 67 | -// uiContext.startAbility(wantInfo) | ||
| 68 | -// } | ||
| 69 | -// | ||
| 70 | -// private static async checkAccessToken(permission: Permissions): Promise<abilityAccessCtrl.GrantStatus> { | ||
| 71 | -// let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); | ||
| 72 | -// let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; | ||
| 73 | -// | ||
| 74 | -// // 获取应用程序的accessTokenID | ||
| 75 | -// if (PermissionUtils.tokenId == 0) { | ||
| 76 | -// try { | ||
| 77 | -// let bundleInfo: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); | ||
| 78 | -// let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; | ||
| 79 | -// PermissionUtils.tokenId = appInfo.accessTokenId; | ||
| 80 | -// } catch (error) { | ||
| 81 | -// const err: BusinessError = error as BusinessError; | ||
| 82 | -// } | ||
| 83 | -// } | ||
| 84 | -// // 校验应用是否被授予权限 | ||
| 85 | -// try { | ||
| 86 | -// grantStatus = await atManager.checkAccessToken(PermissionUtils.tokenId, permission); | ||
| 87 | -// } catch (error) { | ||
| 88 | -// const err: BusinessError = error as BusinessError; | ||
| 89 | -// } | ||
| 90 | -// | ||
| 91 | -// return grantStatus; | ||
| 92 | -// } | ||
| 93 | -// | ||
| 94 | -// } | ||
| 1 | +import { abilityAccessCtrl, bundleManager, common, Permissions, Want } from '@kit.AbilityKit' | ||
| 2 | +import { BusinessError } from '@kit.BasicServicesKit' | ||
| 3 | +import { AppUtils } from './AppUtils' | ||
| 4 | +import { Logger } from './Logger' | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 权限工具类 | ||
| 8 | + * */ | ||
| 9 | +export class PermissionUtils { | ||
| 10 | + //相机权限 | ||
| 11 | + static CAMERA: Permissions = 'ohos.permission.CAMERA' | ||
| 12 | + //文件权限 | ||
| 13 | + static READ_MEDIA: Permissions = 'ohos.permission.READ_MEDIA' | ||
| 14 | + static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_MEDIA' | ||
| 15 | + private static tokenId: number = 0 | ||
| 16 | + | ||
| 17 | + /**检查权限是否授权*/ | ||
| 18 | + static async checkPermissions(permission: Permissions): Promise<boolean> { | ||
| 19 | + let hasPermissions = false; | ||
| 20 | + let grantStatus: abilityAccessCtrl.GrantStatus = await PermissionUtils.checkAccessToken(permission); | ||
| 21 | + | ||
| 22 | + if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { | ||
| 23 | + // 已经授权,可以继续访问目标操作 | ||
| 24 | + hasPermissions = true; | ||
| 25 | + } else { | ||
| 26 | + hasPermissions = false; | ||
| 27 | + // 申请日历权限 | ||
| 28 | + } | ||
| 29 | + return hasPermissions; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /**动态申请权限*/ | ||
| 33 | + static reqPermissionsFromUser(permissions: Array<Permissions>, component: Object): Promise<boolean> { | ||
| 34 | + | ||
| 35 | + return new Promise((resolve, fail) => { | ||
| 36 | + let context = getContext(component) as common.UIAbilityContext; | ||
| 37 | + let atManager = abilityAccessCtrl.createAtManager(); | ||
| 38 | + atManager.requestPermissionsFromUser(context, permissions).then((data) => { | ||
| 39 | + let grantStatus: Array<number> = data.authResults; | ||
| 40 | + let length: number = grantStatus.length; | ||
| 41 | + | ||
| 42 | + for (let i = 0; i < length; i++) { | ||
| 43 | + if (grantStatus[i] === 0) { | ||
| 44 | + // 用户授权,可以继续访问目标操作 | ||
| 45 | + resolve(true); | ||
| 46 | + } else { | ||
| 47 | + resolve(false) | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + }).catch((err: Error) => { | ||
| 51 | + fail(err) | ||
| 52 | + }) | ||
| 53 | + }); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /**跳转设置页面*/ | ||
| 57 | + static openPermissionsInSystemSettings(context: Object): void { | ||
| 58 | + let uiContext = getContext(context) as common.UIAbilityContext; | ||
| 59 | + let wantInfo: Want = { | ||
| 60 | + bundleName: 'com.huawei.hmos.settings', | ||
| 61 | + abilityName: 'com.huawei.hmos.settings.MainAbility', | ||
| 62 | + uri: 'application_info_entry', | ||
| 63 | + parameters: { | ||
| 64 | + pushParams: AppUtils.getPackageName(uiContext) // 打开指定应用的设置页面 | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + uiContext.startAbility(wantInfo) | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + private static async checkAccessToken(permission: Permissions): Promise<abilityAccessCtrl.GrantStatus> { | ||
| 71 | + let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); | ||
| 72 | + let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; | ||
| 73 | + | ||
| 74 | + // 获取应用程序的accessTokenID | ||
| 75 | + if (PermissionUtils.tokenId == 0) { | ||
| 76 | + try { | ||
| 77 | + let bundleInfo: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); | ||
| 78 | + let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; | ||
| 79 | + PermissionUtils.tokenId = appInfo.accessTokenId; | ||
| 80 | + } catch (error) { | ||
| 81 | + const err: BusinessError = error as BusinessError; | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + // 校验应用是否被授予权限 | ||
| 85 | + try { | ||
| 86 | + grantStatus = await atManager.checkAccessToken(PermissionUtils.tokenId, permission); | ||
| 87 | + } catch (error) { | ||
| 88 | + const err: BusinessError = error as BusinessError; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + return grantStatus; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | +} |
| @@ -4,3 +4,5 @@ export { HttpRequest as WDHttp } from "./src/main/ets/http/HttpRequest" | @@ -4,3 +4,5 @@ export { HttpRequest as WDHttp } from "./src/main/ets/http/HttpRequest" | ||
| 4 | 4 | ||
| 5 | export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils" | 5 | export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils" |
| 6 | 6 | ||
| 7 | +export { HttpBizUtil } from "./src/main/ets/http/HttpBizUtil" | ||
| 8 | + |
| 1 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 2 | +import { EmitterEventId, EmitterUtils, Logger, SPHelper, ToastUtils } from 'wdKit/Index'; | ||
| 3 | +import HashMap from '@ohos.util.HashMap'; | ||
| 4 | +import { ResponseDTO } from '../bean/ResponseDTO'; | ||
| 5 | +import { HttpUrlUtils, WDHttp } from '../../../../Index'; | ||
| 6 | +import { RefreshTokenRes } from '../bean/RefreshTokenRes'; | ||
| 7 | + | ||
| 8 | +const TAG: string = 'HttpBizUtil' | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 网络请求工具,业务封装http,暂添加TokenInterceptor功能 | ||
| 12 | + * TODO 待优化,将HttpBizUtil接入 AxiosInstance.interceptors.response.use | ||
| 13 | + */ | ||
| 14 | +export class HttpBizUtil { | ||
| 15 | + /** | ||
| 16 | + * get请求,封装了刷新token逻辑,接口选用,不涉及业务接口可以用原来的接口(如page接口)。 | ||
| 17 | + * | ||
| 18 | + * @param url 请求地址 | ||
| 19 | + * @param headers 请求header参数 | ||
| 20 | + * @returns 返回值 | ||
| 21 | + */ | ||
| 22 | + static get<T = string>(url: string, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> { | ||
| 23 | + return new Promise<ResponseDTO<T>>((success, debug) => { | ||
| 24 | + WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 25 | + Logger.debug(TAG, 'get: ' + resDTO.code) | ||
| 26 | + Logger.debug(TAG, 'get: ' + resDTO.message) | ||
| 27 | + // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 28 | + if (resDTO.code == 403 || resDTO.code == 406) { | ||
| 29 | + HttpBizUtil.refreshToken().then((token: string) => { | ||
| 30 | + if (headers) { | ||
| 31 | + headers.replace('RMRB-X-TOKEN', token) | ||
| 32 | + headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 33 | + } | ||
| 34 | + Logger.debug(TAG, 'get again send: ' + token) | ||
| 35 | + // refreshToken为空场景不处理,直接请求接口。 | ||
| 36 | + WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 37 | + Logger.debug(TAG, 'get again: ' + resDTO.message) | ||
| 38 | + success(resDTO) | ||
| 39 | + }).catch((res: object) => { | ||
| 40 | + debug(res) | ||
| 41 | + }) | ||
| 42 | + }); | ||
| 43 | + } else { | ||
| 44 | + success(resDTO) | ||
| 45 | + } | ||
| 46 | + }).catch((res: object) => { | ||
| 47 | + debug(res) | ||
| 48 | + }) | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * post请求,封装了刷新token逻辑,接口选用,不涉及业务接口可以用原来的接口(如page接口)。 | ||
| 54 | + * | ||
| 55 | + * @param url 请求地址 | ||
| 56 | + * @param headers 请求header参数 | ||
| 57 | + * @returns 返回值 | ||
| 58 | + */ | ||
| 59 | + static post<T = string>(url: string, data?: object, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> { | ||
| 60 | + return new Promise<ResponseDTO<T>>((success, debug) => { | ||
| 61 | + WDHttp.post<ResponseDTO<T>>(url, data, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 62 | + Logger.debug(TAG, 'post: ' + resDTO.code) | ||
| 63 | + Logger.debug(TAG, 'post: ' + resDTO.message) | ||
| 64 | + // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 65 | + if (resDTO.code == 0 || resDTO.code == 406) { | ||
| 66 | + HttpBizUtil.refreshToken().then((token: string) => { | ||
| 67 | + if (headers) { | ||
| 68 | + headers.replace('RMRB-X-TOKEN', token) | ||
| 69 | + headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 70 | + } | ||
| 71 | + // refreshToken为空场景不处理,直接请求接口。 | ||
| 72 | + WDHttp.post<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 73 | + success(resDTO) | ||
| 74 | + }).catch((res: object) => { | ||
| 75 | + debug(res) | ||
| 76 | + }) | ||
| 77 | + }); | ||
| 78 | + } else { | ||
| 79 | + success(resDTO) | ||
| 80 | + } | ||
| 81 | + }).catch((res: object) => { | ||
| 82 | + debug(res) | ||
| 83 | + }) | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /* | ||
| 88 | + * 获取刷新后的token,可能为空 | ||
| 89 | + */ | ||
| 90 | + static refreshToken(): Promise<string> { | ||
| 91 | + let url = HttpUrlUtils.getRefreshTokenUrl(); | ||
| 92 | + let params: HashMap<string, string> = new HashMap<string, string>() | ||
| 93 | + params.set('refreshToken', HttpUrlUtils.getRefreshToken()) | ||
| 94 | + params.set('deviceId', HttpUrlUtils.getDeviceId()) | ||
| 95 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 96 | + Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken()) | ||
| 97 | + // // 请求刷新token接口 | ||
| 98 | + return new Promise<string>((success, debug) => { | ||
| 99 | + WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params, headers).then((resDTO: ResponseDTO<RefreshTokenRes>) => { | ||
| 100 | + let newToken = '' | ||
| 101 | + if (resDTO) { | ||
| 102 | + Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.message) | ||
| 103 | + Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.code) | ||
| 104 | + if (resDTO.code == 377) { | ||
| 105 | + // 377强制用户下线、重新登录、封禁等场景;refreshToken 失效 | ||
| 106 | + ToastUtils.showToast("已登出,请重新登入", 1000); | ||
| 107 | + EmitterUtils.sendEmptyEvent(EmitterEventId.FORCE_USER_LOGIN_OUT) | ||
| 108 | + // WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 109 | + } else if (resDTO.code == 0 && resDTO.data) { | ||
| 110 | + newToken = resDTO.data.jwtToken | ||
| 111 | + let refreshToken = resDTO.data.refreshToken | ||
| 112 | + SPHelper.default.save(SpConstants.USER_JWT_TOKEN, newToken) | ||
| 113 | + SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, refreshToken) | ||
| 114 | + Logger.debug(TAG, 'refreshToken jwtToken: ' + resDTO.data.jwtToken) | ||
| 115 | + Logger.debug(TAG, 'refreshToken refreshToken: ' + resDTO.data.refreshToken) | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + success(newToken) | ||
| 119 | + }); | ||
| 120 | + }) | ||
| 121 | + } | ||
| 122 | +} |
| @@ -112,6 +112,10 @@ export class HttpUrlUtils { | @@ -112,6 +112,10 @@ export class HttpUrlUtils { | ||
| 112 | */ | 112 | */ |
| 113 | static readonly APPOINTMENT_userArea_PATH: string = "/api/rmrb-content-center/c/service/sys-area/treeselect"; | 113 | static readonly APPOINTMENT_userArea_PATH: string = "/api/rmrb-content-center/c/service/sys-area/treeselect"; |
| 114 | /** | 114 | /** |
| 115 | + * 用户token刷新接口(token过期,需要刷新) | ||
| 116 | + */ | ||
| 117 | + static readonly REFRESH_TOKEN_PATH: string = "/api/rmrb-user-center/auth/zh/c/refreshToken"; | ||
| 118 | + /** | ||
| 115 | /** | 119 | /** |
| 116 | * 个人中心 关注列表详情 | 120 | * 个人中心 关注列表详情 |
| 117 | */ | 121 | */ |
| @@ -188,7 +192,6 @@ export class HttpUrlUtils { | @@ -188,7 +192,6 @@ export class HttpUrlUtils { | ||
| 188 | * 搜索主页 热词 | 192 | * 搜索主页 热词 |
| 189 | */ | 193 | */ |
| 190 | static readonly SEARCH_HOTS_DATA_PATH: string = "/api/rmrb-search-api/zh/c/hots"; | 194 | static readonly SEARCH_HOTS_DATA_PATH: string = "/api/rmrb-search-api/zh/c/hots"; |
| 191 | - | ||
| 192 | /** | 195 | /** |
| 193 | * 搜索联想词 | 196 | * 搜索联想词 |
| 194 | */ | 197 | */ |
| @@ -198,7 +201,6 @@ export class HttpUrlUtils { | @@ -198,7 +201,6 @@ export class HttpUrlUtils { | ||
| 198 | * 直播详情 | 201 | * 直播详情 |
| 199 | */ | 202 | */ |
| 200 | static readonly LIVE_DETAILS_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail"; | 203 | static readonly LIVE_DETAILS_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail"; |
| 201 | - | ||
| 202 | /** | 204 | /** |
| 203 | * 直播详情-直播间列表 | 205 | * 直播详情-直播间列表 |
| 204 | */ | 206 | */ |
| @@ -215,6 +217,11 @@ export class HttpUrlUtils { | @@ -215,6 +217,11 @@ export class HttpUrlUtils { | ||
| 215 | static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword="; | 217 | static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword="; |
| 216 | 218 | ||
| 217 | /** | 219 | /** |
| 220 | + * 搜索结果 显示list 详情 | ||
| 221 | + */ | ||
| 222 | + static readonly SEARCH_RESULT_LIST_DATA_PATH: string = "/api/rmrb-search-api/zh/c/search"; | ||
| 223 | + | ||
| 224 | + /** | ||
| 218 | * 早晚报列表 | 225 | * 早晚报列表 |
| 219 | * 根据页面id获取页面楼层列表 | 226 | * 根据页面id获取页面楼层列表 |
| 220 | * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/pageInfo?pageId=28927 | 227 | * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/pageInfo?pageId=28927 |
| @@ -358,7 +365,7 @@ export class HttpUrlUtils { | @@ -358,7 +365,7 @@ export class HttpUrlUtils { | ||
| 358 | return ''; | 365 | return ''; |
| 359 | } | 366 | } |
| 360 | 367 | ||
| 361 | - private static getDeviceId() { | 368 | + public static getDeviceId() { |
| 362 | // TODO | 369 | // TODO |
| 363 | return '8a81226a-cabd-3e1b-b630-b51db4a720ed'; | 370 | return '8a81226a-cabd-3e1b-b630-b51db4a720ed'; |
| 364 | } | 371 | } |
| @@ -452,6 +459,10 @@ export class HttpUrlUtils { | @@ -452,6 +459,10 @@ export class HttpUrlUtils { | ||
| 452 | return url; | 459 | return url; |
| 453 | } | 460 | } |
| 454 | 461 | ||
| 462 | + static getRefreshTokenUrl() { | ||
| 463 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.REFRESH_TOKEN_PATH; | ||
| 464 | + return url; | ||
| 465 | + } | ||
| 455 | 466 | ||
| 456 | static getResetPassworddUrl() { | 467 | static getResetPassworddUrl() { |
| 457 | let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; | 468 | let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; |
| @@ -488,6 +499,21 @@ export class HttpUrlUtils { | @@ -488,6 +499,21 @@ export class HttpUrlUtils { | ||
| 488 | return url; | 499 | return url; |
| 489 | } | 500 | } |
| 490 | 501 | ||
| 502 | + | ||
| 503 | + /*优质评论页*/ | ||
| 504 | + static getQualityCommentUrl() { | ||
| 505 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/highQuality"; | ||
| 506 | + | ||
| 507 | + return url | ||
| 508 | + } | ||
| 509 | + | ||
| 510 | + /*获取详情页评论列表*/ | ||
| 511 | + static getContentCommentListDataUrl() { | ||
| 512 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/contentCommentList" | ||
| 513 | + return url | ||
| 514 | + } | ||
| 515 | + | ||
| 516 | + | ||
| 491 | //账户注销 | 517 | //账户注销 |
| 492 | static accountLogoutUrl() { | 518 | static accountLogoutUrl() { |
| 493 | let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logoff"; | 519 | let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logoff"; |
| @@ -500,6 +526,12 @@ export class HttpUrlUtils { | @@ -500,6 +526,12 @@ export class HttpUrlUtils { | ||
| 500 | return url; | 526 | return url; |
| 501 | } | 527 | } |
| 502 | 528 | ||
| 529 | + //获取用户安全页信息 | ||
| 530 | + static querySecurity() { | ||
| 531 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/security/query"; | ||
| 532 | + return url; | ||
| 533 | + } | ||
| 534 | + | ||
| 503 | static getAppointmentListDataUrl() { | 535 | static getAppointmentListDataUrl() { |
| 504 | let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH | 536 | let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH |
| 505 | return url | 537 | return url |
| @@ -625,6 +657,11 @@ export class HttpUrlUtils { | @@ -625,6 +657,11 @@ export class HttpUrlUtils { | ||
| 625 | return url | 657 | return url |
| 626 | } | 658 | } |
| 627 | 659 | ||
| 660 | + static getSearchResultListDataUrl() { | ||
| 661 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_RESULT_LIST_DATA_PATH | ||
| 662 | + return url | ||
| 663 | + } | ||
| 664 | + | ||
| 628 | // static getYcgCommonHeaders(): HashMap<string, string> { | 665 | // static getYcgCommonHeaders(): HashMap<string, string> { |
| 629 | // let headers: HashMap<string, string> = new HashMap<string, string>() | 666 | // let headers: HashMap<string, string> = new HashMap<string, string>() |
| 630 | // | 667 | // |
| @@ -53,6 +53,12 @@ export function registerRouter() { | @@ -53,6 +53,12 @@ export function registerRouter() { | ||
| 53 | return WDRouterPage.detailPlayLivePage | 53 | return WDRouterPage.detailPlayLivePage |
| 54 | } else if (action.params?.detailPageType == 7 || action.params?.detailPageType == 8) { | 54 | } else if (action.params?.detailPageType == 7 || action.params?.detailPageType == 8) { |
| 55 | return WDRouterPage.detailVideoListPage | 55 | return WDRouterPage.detailVideoListPage |
| 56 | + }else if(action.params?.detailPageType == 9){ | ||
| 57 | + //图集详情页 | ||
| 58 | + return WDRouterPage.multiPictureDetailPage | ||
| 59 | + }else if(action.params?.detailPageType == 14 || action.params?.detailPageType == 15){ | ||
| 60 | + //动态详情页 | ||
| 61 | + return WDRouterPage.dynamicDetailPage | ||
| 56 | } else if (action.params?.detailPageType == 17) { | 62 | } else if (action.params?.detailPageType == 17) { |
| 57 | return WDRouterPage.multiPictureDetailPage | 63 | return WDRouterPage.multiPictureDetailPage |
| 58 | } else if (action.params?.detailPageType == 13) { | 64 | } else if (action.params?.detailPageType == 13) { |
| @@ -74,6 +80,8 @@ export function registerRouter() { | @@ -74,6 +80,8 @@ export function registerRouter() { | ||
| 74 | return WDRouterPage.imageTextDetailPage | 80 | return WDRouterPage.imageTextDetailPage |
| 75 | } else if (action.params?.pageID == "BroadcastPage") { | 81 | } else if (action.params?.pageID == "BroadcastPage") { |
| 76 | return WDRouterPage.broadcastPage | 82 | return WDRouterPage.broadcastPage |
| 83 | + } else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") { | ||
| 84 | + return WDRouterPage.spacialTopicPage | ||
| 77 | } | 85 | } |
| 78 | return undefined | 86 | return undefined |
| 79 | }) | 87 | }) |
| @@ -32,6 +32,8 @@ export class WDRouterPage { | @@ -32,6 +32,8 @@ export class WDRouterPage { | ||
| 32 | static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage") | 32 | static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage") |
| 33 | // 图文详情页 | 33 | // 图文详情页 |
| 34 | static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage"); | 34 | static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage"); |
| 35 | + // 专题页 | ||
| 36 | + static spacialTopicPage = new WDRouterPage("phone", "ets/pages/SpacialTopicPage"); | ||
| 35 | // 短视频详情页 | 37 | // 短视频详情页 |
| 36 | static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage"); | 38 | static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage"); |
| 37 | static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage"); | 39 | static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage"); |
| @@ -45,6 +47,8 @@ export class WDRouterPage { | @@ -45,6 +47,8 @@ export class WDRouterPage { | ||
| 45 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); | 47 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); |
| 46 | // 音乐详情页 | 48 | // 音乐详情页 |
| 47 | static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail"); | 49 | static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail"); |
| 50 | + // 动态详情页 | ||
| 51 | + static dynamicDetailPage = new WDRouterPage("phone", "ets/pages/detail/DynamicDetailPage"); | ||
| 48 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); | 52 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); |
| 49 | static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage"); | 53 | static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage"); |
| 50 | //我的 预约 | 54 | //我的 预约 |
| @@ -8,13 +8,17 @@ export class H5CallNativeType { | @@ -8,13 +8,17 @@ export class H5CallNativeType { | ||
| 8 | static jsCall_getAppPublicInfo = 'jsCall_getAppPublicInfo' | 8 | static jsCall_getAppPublicInfo = 'jsCall_getAppPublicInfo' |
| 9 | static jsCall_getArticleDetailBussinessData = 'jsCall_getArticleDetailBussinessData' | 9 | static jsCall_getArticleDetailBussinessData = 'jsCall_getArticleDetailBussinessData' |
| 10 | static jsCall_callAppService = 'jsCall_callAppService' | 10 | static jsCall_callAppService = 'jsCall_callAppService' |
| 11 | + static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod' | ||
| 12 | + static jsCall_receiveH5Data = 'jsCall_receiveH5Data' | ||
| 11 | // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 | 13 | // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 |
| 12 | 14 | ||
| 13 | - static init() { | 15 | + static { |
| 14 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_currentPageOperate) | 16 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_currentPageOperate) |
| 15 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppPublicInfo) | 17 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppPublicInfo) |
| 16 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getArticleDetailBussinessData) | 18 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getArticleDetailBussinessData) |
| 17 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_callAppService) | 19 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_callAppService) |
| 20 | + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod) | ||
| 21 | + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data) | ||
| 18 | } | 22 | } |
| 19 | } | 23 | } |
| 20 | 24 |
| @@ -2,6 +2,9 @@ import { Callback, BridgeWebViewControl } from 'wdJsBridge'; | @@ -2,6 +2,9 @@ import { Callback, BridgeWebViewControl } from 'wdJsBridge'; | ||
| 2 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 2 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 3 | import { Logger, StringUtils, } from 'wdKit'; | 3 | import { Logger, StringUtils, } from 'wdKit'; |
| 4 | import { H5CallNativeType } from './H5CallNativeType'; | 4 | import { H5CallNativeType } from './H5CallNativeType'; |
| 5 | +import { ContentDTO } from 'wdBean'; | ||
| 6 | +//TODO 这里引用了 features模块,是否考虑将跳转抽到公共模块 | ||
| 7 | +import { ProcessUtils } from '../../../../../../features/wdComponent/src/main/ets/utils/ProcessUtils'; | ||
| 5 | 8 | ||
| 6 | const TAG = 'JsBridgeBiz' | 9 | const TAG = 'JsBridgeBiz' |
| 7 | 10 | ||
| @@ -11,7 +14,7 @@ const TAG = 'JsBridgeBiz' | @@ -11,7 +14,7 @@ const TAG = 'JsBridgeBiz' | ||
| 11 | * @param call | 14 | * @param call |
| 12 | */ | 15 | */ |
| 13 | export function performJSCallNative(data: Message, call: Callback) { | 16 | export function performJSCallNative(data: Message, call: Callback) { |
| 14 | - Logger.debug(TAG, 'performJSCallNative handlerName: ' + data.handlerName + ', data: ' + data.data) | 17 | + Logger.debug(TAG, 'performJSCallNative handlerName: ' + data.handlerName + ', data: ' + JSON.stringify(data.data)) |
| 15 | switch (data.handlerName) { | 18 | switch (data.handlerName) { |
| 16 | case H5CallNativeType.jsCall_currentPageOperate: | 19 | case H5CallNativeType.jsCall_currentPageOperate: |
| 17 | break; | 20 | break; |
| @@ -23,6 +26,9 @@ export function performJSCallNative(data: Message, call: Callback) { | @@ -23,6 +26,9 @@ export function performJSCallNative(data: Message, call: Callback) { | ||
| 23 | break; | 26 | break; |
| 24 | case H5CallNativeType.jsCall_callAppService: | 27 | case H5CallNativeType.jsCall_callAppService: |
| 25 | break; | 28 | break; |
| 29 | + case H5CallNativeType.jsCall_receiveH5Data: | ||
| 30 | + handleH5Data(JSON.parse(data?.data?.dataJson || '{}')) | ||
| 31 | + break; | ||
| 26 | case 'changeNativeMessage': | 32 | case 'changeNativeMessage': |
| 27 | call("this is change Web Message") | 33 | call("this is change Web Message") |
| 28 | break; | 34 | break; |
| @@ -50,4 +56,7 @@ function getAppPublicInfo(): string { | @@ -50,4 +56,7 @@ function getAppPublicInfo(): string { | ||
| 50 | return result; | 56 | return result; |
| 51 | } | 57 | } |
| 52 | 58 | ||
| 59 | +function handleH5Data(content:ContentDTO) { | ||
| 60 | + ProcessUtils.processPage(content) | ||
| 61 | +} | ||
| 53 | 62 |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | -import { Action } from 'wdBean'; | ||
| 3 | -import { ConfigConstants } from 'wdConstant'; | ||
| 4 | -import { Logger } from 'wdKit'; | ||
| 5 | -import { BridgeHandler, BridgeUtil, BridgeWebViewControl, Callback } from 'wdJsBridge'; | 2 | +import { BridgeUtil, BridgeWebViewControl, Callback } from 'wdJsBridge'; |
| 3 | +import { Logger } from 'wdKit/Index'; | ||
| 6 | import { performJSCallNative } from './JsBridgeBiz'; | 4 | import { performJSCallNative } from './JsBridgeBiz'; |
| 7 | -import { setDefaultNativeWebSettings } from './WebComponentUtil'; | 5 | +import { H5CallNativeType } from './H5CallNativeType'; |
| 8 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 6 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 9 | 7 | ||
| 10 | -const TAG = 'WdWebComponent'; | 8 | +const TAG = 'WdWebLocalComponent'; |
| 11 | 9 | ||
| 12 | @Component | 10 | @Component |
| 13 | export struct WdWebComponent { | 11 | export struct WdWebComponent { |
| 14 | - private webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | ||
| 15 | - //TODO 默认网页 | ||
| 16 | - webUrl: string | Resource = ConfigConstants.DETAIL_URL | ||
| 17 | - /** | ||
| 18 | - * 对外暴露webview的回调,能力 | ||
| 19 | - */ | ||
| 20 | - onPageBegin: (url?: string) => void = () => { | ||
| 21 | - } | ||
| 22 | - onPageEnd: (url?: string) => void = () => { | ||
| 23 | - } | ||
| 24 | - onLoadIntercept: (url?: string) => boolean = () => { | ||
| 25 | - return false | ||
| 26 | - } | ||
| 27 | - onHttpErrorReceive: (url?: string) => boolean = () => { | ||
| 28 | - return false | ||
| 29 | - } | 12 | + webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 13 | + @Prop backVisibility: boolean = false | ||
| 14 | + @Prop webUrl: string = '' | ||
| 30 | @Prop @Watch('onReloadStateChanged') reload: number = 0 | 15 | @Prop @Watch('onReloadStateChanged') reload: number = 0 |
| 31 | - /** | ||
| 32 | - * 默认【CallNative】逻辑处理 | ||
| 33 | - */ | ||
| 34 | - private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => { | ||
| 35 | - performJSCallNative(data, f) | ||
| 36 | - } | ||
| 37 | - /** | ||
| 38 | - * jsBridge的处理 | ||
| 39 | - */ | ||
| 40 | - handleInfo: [string, BridgeHandler][] = [] | ||
| 41 | - backVisibility: boolean = false | ||
| 42 | - | ||
| 43 | - defaultRegisterHandler(): void { | ||
| 44 | - this.webviewControl.registerHandler("CallNative", { | ||
| 45 | - handle: (data: Message, f: Callback) => { | ||
| 46 | - this.defaultPerformJSCallNative(data, f) | ||
| 47 | - } | ||
| 48 | - }); | ||
| 49 | - | ||
| 50 | - } | ||
| 51 | 16 | ||
| 52 | build() { | 17 | build() { |
| 53 | Column() { | 18 | Column() { |
| @@ -71,26 +36,13 @@ export struct WdWebComponent { | @@ -71,26 +36,13 @@ export struct WdWebComponent { | ||
| 71 | .zoomAccess(false) | 36 | .zoomAccess(false) |
| 72 | .horizontalScrollBarAccess(false) | 37 | .horizontalScrollBarAccess(false) |
| 73 | .verticalScrollBarAccess(false) | 38 | .verticalScrollBarAccess(false) |
| 74 | - .onHttpErrorReceive((event) => { | ||
| 75 | - //TODO 页面加载不成功的时候处理 | ||
| 76 | - Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl()); | ||
| 77 | - Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); | 39 | + .onPageBegin((event) => { |
| 40 | + console.log(this.webUrl,"yzl") | ||
| 41 | + this.onPageBegin(event?.url); | ||
| 78 | }) | 42 | }) |
| 79 | .onPageEnd((event) => { | 43 | .onPageEnd((event) => { |
| 80 | this.onPageEnd(event?.url) | 44 | this.onPageEnd(event?.url) |
| 81 | }) | 45 | }) |
| 82 | - .onPageBegin((event) => { | ||
| 83 | - // setDefaultNativeWebSettings(this.webviewControl, this.webUrl).then(()=>{ | ||
| 84 | - // this.handleInfo && this.handleInfo.length > 1 ? this.handleInfo.forEach(value => { | ||
| 85 | - // this.webviewControl.registerHandler(value[0], value[1]) | ||
| 86 | - // }) : this.defaultRegisterHandler() | ||
| 87 | - // setTimeout(()=>{ | ||
| 88 | - // BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 89 | - // },500) | ||
| 90 | - // }) | ||
| 91 | - // this.onPageBegin(event?.url) | ||
| 92 | - // this.webviewControl?.setCustomUserAgent('Mozilla/5.0 (Linux; Android 12; HarmonyOS; OXF-AN00; HMSCore 6.13.0.302) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 HuaweiBrowser/14.0.6.300 Mobile Safari/537.36') | ||
| 93 | - }) | ||
| 94 | .onLoadIntercept((event) => { | 46 | .onLoadIntercept((event) => { |
| 95 | let url: string = event.data.getRequestUrl().toString() | 47 | let url: string = event.data.getRequestUrl().toString() |
| 96 | url = url.replace("%(?![0-9a-fA-F]{2})", "%25") | 48 | url = url.replace("%(?![0-9a-fA-F]{2})", "%25") |
| @@ -101,19 +53,51 @@ export struct WdWebComponent { | @@ -101,19 +53,51 @@ export struct WdWebComponent { | ||
| 101 | return true | 53 | return true |
| 102 | } | 54 | } |
| 103 | if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) { | 55 | if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) { |
| 56 | + Logger.debug(TAG, 'flushMessageQueue'); | ||
| 104 | this.webviewControl.flushMessageQueue() | 57 | this.webviewControl.flushMessageQueue() |
| 105 | return true | 58 | return true |
| 106 | } | 59 | } |
| 107 | - return this.onLoadIntercept(event.data.getRequestUrl().toString()) | 60 | + return this.onLoadIntercept(event.data.getRequestUrl().toString()); |
| 108 | }) | 61 | }) |
| 109 | } | 62 | } |
| 110 | } | 63 | } |
| 111 | 64 | ||
| 65 | + private registerHandlers(): void { | ||
| 66 | + // 注册h5调用js相关 | ||
| 67 | + for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { | ||
| 68 | + let handleName = H5CallNativeType.JsCallTypeList[i]; | ||
| 69 | + console.log('handleName:', handleName) | ||
| 70 | + let handle = (data: Message, f: Callback) => { | ||
| 71 | + this.defaultPerformJSCallNative(data, f) | ||
| 72 | + }; | ||
| 73 | + this.webviewControl.registerHandler(handleName, { handle: handle }); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 默认【CallNative】逻辑处理 | ||
| 79 | + */ | ||
| 80 | + private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => { | ||
| 81 | + performJSCallNative(data, f) | ||
| 82 | + } | ||
| 83 | + onPageBegin: (url?: string) => void = () => { | ||
| 84 | + Logger.debug(TAG, 'onPageBegin'); | ||
| 85 | + this.registerHandlers(); | ||
| 86 | + BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 87 | + } | ||
| 88 | + onPageEnd: (url?: string) => void = () => { | ||
| 89 | + Logger.debug(TAG, 'onPageEnd'); | ||
| 90 | + } | ||
| 91 | + onLoadIntercept: (url?: string) => boolean = () => { | ||
| 92 | + Logger.debug(TAG, 'onLoadIntercept return false'); | ||
| 93 | + return false | ||
| 94 | + } | ||
| 112 | onReloadStateChanged() { | 95 | onReloadStateChanged() { |
| 113 | Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); | 96 | Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); |
| 114 | if (this.reload > 0) { | 97 | if (this.reload > 0) { |
| 115 | this.webviewControl.refresh() | 98 | this.webviewControl.refresh() |
| 116 | } | 99 | } |
| 117 | } | 100 | } |
| 101 | + | ||
| 118 | } | 102 | } |
| 119 | 103 |
| @@ -11,9 +11,10 @@ const TAG = 'WdWebLocalComponent'; | @@ -11,9 +11,10 @@ const TAG = 'WdWebLocalComponent'; | ||
| 11 | 11 | ||
| 12 | @Component | 12 | @Component |
| 13 | export struct WdWebLocalComponent { | 13 | export struct WdWebLocalComponent { |
| 14 | - private webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | ||
| 15 | - backVisibility: boolean = false | ||
| 16 | - webResource: Resource = {} as Resource | 14 | + webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 15 | + @Prop backVisibility: boolean = false | ||
| 16 | + @Prop webResource: Resource = {} as Resource | ||
| 17 | + @State webHeight : string = '100%' | ||
| 17 | 18 | ||
| 18 | build() { | 19 | build() { |
| 19 | Column() { | 20 | Column() { |
| @@ -31,30 +32,16 @@ export struct WdWebLocalComponent { | @@ -31,30 +32,16 @@ export struct WdWebLocalComponent { | ||
| 31 | .visibility(this.backVisibility ? Visibility.Visible : Visibility.None) | 32 | .visibility(this.backVisibility ? Visibility.Visible : Visibility.None) |
| 32 | 33 | ||
| 33 | Web({ src: this.webResource, controller: this.webviewControl }) | 34 | Web({ src: this.webResource, controller: this.webviewControl }) |
| 34 | - .layoutMode(WebLayoutMode.FIT_CONTENT) | ||
| 35 | .domStorageAccess(true) | 35 | .domStorageAccess(true) |
| 36 | .databaseAccess(true) | 36 | .databaseAccess(true) |
| 37 | .javaScriptAccess(true) | 37 | .javaScriptAccess(true) |
| 38 | - // .imageAccess(true) | ||
| 39 | - // .onlineImageAccess(true) | ||
| 40 | - // .fileAccess(true) | 38 | + .imageAccess(true) |
| 39 | + .mixedMode(MixedMode.All) | ||
| 40 | + .onlineImageAccess(true) | ||
| 41 | + .enableNativeEmbedMode(true) | ||
| 42 | + .height(this.webHeight === '100%' ? '100%' : Number(this.webHeight)) | ||
| 41 | .onPageBegin((event) => { | 43 | .onPageBegin((event) => { |
| 42 | - | ||
| 43 | - // setDefaultNativeWebSettings(this.webviewControl, this.webResource).then(()=>{ | ||
| 44 | - // this.handleInfo && this.handleInfo.length > 1 ? this.handleInfo.forEach(value => { | ||
| 45 | - // this.webviewControl.registerHandler(value[0], value[1]) | ||
| 46 | - // }) : this.defaultRegisterHandler() | ||
| 47 | - // setTimeout(()=>{ | ||
| 48 | - // BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 49 | - // },500) | ||
| 50 | - // }) | ||
| 51 | - // this.onPageBegin(event?.url) | ||
| 52 | - // BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl); | ||
| 53 | this.onPageBegin(event?.url); | 44 | this.onPageBegin(event?.url); |
| 54 | - this.registerHandlers(); | ||
| 55 | - setTimeout(() => { | ||
| 56 | - BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 57 | - }, 200) | ||
| 58 | }) | 45 | }) |
| 59 | .onPageEnd((event) => { | 46 | .onPageEnd((event) => { |
| 60 | this.onPageEnd(event?.url) | 47 | this.onPageEnd(event?.url) |
| @@ -79,25 +66,24 @@ export struct WdWebLocalComponent { | @@ -79,25 +66,24 @@ export struct WdWebLocalComponent { | ||
| 79 | } | 66 | } |
| 80 | 67 | ||
| 81 | private registerHandlers(): void { | 68 | private registerHandlers(): void { |
| 82 | - // TODO 待优化 | ||
| 83 | - H5CallNativeType.init(); | ||
| 84 | // 注册h5调用js相关 | 69 | // 注册h5调用js相关 |
| 85 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { | 70 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { |
| 86 | let handleName = H5CallNativeType.JsCallTypeList[i]; | 71 | let handleName = H5CallNativeType.JsCallTypeList[i]; |
| 87 | let handle = (data: Message, f: Callback) => { | 72 | let handle = (data: Message, f: Callback) => { |
| 73 | + this.setCurrentPageOperate(data) | ||
| 88 | this.defaultPerformJSCallNative(data, f) | 74 | this.defaultPerformJSCallNative(data, f) |
| 89 | - } ; | 75 | + }; |
| 90 | this.webviewControl.registerHandler(handleName, { handle: handle }); | 76 | this.webviewControl.registerHandler(handleName, { handle: handle }); |
| 91 | } | 77 | } |
| 92 | - // // TODO test | ||
| 93 | - // this.webviewControl.registerHandler('changeNativeMessage', { | ||
| 94 | - // handle: (data: Message, f: Callback) => { | ||
| 95 | - // this.defaultPerformJSCallNative(data, f) | ||
| 96 | - // } | ||
| 97 | - // }); | ||
| 98 | - | ||
| 99 | } | 78 | } |
| 100 | 79 | ||
| 80 | + //webview 高度设置 | ||
| 81 | + private setCurrentPageOperate: (data: Message) => void = (data) => { | ||
| 82 | + console.log("setCurrentPageOperate",JSON.stringify(data)) | ||
| 83 | + if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { | ||
| 84 | + this.webHeight = data?.data?.webViewHeight || '100%' | ||
| 85 | + } | ||
| 86 | + } | ||
| 101 | /** | 87 | /** |
| 102 | * 默认【CallNative】逻辑处理 | 88 | * 默认【CallNative】逻辑处理 |
| 103 | */ | 89 | */ |
| @@ -106,12 +92,16 @@ export struct WdWebLocalComponent { | @@ -106,12 +92,16 @@ export struct WdWebLocalComponent { | ||
| 106 | } | 92 | } |
| 107 | onPageBegin: (url?: string) => void = () => { | 93 | onPageBegin: (url?: string) => void = () => { |
| 108 | Logger.debug(TAG, 'onPageBegin'); | 94 | Logger.debug(TAG, 'onPageBegin'); |
| 95 | + this.registerHandlers(); | ||
| 96 | + // setTimeout(() => { | ||
| 97 | + BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 98 | + // }, 100) | ||
| 109 | } | 99 | } |
| 110 | onPageEnd: (url?: string) => void = () => { | 100 | onPageEnd: (url?: string) => void = () => { |
| 111 | Logger.debug(TAG, 'onPageEnd'); | 101 | Logger.debug(TAG, 'onPageEnd'); |
| 112 | } | 102 | } |
| 113 | onLoadIntercept: (url?: string) => boolean = () => { | 103 | onLoadIntercept: (url?: string) => boolean = () => { |
| 114 | - Logger.debug(TAG, 'onPageBegin return false'); | 104 | + Logger.debug(TAG, 'onLoadIntercept return false'); |
| 115 | return false | 105 | return false |
| 116 | } | 106 | } |
| 117 | } | 107 | } |
| @@ -69,6 +69,8 @@ export interface ContentDTO { | @@ -69,6 +69,8 @@ export interface ContentDTO { | ||
| 69 | isSelect: boolean; | 69 | isSelect: boolean; |
| 70 | rmhInfo: RmhInfoDTO; // 人民号信息 | 70 | rmhInfo: RmhInfoDTO; // 人民号信息 |
| 71 | photoNum: number; | 71 | photoNum: number; |
| 72 | - | 72 | + corner: string; |
| 73 | + rmhPlatform: number; | ||
| 74 | + newTags: string | ||
| 73 | 75 | ||
| 74 | } | 76 | } |
| @@ -43,20 +43,14 @@ export { ImageAndTextWebComponent } from "./src/main/ets/components/ImageAndText | @@ -43,20 +43,14 @@ export { ImageAndTextWebComponent } from "./src/main/ets/components/ImageAndText | ||
| 43 | 43 | ||
| 44 | export { DetailViewModel } from "./src/main/ets/viewmodel/DetailViewModel" | 44 | export { DetailViewModel } from "./src/main/ets/viewmodel/DetailViewModel" |
| 45 | 45 | ||
| 46 | -export { SingleImageCardComponent } from "./src/main/ets/components/view/SingleImageCardComponent" | ||
| 47 | - | ||
| 48 | -export { TriPicCardComponent } from "./src/main/ets/components/view/TriPicCardComponent" | ||
| 49 | - | ||
| 50 | export { BigPicCardComponent } from "./src/main/ets/components/view/BigPicCardComponent" | 46 | export { BigPicCardComponent } from "./src/main/ets/components/view/BigPicCardComponent" |
| 51 | 47 | ||
| 52 | -export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPictureCardComponent" | ||
| 53 | - | ||
| 54 | -export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent" | ||
| 55 | - | ||
| 56 | export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" | 48 | export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" |
| 57 | 49 | ||
| 58 | export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent" | 50 | export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent" |
| 59 | 51 | ||
| 52 | +export { AudioSuspensionModel } from "./src/main/ets/viewmodel/AudioSuspensionModel" | ||
| 53 | + | ||
| 60 | export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent" | 54 | export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent" |
| 61 | 55 | ||
| 62 | export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/FirstTabTopSearchComponent" | 56 | export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/FirstTabTopSearchComponent" |
| @@ -64,3 +58,8 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir | @@ -64,3 +58,8 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir | ||
| 64 | export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI" | 58 | export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI" |
| 65 | 59 | ||
| 66 | export { LottieView } from './src/main/ets/lottie/LottieView' | 60 | export { LottieView } from './src/main/ets/lottie/LottieView' |
| 61 | + | ||
| 62 | +export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent' | ||
| 63 | + | ||
| 64 | +export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" | ||
| 65 | + |
| @@ -12,6 +12,7 @@ import { Card17Component } from './cardview/Card17Component'; | @@ -12,6 +12,7 @@ import { Card17Component } from './cardview/Card17Component'; | ||
| 12 | import { Card15Component } from './cardview/Card15Component'; | 12 | import { Card15Component } from './cardview/Card15Component'; |
| 13 | import { Card19Component } from './cardview/Card19Component'; | 13 | import { Card19Component } from './cardview/Card19Component'; |
| 14 | import { Card20Component } from './cardview/Card20Component'; | 14 | import { Card20Component } from './cardview/Card20Component'; |
| 15 | +import { Card21Component } from './cardview/Card21Component'; | ||
| 15 | 16 | ||
| 16 | /** | 17 | /** |
| 17 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle | 18 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle |
| @@ -52,6 +53,8 @@ export struct CardParser { | @@ -52,6 +53,8 @@ export struct CardParser { | ||
| 52 | Card19Component({ contentDTO }) | 53 | Card19Component({ contentDTO }) |
| 53 | } else if (contentDTO.appStyle === CompStyle.Card_20) { | 54 | } else if (contentDTO.appStyle === CompStyle.Card_20) { |
| 54 | Card20Component({ contentDTO }) | 55 | Card20Component({ contentDTO }) |
| 56 | + } else if (contentDTO.appStyle === CompStyle.Card_21) { | ||
| 57 | + Card21Component({ contentDTO }) | ||
| 55 | } | 58 | } |
| 56 | else { | 59 | else { |
| 57 | // todo:组件未实现 / Component Not Implemented | 60 | // todo:组件未实现 / Component Not Implemented |
| 1 | +import { Logger } from 'wdKit'; | ||
| 2 | +import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | ||
| 3 | +import { ContentDetailDTO } from 'wdBean'; | ||
| 4 | +import media from '@ohos.multimedia.media'; | ||
| 5 | +import { OperRowListView } from './view/OperRowListView'; | ||
| 6 | +import { WDPlayerController } from 'wdPlayer/Index'; | ||
| 7 | + | ||
| 8 | +const TAG = 'DynamicDetailComponent' | ||
| 9 | +@Preview | ||
| 10 | +@Component | ||
| 11 | +export struct DynamicDetailComponent { | ||
| 12 | + //入参 | ||
| 13 | + private relId: string = '' | ||
| 14 | + private contentId: string = '' | ||
| 15 | + private relType: string = '' | ||
| 16 | + //出参 | ||
| 17 | + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[] | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + async aboutToAppear() { | ||
| 21 | + await this.getContentDetailData() | ||
| 22 | + } | ||
| 23 | + onPageHide() { | ||
| 24 | + | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + build() { | ||
| 28 | + Row() { | ||
| 29 | + Column(){ | ||
| 30 | + Text("this is a test!") | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | + private async getContentDetailData() { | ||
| 36 | + try { | ||
| 37 | + let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) | ||
| 38 | + this.contentDetailData = data; | ||
| 39 | + console.log('动态详情',JSON.stringify(this.contentDetailData)) | ||
| 40 | + } catch (exception) { | ||
| 41 | + console.log('请求失败',JSON.stringify(exception)) | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | +} |
| @@ -22,13 +22,6 @@ import { PageRepository } from '../repository/PageRepository'; | @@ -22,13 +22,6 @@ import { PageRepository } from '../repository/PageRepository'; | ||
| 22 | 22 | ||
| 23 | const TAG = 'ImageAndTextPageComponent' | 23 | const TAG = 'ImageAndTextPageComponent' |
| 24 | 24 | ||
| 25 | -export interface OperationItem { | ||
| 26 | - icon: Resource; | ||
| 27 | - icon_check?: Resource; | ||
| 28 | - text: string | Resource; | ||
| 29 | - num?: number; // 个数 | ||
| 30 | -} | ||
| 31 | - | ||
| 32 | @Component | 25 | @Component |
| 33 | export struct ImageAndTextPageComponent { | 26 | export struct ImageAndTextPageComponent { |
| 34 | scroller: Scroller = new Scroller(); | 27 | scroller: Scroller = new Scroller(); |
| @@ -37,7 +30,6 @@ export struct ImageAndTextPageComponent { | @@ -37,7 +30,6 @@ export struct ImageAndTextPageComponent { | ||
| 37 | @State recommendList: ContentDTO[] = [] | 30 | @State recommendList: ContentDTO[] = [] |
| 38 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 31 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 39 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 32 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 40 | - | ||
| 41 | build() { | 33 | build() { |
| 42 | Column() { | 34 | Column() { |
| 43 | // 发布时间 | 35 | // 发布时间 |
| @@ -64,66 +56,28 @@ export struct ImageAndTextPageComponent { | @@ -64,66 +56,28 @@ export struct ImageAndTextPageComponent { | ||
| 64 | .objectFit(ImageFit.Cover) | 56 | .objectFit(ImageFit.Cover) |
| 65 | .margin({ top: 10 }) | 57 | .margin({ top: 10 }) |
| 66 | } | 58 | } |
| 67 | - .padding({ left: 15, right: 15, }) | 59 | + .padding({ left: 15, right: 15 }) |
| 68 | .backgroundColor(Color.White) | 60 | .backgroundColor(Color.White) |
| 69 | 61 | ||
| 70 | Stack({ alignContent: Alignment.Bottom }) { | 62 | Stack({ alignContent: Alignment.Bottom }) { |
| 71 | - List() { | ||
| 72 | - //详情展示区 | ||
| 73 | - ListItem() { | 63 | + Scroll(this.scroller) { |
| 64 | + Column() { | ||
| 65 | + ImageAndTextWebComponent({ | ||
| 66 | + contentDetailData: this.contentDetailData, | ||
| 67 | + action: this.action | ||
| 68 | + }) | ||
| 74 | Column() { | 69 | Column() { |
| 75 | - ImageAndTextWebComponent({ | ||
| 76 | - contentDetailData: this.contentDetailData, | ||
| 77 | - action: this.action, | ||
| 78 | - }) | ||
| 79 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 80 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - if (this.contentDetailData[0]?.openLikes === 1) { | ||
| 84 | - ListItem() { | ||
| 85 | - // 点赞 | ||
| 86 | - Row() { | ||
| 87 | - Row() { | ||
| 88 | - if (this.newsStatusOfUser?.likeStatus === '1') { | ||
| 89 | - Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active'))) | ||
| 90 | - .width(24) | ||
| 91 | - .height(24) | ||
| 92 | - .margin({ right: 5 }) | ||
| 93 | - } else { | ||
| 94 | - Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle'))) | ||
| 95 | - .width(24) | ||
| 96 | - .height(24) | ||
| 97 | - .margin({ right: 5 }) | ||
| 98 | - } | ||
| 99 | - Text(`${this.interactData?.likeNum || 0}`) | ||
| 100 | - .fontSize(16) | ||
| 101 | - .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') | ||
| 102 | - .fontWeight(500) | ||
| 103 | - }.alignItems(VerticalAlign.Center) | ||
| 104 | - .onClick(() => { | ||
| 105 | - this.toggleLikeStatus() | ||
| 106 | - }) | ||
| 107 | - | ||
| 108 | - }.width(CommonConstants.FULL_WIDTH).height(80) | ||
| 109 | - .justifyContent(FlexAlign.Center) | 70 | + if (this.recommendList.length > 0) { |
| 71 | + RecommendList({ recommendList: this.recommendList }) | ||
| 72 | + } | ||
| 110 | } | 73 | } |
| 111 | - .border({ | ||
| 112 | - width: { bottom: 5 }, | ||
| 113 | - color: '#f5f5f5', | ||
| 114 | - }) | ||
| 115 | } | 74 | } |
| 116 | 75 | ||
| 117 | - // 相关推荐区 | ||
| 118 | - ListItem() { | ||
| 119 | - RecommendList({ recommendList: this.recommendList }) | ||
| 120 | - } | ||
| 121 | } | 76 | } |
| 122 | .width(CommonConstants.FULL_WIDTH) | 77 | .width(CommonConstants.FULL_WIDTH) |
| 123 | .height(CommonConstants.FULL_HEIGHT) | 78 | .height(CommonConstants.FULL_HEIGHT) |
| 124 | - .padding({ bottom: 56 }) | ||
| 125 | - .scrollBar(BarState.Off) | ||
| 126 | - .edgeEffect(EdgeEffect.None) | 79 | + .padding({ bottom: 76 }) |
| 80 | + // .scrollBar(BarState.Off) | ||
| 127 | 81 | ||
| 128 | //底部交互区 | 82 | //底部交互区 |
| 129 | Row() { | 83 | Row() { |
| @@ -163,11 +117,143 @@ export struct ImageAndTextPageComponent { | @@ -163,11 +117,143 @@ export struct ImageAndTextPageComponent { | ||
| 163 | .justifyContent(FlexAlign.SpaceBetween) | 117 | .justifyContent(FlexAlign.SpaceBetween) |
| 164 | .backgroundColor(Color.White) | 118 | .backgroundColor(Color.White) |
| 165 | } | 119 | } |
| 166 | - }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | ||
| 167 | - .backgroundColor(Color.White) | ||
| 168 | - | 120 | + } |
| 121 | + .width(CommonConstants.FULL_WIDTH) | ||
| 122 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 169 | } | 123 | } |
| 170 | 124 | ||
| 125 | + // build() { | ||
| 126 | + // Column() { | ||
| 127 | + // // 发布时间 | ||
| 128 | + // Row() { | ||
| 129 | + // Image($r('app.media.icon_ren_min_ri_bao')) | ||
| 130 | + // .width(70) | ||
| 131 | + // .height(28) | ||
| 132 | + // Text(this.contentDetailData[0]?.publishTime) | ||
| 133 | + // .fontColor($r('app.color.color_B0B0B0')) | ||
| 134 | + // .fontSize($r('app.float.font_size_13')) | ||
| 135 | + // .height('100%') | ||
| 136 | + // .align(Alignment.End) | ||
| 137 | + // } | ||
| 138 | + // .width(CommonConstants.FULL_WIDTH) | ||
| 139 | + // .height(32) | ||
| 140 | + // .padding({ left: 15, right: 15, }) | ||
| 141 | + // .justifyContent(FlexAlign.SpaceBetween) | ||
| 142 | + // .backgroundColor(Color.White) | ||
| 143 | + // | ||
| 144 | + // Row() { | ||
| 145 | + // Image($r('app.media.line')) | ||
| 146 | + // .width('100%') | ||
| 147 | + // .height(6) | ||
| 148 | + // .objectFit(ImageFit.Cover) | ||
| 149 | + // .margin({ top: 10 }) | ||
| 150 | + // } | ||
| 151 | + // .padding({ left: 15, right: 15, }) | ||
| 152 | + // .backgroundColor(Color.White) | ||
| 153 | + // | ||
| 154 | + // Stack({ alignContent: Alignment.Bottom }) { | ||
| 155 | + // | ||
| 156 | + // List() { | ||
| 157 | + // //详情展示区 | ||
| 158 | + // ListItem() { | ||
| 159 | + // Column() { | ||
| 160 | + // ImageAndTextWebComponent({ | ||
| 161 | + // contentDetailData: this.contentDetailData, | ||
| 162 | + // action: this.action, | ||
| 163 | + // }) | ||
| 164 | + // }.width(CommonConstants.FULL_WIDTH) | ||
| 165 | + // // .height(CommonConstants.FULL_HEIGHT) | ||
| 166 | + // } | ||
| 167 | + // | ||
| 168 | + // if (this.contentDetailData[0]?.openLikes === 1) { | ||
| 169 | + // ListItem() { | ||
| 170 | + // // 点赞 | ||
| 171 | + // Row() { | ||
| 172 | + // Row() { | ||
| 173 | + // if (this.newsStatusOfUser?.likeStatus === '1') { | ||
| 174 | + // Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active'))) | ||
| 175 | + // .width(24) | ||
| 176 | + // .height(24) | ||
| 177 | + // .margin({ right: 5 }) | ||
| 178 | + // } else { | ||
| 179 | + // Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle'))) | ||
| 180 | + // .width(24) | ||
| 181 | + // .height(24) | ||
| 182 | + // .margin({ right: 5 }) | ||
| 183 | + // } | ||
| 184 | + // Text(`${this.interactData?.likeNum || 0}`) | ||
| 185 | + // .fontSize(16) | ||
| 186 | + // .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') | ||
| 187 | + // .fontWeight(500) | ||
| 188 | + // }.alignItems(VerticalAlign.Center) | ||
| 189 | + // .onClick(() => { | ||
| 190 | + // this.toggleLikeStatus() | ||
| 191 | + // }) | ||
| 192 | + // | ||
| 193 | + // }.width(CommonConstants.FULL_WIDTH).height(80) | ||
| 194 | + // .justifyContent(FlexAlign.Center) | ||
| 195 | + // } | ||
| 196 | + // .border({ | ||
| 197 | + // width: { bottom: 5 }, | ||
| 198 | + // color: '#f5f5f5', | ||
| 199 | + // }) | ||
| 200 | + // } | ||
| 201 | + // | ||
| 202 | + // // 相关推荐区 | ||
| 203 | + // ListItem() { | ||
| 204 | + // RecommendList({ recommendList: this.recommendList }) | ||
| 205 | + // } | ||
| 206 | + // } | ||
| 207 | + // .width(CommonConstants.FULL_WIDTH) | ||
| 208 | + // .height(CommonConstants.FULL_HEIGHT) | ||
| 209 | + // .padding({ bottom: 56 }) | ||
| 210 | + // .scrollBar(BarState.Off) | ||
| 211 | + // .edgeEffect(EdgeEffect.None) | ||
| 212 | + // | ||
| 213 | + // //底部交互区 | ||
| 214 | + // Row() { | ||
| 215 | + // Image($r('app.media.icon_arrow_left')) | ||
| 216 | + // .width(24) | ||
| 217 | + // .height(24) | ||
| 218 | + // .onClick((event: ClickEvent) => { | ||
| 219 | + // router.back() | ||
| 220 | + // }) | ||
| 221 | + // | ||
| 222 | + // Row() { | ||
| 223 | + // Image($r('app.media.icon_comment')) | ||
| 224 | + // .width(24) | ||
| 225 | + // .height(24) | ||
| 226 | + // .margin({ right: 24 }) | ||
| 227 | + // .id('comment') | ||
| 228 | + // | ||
| 229 | + // Image($r('app.media.icon_star')) | ||
| 230 | + // .width(24) | ||
| 231 | + // .height(24) | ||
| 232 | + // .margin({ right: 24 }) | ||
| 233 | + // | ||
| 234 | + // Image($r('app.media.icon_listen')) | ||
| 235 | + // .width(24) | ||
| 236 | + // .height(24) | ||
| 237 | + // .margin({ right: 24 }) | ||
| 238 | + // | ||
| 239 | + // Image($r('app.media.icon_forward')) | ||
| 240 | + // .width(24) | ||
| 241 | + // .height(24) | ||
| 242 | + // | ||
| 243 | + // } | ||
| 244 | + // } | ||
| 245 | + // .width(CommonConstants.FULL_WIDTH) | ||
| 246 | + // .height(56) | ||
| 247 | + // .padding({ left: 15, right: 15, bottom: 50, top: 20 }) | ||
| 248 | + // .justifyContent(FlexAlign.SpaceBetween) | ||
| 249 | + // .backgroundColor(Color.White) | ||
| 250 | + // } | ||
| 251 | + // | ||
| 252 | + // }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | ||
| 253 | + // .backgroundColor(Color.White) | ||
| 254 | + // | ||
| 255 | + // } | ||
| 256 | + | ||
| 171 | private async getDetail() { | 257 | private async getDetail() { |
| 172 | let contentId: string = '' | 258 | let contentId: string = '' |
| 173 | let relId: string = '' | 259 | let relId: string = '' |
| @@ -199,7 +285,6 @@ export struct ImageAndTextPageComponent { | @@ -199,7 +285,6 @@ export struct ImageAndTextPageComponent { | ||
| 199 | } | 285 | } |
| 200 | } | 286 | } |
| 201 | 287 | ||
| 202 | - | ||
| 203 | private async getRecommend() { | 288 | private async getRecommend() { |
| 204 | let params: postRecommendListParams = { | 289 | let params: postRecommendListParams = { |
| 205 | imei: "8272c108-4fa2-34ce-80b9-bc425a7c2a7e", | 290 | imei: "8272c108-4fa2-34ce-80b9-bc425a7c2a7e", |
| @@ -211,9 +296,7 @@ export struct ImageAndTextPageComponent { | @@ -211,9 +296,7 @@ export struct ImageAndTextPageComponent { | ||
| 211 | channelId: String(this.contentDetailData[0]?.reLInfo?.channelId) | 296 | channelId: String(this.contentDetailData[0]?.reLInfo?.channelId) |
| 212 | } | 297 | } |
| 213 | let recommendList = await DetailViewModel.postRecommendList(params) | 298 | let recommendList = await DetailViewModel.postRecommendList(params) |
| 214 | - if (recommendList && recommendList.length > 0) { | ||
| 215 | - this.recommendList = recommendList; | ||
| 216 | - } | 299 | + this.recommendList = recommendList; |
| 217 | } | 300 | } |
| 218 | 301 | ||
| 219 | // 已登录->查询用户对作品点赞、收藏状态 | 302 | // 已登录->查询用户对作品点赞、收藏状态 |
| @@ -7,7 +7,7 @@ import { | @@ -7,7 +7,7 @@ import { | ||
| 7 | ResponseBean | 7 | ResponseBean |
| 8 | } from 'wdBean'; | 8 | } from 'wdBean'; |
| 9 | import { Logger } from 'wdKit'; | 9 | import { Logger } from 'wdKit'; |
| 10 | -import { WdWebComponent, WdWebLocalComponent } from 'wdWebComponent'; | 10 | +import { WdWebLocalComponent } from 'wdWebComponent'; |
| 11 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; | 11 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; |
| 12 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 12 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| 13 | 13 | ||
| @@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent { | @@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent { | ||
| 85 | webResource: $rawfile('apph5/index.html'), | 85 | webResource: $rawfile('apph5/index.html'), |
| 86 | backVisibility: false, | 86 | backVisibility: false, |
| 87 | }) | 87 | }) |
| 88 | - // WdWebLocalComponent({ | ||
| 89 | - // webviewControl: this.webviewControl, | ||
| 90 | - // webResource: "http://pd-people-uat.pdnews.cn/articletopic/35398-10000015965", | ||
| 91 | - // backVisibility: false, | ||
| 92 | - // }) | ||
| 93 | } | 88 | } |
| 94 | } | 89 | } |
| 95 | 90 | ||
| @@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent { | @@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent { | ||
| 97 | Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData'); | 92 | Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData'); |
| 98 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, | 93 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, |
| 99 | JSON.stringify(h5ReceiveAppData), (data: string) => { | 94 | JSON.stringify(h5ReceiveAppData), (data: string) => { |
| 100 | - // Logger.debug('ImageAndTextWebComponent', "from js data = " + data); | 95 | + Logger.debug('ImageAndTextWebComponent', "from js data = " + data); |
| 101 | }) | 96 | }) |
| 102 | } | 97 | } |
| 103 | } | 98 | } |
| 1 | +import { Action, ContentDetailDTO, } from 'wdBean'; | ||
| 2 | +import DetailViewModel from '../viewmodel/DetailViewModel'; | ||
| 3 | +import { WdWebComponent } from 'wdWebComponent'; | ||
| 4 | +import router from '@ohos.router'; | ||
| 5 | +import { CommonConstants } from 'wdConstant' | ||
| 6 | +import { BridgeWebViewControl } from 'wdJsBridge/Index'; | ||
| 7 | + | ||
| 8 | +const TAG = 'SpacialTopicPageComponent' | ||
| 9 | + | ||
| 10 | +@Component | ||
| 11 | +export struct SpacialTopicPageComponent { | ||
| 12 | + webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | ||
| 13 | + scroller: Scroller = new Scroller(); | ||
| 14 | + action: Action = {} as Action | ||
| 15 | + @State webUrl: string = ''; | ||
| 16 | + build() { | ||
| 17 | + Column() { | ||
| 18 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 19 | + Column() { | ||
| 20 | + WdWebComponent({ | ||
| 21 | + webviewControl: this.webviewControl, | ||
| 22 | + webUrl: this.webUrl, | ||
| 23 | + backVisibility: false, | ||
| 24 | + }) | ||
| 25 | + } | ||
| 26 | + .padding({ bottom: 56 }) | ||
| 27 | + .width(CommonConstants.FULL_WIDTH) | ||
| 28 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 29 | + | ||
| 30 | + //底部交互区 | ||
| 31 | + Row() { | ||
| 32 | + Image($r('app.media.icon_arrow_left')) | ||
| 33 | + .width(24) | ||
| 34 | + .height(24) | ||
| 35 | + .onClick((event: ClickEvent) => { | ||
| 36 | + router.back() | ||
| 37 | + }) | ||
| 38 | + | ||
| 39 | + Row() { | ||
| 40 | + Image($r('app.media.icon_comment')) | ||
| 41 | + .width(24) | ||
| 42 | + .height(24) | ||
| 43 | + .margin({ right: 24 }) | ||
| 44 | + .id('comment') | ||
| 45 | + | ||
| 46 | + Image($r('app.media.icon_star')) | ||
| 47 | + .width(24) | ||
| 48 | + .height(24) | ||
| 49 | + .margin({ right: 24 }) | ||
| 50 | + | ||
| 51 | + Image($r('app.media.icon_listen')) | ||
| 52 | + .width(24) | ||
| 53 | + .height(24) | ||
| 54 | + .margin({ right: 24 }) | ||
| 55 | + | ||
| 56 | + Image($r('app.media.icon_forward')) | ||
| 57 | + .width(24) | ||
| 58 | + .height(24) | ||
| 59 | + | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + .width(CommonConstants.FULL_WIDTH) | ||
| 63 | + .height(56) | ||
| 64 | + .padding({ left: 15, right: 15, bottom: 20, top: 20 }) | ||
| 65 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 66 | + .backgroundColor(Color.White) | ||
| 67 | + } | ||
| 68 | + }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | ||
| 69 | + .backgroundColor(Color.White) | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + aboutToAppear() { | ||
| 73 | + let action: Action = router.getParams() as Action | ||
| 74 | + if (action) { | ||
| 75 | + this.webUrl = action.params?.url || '' | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + aboutToDisappear() { | ||
| 80 | + } | ||
| 81 | +} |
| 1 | +import { ContentDTO } from 'wdBean' | ||
| 2 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 3 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export struct CardSourceInfo { | ||
| 7 | + @State contentDTO: ContentDTO = {} as ContentDTO; | ||
| 8 | + build() { | ||
| 9 | + Flex() { | ||
| 10 | + if(this.contentDTO.corner) { | ||
| 11 | + Text(this.contentDTO.corner) | ||
| 12 | + .fontSize($r("app.float.font_size_12")) | ||
| 13 | + .fontColor($r("app.color.color_ED2800")) | ||
| 14 | + .margin({right: 2}) | ||
| 15 | + } | ||
| 16 | + if(this.contentDTO.rmhPlatform === 1) { | ||
| 17 | + Text(this.contentDTO.rmhInfo.rmhName) | ||
| 18 | + .fontSize($r("app.float.font_size_12")) | ||
| 19 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 20 | + .maxLines(1) | ||
| 21 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 22 | + Image($r("app.media.point")) | ||
| 23 | + .width(16) | ||
| 24 | + .height(16) | ||
| 25 | + } else if(this.contentDTO.source) { | ||
| 26 | + Text(`${this.contentDTO.source}`) | ||
| 27 | + .fontSize($r("app.float.font_size_12")) | ||
| 28 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 29 | + .maxLines(1) | ||
| 30 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 31 | + Image($r("app.media.point")) | ||
| 32 | + .width(16) | ||
| 33 | + .height(16) | ||
| 34 | + } | ||
| 35 | + // TODO 这里还有个判断需要完善,依赖外部,新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 | ||
| 36 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 37 | + .fontSize($r("app.float.font_size_12")) | ||
| 38 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 39 | + .margin({ right: 6 }) | ||
| 40 | + .flexShrink(0) | ||
| 41 | + if(this.contentDTO?.interactData?.commentNum) { | ||
| 42 | + Text(`${this.contentDTO.interactData.commentNum}评`) | ||
| 43 | + .fontSize($r("app.float.font_size_12")) | ||
| 44 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 45 | + .flexShrink(0) | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + .width(CommonConstants.FULL_WIDTH) | ||
| 49 | + .margin({ top: 8 }) | ||
| 50 | + } | ||
| 51 | +} |
| @@ -2,7 +2,8 @@ import { ContentDTO, slideShows } from 'wdBean'; | @@ -2,7 +2,8 @@ import { ContentDTO, slideShows } from 'wdBean'; | ||
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 5 | - | 5 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 6 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 大专题卡--CompStyle: 10 | 9 | * 大专题卡--CompStyle: 10 |
| @@ -76,10 +77,10 @@ export struct Card10Component { | @@ -76,10 +77,10 @@ export struct Card10Component { | ||
| 76 | } | 77 | } |
| 77 | .width(CommonConstants.FULL_WIDTH) | 78 | .width(CommonConstants.FULL_WIDTH) |
| 78 | .padding({ | 79 | .padding({ |
| 79 | - top: 14, | ||
| 80 | - left: 16, | ||
| 81 | - right: 16, | ||
| 82 | - bottom: 14 | 80 | + left: $r('app.float.card_comp_pagePadding_lf'), |
| 81 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 82 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 83 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 83 | }) | 84 | }) |
| 84 | .backgroundColor($r("app.color.white")) | 85 | .backgroundColor($r("app.color.white")) |
| 85 | .margin({ bottom: 8 }) | 86 | .margin({ bottom: 8 }) |
| @@ -95,25 +96,14 @@ export struct Card10Component { | @@ -95,25 +96,14 @@ export struct Card10Component { | ||
| 95 | .fontColor($r('app.color.color_222222')) | 96 | .fontColor($r('app.color.color_222222')) |
| 96 | .maxLines(2) | 97 | .maxLines(2) |
| 97 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 98 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 98 | - Row() { | ||
| 99 | - // 展示发稿人 | ||
| 100 | - if (item.source) { | ||
| 101 | - Text(item.source) | ||
| 102 | - .fontSize($r('app.float.font_size_12')) | ||
| 103 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 104 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 105 | - .maxLines(1) | ||
| 106 | - .width(item.source.length > 10 ? '60%' : '') | ||
| 107 | - | ||
| 108 | - Image($r('app.media.point')) | ||
| 109 | - .width(16) | ||
| 110 | - .height(16) | 99 | + CardSourceInfo( |
| 100 | + { | ||
| 101 | + contentDTO: { | ||
| 102 | + publishTime: item.publishTime || '', | ||
| 103 | + source: item.source || '' | ||
| 104 | + } as ContentDTO | ||
| 111 | } | 105 | } |
| 112 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime)))) | ||
| 113 | - .fontSize($r("app.float.font_size_12")) | ||
| 114 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 115 | - } | ||
| 116 | - .margin({ top: 12 }) | 106 | + ) |
| 117 | } | 107 | } |
| 118 | .layoutWeight(1) | 108 | .layoutWeight(1) |
| 119 | .alignItems(HorizontalAlign.Start) | 109 | .alignItems(HorizontalAlign.Start) |
| @@ -3,7 +3,7 @@ import { CommonConstants } from 'wdConstant' | @@ -3,7 +3,7 @@ import { CommonConstants } from 'wdConstant' | ||
| 3 | import { ContentDTO } from 'wdBean' | 3 | import { ContentDTO } from 'wdBean' |
| 4 | import { DateTimeUtils } from 'wdKit' | 4 | import { DateTimeUtils } from 'wdKit' |
| 5 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 6 | - | 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 7 | const TAG = 'Card11Component'; | 7 | const TAG = 'Card11Component'; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| @@ -21,29 +21,8 @@ export struct Card11Component { | @@ -21,29 +21,8 @@ export struct Card11Component { | ||
| 21 | .maxLines(3) | 21 | .maxLines(3) |
| 22 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 22 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 23 | .width(CommonConstants.FULL_WIDTH) | 23 | .width(CommonConstants.FULL_WIDTH) |
| 24 | - Row() { | ||
| 25 | - if (this.contentDTO.source) { | ||
| 26 | - Text(this.contentDTO.source) | ||
| 27 | - .fontSize($r("app.float.font_size_12")) | ||
| 28 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 29 | - .margin({ left: 6 }) | ||
| 30 | - Image($r("app.media.point")) | ||
| 31 | - .width(16) | ||
| 32 | - .height(16) | ||
| 33 | - } | ||
| 34 | - | ||
| 35 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 36 | - .fontSize($r("app.float.font_size_12")) | ||
| 37 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 38 | - .margin({ right: 6 }) | ||
| 39 | - // TODO '评论取哪个字段' | ||
| 40 | - // Text(`1806评`) | ||
| 41 | - // .fontSize($r("app.float.font_size_12")) | ||
| 42 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 43 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 44 | - .justifyContent(FlexAlign.Start) | ||
| 45 | - .margin({ top: 8 }) | ||
| 46 | - | 24 | + // 评论等信息 |
| 25 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 47 | }.width(CommonConstants.FULL_WIDTH) | 26 | }.width(CommonConstants.FULL_WIDTH) |
| 48 | .padding({ | 27 | .padding({ |
| 49 | left: $r('app.float.card_comp_pagePadding_lf'), | 28 | left: $r('app.float.card_comp_pagePadding_lf'), |
| 1 | +import { ContentDTO } from 'wdBean'; | ||
| 2 | +import { RmhTitle } from '../cardCommon/RmhTitle' | ||
| 3 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 4 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 5 | + | ||
| 6 | +const TAG = 'Card12Component'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 人民号-动态---12:人民号无图卡; | ||
| 10 | + */ | ||
| 11 | +@Component | ||
| 12 | +export struct Card12Component { | ||
| 13 | + @State contentDTO: ContentDTO = { | ||
| 14 | + appStyle: '20', | ||
| 15 | + coverType: 1, | ||
| 16 | + coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90', | ||
| 17 | + fullColumnImgUrls: [ | ||
| 18 | + { | ||
| 19 | + landscape: 1, | ||
| 20 | + size: 1, | ||
| 21 | + url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90', | ||
| 22 | + weight: 1600 | ||
| 23 | + } | ||
| 24 | + ], | ||
| 25 | + newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人', | ||
| 26 | + rmhInfo: { | ||
| 27 | + authIcon: | ||
| 28 | + 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png', | ||
| 29 | + authTitle: '10后音乐人王烁然个人人民号', | ||
| 30 | + authTitle2: '10后音乐人王烁然个人人民号', | ||
| 31 | + banControl: 0, | ||
| 32 | + cnIsAttention: 1, | ||
| 33 | + rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人', | ||
| 34 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg', | ||
| 35 | + rmhName: '王烁然', | ||
| 36 | + userId: '522435359667845', | ||
| 37 | + userType: '2' | ||
| 38 | + }, | ||
| 39 | + objectType: '1', | ||
| 40 | + videoInfo: { | ||
| 41 | + firstFrameImageUri: '', | ||
| 42 | + videoDuration: 37, | ||
| 43 | + videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4' | ||
| 44 | + } | ||
| 45 | + } as ContentDTO; | ||
| 46 | + | ||
| 47 | + aboutToAppear(): void { | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + build() { | ||
| 51 | + Column() { | ||
| 52 | + // rmh信息 | ||
| 53 | + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) | ||
| 54 | + // 标题 | ||
| 55 | + if (this.contentDTO.newsTitle) { | ||
| 56 | + Text(this.contentDTO.newsTitle) | ||
| 57 | + .fontSize($r('app.float.font_size_17')) | ||
| 58 | + .fontColor($r('app.color.color_222222')) | ||
| 59 | + .width(CommonConstants.FULL_WIDTH) | ||
| 60 | + .textOverflowStyle(3) | ||
| 61 | + .margin({ bottom: 8 }) | ||
| 62 | + .height(75) | ||
| 63 | + .lineHeight(25) | ||
| 64 | + .fontFamily('PingFang SC-Regular') | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + // if (this.contentDTO.fullColumnImgUrls?.[0]) { | ||
| 68 | + // createImg({ contentDTO: this.contentDTO }) | ||
| 69 | + // } | ||
| 70 | + //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | ||
| 71 | + } | ||
| 72 | + .padding({ | ||
| 73 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 74 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 75 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 76 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 77 | + }) | ||
| 78 | + } | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | +interface radiusType { | ||
| 82 | + topLeft: number | Resource; | ||
| 83 | + topRight: number | Resource; | ||
| 84 | + bottomLeft: number | Resource; | ||
| 85 | + bottomRight: number | Resource; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +@Component | ||
| 89 | +struct createImg { | ||
| 90 | + @Prop contentDTO: ContentDTO | ||
| 91 | + | ||
| 92 | + build() { | ||
| 93 | + GridRow() { | ||
| 94 | + if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) { | ||
| 95 | + // 横屏 | ||
| 96 | + GridCol({ | ||
| 97 | + span: { xs: 12 } | ||
| 98 | + }) { | ||
| 99 | + Stack() { | ||
| 100 | + Image(this.contentDTO.coverUrl) | ||
| 101 | + .width(CommonConstants.FULL_WIDTH) | ||
| 102 | + .aspectRatio(16 / 9) | ||
| 103 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 104 | + CardMediaInfo({ contentDTO: this.contentDTO }) | ||
| 105 | + } | ||
| 106 | + .align(Alignment.BottomEnd) | ||
| 107 | + } | ||
| 108 | + } else { | ||
| 109 | + // 竖图显示,宽度占50%,高度自适应 | ||
| 110 | + GridCol({ | ||
| 111 | + span: { xs: 6 } | ||
| 112 | + }) { | ||
| 113 | + Stack() { | ||
| 114 | + Image(this.contentDTO.coverUrl) | ||
| 115 | + .width(CommonConstants.FULL_WIDTH) | ||
| 116 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 117 | + CardMediaInfo({ contentDTO: this.contentDTO }) | ||
| 118 | + } | ||
| 119 | + .align(Alignment.BottomEnd) | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | + | ||
| 127 | +@Extend(Text) | ||
| 128 | +function textOverflowStyle(maxLine: number) { | ||
| 129 | + .maxLines(maxLine) | ||
| 130 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 131 | +} |
| 1 | +import { ContentDTO } from 'wdBean'; | ||
| 2 | +import { RmhTitle } from '../cardCommon/RmhTitle' | ||
| 3 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 4 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 5 | + | ||
| 6 | +const TAG = 'Card12Component'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 人民号-动态---12:人民号无图卡; | ||
| 10 | + */ | ||
| 11 | +@Entry | ||
| 12 | +@Component | ||
| 13 | +export struct Card12Component { | ||
| 14 | + @State contentDTO: ContentDTO = { | ||
| 15 | + appStyle: '20', | ||
| 16 | + coverType: 1, | ||
| 17 | + coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90', | ||
| 18 | + fullColumnImgUrls: [ | ||
| 19 | + { | ||
| 20 | + landscape: 1, | ||
| 21 | + size: 1, | ||
| 22 | + url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90', | ||
| 23 | + weight: 1600 | ||
| 24 | + } | ||
| 25 | + ], | ||
| 26 | + newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人', | ||
| 27 | + rmhInfo: { | ||
| 28 | + authIcon: | ||
| 29 | + 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png', | ||
| 30 | + authTitle: '10后音乐人王烁然个人人民号', | ||
| 31 | + authTitle2: '10后音乐人王烁然个人人民号', | ||
| 32 | + banControl: 0, | ||
| 33 | + cnIsAttention: 1, | ||
| 34 | + rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人', | ||
| 35 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg', | ||
| 36 | + rmhName: '王烁然', | ||
| 37 | + userId: '522435359667845', | ||
| 38 | + userType: '2' | ||
| 39 | + }, | ||
| 40 | + objectType: '1', | ||
| 41 | + videoInfo: { | ||
| 42 | + firstFrameImageUri: '', | ||
| 43 | + videoDuration: 37, | ||
| 44 | + videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4' | ||
| 45 | + } | ||
| 46 | + } as ContentDTO; | ||
| 47 | + | ||
| 48 | + aboutToAppear(): void { | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + build() { | ||
| 52 | + Column() { | ||
| 53 | + // rmh信息 | ||
| 54 | + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) | ||
| 55 | + // 左标题,右图 | ||
| 56 | + Flex({ direction: FlexDirection.Row }) { | ||
| 57 | + | ||
| 58 | + Text(this.contentDTO.newsTitle) | ||
| 59 | + .fontSize($r('app.float.font_size_17')) | ||
| 60 | + .fontColor($r('app.color.color_222222')) | ||
| 61 | + .textOverflowStyle(3) | ||
| 62 | + .lineHeight(25) | ||
| 63 | + .fontFamily('PingFang SC-Regular') | ||
| 64 | + .textAlign(TextAlign.Start) | ||
| 65 | + .flexBasis('auto') | ||
| 66 | + .margin({right: 12}) | ||
| 67 | + | ||
| 68 | + Image(this.contentDTO.coverUrl) | ||
| 69 | + .flexBasis(174) | ||
| 70 | + .height(75) | ||
| 71 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 72 | + // .flexBasis(160) | ||
| 73 | + .backgroundImageSize(ImageSize.Auto) | ||
| 74 | + | ||
| 75 | + } | ||
| 76 | + .width(CommonConstants.FULL_WIDTH) | ||
| 77 | + .margin({ bottom: 8 }) | ||
| 78 | + .height(75) | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | ||
| 82 | + } | ||
| 83 | + .padding({ | ||
| 84 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 85 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 86 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 87 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 88 | + }) | ||
| 89 | + } | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +interface radiusType { | ||
| 93 | + topLeft: number | Resource; | ||
| 94 | + topRight: number | Resource; | ||
| 95 | + bottomLeft: number | Resource; | ||
| 96 | + bottomRight: number | Resource; | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +@Extend(Text) | ||
| 100 | +function textOverflowStyle(maxLine: number) { | ||
| 101 | + .maxLines(maxLine) | ||
| 102 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 103 | +} |
| @@ -4,7 +4,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -4,7 +4,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | import { DateTimeUtils } from 'wdKit'; | 4 | import { DateTimeUtils } from 'wdKit'; |
| 5 | import { WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterRule } from 'wdRouter'; |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | - | 7 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 8 | const TAG = 'Card17Component'; | 8 | const TAG = 'Card17Component'; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| @@ -81,25 +81,8 @@ export struct Card17Component { | @@ -81,25 +81,8 @@ export struct Card17Component { | ||
| 81 | }; | 81 | }; |
| 82 | WDRouterRule.jumpWithAction(taskAction) | 82 | WDRouterRule.jumpWithAction(taskAction) |
| 83 | }) | 83 | }) |
| 84 | - | ||
| 85 | - Row() { | ||
| 86 | - if (this.contentDTO.source) { | ||
| 87 | - Text(this.contentDTO.source) | ||
| 88 | - .fontSize($r('app.float.font_size_13')) | ||
| 89 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 90 | - Image($r('app.media.point')) | ||
| 91 | - .width(16) | ||
| 92 | - .height(16) | ||
| 93 | - } | ||
| 94 | - if (this.contentDTO.publishTime && this.contentDTO.publishTime.length === 13) { | ||
| 95 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 96 | - .fontSize($r('app.float.font_size_13')) | ||
| 97 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 98 | - } | ||
| 99 | - } | ||
| 100 | - .width(CommonConstants.FULL_WIDTH) | ||
| 101 | - .height(16) | ||
| 102 | - .id('label') | 84 | + // 评论等信息 |
| 85 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 103 | } | 86 | } |
| 104 | .width(CommonConstants.FULL_WIDTH) | 87 | .width(CommonConstants.FULL_WIDTH) |
| 105 | .padding({ | 88 | .padding({ |
| 1 | +import { ContentDTO } from 'wdBean'; | ||
| 2 | +import { CommonConstants, CompStyle } from 'wdConstant'; | ||
| 3 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 4 | +import { RmhTitle } from '../cardCommon/RmhTitle' | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | + | ||
| 7 | +const TAG: string = 'Card6Component-Card13Component'; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 卡片样式:"appStyle":"21" 小视频卡人民号 | ||
| 11 | + */ | ||
| 12 | +@Component | ||
| 13 | +export struct Card21Component { | ||
| 14 | + @State contentDTO: ContentDTO = {} as ContentDTO; | ||
| 15 | + | ||
| 16 | + build() { | ||
| 17 | + Column() { | ||
| 18 | + // 顶部 rmh信息 | ||
| 19 | + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) | ||
| 20 | + // 中间内容 | ||
| 21 | + Grid() { | ||
| 22 | + GridItem() { | ||
| 23 | + Text(`${this.contentDTO.newsTitle}`) | ||
| 24 | + .fontSize($r('app.float.selected_text_size')) | ||
| 25 | + .fontColor($r('app.color.color_222222')) | ||
| 26 | + .width(CommonConstants.FULL_WIDTH) | ||
| 27 | + .maxLines(4) | ||
| 28 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 29 | + .padding({ right: 12 }) | ||
| 30 | + .lineHeight(26) | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + GridItem() { | ||
| 34 | + Stack() { | ||
| 35 | + Image(this.contentDTO.coverUrl) | ||
| 36 | + .width(CommonConstants.FULL_WIDTH) | ||
| 37 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 38 | + CardMediaInfo({ contentDTO: this.contentDTO }) | ||
| 39 | + } | ||
| 40 | + .alignContent(Alignment.BottomEnd) | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + .columnsTemplate('2fr 1fr') | ||
| 44 | + .maxCount(1) | ||
| 45 | + | ||
| 46 | + //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | ||
| 47 | + } | ||
| 48 | + .onClick((event: ClickEvent) => { | ||
| 49 | + ProcessUtils.processPage(this.contentDTO) | ||
| 50 | + }) | ||
| 51 | + .padding({ | ||
| 52 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 53 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 54 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 55 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 56 | + }) | ||
| 57 | + .width(CommonConstants.FULL_WIDTH) | ||
| 58 | + } | ||
| 59 | +} |
| 1 | //全标题 "appStyle":"2", | 1 | //全标题 "appStyle":"2", |
| 2 | import { ContentDTO } from 'wdBean'; | 2 | import { ContentDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | -import { DateTimeUtils } from 'wdKit/Index'; | ||
| 5 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | - | 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 8 | const TAG: string = 'Card2Component'; | 7 | const TAG: string = 'Card2Component'; |
| 9 | 8 | ||
| 10 | /** | 9 | /** |
| @@ -60,21 +59,8 @@ export struct Card2Component { | @@ -60,21 +59,8 @@ export struct Card2Component { | ||
| 60 | .alignItems(HorizontalAlign.Start) | 59 | .alignItems(HorizontalAlign.Start) |
| 61 | 60 | ||
| 62 | //bottom | 61 | //bottom |
| 63 | - Row() { | ||
| 64 | - Text(this.contentDTO.source) | ||
| 65 | - .bottomTextStyle() | ||
| 66 | - //间隔点 | ||
| 67 | - Image($r('app.media.point')) | ||
| 68 | - .width(12) | ||
| 69 | - .height(12) | ||
| 70 | - | ||
| 71 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 72 | - .bottomTextStyle() | ||
| 73 | - } | ||
| 74 | - .width(CommonConstants.FULL_WIDTH) | ||
| 75 | - .height(18) | ||
| 76 | - .justifyContent(FlexAlign.Start) | ||
| 77 | - .margin({ top: 8 }) | 62 | + // 评论等信息 |
| 63 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 78 | } | 64 | } |
| 79 | .width(CommonConstants.FULL_WIDTH) | 65 | .width(CommonConstants.FULL_WIDTH) |
| 80 | .padding({ | 66 | .padding({ |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | -import { DateTimeUtils } from 'wdKit/src/main/ets/utils/DateTimeUtils' | ||
| 4 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 4 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * 卡片样式:"appStyle":"3" | 7 | * 卡片样式:"appStyle":"3" |
| @@ -27,30 +27,8 @@ export struct Card3Component { | @@ -27,30 +27,8 @@ export struct Card3Component { | ||
| 27 | .fontSize($r("app.float.font_size_16")) | 27 | .fontSize($r("app.float.font_size_16")) |
| 28 | .fontColor($r("app.color.color_222222")) | 28 | .fontColor($r("app.color.color_222222")) |
| 29 | .width(CommonConstants.FULL_WIDTH) | 29 | .width(CommonConstants.FULL_WIDTH) |
| 30 | - Row() { | ||
| 31 | - // TODO "锐评"取得哪个字段,什么时候显示。 | ||
| 32 | - // Text("锐评") | ||
| 33 | - // .fontSize($r("app.float.font_size_12")) | ||
| 34 | - // .fontColor($r("app.color.color_ED2800")) | ||
| 35 | - if(this.contentDTO.source) { | ||
| 36 | - Text(this.contentDTO.source) | ||
| 37 | - .fontSize($r("app.float.font_size_12")) | ||
| 38 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 39 | - Image($r("app.media.point")) | ||
| 40 | - .width(16) | ||
| 41 | - .height(16) | ||
| 42 | - } | ||
| 43 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 44 | - .fontSize($r("app.float.font_size_12")) | ||
| 45 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 46 | - .margin({ right: 6 }) | ||
| 47 | - // TODO '评论取哪个字段' | ||
| 48 | - // Text(`1806评`) | ||
| 49 | - // .fontSize($r("app.float.font_size_12")) | ||
| 50 | - // .fontColor($r("app.color.color_B0B0B0")) | ||
| 51 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 52 | - .justifyContent(FlexAlign.Start) | ||
| 53 | - .margin({ top: 8 }) | 30 | + // 评论等信息 |
| 31 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 54 | } | 32 | } |
| 55 | .width(CommonConstants.FULL_WIDTH) | 33 | .width(CommonConstants.FULL_WIDTH) |
| 56 | .padding({ | 34 | .padding({ |
| 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; | 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 4 | -import { DateTimeUtils } from 'wdKit/Index'; | ||
| 5 | - | 4 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 6 | const TAG: string = 'Card4Component'; | 5 | const TAG: string = 'Card4Component'; |
| 7 | 6 | ||
| 8 | /** | 7 | /** |
| @@ -110,25 +109,8 @@ export struct Card4Component { | @@ -110,25 +109,8 @@ export struct Card4Component { | ||
| 110 | .onClick((event: ClickEvent) => { | 109 | .onClick((event: ClickEvent) => { |
| 111 | ProcessUtils.processPage(this.contentDTO) | 110 | ProcessUtils.processPage(this.contentDTO) |
| 112 | }) | 111 | }) |
| 113 | - | ||
| 114 | - | ||
| 115 | - //bottom | ||
| 116 | - Row() { | ||
| 117 | - Text(this.contentDTO.source) | ||
| 118 | - .bottomTextStyle() | ||
| 119 | - //间隔点 | ||
| 120 | - Image($r('app.media.point')) | ||
| 121 | - .width(12) | ||
| 122 | - .height(12) | ||
| 123 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 124 | - .bottomTextStyle() | ||
| 125 | - // TODO 评论字段取值 | ||
| 126 | - // Text('518条评论') | ||
| 127 | - // .bottomTextStyle() | ||
| 128 | - } | ||
| 129 | - .width('100%') | ||
| 130 | - .justifyContent(FlexAlign.Start) | ||
| 131 | - .margin({ top: 8 }) | 112 | + //bottom 评论等信息 |
| 113 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 132 | } | 114 | } |
| 133 | .width(CommonConstants.FULL_WIDTH) | 115 | .width(CommonConstants.FULL_WIDTH) |
| 134 | .padding({ | 116 | .padding({ |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 3 | -import { DateTimeUtils } from 'wdKit'; | ||
| 4 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 5 | - | 4 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | const TAG: string = 'Card6Component-Card13Component'; | 6 | const TAG: string = 'Card6Component-Card13Component'; |
| 7 | -const FULL_PARENT: string = '100%'; | ||
| 8 | 7 | ||
| 9 | /** | 8 | /** |
| 10 | - * 卡片样式:"appStyle":"6"以及13 | 9 | + * 卡片样式:"appStyle":"6"以及13--- 小视频卡 |
| 11 | */ | 10 | */ |
| 12 | @Component | 11 | @Component |
| 13 | export struct Card6Component { | 12 | export struct Card6Component { |
| @@ -17,7 +16,17 @@ export struct Card6Component { | @@ -17,7 +16,17 @@ export struct Card6Component { | ||
| 17 | Row() { | 16 | Row() { |
| 18 | Column() { | 17 | Column() { |
| 19 | Column() { | 18 | Column() { |
| 20 | - Text(this.contentDTO.newsTitle) | 19 | + // TODO 这个tag涉及样式问题。待优化。 |
| 20 | + // if (this.contentDTO.newTags) { | ||
| 21 | + // Text(this.contentDTO.newTags) | ||
| 22 | + // .backgroundColor($r('app.color.color_ED2800')) | ||
| 23 | + // .borderRadius($r('app.float.button_border_radius')) | ||
| 24 | + // .fontColor($r('app.color.color_fff')) | ||
| 25 | + // .fontSize($r('app.float.font_size_12')) | ||
| 26 | + // .padding(2) | ||
| 27 | + // .margin({ right: 2 }) | ||
| 28 | + // } | ||
| 29 | + Text(`${this.contentDTO.newsTitle}`) | ||
| 21 | .fontSize(16) | 30 | .fontSize(16) |
| 22 | .fontWeight(FontWeight.Normal) | 31 | .fontWeight(FontWeight.Normal) |
| 23 | .maxLines(3)// | 32 | .maxLines(3)// |
| @@ -26,93 +35,35 @@ export struct Card6Component { | @@ -26,93 +35,35 @@ export struct Card6Component { | ||
| 26 | }.height("80%") | 35 | }.height("80%") |
| 27 | .justifyContent(FlexAlign.Start) | 36 | .justifyContent(FlexAlign.Start) |
| 28 | 37 | ||
| 29 | - Row() { | ||
| 30 | - if (this.contentDTO.source) { | ||
| 31 | - Text(this.contentDTO.source) | ||
| 32 | - .fontSize($r('app.float.font_size_12')) | ||
| 33 | - .fontColor(Color.Gray) | ||
| 34 | - .maxLines(1) | ||
| 35 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 36 | - .width(this.contentDTO.source.length > 8 ? '50%' : '') | ||
| 37 | - Image($r('app.media.point')) | ||
| 38 | - .width(16) | ||
| 39 | - .height(16) | ||
| 40 | - } | ||
| 41 | - if (this.contentDTO.publishTime && this.contentDTO.publishTime.length === 13) { | ||
| 42 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | ||
| 43 | - .fontSize($r('app.float.font_size_12')) | ||
| 44 | - .fontColor(Color.Gray) | ||
| 45 | - } | ||
| 46 | - Text(this.contentDTO.visitorComment + '评') | ||
| 47 | - .fontSize($r('app.float.font_size_12')) | ||
| 48 | - .fontColor(Color.Gray) | ||
| 49 | - .padding({ | ||
| 50 | - left: 5 | ||
| 51 | - }) | ||
| 52 | - }.alignSelf(ItemAlign.Start) | ||
| 53 | - .height("20%") | ||
| 54 | - .justifyContent(FlexAlign.Start) | 38 | + |
| 39 | + //bottom 评论等信息 | ||
| 40 | + CardSourceInfo({ contentDTO: this.contentDTO }) | ||
| 55 | } | 41 | } |
| 56 | .alignItems(HorizontalAlign.Start) | 42 | .alignItems(HorizontalAlign.Start) |
| 57 | .justifyContent(FlexAlign.Start) | 43 | .justifyContent(FlexAlign.Start) |
| 58 | .width('58%') | 44 | .width('58%') |
| 59 | - | ||
| 60 | - Blank(16) | ||
| 61 | if (this.contentDTO.coverUrl) { | 45 | if (this.contentDTO.coverUrl) { |
| 62 | Stack() { | 46 | Stack() { |
| 63 | Image(this.contentDTO.coverUrl) | 47 | Image(this.contentDTO.coverUrl) |
| 64 | .borderRadius(5) | 48 | .borderRadius(5) |
| 65 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | 49 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) |
| 66 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180) | 50 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180) |
| 67 | - if (this.contentDTO.videoInfo) { | ||
| 68 | - Row() { | ||
| 69 | - Image($r('app.media.iv_card_play_yellow_flag')) | ||
| 70 | - .width(22) | ||
| 71 | - .height(18) | ||
| 72 | - Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) | ||
| 73 | - .fontSize($r('app.float.font_size_13')) | ||
| 74 | - .fontWeight(400) | ||
| 75 | - .fontColor($r('app.color.color_fff')) | ||
| 76 | - } | ||
| 77 | - .alignItems(VerticalAlign.Bottom) | ||
| 78 | - .height(18) | ||
| 79 | - .padding({ right: 4 }) | ||
| 80 | - .margin({ | ||
| 81 | - right: 4, | ||
| 82 | - bottom: 4 | ||
| 83 | - }) | ||
| 84 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 85 | - } else if (this.contentDTO.voiceInfo) { | ||
| 86 | - Row() { | ||
| 87 | - Image($r('app.media.icon_listen')) | ||
| 88 | - .width(22) | ||
| 89 | - .height(18) | ||
| 90 | - Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo | ||
| 91 | - .voiceDuration * 1000)) | ||
| 92 | - .fontSize($r('app.float.font_size_13')) | ||
| 93 | - .fontWeight(400) | ||
| 94 | - .fontColor($r('app.color.color_fff')) | ||
| 95 | - } | ||
| 96 | - .alignItems(VerticalAlign.Bottom) | ||
| 97 | - .height(18) | ||
| 98 | - .padding({ right: 4 }) | ||
| 99 | - .margin({ | ||
| 100 | - right: 4, | ||
| 101 | - bottom: 4 | ||
| 102 | - }) | ||
| 103 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 104 | - } | ||
| 105 | - }.alignContent(Alignment.BottomEnd) | 51 | + CardMediaInfo({ contentDTO: this.contentDTO }) |
| 52 | + } | ||
| 53 | + .alignContent(Alignment.BottomEnd) | ||
| 106 | } | 54 | } |
| 107 | } | 55 | } |
| 108 | .onClick((event: ClickEvent) => { | 56 | .onClick((event: ClickEvent) => { |
| 109 | ProcessUtils.processPage(this.contentDTO) | 57 | ProcessUtils.processPage(this.contentDTO) |
| 110 | }) | 58 | }) |
| 111 | - .padding( | ||
| 112 | - { top: 16, bottom: 16, left: 14, right: 14 }) | ||
| 113 | - .width(FULL_PARENT) | 59 | + .padding({ |
| 60 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 61 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 62 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 63 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 64 | + }) | ||
| 65 | + .width(CommonConstants.FULL_WIDTH) | ||
| 114 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 127 : 217) | 66 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 127 : 217) |
| 115 | .justifyContent(FlexAlign.SpaceBetween) | 67 | .justifyContent(FlexAlign.SpaceBetween) |
| 116 | - | ||
| 117 | } | 68 | } |
| 118 | } | 69 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/model/CommentModel.ets
0 → 100644
| 1 | +import PageModel from '../../../viewmodel/PageModel' | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +/// 所有用户类型定义 | ||
| 5 | +/// 1--普通账户正常;--不能直播、点播 | ||
| 6 | +/// 2--视频号,可以直播、点播;显示查看修改都是自己的信息; | ||
| 7 | +/// 3--矩阵号,是有视频号升级来的;可以登陆app,我的里面是自己的信息;发评论、发视频、直播都是自己;矩阵号下面可以挂视频号、运营子账号; | ||
| 8 | +/// 4--运营子账号,登陆使用的是自己的userId手机,密码;显示是对应视频号的信息,我的里面是视频号的信息,无法更改基本信息,自己没有头像,昵称信息;发点播、发直播、发评论,都是对应视频号的身份发送的;还是需要记录子账号的userId;(评论表 userId,userType,creatorId) | ||
| 9 | +export enum WDPublicUserType { | ||
| 10 | + /// 未知类型 | ||
| 11 | + WDPublicUserType_Unkown = 0, | ||
| 12 | + | ||
| 13 | + /// 普通用户 | ||
| 14 | + WDPublicUserType_NormalUser = 1, | ||
| 15 | + | ||
| 16 | + /// 号主 | ||
| 17 | + WDPublicUserType_AccountOwner = 2, | ||
| 18 | + | ||
| 19 | + /// 矩阵号 | ||
| 20 | + WDPublicUserType_Matrix = 3, | ||
| 21 | + | ||
| 22 | + /// 运营子账号 | ||
| 23 | + WDPublicUserType_OperatingSubAccount = 4, | ||
| 24 | + | ||
| 25 | + /// 内容源账号 | ||
| 26 | + WDPublicUserType_ContentSourceAccount = 5, | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +@Observed | ||
| 30 | +export class commentListModel extends PageModel{ | ||
| 31 | + pageNum: number = 0 | ||
| 32 | + pageSize: number = 0 | ||
| 33 | + totalCount: number = 0 | ||
| 34 | + hasNext: number = 0 | ||
| 35 | + list: commentItemModel[] = [] | ||
| 36 | + | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +@Observed | ||
| 40 | +export class commentItemModel { | ||
| 41 | + authorLike: string = '' | ||
| 42 | + avatarFrame: string = '' | ||
| 43 | + checkStatus: string = '' | ||
| 44 | + childCommentNum: string = '' | ||
| 45 | + childComments: commentItemModel[] = [] | ||
| 46 | + commentContent: string = '' | ||
| 47 | + commentContentSensitive: string = '' | ||
| 48 | + commentLevel: number = 0 | ||
| 49 | + commentPics: string = '' | ||
| 50 | + commentSensitive: string = '' | ||
| 51 | + commentType: number = 0 | ||
| 52 | + contentAuthor: number = 0 | ||
| 53 | + createTime: string = '' | ||
| 54 | + creatorFlag: string = '' | ||
| 55 | + fromCreatorId: string = '' | ||
| 56 | + fromDeviceId: string = '' | ||
| 57 | + fromUserHeader: string = '' | ||
| 58 | + fromUserId: string = '' | ||
| 59 | + fromUserName: string = '' | ||
| 60 | + fromUserType: WDPublicUserType = 0 | ||
| 61 | + id: string = '' | ||
| 62 | + likeNum: string = '' | ||
| 63 | + /*是否点赞*/ | ||
| 64 | + isLike: boolean = false | ||
| 65 | + mySelf: string = '' | ||
| 66 | + parentId: string = '' | ||
| 67 | + region: string = '' | ||
| 68 | + replyNum: string = '' | ||
| 69 | + rootCommentId: string = '' | ||
| 70 | + sensitiveExist: string = '' | ||
| 71 | + sensitiveShow: string = '' | ||
| 72 | + toUserContentAuthor: string = '' | ||
| 73 | + toUserId: string = '' | ||
| 74 | + toUserName: string = '' | ||
| 75 | + toUserType: string = '' | ||
| 76 | + topFlag: string = '' | ||
| 77 | + uuid: string = '' | ||
| 78 | + /*本地使用,收起时默认3行 -1为不限制行数*/ | ||
| 79 | + maxLine: number = 3 | ||
| 80 | + | ||
| 81 | + /*是否有展示更多*/ | ||
| 82 | + hasMore:boolean = false | ||
| 83 | + /*当有展示更多的时候,当前的状态是展开还是收起*/ | ||
| 84 | + expanded:boolean = false | ||
| 85 | + | ||
| 86 | + highQualityExpireTime:string = ''; | ||
| 87 | + highQualityTime:string = ''; | ||
| 88 | + targetTitle:string = ''; | ||
| 89 | + targetStatus:string = ''; | ||
| 90 | + targetId:string = ''; | ||
| 91 | + targetRelId:string = ''; | ||
| 92 | + targetRelObjectId:string = ''; | ||
| 93 | + targetRelType:string = ''; | ||
| 94 | + targetType:string = ''; | ||
| 95 | + visitorComment:string = ''; | ||
| 96 | + shareInfo:commentItemShareInfoModel = new commentItemShareInfoModel; | ||
| 97 | + // targetId:string = ''; | ||
| 98 | + // targetId:string = ''; | ||
| 99 | + // targetId:string = ''; | ||
| 100 | + | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +export class commentItemShareInfoModel { | ||
| 104 | + shareCoverUrl: string = '' | ||
| 105 | + shareSummary: string = '' | ||
| 106 | + shareTitle: string = '' | ||
| 107 | + shareUrl: string = '' | ||
| 108 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/BottomCommentComponent.ets
0 → 100644
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
0 → 100644
| 1 | +import ArrayList from '@ohos.util.ArrayList' | ||
| 2 | +import { ViewType } from 'wdConstant/Index'; | ||
| 3 | +import { DateTimeUtils, LazyDataSource } from 'wdKit/Index'; | ||
| 4 | +import PageModel from '../../../viewmodel/PageModel'; | ||
| 5 | +import { commentItemModel, commentListModel, WDPublicUserType } from '../model/CommentModel'; | ||
| 6 | +import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 7 | +import { CommentText } from './CommentText'; | ||
| 8 | +import measure from '@ohos.measure' | ||
| 9 | + | ||
| 10 | +@Entry | ||
| 11 | +@Preview | ||
| 12 | +@Component | ||
| 13 | +export struct CommentComponent { | ||
| 14 | + @State private browSingModel: commentListModel = new commentListModel() | ||
| 15 | + isloading: boolean = false | ||
| 16 | + // @State allDatas :commentItemModel[] = []; | ||
| 17 | + | ||
| 18 | + @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | ||
| 19 | + | ||
| 20 | + aboutToAppear() { | ||
| 21 | + this.getData(); | ||
| 22 | + this.getData(); | ||
| 23 | + this.getData(); | ||
| 24 | + this.getData(); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + /*标题:全部评论*/ | ||
| 28 | + @Builder | ||
| 29 | + titleHeader() { | ||
| 30 | + Row() { | ||
| 31 | + Row() { | ||
| 32 | + Image($r('app.media.redLine')) | ||
| 33 | + .height(16) | ||
| 34 | + .width(3) | ||
| 35 | + Text('全部评论') | ||
| 36 | + .fontSize(18)// .fontColor('#222222') | ||
| 37 | + .fontColor($r('app.color.color_222222')) | ||
| 38 | + .fontWeight(FontWeight.Medium) | ||
| 39 | + .margin({ left: 5 }) | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + .margin({ left: 16 }) | ||
| 43 | + | ||
| 44 | + }.height(44) | ||
| 45 | + .width('100%') | ||
| 46 | + .justifyContent(FlexAlign.SpaceBetween); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + /*1级评论作为titleHeader*/ | ||
| 50 | + @Builder | ||
| 51 | + CommentHeaderItem(item: commentItemModel) { | ||
| 52 | + Column() { | ||
| 53 | + Row() { | ||
| 54 | + //头像 | ||
| 55 | + Stack() { | ||
| 56 | + Image(item.fromUserHeader) | ||
| 57 | + .alt($r('app.media.default_head')) | ||
| 58 | + .width('32') | ||
| 59 | + .height('32') | ||
| 60 | + .objectFit(ImageFit.Cover) | ||
| 61 | + .borderRadius(16) | ||
| 62 | + Image($r('app.media.icon_border_test')) | ||
| 63 | + .width('48') | ||
| 64 | + .height('48') | ||
| 65 | + .objectFit(ImageFit.Cover) | ||
| 66 | + .borderRadius(24) | ||
| 67 | + } | ||
| 68 | + .width(48) | ||
| 69 | + .height(48) | ||
| 70 | + .margin({ left: 8 }) | ||
| 71 | + .alignContent(Alignment.Center) | ||
| 72 | + .onClick(() => { | ||
| 73 | + // TODO 跳转个人详情 | ||
| 74 | + }) | ||
| 75 | + | ||
| 76 | + //昵称 | ||
| 77 | + Text(item.fromUserName) | ||
| 78 | + .fontSize(14) | ||
| 79 | + .fontColor($r('app.color.color_222222')) | ||
| 80 | + .fontWeight(FontWeight.Medium) | ||
| 81 | + .margin({ left: 5 }) | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + /// 暂时不显示 “我” 的标签了 | ||
| 85 | + /// 人民号>置顶>作者 | ||
| 86 | + | ||
| 87 | + //人民号 | ||
| 88 | + // if (item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) { | ||
| 89 | + Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | ||
| 90 | + // } | ||
| 91 | + //置顶 | ||
| 92 | + // if (item.topFlag) { | ||
| 93 | + Image($r('app.media.comment_icon_zhiding')).width(30).height(18).margin({ left: 5 }); | ||
| 94 | + // } | ||
| 95 | + //作者 | ||
| 96 | + // if (item.contentAuthor === 1) { | ||
| 97 | + Text('作者') | ||
| 98 | + .fontSize(11) | ||
| 99 | + .fontColor('#968562') | ||
| 100 | + .backgroundColor('#F1EFEB') | ||
| 101 | + .textAlign(TextAlign.Center) | ||
| 102 | + .borderRadius(2) | ||
| 103 | + .width(30) | ||
| 104 | + .height(18) | ||
| 105 | + .margin({ left: 5 }); | ||
| 106 | + // } | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + CommentText({ | ||
| 110 | + longMessage: item.commentContent, | ||
| 111 | + maxline: 3, | ||
| 112 | + fontSize: 16, | ||
| 113 | + fontWeight: FontWeight.Regular, | ||
| 114 | + marginWidth: (59 + 16) | ||
| 115 | + }) | ||
| 116 | + .margin({ left: 59, right: 16 }) | ||
| 117 | + | ||
| 118 | + | ||
| 119 | + this.CommentFooterView(item); | ||
| 120 | + }.alignItems(HorizontalAlign.Start) | ||
| 121 | + | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + /*查看更多和收起*/ | ||
| 125 | + @Builder | ||
| 126 | + GroupFooterView(item: commentItemModel) { | ||
| 127 | + Row() { | ||
| 128 | + if (item.expanded){ | ||
| 129 | + Row() { | ||
| 130 | + Text('收起').fontColor($r('app.color.color_222222')).fontSize(14) | ||
| 131 | + Image($r('app.media.comment_pickUp')).width(12).height(12) | ||
| 132 | + }.margin({ left: 213 }) | ||
| 133 | + }else { | ||
| 134 | + Row() { | ||
| 135 | + Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) | ||
| 136 | + Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 }) | ||
| 137 | + Image($r('app.media.comment_unfold')).width(12).height(12) | ||
| 138 | + }.margin({ left: 53 }) | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + | ||
| 144 | + }.height(30) | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + /*评论内容下面的IP地址时间点赞*/ | ||
| 148 | + @Builder | ||
| 149 | + CommentFooterView(item: commentItemModel) { | ||
| 150 | + Row() { | ||
| 151 | + | ||
| 152 | + Row({ space: 6 }) { | ||
| 153 | + Text(item.region ? (item.region + '网友') : '人民日报客户端网友') | ||
| 154 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 155 | + .fontSize(12); | ||
| 156 | + Image($r('app.media.comment_hyphen')) | ||
| 157 | + .size({ | ||
| 158 | + width: 4, | ||
| 159 | + height: 4 | ||
| 160 | + }) | ||
| 161 | + | ||
| 162 | + //TODO: 时间格式需要本地调整 | ||
| 163 | + // / 展现专用,用于获取多久之前 | ||
| 164 | + // ///小于1分钟:刚刚 | ||
| 165 | + // ///1~60分钟:x分钟前 | ||
| 166 | + // ///1小时~1天:x小时前 | ||
| 167 | + // ///1天~2天:1天前 | ||
| 168 | + // ///2天~:日期隐藏 | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.createTime))) | ||
| 172 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 173 | + .fontSize(12) | ||
| 174 | + | ||
| 175 | + Image($r('app.media.comment_hyphen_block')) | ||
| 176 | + .size({ | ||
| 177 | + width: 4, | ||
| 178 | + height: 4 | ||
| 179 | + }) | ||
| 180 | + | ||
| 181 | + Text('回复') | ||
| 182 | + .fontColor($r('app.color.color_222222')) | ||
| 183 | + .fontSize(12) | ||
| 184 | + .onClick(() => { | ||
| 185 | + //TODO: 回复 | ||
| 186 | + }) | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + Row({ space: 6 }) { | ||
| 190 | + Text(item.likeNum) | ||
| 191 | + .fontColor($r('app.color.color_666666')) | ||
| 192 | + .fontSize(14) | ||
| 193 | + | ||
| 194 | + Image($r('app.media.comment_like_normal')) | ||
| 195 | + .size({ | ||
| 196 | + width: 16, | ||
| 197 | + height: 16 | ||
| 198 | + }) | ||
| 199 | + .onClick(() => { | ||
| 200 | + //TODO: 点赞 | ||
| 201 | + }) | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + } | ||
| 205 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 206 | + .height(30) | ||
| 207 | + .margin({ left: 59, right: 16 }) | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + build() { | ||
| 211 | + Column() { | ||
| 212 | + | ||
| 213 | + List() { | ||
| 214 | + ListItemGroup({ header: this.titleHeader() }) | ||
| 215 | + LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 216 | + if (item.hasMore) { | ||
| 217 | + ListItemGroup({ header: this.CommentHeaderItem(item), footer: this.GroupFooterView(item) }) { | ||
| 218 | + ForEach(item.childComments, (childItem: commentItemModel, subIndex: number) => { | ||
| 219 | + ListItem() { | ||
| 220 | + ChildCommentItem(); | ||
| 221 | + } | ||
| 222 | + }) | ||
| 223 | + } | ||
| 224 | + }else { | ||
| 225 | + ListItemGroup({ header: this.CommentHeaderItem(item)}) { | ||
| 226 | + ForEach(item.childComments, (childItem: commentItemModel, subIndex: number) => { | ||
| 227 | + ListItem() { | ||
| 228 | + ChildCommentItem(); | ||
| 229 | + } | ||
| 230 | + }) | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + }.layoutWeight(1) | ||
| 235 | + } | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + //获取数据 | ||
| 239 | + async getData() { | ||
| 240 | + this.browSingModel.currentPage = 1 | ||
| 241 | + commentViewModel.getCommentLocal(getContext()).then(commentListModel => { | ||
| 242 | + if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | ||
| 243 | + commentListModel.hasMore = true; | ||
| 244 | + this.browSingModel.viewType = ViewType.LOADED; | ||
| 245 | + this.allDatas.push(...commentListModel.list) | ||
| 246 | + if (commentListModel.list.length === this.browSingModel.pageSize) { | ||
| 247 | + this.browSingModel.currentPage++; | ||
| 248 | + this.browSingModel.hasMore = true; | ||
| 249 | + } else { | ||
| 250 | + this.browSingModel.hasMore = false; | ||
| 251 | + } | ||
| 252 | + } else { | ||
| 253 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 254 | + } | ||
| 255 | + | ||
| 256 | + | ||
| 257 | + | ||
| 258 | + }) | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + /*回复评论*/ | ||
| 262 | + ReplyComment() { | ||
| 263 | + | ||
| 264 | + } | ||
| 265 | +} | ||
| 266 | + | ||
| 267 | + | ||
| 268 | +@Component | ||
| 269 | +struct ChildCommentItem { | ||
| 270 | + build() { | ||
| 271 | + Text('child') | ||
| 272 | + } | ||
| 273 | +} | ||
| 274 | + |
| 1 | +import measure from '@ohos.measure' | ||
| 2 | +import curves from '@ohos.curves'; | ||
| 3 | +import { BusinessError } from '@ohos.base'; | ||
| 4 | +import display from '@ohos.display'; | ||
| 5 | + | ||
| 6 | +const collapseString = '...展开全文' | ||
| 7 | +const uncollapseString = '...收起' | ||
| 8 | + | ||
| 9 | +@Component | ||
| 10 | +@Preview | ||
| 11 | +export struct CommentText { | ||
| 12 | + // 长文本 | ||
| 13 | + @State longMessage: string = '' | ||
| 14 | + // 最大显示行数 | ||
| 15 | + @State maxLineMesssage: string = ''; | ||
| 16 | + | ||
| 17 | + @State lines: number = 3; | ||
| 18 | + @State maxline: number = 3; | ||
| 19 | + @State marginWidth:number = 0; | ||
| 20 | + // 长文本状态(展开 or 收起) | ||
| 21 | + @State collapseText: string = collapseString | ||
| 22 | + // 屏幕宽度(单位px) | ||
| 23 | + screenWidth: number = 0; | ||
| 24 | + // 是否需要显示"展开"字样(注:当文本长度较短时就不需要“展开”) | ||
| 25 | + @State isExpanded: boolean = false | ||
| 26 | + /*当前展开状态*/ | ||
| 27 | + @State expandedStates: boolean = false; | ||
| 28 | + @State fontSize: number = 18; | ||
| 29 | + @State fontWeight: FontWeight = FontWeight.Regular | ||
| 30 | + fontColor: ResourceColor = $r('app.color.color_222222') | ||
| 31 | + // 测量文本宽度(单位px) | ||
| 32 | + @State textWidth: number = 0; | ||
| 33 | + | ||
| 34 | + // constructor(longMessage?:string,) { | ||
| 35 | + // super(); | ||
| 36 | + // this.longMessage = longMessage; | ||
| 37 | + // } | ||
| 38 | + // 获取当前所有的display对象 | ||
| 39 | + promise: Promise<Array<display.Display>> = display.getAllDisplays() | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + aboutToAppear() { | ||
| 44 | + console.log(`文本宽度为:${this.textWidth}`) | ||
| 45 | + let padding = vp2px(5 + this.marginWidth) | ||
| 46 | + | ||
| 47 | + this.textWidth = measure.measureText({ | ||
| 48 | + textContent: this.longMessage, | ||
| 49 | + fontSize: this.fontSize, | ||
| 50 | + fontWeight: this.fontWeight, | ||
| 51 | + constraintWidth:(this.screenWidth - padding) | ||
| 52 | + }) | ||
| 53 | + | ||
| 54 | + console.log(`文本宽度为:${this.textWidth}`) | ||
| 55 | + | ||
| 56 | + this.promise.then((data: Array<display.Display>) => { | ||
| 57 | + console.log(`所有的屏幕信息:${JSON.stringify(data)}`) | ||
| 58 | + //单位为像素 | ||
| 59 | + this.screenWidth = data[0]["width"] | ||
| 60 | + // 屏幕宽度 * 最大行数 * 组件宽度比例 和 文字测量宽度 | ||
| 61 | + this.isExpanded = (this.screenWidth - padding) * this.lines <= this.textWidth | ||
| 62 | + // this.expandedStates = this.isExpanded; | ||
| 63 | + | ||
| 64 | + //需要展开的话计算3行需要显示的文字 | ||
| 65 | + if (this.isExpanded) { | ||
| 66 | + | ||
| 67 | + | ||
| 68 | + let padding = vp2px(5 + this.marginWidth) | ||
| 69 | + let maxLineTextWidth = (this.screenWidth - padding) * this.maxline; | ||
| 70 | + | ||
| 71 | + for (let index = 0; index < this.longMessage.length; index++) { | ||
| 72 | + const element = this.longMessage.substring(0, index) | ||
| 73 | + const string = element + this.collapseText; //截取 | ||
| 74 | + const thisTextWidth = measure.measureText({ | ||
| 75 | + textContent: string, | ||
| 76 | + fontSize: this.fontSize, | ||
| 77 | + fontWeight: this.fontWeight, | ||
| 78 | + constraintWidth:(this.screenWidth - padding) | ||
| 79 | + }) | ||
| 80 | + | ||
| 81 | + //计算有误差20 | ||
| 82 | + | ||
| 83 | + if (thisTextWidth >= maxLineTextWidth) { | ||
| 84 | + break | ||
| 85 | + } | ||
| 86 | + this.maxLineMesssage = element; | ||
| 87 | + | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + | ||
| 92 | + }).catch((err: BusinessError) => { | ||
| 93 | + console.error(`Failed to obtain all the display objects. Code: ${JSON.stringify(err)}`) | ||
| 94 | + }) | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + build() { | ||
| 100 | + Row() { | ||
| 101 | + Column() { | ||
| 102 | + if (this.isExpanded) { | ||
| 103 | + // Stack({ alignContent: Alignment.BottomEnd }) { | ||
| 104 | + Text(this.longMessage) { | ||
| 105 | + Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) | ||
| 106 | + Span(this.collapseText).onClick(() => { | ||
| 107 | + if (this.collapseText == collapseString) { | ||
| 108 | + this.collapseText = uncollapseString; | ||
| 109 | + this.expandedStates = true; | ||
| 110 | + this.lines = -1; // 使得设置的最大行属性无效 | ||
| 111 | + // 展开动画 | ||
| 112 | + // animateTo({ | ||
| 113 | + // duration: 150, | ||
| 114 | + // curve: curves.springMotion(), | ||
| 115 | + // }, () => { | ||
| 116 | + // this.lines = -1; // 使得设置的最大行属性无效 | ||
| 117 | + // }) | ||
| 118 | + } else { | ||
| 119 | + this.collapseText = collapseString; | ||
| 120 | + this.expandedStates = false; | ||
| 121 | + this.lines = this.maxline; // 只显示3行 | ||
| 122 | + // 收起动画 | ||
| 123 | + // animateTo({ | ||
| 124 | + // duration: 100, | ||
| 125 | + // curve: Curve.Friction, | ||
| 126 | + // }, () => { | ||
| 127 | + // this.lines = this.maxline; // 只显示3行 | ||
| 128 | + // }) | ||
| 129 | + } | ||
| 130 | + }) | ||
| 131 | + } | ||
| 132 | + .width('100%') | ||
| 133 | + .fontSize(this.fontSize) | ||
| 134 | + .fontWeight(this.fontWeight) | ||
| 135 | + .fontColor(this.fontColor) | ||
| 136 | + .maxLines(this.lines) | ||
| 137 | + // .backgroundColor(Color.Red) | ||
| 138 | + | ||
| 139 | + // } | ||
| 140 | + } | ||
| 141 | + else { | ||
| 142 | + Text('我没有展开收起') | ||
| 143 | + .width('100%') | ||
| 144 | + .fontSize(this.fontSize) | ||
| 145 | + .fontWeight(this.fontWeight) | ||
| 146 | + .fontColor(this.fontColor) | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + // .backgroundColor(Color.Brown) | ||
| 150 | + .width('100%') | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + // .height('100%') | ||
| 154 | + } | ||
| 155 | +} | ||
| 156 | + | ||
| 157 | + | ||
| 158 | +// Index.ets | ||
| 159 | +@Entry | ||
| 160 | +@Component | ||
| 161 | +struct Index { | ||
| 162 | + build() { | ||
| 163 | + Column() { | ||
| 164 | + CommentText() | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
0 → 100644
| 1 | +import { ViewType } from 'wdConstant/Index' | ||
| 2 | +import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' | ||
| 3 | +import { commentItemModel, commentListModel } from '../model/CommentModel' | ||
| 4 | +import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 5 | +import { window } from '@kit.ArkUI' | ||
| 6 | + | ||
| 7 | +const TAG = 'QualityCommentsComponent'; | ||
| 8 | + | ||
| 9 | +@Entry | ||
| 10 | +@Preview | ||
| 11 | +@Component | ||
| 12 | +export struct QualityCommentsComponent { | ||
| 13 | + bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | ||
| 14 | + @State private browSingModel: commentListModel = new commentListModel() | ||
| 15 | + isloading: boolean = false | ||
| 16 | + lastWindowColor:string = '#ffffff' | ||
| 17 | + currentWindowColor:string = '#FF4202' | ||
| 18 | + @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | ||
| 19 | + | ||
| 20 | + aboutToDisappear(): void { | ||
| 21 | + | ||
| 22 | + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 23 | + const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 24 | + windowClass.setWindowBackgroundColor(this.lastWindowColor) | ||
| 25 | + windowClass.setWindowLayoutFullScreen(false) | ||
| 26 | + // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + aboutToAppear(): void { | ||
| 31 | + | ||
| 32 | + this.fullScreen(); | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => { | ||
| 36 | + this.allDatas.push(...commentListModel.list) | ||
| 37 | + }) | ||
| 38 | + | ||
| 39 | + // commentViewModel.fetchQualityCommentList('1').then((commentListModel) => { | ||
| 40 | + // if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | ||
| 41 | + // // commentListModel.hasMore = true; | ||
| 42 | + // // this.browSingModel.viewType = ViewType.LOADED; | ||
| 43 | + // this.allDatas.push(...commentListModel.list) | ||
| 44 | + // // if (commentListModel.list.length === this.browSingModel.pageSize) { | ||
| 45 | + // // this.browSingModel.currentPage++; | ||
| 46 | + // // this.browSingModel.hasMore = true; | ||
| 47 | + // // } else { | ||
| 48 | + // // this.browSingModel.hasMore = false; | ||
| 49 | + // // } | ||
| 50 | + // } else { | ||
| 51 | + // this.browSingModel.viewType = ViewType.EMPTY; | ||
| 52 | + // } | ||
| 53 | + // }) | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + fullScreen() { | ||
| 57 | + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 58 | + const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 59 | + // windowClass.setWindowBackgroundColor(this.currentWindowColor) | ||
| 60 | + windowClass.setWindowLayoutFullScreen(true) | ||
| 61 | + // windowClass.setWindowSystemBarProperties({ statusBarColor: '#fff' }) | ||
| 62 | + | ||
| 63 | + // windowClass.setWindowLayoutFullScreen(true).then(() => { | ||
| 64 | + // console.log(TAG + 'setWindowLayoutFullScreen'); | ||
| 65 | + // }) | ||
| 66 | + | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + @Builder | ||
| 70 | + titleHeader() { | ||
| 71 | + Row() { | ||
| 72 | + Image($r('app.media.comment_img_banner')).width('100%').aspectRatio(375 / 283); | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + build() { | ||
| 77 | + Column() { | ||
| 78 | + // this.titleHeader() | ||
| 79 | + List({ space: 28 }) { | ||
| 80 | + ListItemGroup({ header: this.titleHeader() }) | ||
| 81 | + | ||
| 82 | + LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 83 | + ListItem() { | ||
| 84 | + QualityCommentItem({ item: item }).margin({ left: 12, right: 12 }) | ||
| 85 | + } | ||
| 86 | + // .offset({ | ||
| 87 | + // y:-87 | ||
| 88 | + // }) | ||
| 89 | + }) | ||
| 90 | + } | ||
| 91 | + // .contentStartOffset(- 87) | ||
| 92 | + .edgeEffect(EdgeEffect.Spring) | ||
| 93 | + .margin({bottom:this.bottomSafeHeight}) | ||
| 94 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 95 | + }.backgroundColor(this.currentWindowColor).height('100%').width('100%') | ||
| 96 | + } | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | + | ||
| 100 | +@Component | ||
| 101 | +struct QualityCommentItem { | ||
| 102 | + @ObjectLink item: commentItemModel | ||
| 103 | + | ||
| 104 | + build() { | ||
| 105 | + Column() { | ||
| 106 | + /*头像以及昵称*/ | ||
| 107 | + RelativeContainer() { | ||
| 108 | + Image(this.item.fromUserHeader) | ||
| 109 | + .width(50) | ||
| 110 | + .height(50) | ||
| 111 | + .borderRadius(25) | ||
| 112 | + .borderWidth(2) | ||
| 113 | + .borderColor(Color.White) | ||
| 114 | + .id('image1') | ||
| 115 | + .alignRules({ | ||
| 116 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 117 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 118 | + }) | ||
| 119 | + .offset( | ||
| 120 | + { | ||
| 121 | + y: -16 | ||
| 122 | + } | ||
| 123 | + ) | ||
| 124 | + Text(this.item.fromUserName) | ||
| 125 | + .fontSize(14) | ||
| 126 | + .fontColor('#222222') | ||
| 127 | + .fontWeight(FontWeight.Medium) | ||
| 128 | + .id('text1') | ||
| 129 | + .alignRules({ | ||
| 130 | + bottom: { anchor: "image1", align: VerticalAlign.Bottom }, | ||
| 131 | + left: { anchor: "image1", align: HorizontalAlign.End } | ||
| 132 | + }) | ||
| 133 | + .offset( | ||
| 134 | + { | ||
| 135 | + x: 6, | ||
| 136 | + y: -6 - 16 | ||
| 137 | + } | ||
| 138 | + ) | ||
| 139 | + }.height(42) | ||
| 140 | + | ||
| 141 | + Column() { | ||
| 142 | + /*评论内容*/ | ||
| 143 | + Text() { | ||
| 144 | + ImageSpan($r('app.media.WDBestCommentTitleDotIcon')) | ||
| 145 | + .width(12) | ||
| 146 | + .height(12) | ||
| 147 | + .objectFit(ImageFit.Fill) | ||
| 148 | + .offset({ | ||
| 149 | + y: -6 | ||
| 150 | + }) | ||
| 151 | + Span(' ' + this.item.commentContent) | ||
| 152 | + .fontSize(16) | ||
| 153 | + .fontColor('#222222') | ||
| 154 | + .fontWeight(FontWeight.Medium) | ||
| 155 | + }.margin({ top: 10 }) | ||
| 156 | + | ||
| 157 | + /*分割线*/ | ||
| 158 | + Row() { | ||
| 159 | + | ||
| 160 | + }.width('100%').margin({ top: 10, left: 0, right: 0 }).backgroundColor('#EDEDED').height(2.5); | ||
| 161 | + | ||
| 162 | + /*文章或者评论*/ | ||
| 163 | + Row() { | ||
| 164 | + Row() { | ||
| 165 | + Image($r('app.media.comment_img_link')).width(16).height(16) | ||
| 166 | + Text(this.item.shareInfo.shareTitle) | ||
| 167 | + .fontSize(14) | ||
| 168 | + .fontColor('#666666') | ||
| 169 | + .margin({ left: 6, right: 12 }) | ||
| 170 | + .maxLines(1) | ||
| 171 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 172 | + }.height(40).layoutWeight(1) | ||
| 173 | + | ||
| 174 | + Image($r('app.media.more')).width(12).height(12) | ||
| 175 | + | ||
| 176 | + }.width('100%').height(40).justifyContent(FlexAlign.SpaceBetween) | ||
| 177 | + | ||
| 178 | + } | ||
| 179 | + .backgroundColor('#F9F9F9') | ||
| 180 | + .width('100%') | ||
| 181 | + .alignItems(HorizontalAlign.Start) | ||
| 182 | + .borderRadius(4) | ||
| 183 | + .padding({ left: 12, right: 12 }) | ||
| 184 | + | ||
| 185 | + /*时间 点赞评论*/ | ||
| 186 | + Row() { | ||
| 187 | + | ||
| 188 | + Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime))).fontSize(14).fontColor('#999999') | ||
| 189 | + | ||
| 190 | + Row({space:16}){ | ||
| 191 | + Row(){ | ||
| 192 | + Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + Row(){ | ||
| 196 | + //comment_like_select | ||
| 197 | + Image($r(this.item.likeNum?'app.media.comment_like_select':'app.media.comment_like_normal')).width(16).height(16) | ||
| 198 | + if (this.item.likeNum){Text(this.item.likeNum).fontColor(this.item.isLike?'#ED2800':'#999999').fontSize(14).margin({left:3})} | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + }.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween) | ||
| 202 | + | ||
| 203 | + }.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4) | ||
| 204 | + | ||
| 205 | + } | ||
| 206 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
0 → 100644
| 1 | +import { Logger, ResourcesUtils } from 'wdKit/Index'; | ||
| 2 | +import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; | ||
| 3 | +import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | ||
| 4 | +import { commentItemModel, commentListModel } from '../model/CommentModel'; | ||
| 5 | +import HashMap from '@ohos.util.HashMap'; | ||
| 6 | + | ||
| 7 | +const TAG = "CommentViewModel" | ||
| 8 | + | ||
| 9 | +class CommentViewModel { | ||
| 10 | + private static instance: CommentViewModel | ||
| 11 | + /** | ||
| 12 | + * 单例模式 | ||
| 13 | + * @returns | ||
| 14 | + */ | ||
| 15 | + public static getInstance(): CommentViewModel { | ||
| 16 | + if (!CommentViewModel.instance) { | ||
| 17 | + CommentViewModel.instance = new CommentViewModel(); | ||
| 18 | + } | ||
| 19 | + return CommentViewModel.instance; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + /*获取本地mock数据*/ | ||
| 24 | + async getCommentLocal(context: Context): Promise<commentListModel> { | ||
| 25 | + Logger.info(TAG, `getBottomNavDataMock start`); | ||
| 26 | + let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'comment_local.json' ); | ||
| 27 | + if (!compRes || !compRes.data) { | ||
| 28 | + Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | ||
| 29 | + return new commentListModel() | ||
| 30 | + } | ||
| 31 | + Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 32 | + return compRes.data | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + /*获取本地mock数据*/ | ||
| 36 | + async fetchQualityCommentListLocal(context: Context): Promise<commentListModel> { | ||
| 37 | + Logger.info(TAG, `getBottomNavDataMock start`); | ||
| 38 | + let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'qualityComment_local.json' ); | ||
| 39 | + if (!compRes || !compRes.data) { | ||
| 40 | + Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | ||
| 41 | + return new commentListModel() | ||
| 42 | + } | ||
| 43 | + Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 44 | + return compRes.data | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + //qualityComment_local.json | ||
| 50 | + fetchQualityCommentList(pageNum: string) { | ||
| 51 | + let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}` | ||
| 52 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 53 | + return new Promise<commentListModel>((success, fail) => { | ||
| 54 | + HttpRequest.get<ResponseDTO<commentListModel>>(url, headers).then((data: ResponseDTO<commentListModel>) => { | ||
| 55 | + if (!data || !data.data) { | ||
| 56 | + fail("数据为空") | ||
| 57 | + return | ||
| 58 | + } | ||
| 59 | + if (data.code != 0) { | ||
| 60 | + fail(data.message) | ||
| 61 | + return | ||
| 62 | + } | ||
| 63 | + let listData = data.data as commentListModel | ||
| 64 | + | ||
| 65 | + success(listData) | ||
| 66 | + }, (error: Error) => { | ||
| 67 | + fail(error.message) | ||
| 68 | + Logger.debug(TAG, error.toString()) | ||
| 69 | + }) | ||
| 70 | + }) | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + // BaseGetRequest(contentID:number,contentType:string,pageNum:string){ | ||
| 75 | + // let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${10}&pageNum=${pageNum}` | ||
| 76 | + // if (tagId.length > 0) { | ||
| 77 | + // url = url + `&tagId=${tagId}` | ||
| 78 | + // } | ||
| 79 | + // let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() | ||
| 80 | + // return WDHttp.get<ResponseDTO<commentListModel>>(url, headers) | ||
| 81 | + // } | ||
| 82 | + // | ||
| 83 | + // | ||
| 84 | + // fetchCommentList(contentID:number,contentType:string,pageNum:string):Promise<commentListModel>{ | ||
| 85 | + // return new Promise<commentListModel>((success,error) => { | ||
| 86 | + // this.BaseGetRequest(contentID,contentType,pageNum).then((navResDTO: ResponseDTO<commentListModel>) => { | ||
| 87 | + // if (!navResDTO || navResDTO.code != 0) { | ||
| 88 | + // // success(this.getAppointmentListDataLocal(context)) | ||
| 89 | + // return | ||
| 90 | + // } | ||
| 91 | + // Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 92 | + // let listData = navResDTO.data as commentListModel | ||
| 93 | + // success(listData) | ||
| 94 | + // }).catch((err: Error) => { | ||
| 95 | + // Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 96 | + // error("page data invalid"); | ||
| 97 | + // }) | ||
| 98 | + // }) | ||
| 99 | + // } | ||
| 100 | + | ||
| 101 | + | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | + | ||
| 105 | +const commentViewModel = CommentViewModel.getInstance(); | ||
| 106 | + | ||
| 107 | +export default commentViewModel as CommentViewModel |
| @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 33 | Stack(){ | 33 | Stack(){ |
| 34 | Image(this.headPhotoUrl) | 34 | Image(this.headPhotoUrl) |
| 35 | .alt($r('app.media.default_head')) | 35 | .alt($r('app.media.default_head')) |
| 36 | - .width('108lpx') | ||
| 37 | - .height('108lpx') | 36 | + .width('100lpx') |
| 37 | + .height('100lpx') | ||
| 38 | .objectFit(ImageFit.Cover) | 38 | .objectFit(ImageFit.Cover) |
| 39 | .borderRadius(50) | 39 | .borderRadius(50) |
| 40 | Image(this.levelHead) | 40 | Image(this.levelHead) |
| @@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{ | @@ -18,7 +18,7 @@ export struct FollowFirstTabsComponent{ | ||
| 18 | value.forEach((element)=>{ | 18 | value.forEach((element)=>{ |
| 19 | this.data.push(element) | 19 | this.data.push(element) |
| 20 | }) | 20 | }) |
| 21 | - console.log("ycg",this.data.length.toString()); | 21 | + |
| 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ | 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ |
| 23 | //个人主页 跳转 关注页 tab 2 | 23 | //个人主页 跳转 关注页 tab 2 |
| 24 | let intervalID = setInterval(() => { | 24 | let intervalID = setInterval(() => { |
| @@ -171,6 +171,7 @@ struct ChildComponent { | @@ -171,6 +171,7 @@ struct ChildComponent { | ||
| 171 | .fontSize('31lpx') | 171 | .fontSize('31lpx') |
| 172 | .lineHeight('38lpx') | 172 | .lineHeight('38lpx') |
| 173 | .fontColor($r('app.color.color_222222')) | 173 | .fontColor($r('app.color.color_222222')) |
| 174 | + .maxLines(1) | ||
| 174 | Text(`粉丝${this.data.cnFansNum}`) | 175 | Text(`粉丝${this.data.cnFansNum}`) |
| 175 | .fontColor($r('app.color.color_B0B0B0')) | 176 | .fontColor($r('app.color.color_B0B0B0')) |
| 176 | .fontSize('23lpx') | 177 | .fontSize('23lpx') |
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowSecondTabsComponent.ets
| @@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{ | @@ -35,25 +35,45 @@ export struct FollowSecondTabsComponent{ | ||
| 35 | 35 | ||
| 36 | @Builder FollowSecondUI(){ | 36 | @Builder FollowSecondUI(){ |
| 37 | Row() { | 37 | Row() { |
| 38 | + Row(){ | ||
| 39 | + // 页签 | ||
| 40 | + Column({ space: 7 }) { | ||
| 41 | + Scroll() { | ||
| 42 | + Column() { | ||
| 43 | + ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { | ||
| 44 | + this.TabBuilder(index,item) | ||
| 45 | + }) | ||
| 46 | + } | ||
| 47 | + .justifyContent(FlexAlign.Start) | ||
| 48 | + } | ||
| 49 | + .align(Alignment.Top) | ||
| 50 | + .scrollable(ScrollDirection.Vertical) | ||
| 51 | + .scrollBar(BarState.Off) | ||
| 52 | + .height('100%') | ||
| 53 | + }.height('100%') | ||
| 54 | + .alignItems(HorizontalAlign.Center) | ||
| 55 | + } | ||
| 56 | + .alignItems(VerticalAlign.Top) | ||
| 57 | + .height('100%') | ||
| 58 | + | ||
| 38 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 59 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 39 | ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { | 60 | ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { |
| 40 | TabContent(){ | 61 | TabContent(){ |
| 41 | FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) | 62 | FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) |
| 42 | - }.tabBar(this.TabBuilder(index,item)) | 63 | + } |
| 43 | .backgroundColor($r('app.color.white')) | 64 | .backgroundColor($r('app.color.white')) |
| 44 | }, (item: FollowListItem, index: number) => index.toString()) | 65 | }, (item: FollowListItem, index: number) => index.toString()) |
| 45 | } | 66 | } |
| 46 | .vertical(true) | 67 | .vertical(true) |
| 47 | .barMode(BarMode.Scrollable) | 68 | .barMode(BarMode.Scrollable) |
| 48 | - .barWidth('140lpx') | ||
| 49 | .animationDuration(0) | 69 | .animationDuration(0) |
| 50 | .onChange((index: number) => { | 70 | .onChange((index: number) => { |
| 51 | this.currentIndex = index | 71 | this.currentIndex = index |
| 52 | }) | 72 | }) |
| 53 | - .width('100%') | 73 | + .barWidth(0) |
| 74 | + .height('100%') | ||
| 75 | + .layoutWeight(1) | ||
| 54 | }.width('100%') | 76 | }.width('100%') |
| 55 | - .alignItems(VerticalAlign.Top) | ||
| 56 | - .backgroundColor('#0FF') | ||
| 57 | } | 77 | } |
| 58 | 78 | ||
| 59 | @Builder TabBuilder(index: number, item: FollowSecondListItem) { | 79 | @Builder TabBuilder(index: number, item: FollowSecondListItem) { |
| @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ | @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ | ||
| 73 | }) | 93 | }) |
| 74 | .justifyContent(FlexAlign.Center) | 94 | .justifyContent(FlexAlign.Center) |
| 75 | .height('84lpx') | 95 | .height('84lpx') |
| 96 | + .width('140lpx') | ||
| 76 | .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) | 97 | .backgroundColor(this.currentIndex === index?$r('app.color.white'):$r('app.color.color_F9F9F9')) |
| 77 | } | 98 | } |
| 78 | 99 |
| @@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{ | @@ -34,19 +34,45 @@ export struct FollowThirdTabsComponent{ | ||
| 34 | .lineHeight('38lpx') | 34 | .lineHeight('38lpx') |
| 35 | .backgroundColor($r('app.color.color_F9F9F9')) | 35 | .backgroundColor($r('app.color.color_F9F9F9')) |
| 36 | .padding('13lpx') | 36 | .padding('13lpx') |
| 37 | + .maxLines(1) | ||
| 37 | } | 38 | } |
| 38 | .onClick(()=>{ | 39 | .onClick(()=>{ |
| 39 | this.currentIndex = index | 40 | this.currentIndex = index |
| 40 | this.controller.changeIndex(this.currentIndex) | 41 | this.controller.changeIndex(this.currentIndex) |
| 41 | }) | 42 | }) |
| 42 | - .height('100%') | 43 | + .height('84lpx') |
| 43 | .margin({right:'9lpx'}) | 44 | .margin({right:'9lpx'}) |
| 44 | .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) | 45 | .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) |
| 45 | .justifyContent(FlexAlign.Center) | 46 | .justifyContent(FlexAlign.Center) |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | @Builder FollowThirdUI(){ | 49 | @Builder FollowThirdUI(){ |
| 49 | - Row() { | 50 | + |
| 51 | + Column(){ | ||
| 52 | + Column() { | ||
| 53 | + // 页签 | ||
| 54 | + Row({ space: 7 }) { | ||
| 55 | + Scroll() { | ||
| 56 | + Row() { | ||
| 57 | + ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | ||
| 58 | + this.TabBuilder(index,item) | ||
| 59 | + }) | ||
| 60 | + } | ||
| 61 | + .justifyContent(FlexAlign.Start) | ||
| 62 | + } | ||
| 63 | + .align(Alignment.Start) | ||
| 64 | + .scrollable(ScrollDirection.Horizontal) | ||
| 65 | + .scrollBar(BarState.Off) | ||
| 66 | + .width('90%') | ||
| 67 | + .padding({left:'11lpx'}) | ||
| 68 | + } | ||
| 69 | + .alignItems(VerticalAlign.Bottom) | ||
| 70 | + .width('100%') | ||
| 71 | + } | ||
| 72 | + .backgroundColor($r('app.color.white')) | ||
| 73 | + .alignItems(HorizontalAlign.Start) | ||
| 74 | + .width('100%') | ||
| 75 | + | ||
| 50 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 76 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 51 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | 77 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { |
| 52 | TabContent(){ | 78 | TabContent(){ |
| @@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{ | @@ -58,20 +84,19 @@ export struct FollowThirdTabsComponent{ | ||
| 58 | .margin({left:'20lpx'}) | 84 | .margin({left:'20lpx'}) |
| 59 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) | 85 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) |
| 60 | } | 86 | } |
| 61 | - }.tabBar(this.TabBuilder(index,item)) | 87 | + } |
| 62 | .backgroundColor($r('app.color.white')) | 88 | .backgroundColor($r('app.color.white')) |
| 63 | }, (item: FollowListItem, index: number) => index.toString()) | 89 | }, (item: FollowListItem, index: number) => index.toString()) |
| 64 | } | 90 | } |
| 91 | + .barHeight(0) | ||
| 65 | .vertical(false) | 92 | .vertical(false) |
| 66 | .barMode(BarMode.Scrollable) | 93 | .barMode(BarMode.Scrollable) |
| 67 | - .barWidth('100%') | ||
| 68 | - .barHeight('84lpx') | ||
| 69 | .animationDuration(0) | 94 | .animationDuration(0) |
| 70 | .onChange((index: number) => { | 95 | .onChange((index: number) => { |
| 71 | this.currentIndex = index | 96 | this.currentIndex = index |
| 72 | }) | 97 | }) |
| 73 | .width('100%') | 98 | .width('100%') |
| 74 | - }.width('100%') | 99 | + } |
| 75 | } | 100 | } |
| 76 | 101 | ||
| 77 | } | 102 | } |
| @@ -288,7 +288,6 @@ struct ChannelDialog { | @@ -288,7 +288,6 @@ struct ChannelDialog { | ||
| 288 | .justifyContent(FlexAlign.Center) | 288 | .justifyContent(FlexAlign.Center) |
| 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') | 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') |
| 290 | .onClick(() => { | 290 | .onClick(() => { |
| 291 | - console.log('onTouch') | ||
| 292 | if (this.isEditIng) { | 291 | if (this.isEditIng) { |
| 293 | if (item.delPermitted === 1) { | 292 | if (item.delPermitted === 1) { |
| 294 | this.delChannelItem(index) | 293 | this.delChannelItem(index) |
| 1 | - | ||
| 2 | -import { Logger, DateTimeUtils, CollectionUtils } from 'wdKit'; | 1 | +import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; |
| 3 | import { CommonConstants, CompStyle, ViewType } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle, ViewType } from 'wdConstant'; |
| 4 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 5 | import { EmptyComponent } from '../view/EmptyComponent'; | 4 | import { EmptyComponent } from '../view/EmptyComponent'; |
| @@ -14,7 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | @@ -14,7 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 14 | import { CompParser } from '../CompParser'; | 13 | import { CompParser } from '../CompParser'; |
| 15 | import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; | 14 | import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; |
| 16 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 15 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 17 | -import { CompDTO, LiveReviewDTO, PageDTO ,PageInfoDTO} from 'wdBean'; | 16 | +import { CompDTO, LiveReviewDTO, PageDTO, PageInfoBean } from 'wdBean'; |
| 18 | 17 | ||
| 19 | 18 | ||
| 20 | const TAG = 'PageComponent'; | 19 | const TAG = 'PageComponent'; |
| @@ -72,40 +71,44 @@ export struct PageComponent { | @@ -72,40 +71,44 @@ export struct PageComponent { | ||
| 72 | @Builder | 71 | @Builder |
| 73 | ListLayout() { | 72 | ListLayout() { |
| 74 | List() { | 73 | List() { |
| 75 | - // 下拉刷新 | ||
| 76 | - ListItem() { | ||
| 77 | - RefreshLayout({ | ||
| 78 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 79 | - this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | ||
| 80 | - }) | 74 | + if (this.name !== '视频') { |
| 75 | + // 下拉刷新 | ||
| 76 | + ListItem() { | ||
| 77 | + RefreshLayout({ | ||
| 78 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 79 | + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | ||
| 80 | + }) | ||
| 81 | + } | ||
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | - LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { | ||
| 84 | - ListItem() { | ||
| 85 | - Column() { | ||
| 86 | - if (this.name == '视频') { | ||
| 87 | - VideoChannelDetail() | ||
| 88 | - } else { | 84 | + if (this.name === '视频') { |
| 85 | + VideoChannelDetail() | ||
| 86 | + } else { | ||
| 87 | + LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { | ||
| 88 | + ListItem() { | ||
| 89 | + Column() { | ||
| 89 | CompParser({ compDTO: compDTO, compIndex: compIndex }); | 90 | CompParser({ compDTO: compDTO, compIndex: compIndex }); |
| 90 | } | 91 | } |
| 92 | + } | ||
| 93 | + }, | ||
| 94 | + (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp | ||
| 95 | + ) | ||
| 96 | + } | ||
| 91 | 97 | ||
| 98 | + if (this.name !== '视频') { | ||
| 99 | + // 加载更多 | ||
| 100 | + ListItem() { | ||
| 101 | + if (this.pageModel.hasMore) { | ||
| 102 | + LoadMoreLayout({ | ||
| 103 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 104 | + this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 105 | + }) | ||
| 106 | + } else { | ||
| 107 | + NoMoreLayout() | ||
| 92 | } | 108 | } |
| 93 | } | 109 | } |
| 94 | - }, | ||
| 95 | - (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp | ||
| 96 | - ) | ||
| 97 | - | ||
| 98 | - // 加载更多 | ||
| 99 | - ListItem() { | ||
| 100 | - if (this.pageModel.hasMore) { | ||
| 101 | - LoadMoreLayout({ | ||
| 102 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 103 | - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 104 | - }) | ||
| 105 | - } else { | ||
| 106 | - NoMoreLayout() | ||
| 107 | - } | ||
| 108 | } | 110 | } |
| 111 | + | ||
| 109 | } | 112 | } |
| 110 | .scrollBar(BarState.Off) | 113 | .scrollBar(BarState.Off) |
| 111 | .cachedCount(8) | 114 | .cachedCount(8) |
| @@ -138,7 +141,8 @@ export struct PageComponent { | @@ -138,7 +141,8 @@ export struct PageComponent { | ||
| 138 | 141 | ||
| 139 | onChange() { | 142 | onChange() { |
| 140 | Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , ${this.isFirstIn} , navIndex: ${this.currentTopNavSelectedIndex}`); | 143 | Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , ${this.isFirstIn} , navIndex: ${this.currentTopNavSelectedIndex}`); |
| 141 | - if (this.navIndex === this.currentTopNavSelectedIndex && !this.isFirstIn) { | 144 | + // if (this.navIndex === this.currentTopNavSelectedIndex && !this.isFirstIn) { |
| 145 | + if (this.navIndex === this.currentTopNavSelectedIndex) { | ||
| 142 | this.getData(); | 146 | this.getData(); |
| 143 | } | 147 | } |
| 144 | } | 148 | } |
| @@ -158,6 +162,16 @@ export struct PageComponent { | @@ -158,6 +162,16 @@ export struct PageComponent { | ||
| 158 | this.pageModel.viewType = ViewType.EMPTY; | 162 | this.pageModel.viewType = ViewType.EMPTY; |
| 159 | return; | 163 | return; |
| 160 | } | 164 | } |
| 165 | + if (this.navIndex === 0) { | ||
| 166 | + await this.getVideoListData(pageInfo); | ||
| 167 | + } else { | ||
| 168 | + await this.getLiveListData(pageInfo); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + private async getVideoListData(pageInfo: PageInfoBean) { | ||
| 161 | let groupInfo: GroupInfoDTO = CollectionUtils.getElement(pageInfo.groups, 0); | 175 | let groupInfo: GroupInfoDTO = CollectionUtils.getElement(pageInfo.groups, 0); |
| 162 | if (groupInfo != null) { | 176 | if (groupInfo != null) { |
| 163 | this.pageModel.isRecGroup = groupInfo.groupStrategy === 1; | 177 | this.pageModel.isRecGroup = groupInfo.groupStrategy === 1; |
| @@ -165,7 +179,89 @@ export struct PageComponent { | @@ -165,7 +179,89 @@ export struct PageComponent { | ||
| 165 | } | 179 | } |
| 166 | // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | 180 | // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 |
| 167 | // for (const group of pageInfo.groups) { | 181 | // for (const group of pageInfo.groups) { |
| 168 | - this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)) | 182 | + this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)); |
| 183 | + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString(); | ||
| 184 | + if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | ||
| 185 | + this.pageDto.compList.forEach((comp) => { | ||
| 186 | + if (comp.compStyle === CompStyle.Zh_Grid_Layout_02 && this.liveReviewDTO && this.liveReviewDTO.list && this.liveReviewDTO.list.length > 0) { | ||
| 187 | + comp.operDataList.push(...this.liveReviewDTO.list); | ||
| 188 | + } | ||
| 189 | + }); | ||
| 190 | + | ||
| 191 | + this.pageModel.viewType = ViewType.LOADED; | ||
| 192 | + this.pageModel.compList.push(...this.pageDto.compList); | ||
| 193 | + if (this.pageDto.compList.length === this.pageModel.pageSize) { | ||
| 194 | + this.pageModel.currentPage++; | ||
| 195 | + this.pageModel.hasMore = true; | ||
| 196 | + } else { | ||
| 197 | + this.pageModel.hasMore = false; | ||
| 198 | + } | ||
| 199 | + // // 二次请求,批查互动数据 | ||
| 200 | + // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 201 | + // // 刷新,替换所有数据 | ||
| 202 | + // this.pageModel.compList.replaceAll(...data) | ||
| 203 | + // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 204 | + // }) | ||
| 205 | + this.isFirstIn = false; | ||
| 206 | + Logger.debug(TAG, 'cj111'); | ||
| 207 | + // } else { | ||
| 208 | + // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 209 | + // this.pageModel.viewType = ViewType.EMPTY; | ||
| 210 | + // } | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + // private async getLiveListData(pageInfo: PageInfoBean) { | ||
| 215 | + // // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | ||
| 216 | + // for (const group of pageInfo.groups) { | ||
| 217 | + // this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this)); | ||
| 218 | + // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString(); | ||
| 219 | + // if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | ||
| 220 | + // this.pageDto.compList.forEach((comp) => { | ||
| 221 | + // if (comp.compStyle === CompStyle.Zh_Grid_Layout_02 && this.liveReviewDTO && this.liveReviewDTO.list && this.liveReviewDTO.list.length > 0) { | ||
| 222 | + // comp.operDataList.push(...this.liveReviewDTO.list); | ||
| 223 | + // } | ||
| 224 | + // }); | ||
| 225 | + // | ||
| 226 | + // this.pageModel.viewType = ViewType.LOADED; | ||
| 227 | + // this.pageModel.compList.push(...this.pageDto.compList); | ||
| 228 | + // if (this.pageDto.compList.length === this.pageModel.pageSize) { | ||
| 229 | + // this.pageModel.currentPage++; | ||
| 230 | + // this.pageModel.hasMore = true; | ||
| 231 | + // } else { | ||
| 232 | + // this.pageModel.hasMore = false; | ||
| 233 | + // } | ||
| 234 | + // // // 二次请求,批查互动数据 | ||
| 235 | + // // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 236 | + // // // 刷新,替换所有数据 | ||
| 237 | + // // this.pageModel.compList.replaceAll(...data) | ||
| 238 | + // // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 239 | + // // }) | ||
| 240 | + // this.isFirstIn = false; | ||
| 241 | + // Logger.debug(TAG, 'cj111'); | ||
| 242 | + // // } else { | ||
| 243 | + // // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 244 | + // // this.pageModel.viewType = ViewType.EMPTY; | ||
| 245 | + // } | ||
| 246 | + // } | ||
| 247 | + // } | ||
| 248 | + | ||
| 249 | + async getLiveListData(pageInfo: PageInfoBean) { | ||
| 250 | + // Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 251 | + // this.pageModel.pageId = this.pageId; | ||
| 252 | + // this.pageModel.groupId = this.pageId; | ||
| 253 | + // this.pageModel.channelId = this.channelId; | ||
| 254 | + // this.pageModel.currentPage = 1; | ||
| 255 | + // let pageInfo = await PageViewModel.getPageUrlData(this.pageModel.pageId); | ||
| 256 | + // if (pageInfo == null) { | ||
| 257 | + // this.pageModel.viewType = ViewType.EMPTY; | ||
| 258 | + // return; | ||
| 259 | + // } | ||
| 260 | + Logger.debug(TAG, 'getPageUrlData ' + pageInfo.id); | ||
| 261 | + // pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代 | ||
| 262 | + for (const group of pageInfo.groups) { | ||
| 263 | + this.pageDto = await PageViewModel.getLivePageData(this.pageModel.pageId, `${group.id}`, this.pageModel.channelId, group.groupStrategy | ||
| 264 | + , this.pageModel.currentPage, this.pageModel.pageSize, getContext(this)) | ||
| 169 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | 265 | this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() |
| 170 | if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { | 266 | if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) { |
| 171 | this.pageDto.compList.forEach((comp) => { | 267 | this.pageDto.compList.forEach((comp) => { |
| @@ -182,20 +278,18 @@ export struct PageComponent { | @@ -182,20 +278,18 @@ export struct PageComponent { | ||
| 182 | } else { | 278 | } else { |
| 183 | this.pageModel.hasMore = false; | 279 | this.pageModel.hasMore = false; |
| 184 | } | 280 | } |
| 185 | - // // 二次请求,批查互动数据 | ||
| 186 | - // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => { | ||
| 187 | - // // 刷新,替换所有数据 | ||
| 188 | - // this.pageModel.compList.replaceAll(...data) | ||
| 189 | - // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 190 | - // }) | 281 | + // 二次请求,批查互动数据 |
| 282 | + PageViewModel.getInteractData(this.pageDto.compList).then((data: CompDTO[]) => { | ||
| 283 | + // 刷新,替换所有数据 | ||
| 284 | + this.pageModel.compList.replaceAll(...data) | ||
| 285 | + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 286 | + }) | ||
| 191 | this.isFirstIn = false | 287 | this.isFirstIn = false |
| 192 | - Logger.debug(TAG, 'cj111'); | ||
| 193 | - // } else { | ||
| 194 | - // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 195 | - // this.pageModel.viewType = ViewType.EMPTY; | ||
| 196 | - // } | 288 | + } else { |
| 289 | + Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); | ||
| 290 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 291 | + } | ||
| 197 | } | 292 | } |
| 198 | - | ||
| 199 | } | 293 | } |
| 200 | 294 | ||
| 201 | async getPreviewData() { | 295 | async getPreviewData() { |
| @@ -128,7 +128,7 @@ export struct SearchComponent { | @@ -128,7 +128,7 @@ export struct SearchComponent { | ||
| 128 | * @param content | 128 | * @param content |
| 129 | */ | 129 | */ |
| 130 | getSearchHistoryResData(content:string,index:number){ | 130 | getSearchHistoryResData(content:string,index:number){ |
| 131 | - //删除单挑记录 | 131 | + //删除单条记录 |
| 132 | SearcherAboutDataModel.delSearchSingleHistoryData(index) | 132 | SearcherAboutDataModel.delSearchSingleHistoryData(index) |
| 133 | this.isClickedHistory = true | 133 | this.isClickedHistory = true |
| 134 | this.searchResData(content) | 134 | this.searchResData(content) |
| @@ -149,33 +149,6 @@ export struct SearchComponent { | @@ -149,33 +149,6 @@ export struct SearchComponent { | ||
| 149 | this.getSearchResultCountData() | 149 | this.getSearchResultCountData() |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | - getSearchResultCountData() { | ||
| 153 | - SearcherAboutDataModel.getSearchResultCountData(encodeURI(this.searchText),getContext(this)).then((value) => { | ||
| 154 | - if (value != null) { | ||
| 155 | - this.count = [] | ||
| 156 | - if(value.allTotal!=0){ | ||
| 157 | - this.count.push("全部") | ||
| 158 | - } | ||
| 159 | - if(value.cmsTotal!=0){ | ||
| 160 | - this.count.push("精选") | ||
| 161 | - } | ||
| 162 | - if(value.rmhTotal!=0){ | ||
| 163 | - this.count.push("人民号") | ||
| 164 | - } | ||
| 165 | - if(value.videoTotal!=0){ | ||
| 166 | - this.count.push("视频") | ||
| 167 | - } | ||
| 168 | - if(value.activityTotal!=0){ | ||
| 169 | - this.count.push("活动") | ||
| 170 | - } | ||
| 171 | - } | ||
| 172 | - }).catch((err: Error) => { | ||
| 173 | - console.log(TAG, JSON.stringify(err)) | ||
| 174 | - }) | ||
| 175 | - } | ||
| 176 | - | ||
| 177 | - | ||
| 178 | - | ||
| 179 | /** | 152 | /** |
| 180 | * 点击联想搜索列表回调 | 153 | * 点击联想搜索列表回调 |
| 181 | * @param content | 154 | * @param content |
| @@ -291,4 +264,30 @@ export struct SearchComponent { | @@ -291,4 +264,30 @@ export struct SearchComponent { | ||
| 291 | .padding({ left: '31lpx' }) | 264 | .padding({ left: '31lpx' }) |
| 292 | .alignItems(VerticalAlign.Center) | 265 | .alignItems(VerticalAlign.Center) |
| 293 | } | 266 | } |
| 267 | + | ||
| 268 | + | ||
| 269 | + getSearchResultCountData() { | ||
| 270 | + SearcherAboutDataModel.getSearchResultCountData(encodeURI(this.searchText),getContext(this)).then((value) => { | ||
| 271 | + if (value != null) { | ||
| 272 | + this.count = [] | ||
| 273 | + if(value.allTotal!=0){ | ||
| 274 | + this.count.push("全部") | ||
| 275 | + } | ||
| 276 | + if(value.cmsTotal!=0){ | ||
| 277 | + this.count.push("精选") | ||
| 278 | + } | ||
| 279 | + if(value.rmhTotal!=0){ | ||
| 280 | + this.count.push("人民号") | ||
| 281 | + } | ||
| 282 | + if(value.videoTotal!=0){ | ||
| 283 | + this.count.push("视频") | ||
| 284 | + } | ||
| 285 | + if(value.activityTotal!=0){ | ||
| 286 | + this.count.push("活动") | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + }).catch((err: Error) => { | ||
| 290 | + console.log(TAG, JSON.stringify(err)) | ||
| 291 | + }) | ||
| 292 | + } | ||
| 294 | } | 293 | } |
| 1 | +import { SearchResultContentComponent } from './SearchResultContentComponent' | ||
| 1 | 2 | ||
| 2 | const TAG = "SearchResultComponent" | 3 | const TAG = "SearchResultComponent" |
| 3 | /** | 4 | /** |
| @@ -19,7 +20,7 @@ export struct SearchResultComponent{ | @@ -19,7 +20,7 @@ export struct SearchResultComponent{ | ||
| 19 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 20 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 20 | ForEach(this.count, (item: string, index: number ) => { | 21 | ForEach(this.count, (item: string, index: number ) => { |
| 21 | TabContent(){ | 22 | TabContent(){ |
| 22 | - Text(item) | 23 | + SearchResultContentComponent({keywords:this.searchText,searchType:item}) |
| 23 | }.tabBar(this.TabBuilder(index,item)) | 24 | }.tabBar(this.TabBuilder(index,item)) |
| 24 | }, (item: string, index: number) => index.toString()) | 25 | }, (item: string, index: number) => index.toString()) |
| 25 | } | 26 | } |
| @@ -63,4 +64,5 @@ export struct SearchResultComponent{ | @@ -63,4 +64,5 @@ export struct SearchResultComponent{ | ||
| 63 | .margin({right:'9lpx'}) | 64 | .margin({right:'9lpx'}) |
| 64 | .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"}) | 65 | .padding({left:'31lpx',right:index === this.count.length-1?"31lpx":"0lpx"}) |
| 65 | } | 66 | } |
| 67 | + | ||
| 66 | } | 68 | } |
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
0 → 100644
| 1 | +import { ContentDTO, FullColumnImgUrlDTO, InteractDataDTO, RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index' | ||
| 2 | +import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' | ||
| 3 | +import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' | ||
| 4 | +import { LazyDataSource, StringUtils } from 'wdKit/Index' | ||
| 5 | +import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | ||
| 6 | +import { CardParser } from '../CardParser' | ||
| 7 | +import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' | ||
| 8 | + | ||
| 9 | +const TAG = "SearchResultContentComponent" | ||
| 10 | + | ||
| 11 | +@Component | ||
| 12 | +export struct SearchResultContentComponent{ | ||
| 13 | + @State keywords:string = "" | ||
| 14 | + @State searchType:string = "" | ||
| 15 | + @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 16 | + @State count:number = 0; | ||
| 17 | + @State isLoading:boolean = false | ||
| 18 | + @State hasMore:boolean = true | ||
| 19 | + curPageNum:number = 1; | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + aboutToAppear(): void { | ||
| 23 | + if(this.searchType == "全部"){ | ||
| 24 | + this.searchType = "all" | ||
| 25 | + }else if(this.searchType == "精选"){ | ||
| 26 | + this.searchType = "cms" | ||
| 27 | + }else if(this.searchType == "人民号"){ | ||
| 28 | + this.searchType = "rmh" | ||
| 29 | + }else if(this.searchType == "视频"){ | ||
| 30 | + this.searchType = "video" | ||
| 31 | + }else if(this.searchType == "活动"){ | ||
| 32 | + this.searchType = "activity" | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + this.keywords = encodeURI(this.keywords) | ||
| 36 | + this.getNewSearchResultData() | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + getNewSearchResultData(){ | ||
| 40 | + this.isLoading = true | ||
| 41 | + if(this.hasMore){ | ||
| 42 | + SearcherAboutDataModel.getSearchResultListData("20",`${this.curPageNum}`,this.searchType,this.keywords,getContext(this)).then((value)=>{ | ||
| 43 | + if (!this.data || value.list.length == 0){ | ||
| 44 | + this.hasMore = false | ||
| 45 | + }else{ | ||
| 46 | + value.list.forEach((value)=>{ | ||
| 47 | + | ||
| 48 | + let photos:FullColumnImgUrlDTO[] = [] | ||
| 49 | + if(value.data.appStyle === 4){ | ||
| 50 | + value.data.appStyleImages.split("&&").forEach((value)=>{ | ||
| 51 | + photos.push({url:value} as FullColumnImgUrlDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + //TODO 48 个赋值 | ||
| 56 | + let contentDTO:ContentDTO = { | ||
| 57 | + appStyle: value.data.appStyle + "", | ||
| 58 | + cityCode: value.data.cityCode, | ||
| 59 | + coverSize: "", | ||
| 60 | + coverType: -1, | ||
| 61 | + coverUrl: value.data.appStyleImages.split("&&")[0], | ||
| 62 | + description: value.data.description, | ||
| 63 | + districtCode: value.data.districtCode, | ||
| 64 | + endTime: value.data.endTime, | ||
| 65 | + hImageUrl: "", | ||
| 66 | + heatValue: "", | ||
| 67 | + innerUrl: "", | ||
| 68 | + landscape: Number.parseInt(value.data.landscape), | ||
| 69 | + // lengthTime:null, | ||
| 70 | + linkUrl: value.data.linkUrl, | ||
| 71 | + openLikes: Number.parseInt(value.data.openLikes), | ||
| 72 | + openUrl: "", | ||
| 73 | + pageId: value.data.pageId, | ||
| 74 | + programAuth: "", | ||
| 75 | + programId: "", | ||
| 76 | + programName: "", | ||
| 77 | + programSource: -1, | ||
| 78 | + programType: -1, | ||
| 79 | + provinceCode: value.data.provinceCode, | ||
| 80 | + showTitleEd: value.data.showTitleEd, | ||
| 81 | + showTitleIng: value.data.showTitleIng, | ||
| 82 | + showTitleNo: value.data.showTitleNo, | ||
| 83 | + startTime: value.data.startTime, | ||
| 84 | + subType: "", | ||
| 85 | + subtitle: "", | ||
| 86 | + title: value.data.title, | ||
| 87 | + vImageUrl: "", | ||
| 88 | + screenType: "", | ||
| 89 | + source: StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName, | ||
| 90 | + objectId: "", | ||
| 91 | + objectType: value.data.type, | ||
| 92 | + channelId: value.data.channelId, | ||
| 93 | + relId: value.data.relId, | ||
| 94 | + relType: value.data.relType, | ||
| 95 | + newsTitle: value.data.titleLiteral, | ||
| 96 | + publishTime: value.data.publishTime, | ||
| 97 | + visitorComment: -1, | ||
| 98 | + fullColumnImgUrls: photos, | ||
| 99 | + newsSummary: "", | ||
| 100 | + hasMore: -1, | ||
| 101 | + slideShows: [], | ||
| 102 | + voiceInfo: {} as VoiceInfoDTO, | ||
| 103 | + tagWord: -1, | ||
| 104 | + isSelect: true, | ||
| 105 | + rmhInfo: {} as RmhInfoDTO, | ||
| 106 | + photoNum: -1, | ||
| 107 | + liveInfo: {} as LiveInfoDTO, | ||
| 108 | + videoInfo: { | ||
| 109 | + videoDuration: Number.parseInt(value.data.duration) | ||
| 110 | + } as VideoInfoDTO, | ||
| 111 | + interactData: {} as InteractDataDTO, | ||
| 112 | + corner: '', | ||
| 113 | + rmhPlatform: 0, | ||
| 114 | + newTags: '' | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + this.data.push(contentDTO) | ||
| 118 | + }) | ||
| 119 | + this.data.notifyDataReload() | ||
| 120 | + this.count = this.data.totalCount() | ||
| 121 | + if (this.data.totalCount() < value.totalCount) { | ||
| 122 | + this.curPageNum++ | ||
| 123 | + }else { | ||
| 124 | + this.hasMore = false | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + }).catch((err:Error)=>{ | ||
| 128 | + console.log(TAG,JSON.stringify(err)) | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + this.isLoading = false | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + build() { | ||
| 136 | + Column() { | ||
| 137 | + if(this.count == 0){ | ||
| 138 | + ListHasNoMoreDataUI({style:2}) | ||
| 139 | + }else{ | ||
| 140 | + //List | ||
| 141 | + List({ space: '6lpx' }) { | ||
| 142 | + LazyForEach(this.data, (item: ContentDTO, index: number) => { | ||
| 143 | + ListItem() { | ||
| 144 | + CardParser({contentDTO:item}) | ||
| 145 | + } | ||
| 146 | + .onClick(()=>{ | ||
| 147 | + //TODO 跳转 | ||
| 148 | + }) | ||
| 149 | + }, (item: ContentDTO, index: number) => index.toString()) | ||
| 150 | + | ||
| 151 | + //没有更多数据 显示提示 | ||
| 152 | + if(!this.hasMore){ | ||
| 153 | + ListItem(){ | ||
| 154 | + ListHasNoMoreDataUI() | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + }.cachedCount(4) | ||
| 158 | + .scrollBar(BarState.Off) | ||
| 159 | + .margin({top:'23lpx',left:'23lpx',right:'23lpx'}) | ||
| 160 | + .layoutWeight(1) | ||
| 161 | + .onReachEnd(()=>{ | ||
| 162 | + console.log(TAG,"触底了"); | ||
| 163 | + if(!this.isLoading){ | ||
| 164 | + //加载分页数据 | ||
| 165 | + this.getNewSearchResultData() | ||
| 166 | + } | ||
| 167 | + }) | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + .backgroundColor($r('app.color.white')) | ||
| 171 | + .height('100%') | ||
| 172 | + .width('100%') | ||
| 173 | + } | ||
| 174 | +} |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 3 | -import featureAbility from '@ohos.ability.featureAbility'; | 3 | +import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; |
| 4 | 4 | ||
| 5 | const TAG = 'AboutPageUI'; | 5 | const TAG = 'AboutPageUI'; |
| 6 | 6 | ||
| 7 | @Component | 7 | @Component |
| 8 | -export struct AboutPageUI { | 8 | +export struct AboutPageUI { |
| 9 | @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; | 9 | @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; |
| 10 | @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' | 10 | @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' |
| 11 | @State version: string = '版本号:v' | 11 | @State version: string = '版本号:v' |
| 12 | + clickTimes: number = 0 | ||
| 13 | + dialogController: CustomDialogController = new CustomDialogController({ | ||
| 14 | + builder: EnvironmentCustomDialog({ | ||
| 15 | + cancel: () => { | ||
| 12 | 16 | ||
| 17 | + }, | ||
| 18 | + confirm: () => { | ||
| 19 | + } | ||
| 20 | + }), | ||
| 21 | + customStyle: true, | ||
| 22 | + alignment: DialogAlignment.Center | ||
| 23 | + }) | ||
| 13 | 24 | ||
| 14 | build() { | 25 | build() { |
| 15 | Navigation() { | 26 | Navigation() { |
| @@ -19,18 +30,24 @@ export struct AboutPageUI { | @@ -19,18 +30,24 @@ export struct AboutPageUI { | ||
| 19 | .title('关于') | 30 | .title('关于') |
| 20 | } | 31 | } |
| 21 | 32 | ||
| 22 | - aboutToAppear(){ | 33 | + aboutToAppear() { |
| 23 | let context = getContext(); | 34 | let context = getContext(); |
| 24 | context.getApplicationContext(); | 35 | context.getApplicationContext(); |
| 25 | } | 36 | } |
| 26 | 37 | ||
| 27 | - @Builder aboutUi() { | 38 | + @Builder |
| 39 | + aboutUi() { | ||
| 28 | Column() { | 40 | Column() { |
| 29 | Image($r('app.media.setting_about_logo')) | 41 | Image($r('app.media.setting_about_logo')) |
| 30 | .width('278lpx') | 42 | .width('278lpx') |
| 31 | .height('154lpx') | 43 | .height('154lpx') |
| 32 | - .margin({top:'173lpx',bottom:'154lpx'}) | ||
| 33 | - | 44 | + .margin({ top: '173lpx', bottom: '154lpx' }) |
| 45 | + .onClick(() => { | ||
| 46 | + this.clickTimes++ | ||
| 47 | + if (this.clickTimes > 2) { | ||
| 48 | + this.dialogController.open() | ||
| 49 | + } | ||
| 50 | + }) | ||
| 34 | // Row(){ | 51 | // Row(){ |
| 35 | // | 52 | // |
| 36 | // }.backgroundColor(Color.Yellow) | 53 | // }.backgroundColor(Color.Yellow) |
| @@ -44,19 +61,17 @@ export struct AboutPageUI { | @@ -44,19 +61,17 @@ export struct AboutPageUI { | ||
| 44 | // .height('97lpx') | 61 | // .height('97lpx') |
| 45 | 62 | ||
| 46 | 63 | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - List(){ | ||
| 50 | - ForEach(this.listData, (item:string, index : number) =>{ | 64 | + List() { |
| 65 | + ForEach(this.listData, (item: string, index: number) => { | ||
| 51 | ListItem() { | 66 | ListItem() { |
| 52 | this.getArrowCell(item, index) | 67 | this.getArrowCell(item, index) |
| 53 | - }.onClick(() =>{ | 68 | + }.onClick(() => { |
| 54 | if (index == 0) { | 69 | if (index == 0) { |
| 55 | - let bean={contentId:"1",pageID:""} as Params | ||
| 56 | - WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | ||
| 57 | - }else{ | ||
| 58 | - let bean={contentId:"2",pageID:""} as Params | ||
| 59 | - WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | 70 | + let bean = { contentId: "1", pageID: "" } as Params |
| 71 | + WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | ||
| 72 | + } else { | ||
| 73 | + let bean = { contentId: "2", pageID: "" } as Params | ||
| 74 | + WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | ||
| 60 | } | 75 | } |
| 61 | }) | 76 | }) |
| 62 | }) | 77 | }) |
| @@ -77,42 +92,39 @@ export struct AboutPageUI { | @@ -77,42 +92,39 @@ export struct AboutPageUI { | ||
| 77 | .fontSize('25lpx') | 92 | .fontSize('25lpx') |
| 78 | .textAlign(TextAlign.Center) | 93 | .textAlign(TextAlign.Center) |
| 79 | .fontColor($r("app.color.color_666666")) | 94 | .fontColor($r("app.color.color_666666")) |
| 80 | - .margin({bottom:'31lpx'}) | 95 | + .margin({ bottom: '31lpx' }) |
| 81 | 96 | ||
| 82 | Text(this.message) | 97 | Text(this.message) |
| 83 | .fontSize('19lpx') | 98 | .fontSize('19lpx') |
| 84 | .textAlign(TextAlign.Center) | 99 | .textAlign(TextAlign.Center) |
| 85 | .fontColor($r("app.color.color_999999")) | 100 | .fontColor($r("app.color.color_999999")) |
| 86 | - .margin({bottom:'35lpx'}) | 101 | + .margin({ bottom: '35lpx' }) |
| 87 | } | 102 | } |
| 88 | .width('100%') | 103 | .width('100%') |
| 89 | .height('100%') | 104 | .height('100%') |
| 90 | } | 105 | } |
| 91 | 106 | ||
| 92 | - | ||
| 93 | - | ||
| 94 | // 右文字+箭头cell | 107 | // 右文字+箭头cell |
| 95 | - @Builder getArrowCell(item:string, index:number) { | ||
| 96 | - | ||
| 97 | - Row() { | ||
| 98 | - // 左侧标题 | ||
| 99 | - Text(`${item}`) | ||
| 100 | - .fontColor('#666666') | ||
| 101 | - .fontSize('31lpx') | ||
| 102 | - | ||
| 103 | - Image($r('app.media.mine_user_arrow')) | ||
| 104 | - .width('27lpx') | ||
| 105 | - .height('27lpx') | ||
| 106 | - .objectFit(ImageFit.Auto) | ||
| 107 | - } | ||
| 108 | - .alignItems(VerticalAlign.Center) | ||
| 109 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 110 | - .height('97lpx') | ||
| 111 | - .width('100%') | ||
| 112 | - .padding({left:'29lpx',right:'29lpx'}) | 108 | + @Builder |
| 109 | + getArrowCell(item: string, index: number) { | ||
| 110 | + | ||
| 111 | + Row() { | ||
| 112 | + // 左侧标题 | ||
| 113 | + Text(`${item}`) | ||
| 114 | + .fontColor('#666666') | ||
| 115 | + .fontSize('31lpx') | ||
| 116 | + | ||
| 117 | + Image($r('app.media.mine_user_arrow')) | ||
| 118 | + .width('27lpx') | ||
| 119 | + .height('27lpx') | ||
| 120 | + .objectFit(ImageFit.Auto) | ||
| 121 | + } | ||
| 122 | + .alignItems(VerticalAlign.Center) | ||
| 123 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 124 | + .height('97lpx') | ||
| 125 | + .width('100%') | ||
| 126 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 113 | } | 127 | } |
| 114 | - | ||
| 115 | - | ||
| 116 | } | 128 | } |
| 117 | 129 | ||
| 118 | 130 |
| @@ -17,6 +17,7 @@ import { Router } from '@ohos.arkui.UIContext'; | @@ -17,6 +17,7 @@ import { Router } from '@ohos.arkui.UIContext'; | ||
| 17 | import promptAction from '@ohos.promptAction'; | 17 | import promptAction from '@ohos.promptAction'; |
| 18 | import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | 18 | import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; |
| 19 | import { CustomLogoutDialog } from './CustomLogoutDialog'; | 19 | import { CustomLogoutDialog } from './CustomLogoutDialog'; |
| 20 | +import { emitter } from '@kit.BasicServicesKit'; | ||
| 20 | 21 | ||
| 21 | export { SettingPasswordParams } from "wdLogin" | 22 | export { SettingPasswordParams } from "wdLogin" |
| 22 | 23 | ||
| @@ -41,9 +42,11 @@ export struct AccountAndSecurityLayout { | @@ -41,9 +42,11 @@ export struct AccountAndSecurityLayout { | ||
| 41 | alignment: DialogAlignment.Center | 42 | alignment: DialogAlignment.Center |
| 42 | }) | 43 | }) |
| 43 | 44 | ||
| 45 | + | ||
| 44 | aboutToAppear() { | 46 | aboutToAppear() { |
| 45 | // 获取设置页面数据 | 47 | // 获取设置页面数据 |
| 46 | this.getAccountAndSecurityData() | 48 | this.getAccountAndSecurityData() |
| 49 | + this.addEmitEvent() | ||
| 47 | } | 50 | } |
| 48 | 51 | ||
| 49 | async getAccountAndSecurityData() { | 52 | async getAccountAndSecurityData() { |
| @@ -56,6 +59,28 @@ export struct AccountAndSecurityLayout { | @@ -56,6 +59,28 @@ export struct AccountAndSecurityLayout { | ||
| 56 | 59 | ||
| 57 | } | 60 | } |
| 58 | 61 | ||
| 62 | + addEmitEvent(){ | ||
| 63 | + // 定义一个eventId为1的事件 | ||
| 64 | + let event: emitter.InnerEvent = { | ||
| 65 | + eventId: 10010 | ||
| 66 | + }; | ||
| 67 | + | ||
| 68 | + // 收到eventId为1的事件后执行该回调 | ||
| 69 | + let callback = (eventData: emitter.EventData): void => { | ||
| 70 | + promptAction.showToast({ | ||
| 71 | + message: JSON.stringify(eventData) | ||
| 72 | + }); | ||
| 73 | + if(eventData&&eventData.data){ | ||
| 74 | + this.listData[0].subTitle = eventData.data['content'] | ||
| 75 | + } | ||
| 76 | + Logger.debug( 'event callback:' + JSON.stringify(eventData)); | ||
| 77 | + }; | ||
| 78 | + | ||
| 79 | + // 订阅eventId为1的事件 | ||
| 80 | + emitter.on(event, callback); | ||
| 81 | + | ||
| 82 | + } | ||
| 83 | + | ||
| 59 | build() { | 84 | build() { |
| 60 | Column(){ | 85 | Column(){ |
| 61 | if(this.isAccountPage){ | 86 | if(this.isAccountPage){ |
| @@ -106,7 +131,8 @@ export struct AccountAndSecurityLayout { | @@ -106,7 +131,8 @@ export struct AccountAndSecurityLayout { | ||
| 106 | ListItem() { | 131 | ListItem() { |
| 107 | if (item.type == 0) { | 132 | if (item.type == 0) { |
| 108 | Column() { | 133 | Column() { |
| 109 | - this.getArrowCell(item) | 134 | + // this.getArrowCell(item) |
| 135 | + AccountArrowCell({ item:item}) | ||
| 110 | }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) | 136 | }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) |
| 111 | } else if (item.type == 1) { | 137 | } else if (item.type == 1) { |
| 112 | Column() { | 138 | Column() { |
| @@ -285,7 +311,7 @@ export struct AccountAndSecurityLayout { | @@ -285,7 +311,7 @@ export struct AccountAndSecurityLayout { | ||
| 285 | }.alignItems(VerticalAlign.Center) | 311 | }.alignItems(VerticalAlign.Center) |
| 286 | 312 | ||
| 287 | Row() { | 313 | Row() { |
| 288 | - Text("登录") | 314 | + Text("注销账户") |
| 289 | .borderRadius(4) | 315 | .borderRadius(4) |
| 290 | .fontColor(this.protocolState ? "#FFFFFFFF" : "#66FFFFFF") | 316 | .fontColor(this.protocolState ? "#FFFFFFFF" : "#66FFFFFF") |
| 291 | .fontSize(18) | 317 | .fontSize(18) |
| @@ -404,4 +430,47 @@ export struct AccountAndSecurityLayout { | @@ -404,4 +430,47 @@ export struct AccountAndSecurityLayout { | ||
| 404 | securityNum = phoneNum.replace(needSecurityString,'****') | 430 | securityNum = phoneNum.replace(needSecurityString,'****') |
| 405 | return securityNum; | 431 | return securityNum; |
| 406 | } | 432 | } |
| 433 | +} | ||
| 434 | + | ||
| 435 | +@Component | ||
| 436 | +export struct AccountArrowCell{ | ||
| 437 | + @ObjectLink item: MineMainSettingFunctionItem | ||
| 438 | + build() { | ||
| 439 | + Column() { | ||
| 440 | + Row() { | ||
| 441 | + // 左侧logo和标题 | ||
| 442 | + Row() { | ||
| 443 | + // 判断有没有图片 | ||
| 444 | + if (this.item.imgSrc) { | ||
| 445 | + Image(this.item.imgSrc) | ||
| 446 | + .height('38lpx') | ||
| 447 | + .margin({ right: '5lpx' }) | ||
| 448 | + } | ||
| 449 | + Text(`${this.item.title}`) | ||
| 450 | + .margin({ top: '8lpx' }) | ||
| 451 | + .height('38lpx') | ||
| 452 | + .fontColor('#333333') | ||
| 453 | + .fontSize('29lpx') | ||
| 454 | + }.width('60%') | ||
| 455 | + | ||
| 456 | + // 右侧文案和右箭头 | ||
| 457 | + Row() { | ||
| 458 | + Text(this.item.subTitle ? this.item.subTitle : '') | ||
| 459 | + .fontColor('#999999') | ||
| 460 | + .maxLines(1) | ||
| 461 | + Image($r('app.media.mine_user_arrow')) | ||
| 462 | + .width('27lpx') | ||
| 463 | + .height('27lpx') | ||
| 464 | + .objectFit(ImageFit.Auto) | ||
| 465 | + Column().width('29lpx') | ||
| 466 | + }.width('40%') | ||
| 467 | + .margin({ right: '29lpx' }) | ||
| 468 | + .justifyContent(FlexAlign.End) | ||
| 469 | + | ||
| 470 | + } | ||
| 471 | + .alignItems(VerticalAlign.Center) | ||
| 472 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 473 | + } | ||
| 474 | + .height('54lpx') | ||
| 475 | + } | ||
| 407 | } | 476 | } |
sight_harmony/features/wdComponent/src/main/ets/components/setting/EnvironmentCustomDialog.ets
0 → 100644
| 1 | +import { SPHelper } from 'wdKit/Index'; | ||
| 2 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 3 | + | ||
| 4 | +@CustomDialog | ||
| 5 | +export struct EnvironmentCustomDialog { | ||
| 6 | + currentEnvironment: string = HttpUrlUtils.HOST_PRODUCT; | ||
| 7 | + controller: CustomDialogController | ||
| 8 | + cancel: () => void = () => { | ||
| 9 | + } | ||
| 10 | + confirm: () => void = () => { | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + build() { | ||
| 14 | + Column() { | ||
| 15 | + Text("请选择环境") | ||
| 16 | + .fontColor("#222222") | ||
| 17 | + .fontSize(18) | ||
| 18 | + .width("100%") | ||
| 19 | + .fontWeight(FontWeight.Bold) | ||
| 20 | + .textAlign(TextAlign.Center) | ||
| 21 | + .margin({ top: 20 }) | ||
| 22 | + Row() { | ||
| 23 | + Radio({ value: 'Radio1', group: 'radioGroup' }) | ||
| 24 | + .checked(true) | ||
| 25 | + .height(20) | ||
| 26 | + .width(20) | ||
| 27 | + .onChange((isChecked: boolean) => { | ||
| 28 | + if (isChecked) { | ||
| 29 | + this.currentEnvironment = HttpUrlUtils.HOST_SIT; | ||
| 30 | + } | ||
| 31 | + }) | ||
| 32 | + Text('切换到SIT(测试)环境,重启应用生效') | ||
| 33 | + .fontSize(14) | ||
| 34 | + } | ||
| 35 | + .justifyContent(FlexAlign.Start) | ||
| 36 | + .width('90%') | ||
| 37 | + | ||
| 38 | + Row() { | ||
| 39 | + Radio({ value: 'Radio1', group: 'radioGroup' }) | ||
| 40 | + .checked(true) | ||
| 41 | + .height(20) | ||
| 42 | + .width(20) | ||
| 43 | + .onChange((isChecked: boolean) => { | ||
| 44 | + if (isChecked) { | ||
| 45 | + this.currentEnvironment = HttpUrlUtils.HOST_UAT; | ||
| 46 | + } | ||
| 47 | + }) | ||
| 48 | + Text('切换到UAT(预发布)环境,重启应用生效') | ||
| 49 | + .fontSize(14) | ||
| 50 | + } | ||
| 51 | + .width('90%') | ||
| 52 | + .justifyContent(FlexAlign.Start) | ||
| 53 | + | ||
| 54 | + Row() { | ||
| 55 | + Radio({ value: 'Radio1', group: 'radioGroup' }) | ||
| 56 | + .checked(true) | ||
| 57 | + .height(20) | ||
| 58 | + .width(20) | ||
| 59 | + .onChange((isChecked: boolean) => { | ||
| 60 | + if (isChecked) { | ||
| 61 | + this.currentEnvironment = HttpUrlUtils.HOST_PRODUCT; | ||
| 62 | + } | ||
| 63 | + }) | ||
| 64 | + Text('切换到PROD(现网)环境,重启应用生效') | ||
| 65 | + .fontSize(14) | ||
| 66 | + } | ||
| 67 | + .width('90%') | ||
| 68 | + .justifyContent(FlexAlign.Start) | ||
| 69 | + | ||
| 70 | + Row() { | ||
| 71 | + Radio({ value: 'Radio1', group: 'radioGroup' }) | ||
| 72 | + .checked(true) | ||
| 73 | + .height(20) | ||
| 74 | + .width(20) | ||
| 75 | + .onChange((isChecked: boolean) => { | ||
| 76 | + if (isChecked) { | ||
| 77 | + this.currentEnvironment = HttpUrlUtils.HOST_DEV; | ||
| 78 | + } | ||
| 79 | + }) | ||
| 80 | + Text('切换到DEV(开发)环境,重启应用生效') | ||
| 81 | + .fontSize(14) | ||
| 82 | + } | ||
| 83 | + .width('90%') | ||
| 84 | + .justifyContent(FlexAlign.Start) | ||
| 85 | + | ||
| 86 | + Button('确认') | ||
| 87 | + .margin({ top: 20 }) | ||
| 88 | + .onClick(() => { | ||
| 89 | + // HttpUrlUtils.hostUrl = this.currentEnvironment | ||
| 90 | + SPHelper.default.saveSync('hostUrl', this.currentEnvironment); | ||
| 91 | + this.controller.close() | ||
| 92 | + this.confirm() | ||
| 93 | + }) | ||
| 94 | + }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') | ||
| 95 | + | ||
| 96 | + } | ||
| 97 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/view/AlbumCardComponent.ets
deleted
100644 → 0
| 1 | -import { Action, CompDTO, Params } from 'wdBean'; | ||
| 2 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | ||
| 3 | -import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | -import { DateTimeUtils, Logger } from 'wdKit'; | ||
| 5 | -import { WDRouterRule } from 'wdRouter'; | ||
| 6 | - | ||
| 7 | -const TAG = 'AlbumCardComponent'; | ||
| 8 | - | ||
| 9 | -@Preview | ||
| 10 | -@Component | ||
| 11 | -export struct AlbumCardComponent { | ||
| 12 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 13 | - | ||
| 14 | - aboutToAppear() { | ||
| 15 | - Logger.debug(TAG + "this.compDTO.operDataList" + JSON.stringify(this.compDTO.operDataList)); | ||
| 16 | - | ||
| 17 | - } | ||
| 18 | - | ||
| 19 | - build() { | ||
| 20 | - Column({ space: 8 }) { | ||
| 21 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 22 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 23 | - .fontSize(17) | ||
| 24 | - .fontColor(0x222222) | ||
| 25 | - .lineHeight(25) | ||
| 26 | - .maxLines(3) | ||
| 27 | - .width(CommonConstants.FULL_WIDTH) | ||
| 28 | - | ||
| 29 | - RelativeContainer() { | ||
| 30 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url) | ||
| 31 | - .width('66.6%') | ||
| 32 | - .aspectRatio(16/9) | ||
| 33 | - .alignRules({ | ||
| 34 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 35 | - left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 36 | - }) | ||
| 37 | - .id('mainImage') | ||
| 38 | - | ||
| 39 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url) | ||
| 40 | - .width('33%') | ||
| 41 | - .aspectRatio(16/9) | ||
| 42 | - .alignRules({ | ||
| 43 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 44 | - right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 45 | - }) | ||
| 46 | - .id('subTopImage') | ||
| 47 | - | ||
| 48 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url) | ||
| 49 | - .width('33%') | ||
| 50 | - .aspectRatio(16/9) | ||
| 51 | - .alignRules({ | ||
| 52 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 53 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | ||
| 54 | - }) | ||
| 55 | - .id('subBottomImage') | ||
| 56 | - // 下面是渲染右下角图标 | ||
| 57 | - Shape() { | ||
| 58 | - Rect().width(33).height(18) | ||
| 59 | - } | ||
| 60 | - // .viewPort({ x: -2, y: -2, width: 304, height: 130 }) | ||
| 61 | - .fill(0x000000) | ||
| 62 | - .fillOpacity(0.3) | ||
| 63 | - // .strokeDashArray([20]) | ||
| 64 | - // .strokeDashOffset(10) | ||
| 65 | - .strokeLineCap(LineCapStyle.Round) | ||
| 66 | - .strokeLineJoin(LineJoinStyle.Round) | ||
| 67 | - .antiAlias(true) | ||
| 68 | - .id('shape') | ||
| 69 | - .alignRules({ | ||
| 70 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 71 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | ||
| 72 | - }) | ||
| 73 | - .margin({ right: 4, | ||
| 74 | - bottom: 4 }) | ||
| 75 | - | ||
| 76 | - Image($r('app.media.album_card_shape')) | ||
| 77 | - .width(22) | ||
| 78 | - .height(18) | ||
| 79 | - .alignRules({ | ||
| 80 | - left: { anchor: "shape", align: HorizontalAlign.Start }, | ||
| 81 | - top: { anchor: "shape", align: VerticalAlign.Top } | ||
| 82 | - }) | ||
| 83 | - .id('shapeSubImage') | ||
| 84 | - | ||
| 85 | - Text(this.compDTO.operDataList[0].fullColumnImgUrls.length + '') | ||
| 86 | - .fontSize(13) | ||
| 87 | - .fontColor(0xFFFFFF) | ||
| 88 | - .id('pageIndex') | ||
| 89 | - .alignRules({ | ||
| 90 | - right: { anchor: "shape", align: HorizontalAlign.End }, | ||
| 91 | - top: { anchor: "shape", align: VerticalAlign.Top } | ||
| 92 | - }) | ||
| 93 | - .margin({ right: 2 }) | ||
| 94 | - .textAlign(TextAlign.Center) | ||
| 95 | - .width(17) | ||
| 96 | - .height(17) | ||
| 97 | - } | ||
| 98 | - .width(CommonConstants.FULL_WIDTH) | ||
| 99 | - .aspectRatio(24/9) | ||
| 100 | - .onClick((event: ClickEvent) => { | ||
| 101 | - let taskAction: Action = { | ||
| 102 | - type: 'JUMP_DETAIL_PAGE', | ||
| 103 | - params: { | ||
| 104 | - detailPageType: 17, | ||
| 105 | - contentID: this.compDTO.operDataList?.[0].objectId, | ||
| 106 | - extra: { | ||
| 107 | - relType: this.compDTO.operDataList?.[0].relType, | ||
| 108 | - relId: `${this.compDTO.operDataList?.[0].relId}`, | ||
| 109 | - } as ExtraDTO | ||
| 110 | - } as Params, | ||
| 111 | - }; | ||
| 112 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 113 | - }) | ||
| 114 | - | ||
| 115 | - Row() { | ||
| 116 | - if (this.compDTO.operDataList[0].source) { | ||
| 117 | - Text(this.compDTO.operDataList[0].source) | ||
| 118 | - .fontSize(13) | ||
| 119 | - .fontColor(0xB0B0B0) | ||
| 120 | - Image($r('app.media.point')) | ||
| 121 | - .width(16) | ||
| 122 | - .height(16) | ||
| 123 | - } | ||
| 124 | - if (this.compDTO.operDataList[0].publishTime && this.compDTO.operDataList[0].publishTime.length === 13) { | ||
| 125 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 126 | - .fontSize(13) | ||
| 127 | - .fontColor(0xB0B0B0) | ||
| 128 | - } | ||
| 129 | - Text('328评') | ||
| 130 | - .fontSize(13) | ||
| 131 | - .fontColor(0xB0B0B0) | ||
| 132 | - .margin({ | ||
| 133 | - left: 6 | ||
| 134 | - }) | ||
| 135 | - } | ||
| 136 | - .width(CommonConstants.FULL_WIDTH) | ||
| 137 | - .height(16) | ||
| 138 | - .id('label') | ||
| 139 | - } | ||
| 140 | - .width(CommonConstants.FULL_WIDTH) | ||
| 141 | - .padding({ | ||
| 142 | - top: 14, | ||
| 143 | - left: 16, | ||
| 144 | - right: 16, | ||
| 145 | - bottom: 14 | ||
| 146 | - }) | ||
| 147 | - } | ||
| 148 | -} |
| 1 | -import { CompDTO, slideShows } from 'wdBean'; | ||
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { DateTimeUtils } from 'wdKit'; | ||
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 5 | -/** | ||
| 6 | - * 时间链卡--CompStyle: 09 | ||
| 7 | - */ | ||
| 8 | -@Component | ||
| 9 | -export struct CompStyle_09 { | ||
| 10 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 11 | - | ||
| 12 | - build() { | ||
| 13 | - Column(){ | ||
| 14 | - // 顶部标题,最多两行 | ||
| 15 | - if(this.compDTO.operDataList[0].newsTitle) { | ||
| 16 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 17 | - .width(CommonConstants.FULL_WIDTH) | ||
| 18 | - .fontSize($r('app.float.font_size_17')) | ||
| 19 | - .fontWeight(600) | ||
| 20 | - .maxLines(2) | ||
| 21 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 22 | - .margin({ bottom: 19 }) | ||
| 23 | - } | ||
| 24 | - // 大图 | ||
| 25 | - Stack(){ | ||
| 26 | - Image(this.compDTO.operDataList[0].coverUrl) | ||
| 27 | - .width('100%') | ||
| 28 | - .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')}) | ||
| 29 | - Text('专题') | ||
| 30 | - .fontSize($r('app.float.font_size_12')) | ||
| 31 | - .padding({left: 8, right: 8, top: 3, bottom: 3}) | ||
| 32 | - .backgroundColor(Color.Red) | ||
| 33 | - .fontColor(Color.White) | ||
| 34 | - .borderRadius($r('app.float.button_border_radius')) | ||
| 35 | - .margin({left: 5, bottom: 5}) | ||
| 36 | - }.alignContent(Alignment.BottomStart) | ||
| 37 | - // 时间线--后端返回三个, | ||
| 38 | - Column(){ | ||
| 39 | - ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { | ||
| 40 | - this.timelineItem(item, index) | ||
| 41 | - }) | ||
| 42 | - } | ||
| 43 | - // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 | ||
| 44 | - if(this.compDTO.operDataList[0].hasMore == 1) { | ||
| 45 | - Row() { | ||
| 46 | - Text("查看更多") | ||
| 47 | - .fontSize($r("app.float.font_size_14")) | ||
| 48 | - .fontColor($r("app.color.color_222222")) | ||
| 49 | - .margin({ right: 1 }) | ||
| 50 | - Image($r("app.media.more")) | ||
| 51 | - .width(14) | ||
| 52 | - .height(14) | ||
| 53 | - } | ||
| 54 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 55 | - .width(CommonConstants.FULL_WIDTH) | ||
| 56 | - .height(40) | ||
| 57 | - .borderRadius($r('app.float.button_border_radius')) | ||
| 58 | - .justifyContent(FlexAlign.Center) | ||
| 59 | - .margin({top: 5}) | ||
| 60 | - } | ||
| 61 | - } | ||
| 62 | - .width(CommonConstants.FULL_WIDTH) | ||
| 63 | - .padding({ | ||
| 64 | - top: 14, | ||
| 65 | - left: 16, | ||
| 66 | - right: 16, | ||
| 67 | - bottom: 14 | ||
| 68 | - }) | ||
| 69 | - .backgroundColor($r("app.color.white")) | ||
| 70 | - .margin({ bottom: 8 }) | ||
| 71 | - .onClick((event: ClickEvent) => { | ||
| 72 | - ProcessUtils.processPage(this.compDTO?.operDataList[0]) | ||
| 73 | - }) | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - @Builder timelineItem (item:slideShows, index:number) { | ||
| 77 | - Column(){ | ||
| 78 | - Stack() { | ||
| 79 | - if(index < this.compDTO.operDataList[0].slideShows.length - 1) { | ||
| 80 | - Divider() | ||
| 81 | - .vertical(true) | ||
| 82 | - .color($r('app.color.color_EDEDED')) | ||
| 83 | - .strokeWidth(1) | ||
| 84 | - .margin({top: index > 0 ? 0 : 16, left: 4}) | ||
| 85 | - } | ||
| 86 | - if(index > 0 && index == this.compDTO.operDataList[0].slideShows.length - 1) { | ||
| 87 | - Divider() | ||
| 88 | - .vertical(true) | ||
| 89 | - .color($r('app.color.color_EDEDED')) | ||
| 90 | - .strokeWidth(1) | ||
| 91 | - .height(16) | ||
| 92 | - .margin({left: 4}) | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - Column(){ | ||
| 96 | - Row() { | ||
| 97 | - // 标题 | ||
| 98 | - Image($r("app.media.point_icon")) | ||
| 99 | - .width(9) | ||
| 100 | - .height(9) | ||
| 101 | - .margin({ right: 5 }) | ||
| 102 | - Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) | ||
| 103 | - .fontSize($r('app.float.font_size_12')) | ||
| 104 | - .fontColor($r('app.color.color_222222')) | ||
| 105 | - .fontWeight(600) | ||
| 106 | - } | ||
| 107 | - .width(CommonConstants.FULL_WIDTH) | ||
| 108 | - .height(32) | ||
| 109 | - .alignItems(VerticalAlign.Center) | ||
| 110 | - Row() { | ||
| 111 | - Text(item.newsTitle) | ||
| 112 | - .fontSize($r('app.float.font_size_17')) | ||
| 113 | - .fontWeight(400) | ||
| 114 | - .fontColor($r('app.color.color_222222')) | ||
| 115 | - .layoutWeight(1) | ||
| 116 | - .maxLines(2) | ||
| 117 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 118 | - .alignSelf(ItemAlign.Center) | ||
| 119 | - .margin({left: 12}) | ||
| 120 | - if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 121 | - Image(item.fullColumnImgUrls[0].url) | ||
| 122 | - .width(90) | ||
| 123 | - .height(60) | ||
| 124 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 125 | - } | ||
| 126 | - } | ||
| 127 | - } | ||
| 128 | - } | ||
| 129 | - .alignContent(Alignment.TopStart) | ||
| 130 | - } | ||
| 131 | - .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78) | ||
| 132 | - .alignItems(HorizontalAlign.Start) | ||
| 133 | - } | ||
| 134 | -} |
| 1 | -import { CompDTO, ContentDTO, slideShows } from 'wdBean'; | ||
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { DateTimeUtils } from 'wdKit'; | ||
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 5 | - | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 大专题卡--CompStyle: 10 | ||
| 9 | - */ | ||
| 10 | -@Component | ||
| 11 | -export struct CompStyle_10 { | ||
| 12 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 13 | - | ||
| 14 | - build() { | ||
| 15 | - Column(){ | ||
| 16 | - // 顶部标题,最多两行 | ||
| 17 | - if(this.compDTO.operDataList[0].newsTitle) { | ||
| 18 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 19 | - .width(CommonConstants.FULL_WIDTH) | ||
| 20 | - .fontSize($r('app.float.font_size_17')) | ||
| 21 | - .fontWeight(600) | ||
| 22 | - .maxLines(2) | ||
| 23 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 24 | - .margin({ bottom: 19 }) | ||
| 25 | - } | ||
| 26 | - // 大图 | ||
| 27 | - Stack(){ | ||
| 28 | - Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl) | ||
| 29 | - .width('100%') | ||
| 30 | - .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')}) | ||
| 31 | - .onClick((event: ClickEvent) => { | ||
| 32 | - ProcessUtils.processPage(this.compDTO?.operDataList[0]) | ||
| 33 | - }) | ||
| 34 | - Text('专题') | ||
| 35 | - .fontSize($r('app.float.font_size_12')) | ||
| 36 | - .padding({left: 8, right: 8, top: 3, bottom: 3}) | ||
| 37 | - .backgroundColor(Color.Red) | ||
| 38 | - .fontColor(Color.White) | ||
| 39 | - .borderRadius($r('app.float.button_border_radius')) | ||
| 40 | - .margin({left: 5, bottom: 5}) | ||
| 41 | - }.alignContent(Alignment.BottomStart) | ||
| 42 | - // 专题列表--后端返回三个, | ||
| 43 | - Column(){ | ||
| 44 | - ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { | ||
| 45 | - this.timelineItem(item, index) | ||
| 46 | - }) | ||
| 47 | - } | ||
| 48 | - // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 | ||
| 49 | - if(this.compDTO.operDataList[0].hasMore == 1) { | ||
| 50 | - Row() { | ||
| 51 | - Text("查看更多") | ||
| 52 | - .fontSize($r("app.float.font_size_14")) | ||
| 53 | - .fontColor($r("app.color.color_222222")) | ||
| 54 | - .margin({ right: 1 }) | ||
| 55 | - Image($r("app.media.more")) | ||
| 56 | - .width(14) | ||
| 57 | - .height(14) | ||
| 58 | - } | ||
| 59 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 60 | - .width(CommonConstants.FULL_WIDTH) | ||
| 61 | - .height(40) | ||
| 62 | - .borderRadius($r('app.float.button_border_radius')) | ||
| 63 | - .justifyContent(FlexAlign.Center) | ||
| 64 | - .margin({top: 5}) | ||
| 65 | - .onClick((event: ClickEvent) => { | ||
| 66 | - ProcessUtils.processPage(this.compDTO?.operDataList[0]) | ||
| 67 | - }) | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | - .width(CommonConstants.FULL_WIDTH) | ||
| 71 | - .padding({ | ||
| 72 | - top: 14, | ||
| 73 | - left: 16, | ||
| 74 | - right: 16, | ||
| 75 | - bottom: 14 | ||
| 76 | - }) | ||
| 77 | - .backgroundColor($r("app.color.white")) | ||
| 78 | - .margin({ bottom: 8 }) | ||
| 79 | - } | ||
| 80 | - @Builder timelineItem (item:slideShows, index:number) { | ||
| 81 | - Row() { | ||
| 82 | - Column(){ | ||
| 83 | - Text(item.newsTitle) | ||
| 84 | - .fontSize($r('app.float.font_size_17')) | ||
| 85 | - .fontWeight(400) | ||
| 86 | - .fontColor($r('app.color.color_222222')) | ||
| 87 | - .maxLines(2) | ||
| 88 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 89 | - Row(){ | ||
| 90 | - // 展示发稿人 | ||
| 91 | - if(item.source) { | ||
| 92 | - Text(item.source) | ||
| 93 | - .fontSize($r('app.float.font_size_12')) | ||
| 94 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 95 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 96 | - .maxLines(1) | ||
| 97 | - .width(item.source.length > 10 ? '60%' : '') | ||
| 98 | - | ||
| 99 | - Image($r('app.media.point')) | ||
| 100 | - .width(16) | ||
| 101 | - .height(16) | ||
| 102 | - } | ||
| 103 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime)))) | ||
| 104 | - .fontSize($r("app.float.font_size_12")) | ||
| 105 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 106 | - } | ||
| 107 | - .margin({top: 12}) | ||
| 108 | - } | ||
| 109 | - .layoutWeight(1) | ||
| 110 | - .alignItems(HorizontalAlign.Start) | ||
| 111 | - | ||
| 112 | - // 右侧图片 | ||
| 113 | - if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 114 | - Image(item.fullColumnImgUrls[0].url) | ||
| 115 | - .width(117) | ||
| 116 | - .height(78) | ||
| 117 | - .objectFit(ImageFit.Cover) | ||
| 118 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 119 | - .margin({left: 12}) | ||
| 120 | - } | ||
| 121 | - } | ||
| 122 | - .padding({top: 10, bottom: 10}) | ||
| 123 | - .onClick((event: ClickEvent) => { | ||
| 124 | - const str: string = JSON.stringify(this.compDTO.operDataList[0]); | ||
| 125 | - const data: ContentDTO = JSON.parse(str) | ||
| 126 | - data.objectId = item.newsId | ||
| 127 | - data.relId = item.relId | ||
| 128 | - data.objectType = String(item.objectType) | ||
| 129 | - ProcessUtils.processPage(data) | ||
| 130 | - }) | ||
| 131 | - } | ||
| 132 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/HeadPictureCardComponent.ets
deleted
100644 → 0
| 1 | -import { CompDTO } from 'wdBean'; | ||
| 2 | -import { CommonConstants } from 'wdConstant'; | ||
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 4 | - | ||
| 5 | -@Component | ||
| 6 | -export struct HeadPictureCardComponent { | ||
| 7 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 8 | - | ||
| 9 | - build() { | ||
| 10 | - Stack() { | ||
| 11 | - Image(this.compDTO.operDataList[0].coverUrl) | ||
| 12 | - .width(CommonConstants.FULL_WIDTH) | ||
| 13 | - .autoResize(true) | ||
| 14 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 15 | - if (this.compDTO.operDataList[0].newsTitle) { | ||
| 16 | - Row() | ||
| 17 | - .width(CommonConstants.FULL_WIDTH) | ||
| 18 | - .height(59) | ||
| 19 | - .linearGradient({ | ||
| 20 | - colors: [ | ||
| 21 | - ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] | ||
| 22 | - ] | ||
| 23 | - }) | ||
| 24 | - Row() { | ||
| 25 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 26 | - .width(CommonConstants.FULL_WIDTH) | ||
| 27 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 28 | - .fontColor(Color.White) | ||
| 29 | - .fontSize($r('app.float.normal_text_size')) | ||
| 30 | - .fontWeight(FontWeight.Bold) | ||
| 31 | - .maxLines(2) | ||
| 32 | - .align(Alignment.Bottom) | ||
| 33 | - } | ||
| 34 | - .justifyContent(FlexAlign.Start) | ||
| 35 | - .height(40) | ||
| 36 | - .margin({ left: 12, bottom: 10, right: 12 }) | ||
| 37 | - } | ||
| 38 | - } | ||
| 39 | - .alignContent(Alignment.Bottom) | ||
| 40 | - .width(CommonConstants.FULL_WIDTH) | ||
| 41 | - .padding( | ||
| 42 | - { top: 16, bottom: 16, left: 14, right: 14 }) | ||
| 43 | - .onClick((event: ClickEvent) => { | ||
| 44 | - ProcessUtils.processPage(this.compDTO?.operDataList[0]) | ||
| 45 | - }) | ||
| 46 | - } | ||
| 47 | -} |
| @@ -27,11 +27,11 @@ export struct RecommendList { | @@ -27,11 +27,11 @@ export struct RecommendList { | ||
| 27 | .width(CommonConstants.FULL_PARENT) | 27 | .width(CommonConstants.FULL_PARENT) |
| 28 | .justifyContent(FlexAlign.Start) | 28 | .justifyContent(FlexAlign.Start) |
| 29 | } | 29 | } |
| 30 | - ForEach(this.recommendList, (item: ContentDTO) => { | ||
| 31 | - Row(){ | 30 | + ForEach(this.recommendList, (item: ContentDTO, index: number) => { |
| 31 | + Row() { | ||
| 32 | CardParser({ contentDTO: item }); | 32 | CardParser({ contentDTO: item }); |
| 33 | }.border({ | 33 | }.border({ |
| 34 | - width:{bottom: 1}, | 34 | + width: { bottom: this.recommendList.length === index + 1 ? 0 : 1 }, |
| 35 | color: '#f5f5f5' | 35 | color: '#f5f5f5' |
| 36 | }) | 36 | }) |
| 37 | }, (item: ContentDTO) => JSON.stringify(item)) | 37 | }, (item: ContentDTO) => JSON.stringify(item)) |
| 1 | -import { Action, CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | -import { CompStyle } from 'wdConstant'; | ||
| 3 | -import { Logger, DateTimeUtils } from 'wdKit'; | ||
| 4 | -import { WDRouterRule } from 'wdRouter'; | ||
| 5 | - | ||
| 6 | -const TAG = 'SingleImageCardAppComponent'; | ||
| 7 | -const FULL_PARENT: string = '100%'; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 单图卡-3行标题/2行标题 | ||
| 11 | - * 枚举值13 | ||
| 12 | - * | ||
| 13 | - * 重磅推荐/精选/电视剧/电影/综艺/短剧/更多>/ | ||
| 14 | - */ | ||
| 15 | -@Entry | ||
| 16 | -@Component | ||
| 17 | -export struct SingleImageCardAppComponent { | ||
| 18 | - // @State compDTO: CompDTO = {} as CompDTO | ||
| 19 | - | ||
| 20 | - @State compDTO: CompDTO = { | ||
| 21 | - operDataList: [ | ||
| 22 | - { | ||
| 23 | - coverSize: '660*371', | ||
| 24 | - coverType: 1, | ||
| 25 | - visitorComment: 10, | ||
| 26 | - coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/a9028e7011bb440e94ba7c63d80b39b7.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg', | ||
| 27 | - newsTitle: '一条江豚的自述', | ||
| 28 | - newsSummary: '我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。', | ||
| 29 | - videoInfo: { | ||
| 30 | - // clarity: 1, | ||
| 31 | - resolutionHeight: 20, | ||
| 32 | - resolutionWidth: 20, | ||
| 33 | - videoDuration: 229, | ||
| 34 | - videoLandScape: 1, | ||
| 35 | - videoType: 1, | ||
| 36 | - videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4", | ||
| 37 | - firstFrameImageUri: "", // 首帧图;【视频内容,contentPictures中】 | ||
| 38 | - }, | ||
| 39 | - | ||
| 40 | - } as ContentDTO | ||
| 41 | - ] | ||
| 42 | - } as CompDTO | ||
| 43 | - | ||
| 44 | - aboutToAppear() { | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - build() { | ||
| 48 | - Column() { | ||
| 49 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 50 | - .fontSize(16) | ||
| 51 | - .fontWeight(FontWeight.Bold) | ||
| 52 | - .alignSelf(ItemAlign.Start) | ||
| 53 | - .maxLines(3) | ||
| 54 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 55 | - if (this.compDTO.operDataList[0].coverUrl) { | ||
| 56 | - Stack() { | ||
| 57 | - Image(this.compDTO.operDataList[0].coverUrl) | ||
| 58 | - .borderRadius(5) | ||
| 59 | - .aspectRatio(16 / 9) | ||
| 60 | - .padding({ top: 10 }) | ||
| 61 | - if (this.compDTO.operDataList[0].videoInfo) { | ||
| 62 | - Row() { | ||
| 63 | - Image($r('app.media.iv_card_play_yellow_flag')) | ||
| 64 | - .width(22) | ||
| 65 | - .height(18) | ||
| 66 | - Text(DateTimeUtils.getFormattedDuration(this.compDTO.operDataList[0].videoInfo.videoDuration * 1000)) | ||
| 67 | - .fontSize($r('app.float.font_size_13')) | ||
| 68 | - .fontWeight(400) | ||
| 69 | - .fontColor($r('app.color.color_fff')) | ||
| 70 | - } | ||
| 71 | - .alignItems(VerticalAlign.Bottom) | ||
| 72 | - .height(18) | ||
| 73 | - .padding({ right: 4 }) | ||
| 74 | - .margin({ | ||
| 75 | - right: 4, | ||
| 76 | - bottom: 4 | ||
| 77 | - }) | ||
| 78 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 79 | - } | ||
| 80 | - }.alignContent(Alignment.BottomEnd) | ||
| 81 | - } | ||
| 82 | - if (this.compDTO.operDataList[0].newsSummary) { | ||
| 83 | - Text(this.compDTO.operDataList[0].newsSummary) | ||
| 84 | - .fontSize(14) | ||
| 85 | - .padding({ top: 10 }) | ||
| 86 | - .alignSelf(ItemAlign.Start) | ||
| 87 | - .maxLines(3) | ||
| 88 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 89 | - } | ||
| 90 | - Row() { | ||
| 91 | - Text(this.compDTO.operDataList[0].visitorComment + "评") | ||
| 92 | - .fontSize(12) | ||
| 93 | - .fontColor(Color.Gray) | ||
| 94 | - Image($r('app.media.icon_share')) | ||
| 95 | - .width(16) | ||
| 96 | - .height(16) | ||
| 97 | - .margin(10) | ||
| 98 | - }.width(FULL_PARENT) | ||
| 99 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 100 | - } | ||
| 101 | - .margin(22) | ||
| 102 | - } | ||
| 103 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
deleted
100644 → 0
| 1 | -import { Action, CompDTO, Params } from 'wdBean'; | ||
| 2 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | ||
| 3 | -import { CompStyle } from 'wdConstant'; | ||
| 4 | -import { Logger, DateTimeUtils } from 'wdKit'; | ||
| 5 | -import { WDRouterRule } from 'wdRouter'; | ||
| 6 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 7 | - | ||
| 8 | -const TAG = 'SingleImageCardComponent'; | ||
| 9 | -const FULL_PARENT: string = '100%'; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 单图卡-3行标题/2行标题 | ||
| 13 | - * 枚举值13 | ||
| 14 | - * ImageCard-03 | ||
| 15 | - * 重磅推荐/精选/电视剧/电影/综艺/短剧/更多>/ | ||
| 16 | - */ | ||
| 17 | - | ||
| 18 | -@Component | ||
| 19 | -export struct SingleImageCardComponent { | ||
| 20 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 21 | - | ||
| 22 | - aboutToAppear() { | ||
| 23 | - //Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList)); | ||
| 24 | - | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - build() { | ||
| 28 | - Row() { | ||
| 29 | - Column() { | ||
| 30 | - Column() { | ||
| 31 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 32 | - .fontSize(16) | ||
| 33 | - .fontWeight(FontWeight.Normal) | ||
| 34 | - .maxLines(3)// | ||
| 35 | - .alignSelf(ItemAlign.Start) | ||
| 36 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 37 | - }.height("80%") | ||
| 38 | - .justifyContent(FlexAlign.Start) | ||
| 39 | - | ||
| 40 | - Row() { | ||
| 41 | - if (this.compDTO.operDataList[0].source) { | ||
| 42 | - Text(this.compDTO.operDataList[0].source) | ||
| 43 | - .fontSize($r('app.float.font_size_12')) | ||
| 44 | - .fontColor(Color.Gray) | ||
| 45 | - .maxLines(1) | ||
| 46 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 47 | - .width(this.compDTO.operDataList[0].source.length > 8 ? '50%' : '') | ||
| 48 | - Image($r('app.media.point')) | ||
| 49 | - .width(16) | ||
| 50 | - .height(16) | ||
| 51 | - } | ||
| 52 | - if (this.compDTO.operDataList[0].publishTime && this.compDTO.operDataList[0].publishTime.length === 13) { | ||
| 53 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 54 | - .fontSize($r('app.float.font_size_12')) | ||
| 55 | - .fontColor(Color.Gray) | ||
| 56 | - } | ||
| 57 | - Text(this.compDTO.operDataList[0].visitorComment + '评') | ||
| 58 | - .fontSize($r('app.float.font_size_12')) | ||
| 59 | - .fontColor(Color.Gray) | ||
| 60 | - .padding({ | ||
| 61 | - left: 5 | ||
| 62 | - }) | ||
| 63 | - }.alignSelf(ItemAlign.Start) | ||
| 64 | - .height("20%") | ||
| 65 | - .justifyContent(FlexAlign.Start) | ||
| 66 | - } | ||
| 67 | - .alignItems(HorizontalAlign.Start) | ||
| 68 | - .justifyContent(FlexAlign.Start) | ||
| 69 | - .width('58%') | ||
| 70 | - | ||
| 71 | - Blank(16) | ||
| 72 | - if (this.compDTO.operDataList[0].coverUrl) { | ||
| 73 | - Stack() { | ||
| 74 | - Image(this.compDTO.operDataList[0].coverUrl) | ||
| 75 | - .borderRadius(5) | ||
| 76 | - .aspectRatio(this.compDTO.compStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | ||
| 77 | - .height(this.compDTO.compStyle === CompStyle.Card_13 ? 90 : 180) | ||
| 78 | - if (this.compDTO.operDataList[0].videoInfo) { | ||
| 79 | - Row() { | ||
| 80 | - Image($r('app.media.iv_card_play_yellow_flag')) | ||
| 81 | - .width(22) | ||
| 82 | - .height(18) | ||
| 83 | - Text(DateTimeUtils.getFormattedDuration(this.compDTO.operDataList[0].videoInfo.videoDuration * 1000)) | ||
| 84 | - .fontSize($r('app.float.font_size_13')) | ||
| 85 | - .fontWeight(400) | ||
| 86 | - .fontColor($r('app.color.color_fff')) | ||
| 87 | - } | ||
| 88 | - .alignItems(VerticalAlign.Bottom) | ||
| 89 | - .height(18) | ||
| 90 | - .padding({ right: 4 }) | ||
| 91 | - .margin({ | ||
| 92 | - right: 4, | ||
| 93 | - bottom: 4 | ||
| 94 | - }) | ||
| 95 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 96 | - } else if(this.compDTO.operDataList[0].voiceInfo) { | ||
| 97 | - Row() { | ||
| 98 | - Image($r('app.media.icon_listen')) | ||
| 99 | - .width(22) | ||
| 100 | - .height(18) | ||
| 101 | - Text(DateTimeUtils.getFormattedDuration(this.compDTO.operDataList[0].voiceInfo | ||
| 102 | - .voiceDuration * 1000)) | ||
| 103 | - .fontSize($r('app.float.font_size_13')) | ||
| 104 | - .fontWeight(400) | ||
| 105 | - .fontColor($r('app.color.color_fff')) | ||
| 106 | - } | ||
| 107 | - .alignItems(VerticalAlign.Bottom) | ||
| 108 | - .height(18) | ||
| 109 | - .padding({ right: 4 }) | ||
| 110 | - .margin({ | ||
| 111 | - right: 4, | ||
| 112 | - bottom: 4 | ||
| 113 | - }) | ||
| 114 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 115 | - } | ||
| 116 | - }.alignContent(Alignment.BottomEnd) | ||
| 117 | - } | ||
| 118 | - } | ||
| 119 | - .onClick((event: ClickEvent) => { | ||
| 120 | - ProcessUtils.processPage(this.compDTO?.operDataList[0]) | ||
| 121 | - }) | ||
| 122 | - .padding( | ||
| 123 | - { top: 16, bottom: 16, left: 14, right: 14 }) | ||
| 124 | - .width(FULL_PARENT) | ||
| 125 | - .height(this.compDTO.compStyle === CompStyle.Card_13 ? 127 : 217) | ||
| 126 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 127 | - } | ||
| 128 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/SmallVideoCardComponent.ets
deleted
100644 → 0
| 1 | -// import { CommonConstants } from 'wdConstant/src/main/ets/constants/CommonConstants' | ||
| 2 | - | ||
| 3 | -@Entry | ||
| 4 | -@Component | ||
| 5 | -export struct SmallVideoCardComponent { | ||
| 6 | - build() { | ||
| 7 | - Row() { | ||
| 8 | - Column() { | ||
| 9 | - Text('“畅享亚运”新模式活动打卡,看杭州打开“金角银边活动启动 跟着体育明星云打卡,看杭州打开“金角银边') | ||
| 10 | - .fontWeight(400) | ||
| 11 | - .fontSize($r('app.float.font_size_17')) | ||
| 12 | - .maxLines(4) | ||
| 13 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 14 | - .fontColor($r('app.color.color_222222')) | ||
| 15 | - .lineHeight(25) | ||
| 16 | - Row() { | ||
| 17 | - Text('人民日报') | ||
| 18 | - .labelTextStyle() | ||
| 19 | - Image($r('app.media.point')) | ||
| 20 | - .width(16) | ||
| 21 | - .height(16) | ||
| 22 | - Text('20分钟前') | ||
| 23 | - .labelTextStyle() | ||
| 24 | - .margin({ | ||
| 25 | - right: 6 | ||
| 26 | - }) | ||
| 27 | - Text('2000评') | ||
| 28 | - .labelTextStyle() | ||
| 29 | - } | ||
| 30 | - } | ||
| 31 | - .height(156) | ||
| 32 | - .layoutWeight(1) | ||
| 33 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 34 | - .alignItems(HorizontalAlign.Start) | ||
| 35 | - .margin({ right: 12 }) | ||
| 36 | - | ||
| 37 | - Stack({ alignContent: Alignment.BottomEnd }) { | ||
| 38 | - Image('https://www.harmonyos.com/resource/image/partner/harmonyos-connect/pic_shengtai_connect_qudao_xianxia.jpg') | ||
| 39 | - .width(117) | ||
| 40 | - .aspectRatio(117 / 156) | ||
| 41 | - .border({ radius: 4 }) | ||
| 42 | - Row() { | ||
| 43 | - Image($r('app.media.iv_card_play_yellow_flag')) | ||
| 44 | - .width(22) | ||
| 45 | - .height(18) | ||
| 46 | - Text('10:00') | ||
| 47 | - .fontSize($r('app.float.font_size_13')) | ||
| 48 | - .fontWeight(400) | ||
| 49 | - .fontColor($r('app.color.color_fff')) | ||
| 50 | - } | ||
| 51 | - .height(18) | ||
| 52 | - .padding({ right: 4 }) | ||
| 53 | - .margin({ | ||
| 54 | - right: 4, | ||
| 55 | - bottom: 4 | ||
| 56 | - }) | ||
| 57 | - .backgroundColor($r('app.color.color_4d000000')) | ||
| 58 | - } | ||
| 59 | - } | ||
| 60 | - // .width(CommonConstants.FULL_WIDTH) | ||
| 61 | - .width('100%') | ||
| 62 | - .height(184) | ||
| 63 | - .padding({ | ||
| 64 | - top: 14, | ||
| 65 | - bottom: 14, | ||
| 66 | - left: 16, | ||
| 67 | - right: 16 | ||
| 68 | - }) | ||
| 69 | - } | ||
| 70 | -} | ||
| 71 | - | ||
| 72 | -@Extend(Text) function labelTextStyle() { | ||
| 73 | - .fontSize($r('app.float.font_size_12')) | ||
| 74 | - .fontWeight(400) | ||
| 75 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 76 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/TitleAbbrComponent.ets
deleted
100644 → 0
| 1 | -//缩略标题 | ||
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { CompDTO } from 'wdBean' | ||
| 4 | -import { DateTimeUtils } from 'wdKit' | ||
| 5 | - | ||
| 6 | -@Component | ||
| 7 | -export struct TitleAbbrComponent { | ||
| 8 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 9 | - | ||
| 10 | - build() { | ||
| 11 | - Column() { | ||
| 12 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 13 | - .fontSize($r("app.float.font_size_16")) | ||
| 14 | - .fontColor($r("app.color.color_222222")) | ||
| 15 | - .maxLines(3) | ||
| 16 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 17 | - .width(CommonConstants.FULL_WIDTH) | ||
| 18 | - Row() { | ||
| 19 | - Text("锐评") | ||
| 20 | - .fontSize($r("app.float.font_size_12")) | ||
| 21 | - .fontColor($r("app.color.color_ED2800")) | ||
| 22 | - Text(this.compDTO.operDataList[0].source) | ||
| 23 | - .fontSize($r("app.float.font_size_12")) | ||
| 24 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 25 | - .margin({ left: 6 }) | ||
| 26 | - Image($r("app.media.point")) | ||
| 27 | - .width(16) | ||
| 28 | - .height(16) | ||
| 29 | - | ||
| 30 | - Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 31 | - .fontSize($r("app.float.font_size_12")) | ||
| 32 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 33 | - | ||
| 34 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 35 | - .justifyContent(FlexAlign.Start) | ||
| 36 | - .margin({ top: 8 }) | ||
| 37 | - | ||
| 38 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 39 | - .padding({ | ||
| 40 | - top: 14, | ||
| 41 | - left: 16, | ||
| 42 | - right: 16, | ||
| 43 | - bottom: 14 | ||
| 44 | - }) | ||
| 45 | - .backgroundColor($r("app.color.white")) | ||
| 46 | - .margin({ bottom: 8 }) | ||
| 47 | - } | ||
| 48 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/TitleAllComponent.ets
deleted
100644 → 0
| 1 | -//全标题 "compStyle":"3", | ||
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { CompDTO } from 'wdBean' | ||
| 4 | -import { DateTimeUtils } from 'wdKit/src/main/ets/utils/DateTimeUtils' | ||
| 5 | -import { Logger } from 'wdKit/src/main/ets/utils/Logger' | ||
| 6 | -import { ProcessUtils } from '../../utils/ProcessUtils' | ||
| 7 | - | ||
| 8 | -@Component | ||
| 9 | -export struct TitleAllComponent { | ||
| 10 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 11 | - | ||
| 12 | - build() { | ||
| 13 | - Column() { | ||
| 14 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 15 | - .fontSize($r("app.float.font_size_16")) | ||
| 16 | - .fontColor($r("app.color.color_222222")) | ||
| 17 | - .width(CommonConstants.FULL_WIDTH) | ||
| 18 | - Row() { | ||
| 19 | - Text("锐评") | ||
| 20 | - .fontSize($r("app.float.font_size_12")) | ||
| 21 | - .fontColor($r("app.color.color_ED2800")) | ||
| 22 | - Text(this.compDTO.operDataList[0].source) | ||
| 23 | - .fontSize($r("app.float.font_size_12")) | ||
| 24 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 25 | - .margin({ left: 6 }) | ||
| 26 | - Image($r("app.media.point")) | ||
| 27 | - .width(16) | ||
| 28 | - .height(16) | ||
| 29 | - | ||
| 30 | - Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 31 | - .fontSize($r("app.float.font_size_12")) | ||
| 32 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 33 | - | ||
| 34 | - }.width(CommonConstants.FULL_WIDTH) | ||
| 35 | - .justifyContent(FlexAlign.Start) | ||
| 36 | - .margin({ top: 8 }) | ||
| 37 | - | ||
| 38 | - }.width("100%") | ||
| 39 | - .padding({ | ||
| 40 | - top: 14, | ||
| 41 | - left: 16, | ||
| 42 | - right: 16, | ||
| 43 | - bottom: 14 | ||
| 44 | - }) | ||
| 45 | - .backgroundColor($r("app.color.white")) | ||
| 46 | - .margin({ bottom: 8 }) | ||
| 47 | - .onClick((event: ClickEvent)=>{ | ||
| 48 | - ProcessUtils.processPage(this.compDTO.operDataList[0]) | ||
| 49 | - }) | ||
| 50 | - } | ||
| 51 | - aboutToAppear(){ | ||
| 52 | - // Logger.info("ssx",JSON.stringify(this.compDTO.operDataList[0])) | ||
| 53 | - } | ||
| 54 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/TriPicCardComponent.ets
deleted
100644 → 0
| 1 | -import { CompDTO } from 'wdBean'; | ||
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 4 | - | ||
| 5 | -const TAG: string = 'TriPicCardComponent'; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 三图卡: | ||
| 9 | - * compstyle:4 | ||
| 10 | - * 卡片结构:上下结构 | ||
| 11 | - * 卡片宽度:充满父窗口 | ||
| 12 | - * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: | ||
| 13 | - */ | ||
| 14 | -// @Entry | ||
| 15 | -@Component | ||
| 16 | -export struct TriPicCardComponent { | ||
| 17 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 18 | - | ||
| 19 | - build() { | ||
| 20 | - Column() { | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - //body | ||
| 24 | - Column() { | ||
| 25 | - //新闻标题 | ||
| 26 | - Text(this.compDTO.operDataList[0].newsTitle) | ||
| 27 | - .fontSize(17) | ||
| 28 | - .fontColor('#222222') | ||
| 29 | - .maxLines(3) | ||
| 30 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 31 | - //三图 | ||
| 32 | - Row() { | ||
| 33 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[0]?.url) | ||
| 34 | - .width('32%') | ||
| 35 | - | ||
| 36 | - .height(75) | ||
| 37 | - .borderRadius({ topLeft:4,bottomLeft:4 }) | ||
| 38 | - | ||
| 39 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[1]?.url) | ||
| 40 | - .width('32%') | ||
| 41 | - .height(75) | ||
| 42 | - | ||
| 43 | - Image(this.compDTO.operDataList[0].fullColumnImgUrls[2]?.url) | ||
| 44 | - .width('32%') | ||
| 45 | - .height(75) | ||
| 46 | - .borderRadius({ topRight:4,bottomRight:4 }) | ||
| 47 | - | ||
| 48 | - } | ||
| 49 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 50 | - .width('100%') | ||
| 51 | - .height(75) | ||
| 52 | - .margin({top:8}) | ||
| 53 | - .borderRadius(8) | ||
| 54 | - | ||
| 55 | - } | ||
| 56 | - .width('100%') | ||
| 57 | - .justifyContent(FlexAlign.Start) | ||
| 58 | - .alignItems(HorizontalAlign.Start) | ||
| 59 | - .padding({top:14}) | ||
| 60 | - .onClick((event: ClickEvent)=>{ | ||
| 61 | - ProcessUtils.processPage(this.compDTO.operDataList[0]) | ||
| 62 | - }) | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - //bottom | ||
| 66 | - Row() { | ||
| 67 | - Text(this.compDTO.operDataList[0].source) | ||
| 68 | - .bottomTextStyle() | ||
| 69 | - //间隔点 | ||
| 70 | - Image($r('app.media.point')) | ||
| 71 | - .width(12) | ||
| 72 | - .height(12) | ||
| 73 | - | ||
| 74 | - Text(this.compDTO.operDataList[0].publishTime) | ||
| 75 | - .bottomTextStyle() | ||
| 76 | - Text(' ') | ||
| 77 | - | ||
| 78 | - Text('518条评论') | ||
| 79 | - .bottomTextStyle() | ||
| 80 | - | ||
| 81 | - } | ||
| 82 | - .width('100%') | ||
| 83 | - | ||
| 84 | - .justifyContent(FlexAlign.Start) | ||
| 85 | - // .padding({bottom:14}) | ||
| 86 | - .margin({top:8}) | ||
| 87 | - .padding({bottom:14}) | ||
| 88 | - | ||
| 89 | - } | ||
| 90 | - .width('100%') | ||
| 91 | - .padding({top:8,left:16,right:16}) | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | -} | ||
| 97 | - | ||
| 98 | - | ||
| 99 | -@Extend(Text) function bottomTextStyle() { | ||
| 100 | - .fontSize(12) | ||
| 101 | - .fontColor('#B0B0B0') | ||
| 102 | -} |
sight_harmony/features/wdComponent/src/main/ets/components/view/ZhGridLayoutComponent.ets
deleted
100644 → 0
| 1 | -import { Action, CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | -import { CompStyle } from 'wdConstant'; | ||
| 3 | -import { Logger } from 'wdKit'; | ||
| 4 | -import { WDRouterRule } from 'wdRouter'; | ||
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 6 | - | ||
| 7 | -const TAG = 'Zh_Grid_Layout-03'; | ||
| 8 | -const FULL_PARENT: string = '100%'; | ||
| 9 | -let listSize: number = 4; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 金刚卡位 | ||
| 13 | - * 枚举值Zh_Grid_Layout-03 | ||
| 14 | - * Zh_Grid_Layout-03 | ||
| 15 | - * | ||
| 16 | - */ | ||
| 17 | -@Preview | ||
| 18 | -@Component | ||
| 19 | -export struct ZhGridLayoutComponent { | ||
| 20 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 21 | - | ||
| 22 | - aboutToAppear() { | ||
| 23 | - if (this.compDTO.operDataList) { | ||
| 24 | - listSize = this.compDTO.operDataList.length > 5 ? 4 : this.compDTO.operDataList.length; | ||
| 25 | - } | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - build() { | ||
| 29 | - GridRow({ | ||
| 30 | - columns: { sm: listSize, md: 8 }, | ||
| 31 | - breakpoints: { value: ['320vp', '520vp', '840vp'] } | ||
| 32 | - }) { | ||
| 33 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 34 | - GridCol() { | ||
| 35 | - this.buildItemCard(this.compDTO.operDataList[index]); | ||
| 36 | - } | ||
| 37 | - }) | ||
| 38 | - } | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 组件项 | ||
| 43 | - * | ||
| 44 | - * @param programmeBean item 组件项, 上面icon,下面标题 | ||
| 45 | - */ | ||
| 46 | - @Builder | ||
| 47 | - buildItemCard(item: ContentDTO) { | ||
| 48 | - Column() { | ||
| 49 | - Image(item.coverUrl) | ||
| 50 | - .width(44) | ||
| 51 | - .aspectRatio(1 / 1) | ||
| 52 | - .margin(16) | ||
| 53 | - Text(item.newsTitle) | ||
| 54 | - .fontSize(13) | ||
| 55 | - .maxLines(1) | ||
| 56 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 57 | - } | ||
| 58 | - .width('100%') | ||
| 59 | - .onClick((event: ClickEvent) => { | ||
| 60 | - ProcessUtils.processPage(item) | ||
| 61 | - }) | ||
| 62 | - } | ||
| 63 | -} | ||
| 64 | - | ||
| 65 | - |
sight_harmony/features/wdComponent/src/main/ets/components/view/ZhSingleRow04.ets
deleted
100644 → 0
| 1 | -import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 2 | -import { CommonConstants } from 'wdConstant'; | ||
| 3 | -import { DateTimeUtils } from 'wdKit'; | ||
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 本地精选卡 | ||
| 8 | - * ZhSingleRow04 | ||
| 9 | - */ | ||
| 10 | - | ||
| 11 | -@Component | ||
| 12 | -export struct ZhSingleRow04 { | ||
| 13 | - @State compDTO: CompDTO = {} as CompDTO | ||
| 14 | - | ||
| 15 | - aboutToAppear() {} | ||
| 16 | - | ||
| 17 | - build() { | ||
| 18 | - Column(){ | ||
| 19 | - //顶部 | ||
| 20 | - Row(){ | ||
| 21 | - Row() { | ||
| 22 | - Image($r("app.media.local_selection")) | ||
| 23 | - .width(24) | ||
| 24 | - .height(24) | ||
| 25 | - .margin({ right: 4 }) | ||
| 26 | - Text(this.compDTO.objectTitle) | ||
| 27 | - .fontSize($r("app.float.font_size_17")) | ||
| 28 | - .fontColor($r("app.color.color_222222")) | ||
| 29 | - .fontWeight(600) | ||
| 30 | - } | ||
| 31 | - Row() { | ||
| 32 | - Text("更多") | ||
| 33 | - .fontSize($r("app.float.font_size_14")) | ||
| 34 | - .fontColor($r("app.color.color_999999")) | ||
| 35 | - .margin({ right: 1 }) | ||
| 36 | - Image($r("app.media.more")) | ||
| 37 | - .width(14) | ||
| 38 | - .height(14) | ||
| 39 | - } | ||
| 40 | - } | ||
| 41 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 42 | - .margin({ top: 8, bottom: 8 }) | ||
| 43 | - .width('100%') | ||
| 44 | - // 列表内容 | ||
| 45 | - List({ space: 12 }) { | ||
| 46 | - ForEach(this.compDTO.operDataList, (item: ContentDTO) => { | ||
| 47 | - ListItem() { | ||
| 48 | - Row(){ | ||
| 49 | - if(item.coverUrl) { | ||
| 50 | - Image(item.coverUrl) | ||
| 51 | - .width(84) | ||
| 52 | - .height(56) | ||
| 53 | - .borderRadius(3) | ||
| 54 | - .objectFit(ImageFit.Cover) | ||
| 55 | - .padding({right: 6}) | ||
| 56 | - } | ||
| 57 | - Column(){ | ||
| 58 | - Text(item.newsTitle) | ||
| 59 | - .fontSize($r("app.float.font_size_16")) | ||
| 60 | - .fontColor($r("app.color.color_212228")) | ||
| 61 | - .fontWeight(400) | ||
| 62 | - .maxLines(2) | ||
| 63 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 64 | - .margin({ top: 8 }) | ||
| 65 | - | ||
| 66 | - Row(){ | ||
| 67 | - Text(item.source) | ||
| 68 | - .fontSize($r('app.float.font_size_12')) | ||
| 69 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 70 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 71 | - .maxLines(1) | ||
| 72 | - .width(item.source.length > 10 ? '60%' : '') | ||
| 73 | - Image($r("app.media.point")) | ||
| 74 | - .width(16) | ||
| 75 | - .height(16) | ||
| 76 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) | ||
| 77 | - .fontSize($r("app.float.font_size_12")) | ||
| 78 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 79 | - } | ||
| 80 | - .width('100%') | ||
| 81 | - } | ||
| 82 | - .width(200) | ||
| 83 | - } | ||
| 84 | - // .margin({right: 18}) | ||
| 85 | - .onClick(() =>{ | ||
| 86 | - ProcessUtils.processPage(item) | ||
| 87 | - }) | ||
| 88 | - } | ||
| 89 | - }) | ||
| 90 | - } | ||
| 91 | - .listDirection(Axis.Horizontal) | ||
| 92 | - .width('100%') | ||
| 93 | - } | ||
| 94 | - .width(CommonConstants.FULL_WIDTH) | ||
| 95 | - .padding({ | ||
| 96 | - top: 14, | ||
| 97 | - left: 16, | ||
| 98 | - right: 16, | ||
| 99 | - bottom: 14 | ||
| 100 | - }) | ||
| 101 | - .backgroundColor($r("app.color.white")) | ||
| 102 | - .margin({ bottom: 8 }) | ||
| 103 | - } | ||
| 104 | -} |
| @@ -21,7 +21,23 @@ export class ContentConstants { | @@ -21,7 +21,23 @@ export class ContentConstants { | ||
| 21 | */ | 21 | */ |
| 22 | static readonly TYPE_TELETEXT: string = "8"; | 22 | static readonly TYPE_TELETEXT: string = "8"; |
| 23 | /** | 23 | /** |
| 24 | + * 9:图集 | ||
| 25 | + */ | ||
| 26 | + static readonly TYPE_NINE: string = "9"; | ||
| 27 | + /** | ||
| 24 | * 13:音频详情 | 28 | * 13:音频详情 |
| 25 | */ | 29 | */ |
| 26 | static readonly TYPE_AUDIO: string = "13"; | 30 | static readonly TYPE_AUDIO: string = "13"; |
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 14:动态图文 | ||
| 34 | + */ | ||
| 35 | + static readonly TYPE_FOURTEEN: string = "14"; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 15:动态视频 | ||
| 39 | + */ | ||
| 40 | + static readonly TYPE_FIFTEEN: string = "15"; | ||
| 41 | + | ||
| 42 | + | ||
| 27 | } | 43 | } |
| 1 | -import { WDPlayerController } from 'wdPlayer'; | 1 | +import { WDPlayerController, PlayerConstants } from 'wdPlayer'; |
| 2 | import { PaperReaderSimpleDialog } from './PaperReaderDialog'; | 2 | import { PaperReaderSimpleDialog } from './PaperReaderDialog'; |
| 3 | import { Logger } from 'wdKit/Index'; | 3 | import { Logger } from 'wdKit/Index'; |
| 4 | +import { AudioSuspensionModel } from '../viewmodel/AudioSuspensionModel'; | ||
| 4 | 5 | ||
| 5 | const TAG = 'AudioDialog'; | 6 | const TAG = 'AudioDialog'; |
| 6 | 7 | ||
| 7 | @Preview | 8 | @Preview |
| 8 | @CustomDialog | 9 | @CustomDialog |
| 9 | export struct AudioDialog { | 10 | export struct AudioDialog { |
| 11 | + @Consume audioTitle: string; | ||
| 12 | + @Consume currentTime: string; | ||
| 13 | + @Consume totalTime: string; | ||
| 14 | + @Consume progressVal: number; | ||
| 15 | + @State currentStatus: number = 0; | ||
| 16 | + controllerDetail?: CustomDialogController | ||
| 17 | + | ||
| 10 | private playerController: WDPlayerController = new WDPlayerController(); | 18 | private playerController: WDPlayerController = new WDPlayerController(); |
| 11 | private simpleAudioDialog: CustomDialogController = new CustomDialogController({ | 19 | private simpleAudioDialog: CustomDialogController = new CustomDialogController({ |
| 12 | builder: PaperReaderSimpleDialog({ | 20 | builder: PaperReaderSimpleDialog({ |
| @@ -21,8 +29,12 @@ export struct AudioDialog { | @@ -21,8 +29,12 @@ export struct AudioDialog { | ||
| 21 | 29 | ||
| 22 | }) | 30 | }) |
| 23 | 31 | ||
| 32 | + private AudioSuspension = new AudioSuspensionModel(this.simpleAudioDialog) | ||
| 33 | + | ||
| 34 | + | ||
| 24 | onCancel() { | 35 | onCancel() { |
| 25 | Logger.info(TAG, "cj2024 onCancel = ") | 36 | Logger.info(TAG, "cj2024 onCancel = ") |
| 37 | + this.AudioSuspension.setPlayerUrl() | ||
| 26 | } | 38 | } |
| 27 | 39 | ||
| 28 | /** | 40 | /** |
| @@ -38,34 +50,92 @@ export struct AudioDialog { | @@ -38,34 +50,92 @@ export struct AudioDialog { | ||
| 38 | } | 50 | } |
| 39 | 51 | ||
| 40 | build() { | 52 | build() { |
| 41 | - Row() { | ||
| 42 | - Image($r("app.media.icon_audio_pause")) | ||
| 43 | - .objectFit(ImageFit.Contain) | ||
| 44 | - .margin(18) | ||
| 45 | - .width(24) | ||
| 46 | - .height(24) | ||
| 47 | - } | ||
| 48 | - .width(60) | ||
| 49 | - .height(60) | ||
| 50 | - .backgroundColor(Color.White) | ||
| 51 | - .onClick(() => { | ||
| 52 | - if (this.simpleAudioDialog) { | ||
| 53 | - this.simpleAudioDialog.close() | ||
| 54 | - this.simpleAudioDialog.open() | ||
| 55 | - if (this.simpleAudioDialog) { | ||
| 56 | - setTimeout(() => { | ||
| 57 | - console.log('PaperReaderSimpleDialog delay 1s'); | ||
| 58 | - if (this.simpleAudioDialog != undefined) { | ||
| 59 | - this.simpleAudioDialog.close() | ||
| 60 | - } | ||
| 61 | - if (this.simpleAudioDialog != undefined) { | ||
| 62 | - this.simpleAudioDialog.open() | ||
| 63 | - } | ||
| 64 | - }, 500000); | 53 | + Stack({ alignContent: Alignment.End }) { |
| 54 | + Column() { //标题 时间 进度条 | ||
| 55 | + Marquee({ | ||
| 56 | + start: true, | ||
| 57 | + step: 5, | ||
| 58 | + loop: Number.POSITIVE_INFINITY, | ||
| 59 | + fromStart: true, | ||
| 60 | + src: this.audioTitle | ||
| 61 | + }) | ||
| 62 | + .width("60%") | ||
| 63 | + .height(20) | ||
| 64 | + .fontColor($r("app.color.color_222222")) | ||
| 65 | + .fontSize(14) | ||
| 66 | + .margin({ top: 10, left: 10 }) | ||
| 67 | + .alignSelf(ItemAlign.Start) | ||
| 68 | + .onStart(() => { | ||
| 69 | + console.info('Marquee animation complete onStart') | ||
| 70 | + }) | ||
| 71 | + .onBounce(() => { | ||
| 72 | + console.info('Marquee animation complete onBounce') | ||
| 73 | + }) | ||
| 74 | + .onFinish(() => { | ||
| 75 | + console.info('Marquee animation complete onFinish') | ||
| 76 | + }) | ||
| 77 | + | ||
| 78 | + Row() { | ||
| 79 | + Text(this.currentTime) | ||
| 80 | + .fontSize($r('app.float.font_size_12')) | ||
| 81 | + .fontColor($r('app.color.color_999999')) | ||
| 82 | + .height("100%") | ||
| 83 | + .alignSelf(ItemAlign.Start) | ||
| 84 | + Text("/" + this.totalTime) | ||
| 85 | + .fontSize($r('app.float.font_size_12')) | ||
| 86 | + .fontColor($r('app.color.color_999999')) | ||
| 87 | + .height("100%") | ||
| 88 | + .alignSelf(ItemAlign.Start) | ||
| 89 | + | ||
| 65 | } | 90 | } |
| 91 | + .width("100%") | ||
| 92 | + .height(16) | ||
| 93 | + .margin({ top: 4, left: 10 }) | ||
| 94 | + | ||
| 95 | + Progress({ value: this.progressVal, total: 100, type: ProgressType.Capsule }) | ||
| 96 | + .color($r('app.color.color_ED2800')) | ||
| 97 | + .backgroundColor($r('app.color.white')) | ||
| 98 | + .width("100%") | ||
| 99 | + .height(3) | ||
| 100 | + .margin({ top: 7 }) | ||
| 66 | } | 101 | } |
| 102 | + .width("100%") | ||
| 103 | + .height("100%") | ||
| 104 | + .justifyContent(FlexAlign.Start) | ||
| 67 | 105 | ||
| 68 | - }) | 106 | + Row() { |
| 107 | + Image(this.currentStatus != PlayerConstants.STATUS_START ? $r("app.media.icon_audio_pause") : $r("app.media.icon_audio_playing")) | ||
| 108 | + .objectFit(ImageFit.Contain) | ||
| 109 | + .width(24) | ||
| 110 | + .height(24) | ||
| 111 | + .margin({ right: 12 }) | ||
| 112 | + .onClick(() => { | ||
| 113 | + if (this.playerController) { | ||
| 114 | + // this.onConfirm() | ||
| 115 | + this.playerController.switchPlayOrPause() | ||
| 116 | + this.currentStatus = this.playerController.getStatus() | ||
| 117 | + } | ||
| 118 | + }) | ||
| 69 | 119 | ||
| 120 | + Image($r("app.media.icon_audio_close")) | ||
| 121 | + .objectFit(ImageFit.Contain) | ||
| 122 | + .width(24) | ||
| 123 | + .height(24) | ||
| 124 | + .onClick(() => { | ||
| 125 | + if (this.playerController) { | ||
| 126 | + this.playerController.stop() | ||
| 127 | + } | ||
| 128 | + if (this.controllerDetail) { | ||
| 129 | + this.controllerDetail.close() | ||
| 130 | + } | ||
| 131 | + }) | ||
| 132 | + }.width(80) | ||
| 133 | + .height(60) | ||
| 134 | + | ||
| 135 | + } | ||
| 136 | + .width("65%") | ||
| 137 | + .height(60) | ||
| 138 | + .backgroundColor(Color.White) | ||
| 139 | + .borderRadius(2) | ||
| 70 | } | 140 | } |
| 71 | } | 141 | } |
| @@ -3,7 +3,7 @@ import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunction | @@ -3,7 +3,7 @@ import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunction | ||
| 3 | import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' | 3 | import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' |
| 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; |
| 5 | import HashMap from '@ohos.util.HashMap'; | 5 | import HashMap from '@ohos.util.HashMap'; |
| 6 | -import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 6 | +import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 7 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; | 7 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; |
| 8 | import { Logger, ResourcesUtils, StringUtils } from 'wdKit'; | 8 | import { Logger, ResourcesUtils, StringUtils } from 'wdKit'; |
| 9 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; | 9 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; |
| @@ -371,7 +371,8 @@ class MinePageDatasModel{ | @@ -371,7 +371,8 @@ class MinePageDatasModel{ | ||
| 371 | fetchMineUserLevelData() { | 371 | fetchMineUserLevelData() { |
| 372 | let url = HttpUrlUtils.getMineUserLevelDataUrl() | 372 | let url = HttpUrlUtils.getMineUserLevelDataUrl() |
| 373 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 373 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 374 | - return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers) | 374 | + // return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers) |
| 375 | + return HttpBizUtil.get<MineUserLevelItem>(url, headers) | ||
| 375 | }; | 376 | }; |
| 376 | 377 | ||
| 377 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { | 378 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { |
| @@ -409,7 +410,8 @@ class MinePageDatasModel{ | @@ -409,7 +410,8 @@ class MinePageDatasModel{ | ||
| 409 | fetchMineUserDetailData() { | 410 | fetchMineUserDetailData() { |
| 410 | let url = HttpUrlUtils.getMineUserDetailDataUrl() | 411 | let url = HttpUrlUtils.getMineUserDetailDataUrl() |
| 411 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 412 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 412 | - return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers) | 413 | + // return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers) |
| 414 | + return HttpBizUtil.get<MineUserDetailItem>(url, headers) | ||
| 413 | }; | 415 | }; |
| 414 | 416 | ||
| 415 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { | 417 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { |
| @@ -5,6 +5,7 @@ import HashMap from '@ohos.util.HashMap'; | @@ -5,6 +5,7 @@ import HashMap from '@ohos.util.HashMap'; | ||
| 5 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; | 5 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; |
| 6 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; | 6 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; |
| 7 | import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem'; | 7 | import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem'; |
| 8 | +import { SearchResultContentData } from '../viewmodel/SearchResultContentData'; | ||
| 8 | 9 | ||
| 9 | const TAG = "SearcherAboutDataModel" | 10 | const TAG = "SearcherAboutDataModel" |
| 10 | 11 | ||
| @@ -35,6 +36,11 @@ class SearcherAboutDataModel{ | @@ -35,6 +36,11 @@ class SearcherAboutDataModel{ | ||
| 35 | public async putSearchHistoryData(content:string){ | 36 | public async putSearchHistoryData(content:string){ |
| 36 | let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 37 | let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string |
| 37 | this.searchHistoryData = JSON.parse(history) | 38 | this.searchHistoryData = JSON.parse(history) |
| 39 | + this.searchHistoryData.forEach((element,index) => { | ||
| 40 | + if (element.searchContent == content) { | ||
| 41 | + this.searchHistoryData.splice(index,1) | ||
| 42 | + } | ||
| 43 | + }); | ||
| 38 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) | 44 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) |
| 39 | await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)); | 45 | await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)); |
| 40 | } | 46 | } |
| @@ -234,6 +240,45 @@ class SearcherAboutDataModel{ | @@ -234,6 +240,45 @@ class SearcherAboutDataModel{ | ||
| 234 | return compRes.data | 240 | return compRes.data |
| 235 | } | 241 | } |
| 236 | 242 | ||
| 243 | + /** | ||
| 244 | + * 搜索结果 展示列表 | ||
| 245 | + */ | ||
| 246 | + getSearchResultListData(pageSize:string,pageNum:string,searchType:string,keyword:string,context: Context): Promise<SearchResultContentData> { | ||
| 247 | + return new Promise<SearchResultContentData>((success, error) => { | ||
| 248 | + Logger.info(TAG, `getSearchResultListData start`); | ||
| 249 | + this.fetchSearchResultListData(pageSize,pageNum,searchType,keyword).then((navResDTO: ResponseDTO<SearchResultContentData>) => { | ||
| 250 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 251 | + success(this.getSearchResultListDataLocal(context)) | ||
| 252 | + return | ||
| 253 | + } | ||
| 254 | + Logger.info(TAG, "getSearchResultListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 255 | + let navigationBean = navResDTO.data as SearchResultContentData | ||
| 256 | + success(navigationBean); | ||
| 257 | + }).catch((err: Error) => { | ||
| 258 | + Logger.error(TAG, `getSearchResultListData catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 259 | + success(this.getSearchResultListDataLocal(context)) | ||
| 260 | + }) | ||
| 261 | + }) | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + fetchSearchResultListData(pageSize:string,pageNum:string,searchType:string,keyword:string) { | ||
| 265 | + let url = HttpUrlUtils.getSearchResultListDataUrl() + `?pageSize=${pageSize}&pageNum=${pageNum}&searchType=${searchType}&keyword=${keyword}` | ||
| 266 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 267 | + return WDHttp.get<ResponseDTO<SearchResultContentData>>(url, headers) | ||
| 268 | + }; | ||
| 269 | + | ||
| 270 | + async getSearchResultListDataLocal(context: Context): Promise<SearchResultContentData> { | ||
| 271 | + Logger.info(TAG, `getSearchResultListDataLocal start`); | ||
| 272 | + let compRes: ResponseDTO<SearchResultContentData> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<SearchResultContentData>>(context,'search_result_list_data.json' ); | ||
| 273 | + if (!compRes || !compRes.data) { | ||
| 274 | + Logger.info(TAG, `getSearchResultListDataLocal compRes is empty`); | ||
| 275 | + return new SearchResultContentData() | ||
| 276 | + } | ||
| 277 | + Logger.info(TAG, `getSearchResultListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 278 | + return compRes.data | ||
| 279 | + } | ||
| 280 | + | ||
| 281 | + | ||
| 237 | } | 282 | } |
| 238 | 283 | ||
| 239 | const searcherAboutDataModel = SearcherAboutDataModel.getInstance() | 284 | const searcherAboutDataModel = SearcherAboutDataModel.getInstance() |
| @@ -2,6 +2,7 @@ import router from '@ohos.router' | @@ -2,6 +2,7 @@ import router from '@ohos.router' | ||
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | import { StringUtils } from 'wdKit'; | 3 | import { StringUtils } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | +import { CardParser } from '../components/CardParser'; | ||
| 5 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; | 6 | import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; |
| 6 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 7 | 8 | ||
| @@ -182,21 +183,46 @@ struct MineHomePage { | @@ -182,21 +183,46 @@ struct MineHomePage { | ||
| 182 | 183 | ||
| 183 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 184 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 184 | 185 | ||
| 185 | - //tab 页面 | ||
| 186 | - Tabs({controller: this.controller}) { | ||
| 187 | - TabContent() { | ||
| 188 | - HomePageBottomComponent({style:0}) | ||
| 189 | - }.tabBar(this.TabBuilder(0,"评论")) | ||
| 190 | - TabContent() { | ||
| 191 | - HomePageBottomComponent({style:1}) | ||
| 192 | - }.tabBar(this.TabBuilder(1,"关注")) | 186 | + Column(){ |
| 187 | + Column() { | ||
| 188 | + // 页签 | ||
| 189 | + Row({ space: 7 }) { | ||
| 190 | + Scroll() { | ||
| 191 | + Row() { | ||
| 192 | + this.TabBuilder(0,"评论") | ||
| 193 | + this.TabBuilder(1,"关注") | ||
| 194 | + } | ||
| 195 | + .justifyContent(FlexAlign.Start) | ||
| 196 | + } | ||
| 197 | + .align(Alignment.Start) | ||
| 198 | + .scrollable(ScrollDirection.Horizontal) | ||
| 199 | + .scrollBar(BarState.Off) | ||
| 200 | + .width('90%') | ||
| 201 | + .padding({left:'31lpx'}) | ||
| 202 | + } | ||
| 203 | + .alignItems(VerticalAlign.Bottom) | ||
| 204 | + .width('100%') | ||
| 205 | + } | ||
| 206 | + .alignItems(HorizontalAlign.Start) | ||
| 207 | + .width('100%') | ||
| 208 | + | ||
| 209 | + //tab 页面 | ||
| 210 | + Tabs({controller: this.controller}) { | ||
| 211 | + TabContent() { | ||
| 212 | + HomePageBottomComponent({style:0}) | ||
| 213 | + } | ||
| 214 | + TabContent() { | ||
| 215 | + HomePageBottomComponent({style:1}) | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + .backgroundColor($r('app.color.white')) | ||
| 219 | + .animationDuration(0) | ||
| 220 | + .onChange((index: number) => { | ||
| 221 | + this.currentIndex = index | ||
| 222 | + }) | ||
| 223 | + .vertical(false) | ||
| 224 | + .barHeight(0) | ||
| 193 | } | 225 | } |
| 194 | - .backgroundColor($r('app.color.white')) | ||
| 195 | - .animationDuration(0) | ||
| 196 | - .onChange((index: number) => { | ||
| 197 | - this.currentIndex = index | ||
| 198 | - }) | ||
| 199 | - .vertical(false) | ||
| 200 | }.width("100%") | 226 | }.width("100%") |
| 201 | } | 227 | } |
| 202 | .edgeEffect(EdgeEffect.None) | 228 | .edgeEffect(EdgeEffect.None) |
| @@ -206,8 +232,8 @@ struct MineHomePage { | @@ -206,8 +232,8 @@ struct MineHomePage { | ||
| 206 | } | 232 | } |
| 207 | }.width('100%') | 233 | }.width('100%') |
| 208 | .layoutWeight(1) | 234 | .layoutWeight(1) |
| 209 | - | ||
| 210 | } | 235 | } |
| 236 | + | ||
| 211 | @Builder MineHomeTitleTransparent() { | 237 | @Builder MineHomeTitleTransparent() { |
| 212 | RelativeContainer() { | 238 | RelativeContainer() { |
| 213 | //标题栏目 | 239 | //标题栏目 |
| @@ -342,9 +368,9 @@ struct MineHomePage { | @@ -342,9 +368,9 @@ struct MineHomePage { | ||
| 342 | this.currentIndex = index | 368 | this.currentIndex = index |
| 343 | this.controller.changeIndex(this.currentIndex) | 369 | this.controller.changeIndex(this.currentIndex) |
| 344 | }) | 370 | }) |
| 345 | - .height('100%') | ||
| 346 | - .width('100%') | ||
| 347 | - .margin({right:'9lpx'}) | 371 | + .height('77lpx') |
| 372 | + .width('70lpx') | ||
| 373 | + .margin({right:'29lpx'}) | ||
| 348 | } | 374 | } |
| 349 | 375 | ||
| 350 | /** | 376 | /** |
| @@ -172,24 +172,51 @@ struct OtherNormalUserHomePage { | @@ -172,24 +172,51 @@ struct OtherNormalUserHomePage { | ||
| 172 | .width('100%') | 172 | .width('100%') |
| 173 | .backgroundColor($r('app.color.white')) | 173 | .backgroundColor($r('app.color.white')) |
| 174 | } | 174 | } |
| 175 | + | ||
| 175 | //间隔符 | 176 | //间隔符 |
| 176 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | 177 | Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') |
| 177 | 178 | ||
| 178 | - //tab 页面 | ||
| 179 | - Tabs({controller: this.controller}) { | ||
| 180 | - TabContent() { | ||
| 181 | - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 182 | - }.tabBar(this.TabBuilder(0,"评论")) | ||
| 183 | - TabContent() { | ||
| 184 | - OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 185 | - }.tabBar(this.TabBuilder(1,"关注")) | 179 | + Column(){ |
| 180 | + Column() { | ||
| 181 | + // 页签 | ||
| 182 | + Row({ space: 7 }) { | ||
| 183 | + Scroll() { | ||
| 184 | + Row() { | ||
| 185 | + this.TabBuilder(0,"评论") | ||
| 186 | + this.TabBuilder(1,"关注") | ||
| 187 | + } | ||
| 188 | + .justifyContent(FlexAlign.Start) | ||
| 189 | + } | ||
| 190 | + .align(Alignment.Start) | ||
| 191 | + .scrollable(ScrollDirection.Horizontal) | ||
| 192 | + .scrollBar(BarState.Off) | ||
| 193 | + .width('90%') | ||
| 194 | + .padding({left:'31lpx'}) | ||
| 195 | + } | ||
| 196 | + .alignItems(VerticalAlign.Bottom) | ||
| 197 | + .width('100%') | ||
| 198 | + } | ||
| 199 | + .backgroundColor($r('app.color.white')) | ||
| 200 | + .alignItems(HorizontalAlign.Start) | ||
| 201 | + .width('100%') | ||
| 202 | + | ||
| 203 | + //tab 页面 | ||
| 204 | + Tabs({controller: this.controller}) { | ||
| 205 | + TabContent() { | ||
| 206 | + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) | ||
| 207 | + } | ||
| 208 | + TabContent() { | ||
| 209 | + OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | + .backgroundColor($r('app.color.white')) | ||
| 213 | + .animationDuration(0) | ||
| 214 | + .onChange((index: number) => { | ||
| 215 | + this.currentIndex = index | ||
| 216 | + }) | ||
| 217 | + .vertical(false) | ||
| 218 | + .barHeight(0) | ||
| 186 | } | 219 | } |
| 187 | - .backgroundColor($r('app.color.white')) | ||
| 188 | - .animationDuration(0) | ||
| 189 | - .onChange((index: number) => { | ||
| 190 | - this.currentIndex = index | ||
| 191 | - }) | ||
| 192 | - .vertical(false) | ||
| 193 | }.width("100%") | 220 | }.width("100%") |
| 194 | } | 221 | } |
| 195 | .edgeEffect(EdgeEffect.None) | 222 | .edgeEffect(EdgeEffect.None) |
| @@ -300,9 +327,9 @@ struct OtherNormalUserHomePage { | @@ -300,9 +327,9 @@ struct OtherNormalUserHomePage { | ||
| 300 | this.currentIndex = index | 327 | this.currentIndex = index |
| 301 | this.controller.changeIndex(this.currentIndex) | 328 | this.controller.changeIndex(this.currentIndex) |
| 302 | }) | 329 | }) |
| 303 | - .height('100%') | ||
| 304 | - .width('100%') | ||
| 305 | - .margin({right:'9lpx'}) | 330 | + .height('77lpx') |
| 331 | + .width('70lpx') | ||
| 332 | + .margin({right:'29lpx'}) | ||
| 306 | } | 333 | } |
| 307 | 334 | ||
| 308 | 335 |
| @@ -6,6 +6,7 @@ import { | @@ -6,6 +6,7 @@ import { | ||
| 6 | CompInfoBean, | 6 | CompInfoBean, |
| 7 | ContentDetailDTO, | 7 | ContentDetailDTO, |
| 8 | ContentDTO, | 8 | ContentDTO, |
| 9 | + contentListParams, | ||
| 9 | InteractDataDTO, | 10 | InteractDataDTO, |
| 10 | LiveReviewDTO, | 11 | LiveReviewDTO, |
| 11 | MorningEveningPaperDTO, | 12 | MorningEveningPaperDTO, |
| @@ -14,11 +15,10 @@ import { | @@ -14,11 +15,10 @@ import { | ||
| 14 | NewspaperTimeInfoBean, | 15 | NewspaperTimeInfoBean, |
| 15 | PageDTO, | 16 | PageDTO, |
| 16 | PageInfoBean, | 17 | PageInfoBean, |
| 18 | + PageInfoDTO, | ||
| 17 | postBatchAttentionStatusParams, | 19 | postBatchAttentionStatusParams, |
| 18 | postBatchAttentionStatusResult, | 20 | postBatchAttentionStatusResult, |
| 19 | postExecuteCollectRecordParams, | 21 | postExecuteCollectRecordParams, |
| 20 | - contentListParams, | ||
| 21 | - PageInfoDTO, | ||
| 22 | postExecuteLikeParams, | 22 | postExecuteLikeParams, |
| 23 | postInteractAccentionOperateParams, | 23 | postInteractAccentionOperateParams, |
| 24 | postRecommendListParams | 24 | postRecommendListParams |
| @@ -48,10 +48,10 @@ export class PageRepository { | @@ -48,10 +48,10 @@ export class PageRepository { | ||
| 48 | 48 | ||
| 49 | static getCompInfoUrl(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { | 49 | static getCompInfoUrl(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { |
| 50 | let url = HttpUrlUtils.getHost(); | 50 | let url = HttpUrlUtils.getHost(); |
| 51 | - if(1 == groupStrategy){ | 51 | + if (1 == groupStrategy) { |
| 52 | //推荐 | 52 | //推荐 |
| 53 | url = url + HttpUrlUtils.COMP_REC_PATH; | 53 | url = url + HttpUrlUtils.COMP_REC_PATH; |
| 54 | - }else{ | 54 | + } else { |
| 55 | //非推荐 | 55 | //非推荐 |
| 56 | url = url + HttpUrlUtils.COMP_PATH; | 56 | url = url + HttpUrlUtils.COMP_PATH; |
| 57 | } | 57 | } |
| @@ -194,8 +194,14 @@ export class PageRepository { | @@ -194,8 +194,14 @@ export class PageRepository { | ||
| 194 | return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers) | 194 | return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers) |
| 195 | }; | 195 | }; |
| 196 | 196 | ||
| 197 | - static fetchCompData(pageId: string, groupId: string, channelId: string,groupStrategy:number, currentPage: number, pageSize: number) { | ||
| 198 | - let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId,groupStrategy, currentPage, pageSize) | 197 | + static fetchLivePageData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { |
| 198 | + let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 199 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 200 | + return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) | ||
| 201 | + }; | ||
| 202 | + | ||
| 203 | + static fetchCompData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) { | ||
| 204 | + let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 199 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 205 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 200 | return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) | 206 | return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) |
| 201 | }; | 207 | }; |
| @@ -42,19 +42,71 @@ export class ProcessUtils { | @@ -42,19 +42,71 @@ export class ProcessUtils { | ||
| 42 | // 图文详情,跳转h5 | 42 | // 图文详情,跳转h5 |
| 43 | ProcessUtils.gotoWeb(content); | 43 | ProcessUtils.gotoWeb(content); |
| 44 | break; | 44 | break; |
| 45 | + //图集详情页 | ||
| 46 | + case ContentConstants.TYPE_NINE: | ||
| 47 | + ProcessUtils.gotoAtlasDetailPage(content); | ||
| 48 | + break; | ||
| 45 | case ContentConstants.TYPE_SPECIAL_TOPIC: | 49 | case ContentConstants.TYPE_SPECIAL_TOPIC: |
| 46 | // 专题详情,跳转h5 | 50 | // 专题详情,跳转h5 |
| 47 | ProcessUtils.gotoSpecialTopic(content); | 51 | ProcessUtils.gotoSpecialTopic(content); |
| 48 | break; | 52 | break; |
| 53 | + //动态详情页(动态图文) | ||
| 54 | + case ContentConstants.TYPE_FOURTEEN: | ||
| 55 | + //动态详情页(动态视频) | ||
| 56 | + case ContentConstants.TYPE_FIFTEEN: | ||
| 57 | + ProcessUtils.gotoDynamicDetailPage(content); | ||
| 58 | + break; | ||
| 49 | default: | 59 | default: |
| 50 | break; | 60 | break; |
| 51 | } | 61 | } |
| 52 | } | 62 | } |
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 动态详情页(动态视频/动态图片) | ||
| 66 | + * @param content | ||
| 67 | + * */ | ||
| 68 | + private static gotoDynamicDetailPage(content: ContentDTO) { | ||
| 69 | + let taskAction: Action = { | ||
| 70 | + type: 'JUMP_DETAIL_PAGE', | ||
| 71 | + params: { | ||
| 72 | + detailPageType: 14, | ||
| 73 | + contentID: content?.objectId, | ||
| 74 | + extra:{ | ||
| 75 | + relType: content?.relType, | ||
| 76 | + relId: content?.relId, | ||
| 77 | + } as ExtraDTO | ||
| 78 | + } as Params, | ||
| 79 | + }; | ||
| 80 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 81 | + Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 图集详情页 | ||
| 86 | + * @param content | ||
| 87 | + * */ | ||
| 88 | + private static gotoAtlasDetailPage(content: ContentDTO) { | ||
| 89 | + let taskAction: Action = { | ||
| 90 | + type: 'JUMP_DETAIL_PAGE', | ||
| 91 | + params: { | ||
| 92 | + detailPageType: 17, | ||
| 93 | + contentID: content?.objectId, | ||
| 94 | + extra:{ | ||
| 95 | + relType: content?.relType, | ||
| 96 | + relId: content?.relId, | ||
| 97 | + } as ExtraDTO | ||
| 98 | + } as Params, | ||
| 99 | + }; | ||
| 100 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 101 | + Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); | ||
| 102 | + } | ||
| 103 | + | ||
| 53 | private static gotoSpecialTopic(content: ContentDTO) { | 104 | private static gotoSpecialTopic(content: ContentDTO) { |
| 54 | let taskAction: Action = { | 105 | let taskAction: Action = { |
| 55 | - type: 'JUMP_H5_BY_WEB_VIEW', | 106 | + type: 'JUMP_INNER_NEW_PAGE', |
| 56 | params: { | 107 | params: { |
| 57 | - url: content.linkUrl | 108 | + url: content.linkUrl, |
| 109 | + pageID: 'SPACIAL_TOPIC_PAGE', | ||
| 58 | } as Params, | 110 | } as Params, |
| 59 | }; | 111 | }; |
| 60 | WDRouterRule.jumpWithAction(taskAction) | 112 | WDRouterRule.jumpWithAction(taskAction) |
| 1 | +import { Logger } from 'wdKit'; | ||
| 2 | +import { WDPlayerController } from 'wdPlayer'; | ||
| 3 | + | ||
| 4 | +const TAG = 'AudioSuspensionModel' | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 音频悬浮窗公共方法类 | ||
| 8 | + */ | ||
| 9 | +export class AudioSuspensionModel { | ||
| 10 | + public playerController: SubscribedAbstractProperty<WDPlayerController> = AppStorage.link<WDPlayerController>('playerController') | ||
| 11 | + public simpleAudioDialog: CustomDialogController = {} as CustomDialogController | ||
| 12 | + constructor(simpleAudioDialog: CustomDialogController) { | ||
| 13 | + this.simpleAudioDialog = simpleAudioDialog | ||
| 14 | + | ||
| 15 | + this.initPlayerController() | ||
| 16 | + } | ||
| 17 | + /** | ||
| 18 | + * 判断音频实例是否已存在,不存在则创建 | ||
| 19 | + */ | ||
| 20 | + private initPlayerController() { | ||
| 21 | + if(this.playerController === undefined) { | ||
| 22 | + Logger.info(TAG, 'playerController undefined') | ||
| 23 | + AppStorage.setOrCreate('playerController', new WDPlayerController()); | ||
| 24 | + this.playerController = AppStorage.link<WDPlayerController>('playerController') | ||
| 25 | + Logger.info(TAG, 'playerController create success') | ||
| 26 | + } else { | ||
| 27 | + Logger.info(TAG, 'playerController already exit') | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + /** | ||
| 31 | + * 配置音频地址 | ||
| 32 | + */ | ||
| 33 | + public setPlayerUrl() { | ||
| 34 | + // this.playerController.switchPlayOrPause() | ||
| 35 | + Logger.info(TAG, 'handlePlayer') | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public delete() { | ||
| 39 | + let res: boolean = AppStorage.delete('PropB'); | ||
| 40 | + Logger.info(TAG, `delete: ${res}`) | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +} |
| @@ -11,22 +11,26 @@ export class LogoutViewModel{ | @@ -11,22 +11,26 @@ export class LogoutViewModel{ | ||
| 11 | requestLogout(){ | 11 | requestLogout(){ |
| 12 | return new Promise<string>((success, fail) => { | 12 | return new Promise<string>((success, fail) => { |
| 13 | this.logout.requestLogout().then((data) => { | 13 | this.logout.requestLogout().then((data) => { |
| 14 | - SPHelper.default.save(SpConstants.USER_FIRST_MARK, '') | ||
| 15 | - SPHelper.default.save(SpConstants.USER_ID, '') | ||
| 16 | - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '') | ||
| 17 | - SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '') | ||
| 18 | - SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '') | ||
| 19 | - SPHelper.default.save(SpConstants.USER_STATUS, '') | ||
| 20 | - SPHelper.default.save(SpConstants.USER_Type, '') | ||
| 21 | - SPHelper.default.save(SpConstants.USER_NAME, '') | ||
| 22 | - SPHelper.default.save(SpConstants.USER_PHONE, '') | ||
| 23 | - HttpUrlUtils.setUserId("") | ||
| 24 | - HttpUrlUtils.setUserType("") | ||
| 25 | - HttpUrlUtils.setUserToken('') | 14 | + LogoutViewModel.clearLoginInfo() |
| 26 | success(data) | 15 | success(data) |
| 27 | }).catch((message: string) => { | 16 | }).catch((message: string) => { |
| 28 | fail(message) | 17 | fail(message) |
| 29 | }) | 18 | }) |
| 30 | }) | 19 | }) |
| 31 | } | 20 | } |
| 21 | + | ||
| 22 | + static clearLoginInfo() { | ||
| 23 | + SPHelper.default.save(SpConstants.USER_FIRST_MARK, '') | ||
| 24 | + SPHelper.default.save(SpConstants.USER_ID, '') | ||
| 25 | + SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '') | ||
| 26 | + SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '') | ||
| 27 | + SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '') | ||
| 28 | + SPHelper.default.save(SpConstants.USER_STATUS, '') | ||
| 29 | + SPHelper.default.save(SpConstants.USER_Type, '') | ||
| 30 | + SPHelper.default.save(SpConstants.USER_NAME, '') | ||
| 31 | + SPHelper.default.save(SpConstants.USER_PHONE, '') | ||
| 32 | + HttpUrlUtils.setUserId("") | ||
| 33 | + HttpUrlUtils.setUserType("") | ||
| 34 | + HttpUrlUtils.setUserToken('') | ||
| 35 | + } | ||
| 32 | } | 36 | } |
| @@ -7,11 +7,9 @@ import { | @@ -7,11 +7,9 @@ import { | ||
| 7 | MorningEveningPaperDTO, | 7 | MorningEveningPaperDTO, |
| 8 | NavigationBodyDTO, | 8 | NavigationBodyDTO, |
| 9 | PageDTO, | 9 | PageDTO, |
| 10 | - PageInfoBean, | ||
| 11 | - PageInfoDTO | 10 | + PageInfoBean |
| 12 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 13 | 12 | ||
| 14 | - | ||
| 15 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; | 13 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; |
| 16 | import { ResponseDTO, } from 'wdNetwork'; | 14 | import { ResponseDTO, } from 'wdNetwork'; |
| 17 | import { PageRepository } from '../repository/PageRepository'; | 15 | import { PageRepository } from '../repository/PageRepository'; |
| @@ -145,7 +143,36 @@ export class PageViewModel extends BaseViewModel { | @@ -145,7 +143,36 @@ export class PageViewModel extends BaseViewModel { | ||
| 145 | 143 | ||
| 146 | async getPageData(pageModel: PageModel, context?: Context): Promise<PageDTO> { | 144 | async getPageData(pageModel: PageModel, context?: Context): Promise<PageDTO> { |
| 147 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); | 145 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); |
| 148 | - return this.parseComp(PageRepository.fetchCompData(pageModel.pageId, pageModel.groupId, pageModel.channelId, pageModel.isRecGroup==true?1:0,pageModel.currentPage, pageModel.pageSize)) | 146 | + return this.parseComp(PageRepository.fetchCompData(pageModel.pageId, pageModel.groupId, pageModel.channelId, pageModel.isRecGroup == true ? 1 : 0, pageModel.currentPage, pageModel.pageSize)) |
| 147 | + } | ||
| 148 | + | ||
| 149 | + async getLivePageData(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number | ||
| 150 | + , pageSize: number, context: Context): Promise<PageDTO> { | ||
| 151 | + Logger.debug(TAG, 'getPageData pageId: ' + pageId); | ||
| 152 | + if (mock_switch) { | ||
| 153 | + return this.getPageData1(currentPage, context); | ||
| 154 | + } | ||
| 155 | + return new Promise<PageDTO>((success, error) => { | ||
| 156 | + PageRepository.fetchLivePageData(pageId, groupId, channelId, groupStrategy, currentPage, pageSize) | ||
| 157 | + .then((resDTO: ResponseDTO<PageDTO>) => { | ||
| 158 | + if (!resDTO || !resDTO.data) { | ||
| 159 | + Logger.error(TAG, 'getNavData then resDTO is empty'); | ||
| 160 | + error('resDTO is empty'); | ||
| 161 | + return | ||
| 162 | + } | ||
| 163 | + if (resDTO.code != 0) { | ||
| 164 | + Logger.error(TAG, `getNavData then code:${resDTO.code}, message:${resDTO.message}`); | ||
| 165 | + error('resDTO Response Code is failure'); | ||
| 166 | + return | ||
| 167 | + } | ||
| 168 | + Logger.info(TAG, "getNavData then,resDTO.timestamp:" + resDTO.timestamp); | ||
| 169 | + success(resDTO.data); | ||
| 170 | + }) | ||
| 171 | + .catch((err: Error) => { | ||
| 172 | + Logger.error(TAG, `getPageData catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 173 | + error(err); | ||
| 174 | + }) | ||
| 175 | + }) | ||
| 149 | } | 176 | } |
| 150 | 177 | ||
| 151 | private parseComp(getData: Promise<ResponseDTO<PageDTO>>): Promise<PageDTO> { | 178 | private parseComp(getData: Promise<ResponseDTO<PageDTO>>): Promise<PageDTO> { |
| 1 | + | ||
| 2 | +export class SearchResultContentItem{ | ||
| 3 | + data:SearchDescription = new SearchDescription() | ||
| 4 | + resultType:string = "" | ||
| 5 | +} | ||
| 6 | + | ||
| 7 | +class SearchDescription{ | ||
| 8 | + likeEnable: string = "" | ||
| 9 | + previewUri: string = "" | ||
| 10 | + firstFrameImageBucket: string = "" | ||
| 11 | + appImg: string = "" | ||
| 12 | + onlineStatus: string = "" | ||
| 13 | + createUserName: string = "" | ||
| 14 | + contentCheck: string = "" | ||
| 15 | + type: string = "" | ||
| 16 | + titleOsst: string = "" | ||
| 17 | + coverHImageBucket: string = "" | ||
| 18 | + shareImageUri: string = "" | ||
| 19 | + searchTypeInt: string = "" | ||
| 20 | + authIcon: string = "" | ||
| 21 | + id: string = "" | ||
| 22 | + newOld: string = "" | ||
| 23 | + seoTags: string = "" | ||
| 24 | + publishTime: string = "" | ||
| 25 | + feedControl: string = "" | ||
| 26 | + saveType: string = "" | ||
| 27 | + userTypeInt: string = "" | ||
| 28 | + userOrigin: string = "" | ||
| 29 | + creatorType: string = "" | ||
| 30 | + planStartTime: string = "" | ||
| 31 | + waresSwitch: string = "" | ||
| 32 | + introductionLiteral: string = "" | ||
| 33 | + topicType: string = "" | ||
| 34 | + hotFlag: string = "" | ||
| 35 | + coverUrl: string = "" | ||
| 36 | + itemId: string = "" | ||
| 37 | + titleEn: string = "" | ||
| 38 | + matrixId: string = "" | ||
| 39 | + tplId: string = "" | ||
| 40 | + joinActivity: string = "" | ||
| 41 | + status: string = "" | ||
| 42 | + headerPhotoUrl: string = "" | ||
| 43 | + zhSearch: string = "" | ||
| 44 | + activityControl: string = "" | ||
| 45 | + city: string = "" | ||
| 46 | + showTitleIng: string = "" | ||
| 47 | + shareFlag: string = "" | ||
| 48 | + creatorName: string = "" | ||
| 49 | + className: string = "" | ||
| 50 | + showTitleNo: string = "" | ||
| 51 | + liveSwitch: string = "" | ||
| 52 | + likesStyle: string = "" | ||
| 53 | + dataKey: string = "" | ||
| 54 | + search: string = "" | ||
| 55 | + puserId: string = "" | ||
| 56 | + top: string = "" | ||
| 57 | + titleLiteral: string = "" | ||
| 58 | + countryCode: string = "" | ||
| 59 | + startTime: string = "" | ||
| 60 | + shareDescription: string = "" | ||
| 61 | + channelId: string = "" | ||
| 62 | + openComment: string = "" | ||
| 63 | + creatorClassify: string = "" | ||
| 64 | + previewBucket: string = "" | ||
| 65 | + picCount: string = "" | ||
| 66 | + recommendControl: string = "" | ||
| 67 | + creatorNameLiteral: string = "" | ||
| 68 | + subjects: string = "" | ||
| 69 | + updateUser: string = "" | ||
| 70 | + i: string = "" | ||
| 71 | + updateTime: string = "" | ||
| 72 | + userId: string = "" | ||
| 73 | + showTitleEd: string = "" | ||
| 74 | + authTo: string = "" | ||
| 75 | + rmhPlatformInt: string = "" | ||
| 76 | + giftEnable: string = "" | ||
| 77 | + titleEnosst: string = "" | ||
| 78 | + shareCoverUrl: string = "" | ||
| 79 | + deleted: string = "" | ||
| 80 | + zhOperateFlag: string = "" | ||
| 81 | + shareTitle: string = "" | ||
| 82 | + scrollUpdated: string = "" | ||
| 83 | + createTime: string = "" | ||
| 84 | + creatorBan: string = "" | ||
| 85 | + publishTimeInt: string = "" | ||
| 86 | + organization: string = "" | ||
| 87 | + channelName: string = "" | ||
| 88 | + createUser: string = "" | ||
| 89 | + currentPoliticsFlag: string = "" | ||
| 90 | + endTime: string = "" | ||
| 91 | + sourceId: string = "" | ||
| 92 | + country: string = "" | ||
| 93 | + secondClassify: string = "" | ||
| 94 | + createUserId: string = "" | ||
| 95 | + firstFrameImageUri: string = "" | ||
| 96 | + pubTime: string = "" | ||
| 97 | + openLikes: string = "" | ||
| 98 | + contentText: string = "" | ||
| 99 | + relType: string = "" | ||
| 100 | + authImg: string = "" | ||
| 101 | + roomId: string = "" | ||
| 102 | + nameLiteral: string = "" | ||
| 103 | + mainControl: string = "" | ||
| 104 | + coverVImageBucket: string = "" | ||
| 105 | + linkUrl: string = "" | ||
| 106 | + openDownload: string = "" | ||
| 107 | + zhChannelPageImg: string = "" | ||
| 108 | + appStandImg: string = "" | ||
| 109 | + shareSummary: string = "" | ||
| 110 | + firstPublishTimeInt: string = "" | ||
| 111 | + rmhPlatform: string = "" | ||
| 112 | + creatorNameOsst: string = "" | ||
| 113 | + searchType: string = "" | ||
| 114 | + author: string = "" | ||
| 115 | + askAnswerFlag: string = "" | ||
| 116 | + seoTagName: string = "" | ||
| 117 | + weight: string = "" | ||
| 118 | + pageId: string = "" | ||
| 119 | + firstPublishTime: string = "" | ||
| 120 | + coverVImageUri: string = "" | ||
| 121 | + publishType: string = "" | ||
| 122 | + isVr: string = "" | ||
| 123 | + name: string = "" | ||
| 124 | + shareUrl: string = "" | ||
| 125 | + userType: string = "" | ||
| 126 | + firstProcessTime: string = "" | ||
| 127 | + hasRecord: string = "" | ||
| 128 | + shareTitleOsst: string = "" | ||
| 129 | + classify: string = "" | ||
| 130 | + itemType: string = "" | ||
| 131 | + nameOsst: string = "" | ||
| 132 | + districtCode: string = "" | ||
| 133 | + hidden: string = "" | ||
| 134 | + cityCode: string = "" | ||
| 135 | + liveType: string = "" | ||
| 136 | + appStyleImages: string = "" | ||
| 137 | + titleShow: string = "" | ||
| 138 | + cornerMark: string = "" | ||
| 139 | + creatorId: string = "" | ||
| 140 | + levelScore: string = "" | ||
| 141 | + description: string = "" | ||
| 142 | + liveStartTime: string = "" | ||
| 143 | + likeStyle: string = "" | ||
| 144 | + title: string = "" | ||
| 145 | + content: string = "" | ||
| 146 | + platform: string = "" | ||
| 147 | + duration: string = "0" | ||
| 148 | + shareDescriptionLiteral: string = "" | ||
| 149 | + createTimeInt: string = "" | ||
| 150 | + liveEndTime: string = "" | ||
| 151 | + topicTemplate: string = "" | ||
| 152 | + barrageEnable: string = "" | ||
| 153 | + introduction: string = "" | ||
| 154 | + notice: string = "" | ||
| 155 | + shareTitleLiteral: string = "" | ||
| 156 | + coverHImageUri: string = "" | ||
| 157 | + relId: string = "" | ||
| 158 | + classCode: string = "" | ||
| 159 | + grayScale: string = "" | ||
| 160 | + appStyle: number = -1 | ||
| 161 | + authTitle: string = "" | ||
| 162 | + provinceCode: string = "" | ||
| 163 | + tenancy: string = "" | ||
| 164 | + platformId: string = "" | ||
| 165 | + classSubName: string = "" | ||
| 166 | + recommended: string = "" | ||
| 167 | + descriptionLiteral: string = "" | ||
| 168 | + banControl: string = "" | ||
| 169 | + auditingStatus: string = "" | ||
| 170 | + planEndTime: string = "" | ||
| 171 | + speakControl: string = "" | ||
| 172 | + sourceName: string = "" | ||
| 173 | + shareImageBucket: string = "" | ||
| 174 | + landscape: string = "" | ||
| 175 | + | ||
| 176 | + | ||
| 177 | +} |
sight_harmony/features/wdComponent/src/main/resources/base/media/WDBestCommentTitleDotIcon.png
0 → 100644
861 Bytes
2.45 KB
2.95 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/WDInput_keyboardImage.png
0 → 100644
776 Bytes
1.26 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/WDInput_selectImageDelete.png
0 → 100644
1.42 KB
2.8 KB
1.02 KB
244 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/comment_hyphen_block.png
0 → 100644
242 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/comment_icon_pinglun.png
0 → 100644
863 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/comment_icon_zhiding.png
0 → 100644
2.7 KB
181 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/comment_img_input_hui.png
0 → 100644
1.75 KB
1.54 KB
1.66 KB
1.14 KB
453 Bytes
354 Bytes
333 Bytes
2.01 KB
373 Bytes
2.82 KB
1.58 KB
| @@ -37,19 +37,15 @@ export struct DetailPlayShortVideoPage { | @@ -37,19 +37,15 @@ export struct DetailPlayShortVideoPage { | ||
| 37 | if (this.currentIndex != this.index) { | 37 | if (this.currentIndex != this.index) { |
| 38 | this.playerController.pause() | 38 | this.playerController.pause() |
| 39 | 39 | ||
| 40 | - if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) { | 40 | + if (this.index < this.currentIndex - 3 && this.playerController.getPlayer()) { |
| 41 | this.playerController.release() | 41 | this.playerController.release() |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | } else { | 44 | } else { |
| 45 | this.queryNewsInfoOfUser() | 45 | this.queryNewsInfoOfUser() |
| 46 | - console.log('currentIndex==== ', this.currentIndex) | ||
| 47 | if (!this.playerController.getPlayer()) { | 46 | if (!this.playerController.getPlayer()) { |
| 48 | - console.error('state91111111===', this.contentDetailData?.videoInfo[0]?.videoUrl || '') | ||
| 49 | this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || ''); | 47 | this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || ''); |
| 50 | - console.error('state91111111===', this.playerController?.getPlayer()?.state) | ||
| 51 | } else { | 48 | } else { |
| 52 | - console.error('state9===', this.playerController?.getPlayer()?.state) | ||
| 53 | this.playerController.play() | 49 | this.playerController.play() |
| 54 | } | 50 | } |
| 55 | 51 | ||
| @@ -135,6 +131,7 @@ export struct DetailPlayShortVideoPage { | @@ -135,6 +131,7 @@ export struct DetailPlayShortVideoPage { | ||
| 135 | } | 131 | } |
| 136 | 132 | ||
| 137 | onPageShow() { | 133 | onPageShow() { |
| 134 | + // this.playerController?.play(); | ||
| 138 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); | 135 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); |
| 139 | } | 136 | } |
| 140 | 137 | ||
| @@ -147,7 +144,7 @@ export struct DetailPlayShortVideoPage { | @@ -147,7 +144,7 @@ export struct DetailPlayShortVideoPage { | ||
| 147 | 144 | ||
| 148 | onPageHide() { | 145 | onPageHide() { |
| 149 | // WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT); | 146 | // WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT); |
| 150 | - devicePLSensorManager.devicePLSensorOff(); | 147 | + // devicePLSensorManager.devicePLSensorOff(); |
| 151 | // this.status = PlayerConstants.STATUS_PAUSE; | 148 | // this.status = PlayerConstants.STATUS_PAUSE; |
| 152 | this.playerController?.pause(); | 149 | this.playerController?.pause(); |
| 153 | } | 150 | } |
| @@ -12,6 +12,7 @@ const storage = LocalStorage.getShared(); | @@ -12,6 +12,7 @@ const storage = LocalStorage.getShared(); | ||
| 12 | @Entry(storage) | 12 | @Entry(storage) |
| 13 | @Component | 13 | @Component |
| 14 | export struct DetailVideoListPage { | 14 | export struct DetailVideoListPage { |
| 15 | + @Provide showComment: boolean = true | ||
| 15 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 16 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 16 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 17 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 17 | private contentId: string = '' | 18 | private contentId: string = '' |
| @@ -22,14 +23,20 @@ export struct DetailVideoListPage { | @@ -22,14 +23,20 @@ export struct DetailVideoListPage { | ||
| 22 | @State testData: string[] = ['111', '222', '333'] | 23 | @State testData: string[] = ['111', '222', '333'] |
| 23 | @State currentIndex: number = 0 | 24 | @State currentIndex: number = 0 |
| 24 | @State interactDataList: InteractDataDTO[] = [] | 25 | @State interactDataList: InteractDataDTO[] = [] |
| 26 | + @State isFullScreen: boolean = false | ||
| 25 | 27 | ||
| 26 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 27 | 29 | ||
| 28 | - | 30 | + /** |
| 31 | + * 开启沉浸式并设置状态栏颜色 | ||
| 32 | + */ | ||
| 29 | const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | 33 | const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage |
| 30 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | 34 | + const windowClass: window.Window = windowStage.getMainWindowSync(); |
| 31 | windowClass.setWindowLayoutFullScreen(true) | 35 | windowClass.setWindowLayoutFullScreen(true) |
| 32 | - windowClass.setWindowSystemBarProperties({ statusBarColor: '#fff' }) | 36 | + this.isFullScreen = true |
| 37 | + windowClass.setWindowSystemBarProperties({ | ||
| 38 | + statusBarContentColor: '#ffffff', | ||
| 39 | + }) | ||
| 33 | 40 | ||
| 34 | 41 | ||
| 35 | let data: ContentDetailDTO[] = [] | 42 | let data: ContentDetailDTO[] = [] |
| @@ -99,7 +106,32 @@ export struct DetailVideoListPage { | @@ -99,7 +106,32 @@ export struct DetailVideoListPage { | ||
| 99 | const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | 106 | const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage |
| 100 | const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | 107 | const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 |
| 101 | windowClass.setWindowLayoutFullScreen(false) | 108 | windowClass.setWindowLayoutFullScreen(false) |
| 102 | - windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 109 | + this.isFullScreen = false |
| 110 | + windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' }) | ||
| 111 | + | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + onPageShow(): void { | ||
| 115 | + if (!this.isFullScreen) { | ||
| 116 | + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 117 | + const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 118 | + windowClass.setWindowLayoutFullScreen(true) | ||
| 119 | + this.isFullScreen = true | ||
| 120 | + windowClass.setWindowSystemBarProperties({ | ||
| 121 | + statusBarContentColor: '#ffffff', | ||
| 122 | + }) | ||
| 123 | + | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + onPageHide(): void { | ||
| 128 | + if (this.isFullScreen) { | ||
| 129 | + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 130 | + const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 131 | + windowClass.setWindowLayoutFullScreen(false) | ||
| 132 | + this.isFullScreen = false | ||
| 133 | + windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' }) | ||
| 134 | + } | ||
| 103 | 135 | ||
| 104 | } | 136 | } |
| 105 | 137 |
| @@ -14,8 +14,8 @@ export struct VideoChannelDetail { | @@ -14,8 +14,8 @@ export struct VideoChannelDetail { | ||
| 14 | private relId: string = '' | 14 | private relId: string = '' |
| 15 | private relType: string = '' | 15 | private relType: string = '' |
| 16 | private swiperController: SwiperController = new SwiperController() | 16 | private swiperController: SwiperController = new SwiperController() |
| 17 | + @Provide showComment: boolean = false | ||
| 17 | @State data: ContentDetailDTO[] = [] | 18 | @State data: ContentDetailDTO[] = [] |
| 18 | - @State testData: string[] = ['111', '222', '333'] | ||
| 19 | @State currentIndex: number = 0 | 19 | @State currentIndex: number = 0 |
| 20 | @State interactDataList: InteractDataDTO[] = [] | 20 | @State interactDataList: InteractDataDTO[] = [] |
| 21 | 21 | ||
| @@ -93,7 +93,7 @@ export struct VideoChannelDetail { | @@ -93,7 +93,7 @@ export struct VideoChannelDetail { | ||
| 93 | if (res.data) { | 93 | if (res.data) { |
| 94 | this.data = this.data.concat(res.data) | 94 | this.data = this.data.concat(res.data) |
| 95 | } | 95 | } |
| 96 | - // console.log('queryVideoList===', JSON.stringify(this.data)) | 96 | + console.log('queryVideoList===', JSON.stringify(this.data)) |
| 97 | }) | 97 | }) |
| 98 | } | 98 | } |
| 99 | 99 |
| @@ -10,6 +10,7 @@ import { | @@ -10,6 +10,7 @@ import { | ||
| 10 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 10 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 11 | import { ToastUtils } from 'wdKit'; | 11 | import { ToastUtils } from 'wdKit'; |
| 12 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 12 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 13 | +import { WDPlayerController } from 'wdPlayer/Index'; | ||
| 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 14 | 15 | ||
| 15 | export interface OperationItem { | 16 | export interface OperationItem { |
| @@ -28,6 +29,7 @@ const TAG = 'OperationListView'; | @@ -28,6 +29,7 @@ const TAG = 'OperationListView'; | ||
| 28 | @Preview | 29 | @Preview |
| 29 | @Component | 30 | @Component |
| 30 | export struct OperationListView { | 31 | export struct OperationListView { |
| 32 | + private playerController?: WDPlayerController; | ||
| 31 | @Consume interactData: InteractDataDTO | 33 | @Consume interactData: InteractDataDTO |
| 32 | @Consume contentDetailData: ContentDetailDTO | 34 | @Consume contentDetailData: ContentDetailDTO |
| 33 | @Consume newsStatusOfUser: batchLikeAndCollectResult | 35 | @Consume newsStatusOfUser: batchLikeAndCollectResult |
| @@ -65,6 +67,7 @@ export struct OperationListView { | @@ -65,6 +67,7 @@ export struct OperationListView { | ||
| 65 | toggleLikeStatus() { | 67 | toggleLikeStatus() { |
| 66 | // 未登录,跳转登录 | 68 | // 未登录,跳转登录 |
| 67 | if (!HttpUrlUtils.getUserId()) { | 69 | if (!HttpUrlUtils.getUserId()) { |
| 70 | + this.playerController?.pause() | ||
| 68 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 71 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 69 | return | 72 | return |
| 70 | } | 73 | } |
| @@ -2,7 +2,7 @@ import router from '@ohos.router'; | @@ -2,7 +2,7 @@ import router from '@ohos.router'; | ||
| 2 | import window from '@ohos.window'; | 2 | import window from '@ohos.window'; |
| 3 | import deviceInfo from '@ohos.deviceInfo'; | 3 | import deviceInfo from '@ohos.deviceInfo'; |
| 4 | import { WindowModel } from 'wdKit'; | 4 | import { WindowModel } from 'wdKit'; |
| 5 | -import { WDPlayerController } from 'wdPlayer'; | 5 | +import { PlayerConstants, WDPlayerController } from 'wdPlayer'; |
| 6 | import { devicePLSensorManager } from 'wdDetailPlayApi'; | 6 | import { devicePLSensorManager } from 'wdDetailPlayApi'; |
| 7 | import { OperationListView } from './OperationListView'; | 7 | import { OperationListView } from './OperationListView'; |
| 8 | import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; | 8 | import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; |
| @@ -17,7 +17,9 @@ export struct PlayerTitleComment { | @@ -17,7 +17,9 @@ export struct PlayerTitleComment { | ||
| 17 | @Consume isFullScreen: boolean; | 17 | @Consume isFullScreen: boolean; |
| 18 | @Consume progressVal: number; | 18 | @Consume progressVal: number; |
| 19 | @Consume videoLandScape?: number | 19 | @Consume videoLandScape?: number |
| 20 | + @Consume showComment?: boolean | ||
| 20 | @State isOpen: boolean = false | 21 | @State isOpen: boolean = false |
| 22 | + @State status: number = PlayerConstants.STATUS_START; | ||
| 21 | dialogController: CustomDialogController = new CustomDialogController({ | 23 | dialogController: CustomDialogController = new CustomDialogController({ |
| 22 | builder: DetailDialog({ | 24 | builder: DetailDialog({ |
| 23 | name: this.getName(), | 25 | name: this.getName(), |
| @@ -32,6 +34,12 @@ export struct PlayerTitleComment { | @@ -32,6 +34,12 @@ export struct PlayerTitleComment { | ||
| 32 | }) | 34 | }) |
| 33 | 35 | ||
| 34 | aboutToAppear() { | 36 | aboutToAppear() { |
| 37 | + if (this.playerController) { | ||
| 38 | + this.playerController.onStatusChange = (status: number) => { | ||
| 39 | + this.status = status | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + } | ||
| 35 | 43 | ||
| 36 | } | 44 | } |
| 37 | 45 | ||
| @@ -54,35 +62,36 @@ export struct PlayerTitleComment { | @@ -54,35 +62,36 @@ export struct PlayerTitleComment { | ||
| 54 | build() { | 62 | build() { |
| 55 | Column() { | 63 | Column() { |
| 56 | 64 | ||
| 57 | - if (this.contentDetailData?.videoInfo[0]?.videoLandScape === 1) { | ||
| 58 | - Column() { | ||
| 59 | - Row() { | ||
| 60 | - Image($r('app.media.ic_switch_orientation')) | ||
| 61 | - .width(34) | ||
| 62 | - .aspectRatio(1) | ||
| 63 | - .objectFit(ImageFit.Contain) | ||
| 64 | - .padding({ left: 10, right: 5 }) | ||
| 65 | - Text("全屏观看") | ||
| 66 | - .fontColor(Color.White) | ||
| 67 | - .fontSize('14fp') | ||
| 68 | - .maxLines(2) | ||
| 69 | - .layoutWeight(1) | ||
| 70 | - } | ||
| 71 | - .width(100) | ||
| 72 | - .backgroundColor(Color.Gray) | ||
| 73 | - .borderRadius(10) | ||
| 74 | - .alignItems(VerticalAlign.Center) | ||
| 75 | - .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible) | ||
| 76 | - .onClick(() => { | ||
| 77 | - this.isFullScreen = !this.isFullScreen; | ||
| 78 | - WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE); | ||
| 79 | - devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE); | ||
| 80 | - }) | ||
| 81 | - } | ||
| 82 | - .width('100%') | ||
| 83 | - // .margin({ bottom: 120 }) | ||
| 84 | - .alignItems(HorizontalAlign.Center) | ||
| 85 | - } | 65 | + // if (this.contentDetailData?.videoInfo[0]?.videoLandScape === 1) { |
| 66 | + // Column() { | ||
| 67 | + // Row() { | ||
| 68 | + // Image($r('app.media.ic_switch_orientation')) | ||
| 69 | + // .width(16) | ||
| 70 | + // .aspectRatio(1) | ||
| 71 | + // .objectFit(ImageFit.Contain) | ||
| 72 | + // .padding({ left: 8, right: 4 }) | ||
| 73 | + // Text("全屏观看") | ||
| 74 | + // .fontColor(Color.White) | ||
| 75 | + // .fontSize(12) | ||
| 76 | + // .layoutWeight(1) | ||
| 77 | + // } | ||
| 78 | + // .width(84) | ||
| 79 | + // .height(28) | ||
| 80 | + // .backgroundColor('#0d0d0d') | ||
| 81 | + // .border({ width: 1, color: '#4DFFFFFF', radius: 2 }) | ||
| 82 | + // .alignItems(VerticalAlign.Center) | ||
| 83 | + // .justifyContent(FlexAlign.Center) | ||
| 84 | + // .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible) | ||
| 85 | + // .onClick(() => { | ||
| 86 | + // // this.isFullScreen = !this.isFullScreen; | ||
| 87 | + // // WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE); | ||
| 88 | + // // devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE); | ||
| 89 | + // }) | ||
| 90 | + // } | ||
| 91 | + // .width('100%') | ||
| 92 | + // .margin({ top: 452 }) | ||
| 93 | + // | ||
| 94 | + // } | ||
| 86 | 95 | ||
| 87 | 96 | ||
| 88 | Row() { | 97 | Row() { |
| @@ -103,7 +112,7 @@ export struct PlayerTitleComment { | @@ -103,7 +112,7 @@ export struct PlayerTitleComment { | ||
| 103 | } | 112 | } |
| 104 | 113 | ||
| 105 | 114 | ||
| 106 | - if (this.contentDetailData?.newsSummary) { | 115 | + if (this.contentDetailData?.newsSummary && this.showComment) { |
| 107 | Text('查看详情 > ') | 116 | Text('查看详情 > ') |
| 108 | .margin({ top: 8 }) | 117 | .margin({ top: 8 }) |
| 109 | .padding(6) | 118 | .padding(6) |
| @@ -123,7 +132,9 @@ export struct PlayerTitleComment { | @@ -123,7 +132,9 @@ export struct PlayerTitleComment { | ||
| 123 | .alignItems(HorizontalAlign.Start) | 132 | .alignItems(HorizontalAlign.Start) |
| 124 | .margin({ left: 16 }) | 133 | .margin({ left: 16 }) |
| 125 | 134 | ||
| 126 | - OperationListView() | 135 | + OperationListView({ |
| 136 | + playerController: this.playerController | ||
| 137 | + }) | ||
| 127 | .width(48) | 138 | .width(48) |
| 128 | } | 139 | } |
| 129 | .width('100%') | 140 | .width('100%') |
| @@ -134,39 +145,49 @@ export struct PlayerTitleComment { | @@ -134,39 +145,49 @@ export struct PlayerTitleComment { | ||
| 134 | Slider({ | 145 | Slider({ |
| 135 | value: this.progressVal, | 146 | value: this.progressVal, |
| 136 | step: 1, | 147 | step: 1, |
| 137 | - style: SliderStyle.OutSet | 148 | + // style: SliderStyle.OutSet |
| 138 | }) | 149 | }) |
| 139 | - .blockColor(Color.White) | ||
| 140 | - .trackColor($r('app.color.track_color')) | ||
| 141 | - .selectedColor($r('app.color.index_tab_selected_font_color')) | ||
| 142 | - .trackThickness(1) | 150 | + .blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color')) |
| 151 | + .trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : $r('app.color.pause_track_color')) | ||
| 152 | + .selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : $r('app.color.pause_selected_color')) | ||
| 153 | + .trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4) | ||
| 154 | + .blockStyle({ | ||
| 155 | + type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE, | ||
| 156 | + image: $r('app.media.ic_player_block') | ||
| 157 | + }) | ||
| 158 | + .blockSize({ width: 18, height: 12 }) | ||
| 143 | .width('100%') | 159 | .width('100%') |
| 160 | + .height(19) | ||
| 144 | .onChange((value: number, mode: SliderChangeMode) => { | 161 | .onChange((value: number, mode: SliderChangeMode) => { |
| 145 | this.playerController?.setSeekTime(value, mode); | 162 | this.playerController?.setSeekTime(value, mode); |
| 146 | }) | 163 | }) |
| 147 | 164 | ||
| 148 | - Row() { | ||
| 149 | - Image($r('app.media.ic_back')) | ||
| 150 | - .width(24) | ||
| 151 | - .height(24) | ||
| 152 | - .aspectRatio(1) | ||
| 153 | - .onClick(() => { | ||
| 154 | - router.back(); | ||
| 155 | - }) | ||
| 156 | - | ||
| 157 | - TextInput({ placeholder: '说两句...', text: this.comment }) | ||
| 158 | - .placeholderColor(Color.White) | ||
| 159 | - .placeholderFont({ size: 14 }) | ||
| 160 | - .fontColor(Color.White) | ||
| 161 | - .fontSize(14) | ||
| 162 | - .maxLines(1) | ||
| 163 | - .layoutWeight(1) | ||
| 164 | - .backgroundColor('#1a1a1a') | ||
| 165 | - .borderRadius(2) | ||
| 166 | - .margin({ left: 12 }) | 165 | + if (this.showComment) { |
| 166 | + Row() { | ||
| 167 | + Image($r('app.media.ic_back')) | ||
| 168 | + .width(24) | ||
| 169 | + .height(24) | ||
| 170 | + .aspectRatio(1) | ||
| 171 | + .onClick(() => { | ||
| 172 | + router.back(); | ||
| 173 | + }) | ||
| 174 | + | ||
| 175 | + TextInput({ placeholder: '说两句...', text: this.comment }) | ||
| 176 | + .placeholderColor(Color.White) | ||
| 177 | + .placeholderFont({ size: 14 }) | ||
| 178 | + .fontColor(Color.White) | ||
| 179 | + .fontSize(14) | ||
| 180 | + .maxLines(1) | ||
| 181 | + .layoutWeight(1) | ||
| 182 | + .backgroundColor('#1a1a1a') | ||
| 183 | + .borderRadius(2) | ||
| 184 | + .height(30) | ||
| 185 | + .margin({ left: 12 }) | ||
| 186 | + } | ||
| 187 | + .alignItems(VerticalAlign.Center) | ||
| 188 | + .padding({ left: 16, right: 16, top: 11, bottom: 11 }) | ||
| 167 | } | 189 | } |
| 168 | - .alignItems(VerticalAlign.Center) | ||
| 169 | - .padding({ left: 16, right: 16, top: 11, bottom: 11 }) | 190 | + |
| 170 | } | 191 | } |
| 171 | }.backgroundColor(Color.Black) | 192 | }.backgroundColor(Color.Black) |
| 172 | 193 |
| 1 | { | 1 | { |
| 2 | "color": [ | 2 | "color": [ |
| 3 | { | 3 | { |
| 4 | + "name": "play_block_color", | ||
| 5 | + "value": "#FFFFFF" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "name": "play_track_color", | ||
| 9 | + "value": "#1AFFFFFF" | ||
| 10 | + }, | ||
| 11 | + { | ||
| 12 | + "name": "play_selected_color", | ||
| 13 | + "value": "#4DFFFFFF" | ||
| 14 | + }, | ||
| 15 | + { | ||
| 16 | + "name": "pause_block_color", | ||
| 17 | + "value": "#FFFFFF" | ||
| 18 | + }, | ||
| 19 | + { | ||
| 20 | + "name": "pause_track_color", | ||
| 21 | + "value": "#1AFFFFFF" | ||
| 22 | + }, | ||
| 23 | + { | ||
| 24 | + "name": "pause_selected_color", | ||
| 25 | + "value": "#FFED2800" | ||
| 26 | + }, | ||
| 27 | + { | ||
| 4 | "name": "index_tab_selected_font_color", | 28 | "name": "index_tab_selected_font_color", |
| 5 | - "value": "#007DFF" | 29 | + "value": "#4DFFFFFF" |
| 6 | }, | 30 | }, |
| 7 | { | 31 | { |
| 8 | "name": "divider_color", | 32 | "name": "divider_color", |
| @@ -10,7 +34,7 @@ | @@ -10,7 +34,7 @@ | ||
| 10 | }, | 34 | }, |
| 11 | { | 35 | { |
| 12 | "name": "track_color", | 36 | "name": "track_color", |
| 13 | - "value": "#888888" | 37 | + "value": "#1AFFFFFF" |
| 14 | }, | 38 | }, |
| 15 | { | 39 | { |
| 16 | "name": "speed_text_color", | 40 | "name": "speed_text_color", |
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_player_block.png
0 → 100644
736 Bytes
| @@ -7,7 +7,9 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | @@ -7,7 +7,9 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | ||
| 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 8 | import { SettingPasswordParams } from './SettingPasswordLayout' | 8 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 9 | import { Router } from '@ohos.arkui.UIContext' | 9 | import { Router } from '@ohos.arkui.UIContext' |
| 10 | -import { ToastUtils } from 'wdKit/Index' | 10 | +import { SPHelper, ToastUtils } from 'wdKit/Index' |
| 11 | +import { SpConstants } from 'wdConstant/Index' | ||
| 12 | +import { emitter } from '@kit.BasicServicesKit' | ||
| 11 | 13 | ||
| 12 | 14 | ||
| 13 | const TAG = 'ForgetPasswordPage' | 15 | const TAG = 'ForgetPasswordPage' |
| @@ -147,7 +149,34 @@ struct ForgetPasswordPage { | @@ -147,7 +149,34 @@ struct ForgetPasswordPage { | ||
| 147 | } | 149 | } |
| 148 | this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ | 150 | this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ |
| 149 | ToastUtils.shortToast('绑定成功') | 151 | ToastUtils.shortToast('绑定成功') |
| 152 | + this.querySecurity() | ||
| 153 | + }) | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + querySecurity(){ | ||
| 157 | + this.loginViewModel.querySecurity().then(()=>{ | ||
| 158 | + SPHelper.default.save(SpConstants.USER_PHONE,this.phoneContent) | ||
| 159 | + this.sendEmitEvent() | ||
| 150 | router.back() | 160 | router.back() |
| 161 | + }).catch(()=>{ | ||
| 162 | + | ||
| 151 | }) | 163 | }) |
| 152 | } | 164 | } |
| 165 | + | ||
| 166 | + sendEmitEvent(){ | ||
| 167 | + // 定义一个eventId为1的事件,事件优先级为Low | ||
| 168 | + let event: emitter.InnerEvent = { | ||
| 169 | + eventId: 10010, | ||
| 170 | + priority: emitter.EventPriority.LOW | ||
| 171 | + }; | ||
| 172 | + | ||
| 173 | + let eventData: emitter.EventData = { | ||
| 174 | + data: { | ||
| 175 | + content: this.phoneContent, | ||
| 176 | + } | ||
| 177 | + }; | ||
| 178 | + | ||
| 179 | + // 发送eventId为1的事件,事件内容为eventData | ||
| 180 | + emitter.emit(event, eventData); | ||
| 181 | + } | ||
| 153 | } | 182 | } |
| 1 | import HashMap from '@ohos.util.HashMap'; | 1 | import HashMap from '@ohos.util.HashMap'; |
| 2 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 2 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 3 | -import { Logger, SPHelper } from 'wdKit'; | 3 | +import { Logger, SPHelper, StringUtils } from 'wdKit'; |
| 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 5 | import { LoginBean } from './LoginBean'; | 5 | import { LoginBean } from './LoginBean'; |
| 6 | import { CheckVerifyBean } from './CheckVerifyBean'; | 6 | import { CheckVerifyBean } from './CheckVerifyBean'; |
| @@ -71,11 +71,11 @@ export class LoginModel { | @@ -71,11 +71,11 @@ export class LoginModel { | ||
| 71 | return new Promise<LoginBean>((success, fail) => { | 71 | return new Promise<LoginBean>((success, fail) => { |
| 72 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { | 72 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { |
| 73 | Logger.debug("LoginViewModel:success2 ", data.message) | 73 | Logger.debug("LoginViewModel:success2 ", data.message) |
| 74 | - if (!data || !data.data) { | 74 | + if (!data) { |
| 75 | fail("数据为空") | 75 | fail("数据为空") |
| 76 | return | 76 | return |
| 77 | } | 77 | } |
| 78 | - if (data.code != 0) { | 78 | + if (!data.data||data.code != 0) { |
| 79 | fail(data.message) | 79 | fail(data.message) |
| 80 | return | 80 | return |
| 81 | } | 81 | } |
| @@ -99,11 +99,11 @@ export class LoginModel { | @@ -99,11 +99,11 @@ export class LoginModel { | ||
| 99 | return new Promise<LoginBean>((success, fail) => { | 99 | return new Promise<LoginBean>((success, fail) => { |
| 100 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { | 100 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { |
| 101 | Logger.debug("LoginViewModel:success2 ", data.message) | 101 | Logger.debug("LoginViewModel:success2 ", data.message) |
| 102 | - if (!data || !data.data) { | 102 | + if (!data) { |
| 103 | fail("数据为空") | 103 | fail("数据为空") |
| 104 | return | 104 | return |
| 105 | } | 105 | } |
| 106 | - if (data.code != 0) { | 106 | + if (!data.data||data.code != 0) { |
| 107 | fail(data.message) | 107 | fail(data.message) |
| 108 | return | 108 | return |
| 109 | } | 109 | } |
| @@ -200,20 +200,35 @@ export class LoginModel { | @@ -200,20 +200,35 @@ export class LoginModel { | ||
| 200 | bean['tempToken'] = tempToken; | 200 | bean['tempToken'] = tempToken; |
| 201 | 201 | ||
| 202 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 202 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 203 | - let JwtToken = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, '') as string; | 203 | + // let JwtToken = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, '') as string; |
| 204 | + // headers.set('JwtToken',(JwtToken)); | ||
| 205 | + // headers.set('rmrb-x-token',(JwtToken)); | ||
| 206 | + // headers.set('cookie', 'RMRB-X-TOKEN=' + JwtToken) | ||
| 207 | + | ||
| 208 | + | ||
| 209 | +// let obj: Record<string, string> = {}; | ||
| 210 | +// headers.forEach((value, key) =>{ | ||
| 211 | +// if(key != undefined && key != null && value != undefined && value != null) { | ||
| 212 | +// obj[key as string] = value; | ||
| 213 | +// } | ||
| 214 | +// }) | ||
| 215 | +// let headerString = JSON.stringify(obj); | ||
| 216 | +// let beanString = JSON.stringify(bean); | ||
| 217 | +// AlertDialog.show({ | ||
| 218 | +// message:headerString + beanString | ||
| 219 | +// }) | ||
| 204 | 220 | ||
| 205 | - headers.set('JwtToken',(JwtToken)); | ||
| 206 | - headers.set('rmrb-x-token',(JwtToken)); | ||
| 207 | return new Promise<string>((success, fail) => { | 221 | return new Promise<string>((success, fail) => { |
| 208 | HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getForgetPasswordUrl(), bean, headers).then((data: ResponseDTO<string>) => { | 222 | HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getForgetPasswordUrl(), bean, headers).then((data: ResponseDTO<string>) => { |
| 209 | - if (!data || !data.data) { | ||
| 210 | - fail("数据为空") | ||
| 211 | - return | ||
| 212 | - } | 223 | + |
| 213 | if (data.code != 0) { | 224 | if (data.code != 0) { |
| 214 | fail(data.message) | 225 | fail(data.message) |
| 215 | return | 226 | return |
| 216 | } | 227 | } |
| 228 | + if (!data || !data.data) { | ||
| 229 | + fail("数据为空") | ||
| 230 | + return | ||
| 231 | + } | ||
| 217 | success(data.data) | 232 | success(data.data) |
| 218 | }, (error: Error) => { | 233 | }, (error: Error) => { |
| 219 | fail(error.message) | 234 | fail(error.message) |
| @@ -253,10 +268,10 @@ export class LoginModel { | @@ -253,10 +268,10 @@ export class LoginModel { | ||
| 253 | let bean: Record<string, Object> = {}; | 268 | let bean: Record<string, Object> = {}; |
| 254 | bean['phone'] = phone | 269 | bean['phone'] = phone |
| 255 | bean['verifyCode'] = verificationCode | 270 | bean['verifyCode'] = verificationCode |
| 256 | - return new Promise<LoginBean>((success, fail) => { | ||
| 257 | - HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.changeBindPhone(), bean, headers).then((data: ResponseDTO<LoginBean>) => { | 271 | + return new Promise<object>((success, fail) => { |
| 272 | + HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.changeBindPhone(), bean, headers).then((data: ResponseDTO<object>) => { | ||
| 258 | Logger.debug("LoginViewModel:success2 ", data.message) | 273 | Logger.debug("LoginViewModel:success2 ", data.message) |
| 259 | - if (!data || !data.data) { | 274 | + if (!data) { |
| 260 | fail("数据为空") | 275 | fail("数据为空") |
| 261 | return | 276 | return |
| 262 | } | 277 | } |
| @@ -264,7 +279,29 @@ export class LoginModel { | @@ -264,7 +279,29 @@ export class LoginModel { | ||
| 264 | fail(data.message) | 279 | fail(data.message) |
| 265 | return | 280 | return |
| 266 | } | 281 | } |
| 267 | - success(data.data) | 282 | + success(data) |
| 283 | + }, (error: Error) => { | ||
| 284 | + fail(error.message) | ||
| 285 | + Logger.debug("LoginViewModel:error2 ", error.toString()) | ||
| 286 | + }) | ||
| 287 | + }) | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + /**获取用户安全页信息*/ | ||
| 291 | + querySecurity(){ | ||
| 292 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 293 | + return new Promise<object>((success, fail) => { | ||
| 294 | + HttpRequest.get<ResponseDTO<object>>(HttpUrlUtils.querySecurity(), headers).then((data: ResponseDTO<object>) => { | ||
| 295 | + Logger.debug("LoginViewModel:success2 ", data.message) | ||
| 296 | + if (!data) { | ||
| 297 | + fail("数据为空") | ||
| 298 | + return | ||
| 299 | + } | ||
| 300 | + if (data.code != 0) { | ||
| 301 | + fail(data.message) | ||
| 302 | + return | ||
| 303 | + } | ||
| 304 | + success(data) | ||
| 268 | }, (error: Error) => { | 305 | }, (error: Error) => { |
| 269 | fail(error.message) | 306 | fail(error.message) |
| 270 | Logger.debug("LoginViewModel:error2 ", error.toString()) | 307 | Logger.debug("LoginViewModel:error2 ", error.toString()) |
| @@ -312,6 +312,8 @@ struct LoginPage { | @@ -312,6 +312,8 @@ struct LoginPage { | ||
| 312 | url: `${WDRouterPage.getBundleInfo()}` | 312 | url: `${WDRouterPage.getBundleInfo()}` |
| 313 | } | 313 | } |
| 314 | ) | 314 | ) |
| 315 | + }).catch((error:string)=>{ | ||
| 316 | + promptAction.showToast({ message: error }) | ||
| 315 | }) | 317 | }) |
| 316 | } else { | 318 | } else { |
| 317 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { | 319 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { |
| @@ -14,18 +14,22 @@ struct LoginProtocolWebview { | @@ -14,18 +14,22 @@ struct LoginProtocolWebview { | ||
| 14 | webviewController: webview.WebviewController = new webview.WebviewController() | 14 | webviewController: webview.WebviewController = new webview.WebviewController() |
| 15 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" | 15 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" |
| 16 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' | 16 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' |
| 17 | + logoutProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1003.html' | ||
| 17 | 18 | ||
| 18 | async aboutToAppear() { | 19 | async aboutToAppear() { |
| 19 | if (router.getParams()) { | 20 | if (router.getParams()) { |
| 20 | let params = router.getParams() as Params | 21 | let params = router.getParams() as Params |
| 21 | Logger.info(TAG, 'params.contentID:' + params.contentID); | 22 | Logger.info(TAG, 'params.contentID:' + params.contentID); |
| 22 | - if (params.contentID == "1") { | 23 | + if (params.contentID == "1") { //用户协议 |
| 23 | this.webUrl = await SPHelper.default.get(SpConstants.USER_PROTOCOL, this.userProtocol) as string | 24 | this.webUrl = await SPHelper.default.get(SpConstants.USER_PROTOCOL, this.userProtocol) as string |
| 24 | this.webviewController.loadUrl(this.webUrl) | 25 | this.webviewController.loadUrl(this.webUrl) |
| 25 | 26 | ||
| 26 | - } else { | 27 | + } else if(params.contentID == "2"){ //隐私协议 |
| 27 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string | 28 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string |
| 28 | this.webviewController.loadUrl(this.webUrl) | 29 | this.webviewController.loadUrl(this.webUrl) |
| 30 | + }else if(params.contentID == "3"){ //注销协议 | ||
| 31 | + this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string | ||
| 32 | + this.webviewController.loadUrl(this.webUrl) | ||
| 29 | } | 33 | } |
| 30 | } | 34 | } |
| 31 | 35 |
| @@ -7,10 +7,8 @@ import cryptoFramework from '@ohos.security.cryptoFramework' | @@ -7,10 +7,8 @@ import cryptoFramework from '@ohos.security.cryptoFramework' | ||
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| 8 | import { encryptMessage } from '../../utils/cryptoUtil' | 8 | import { encryptMessage } from '../../utils/cryptoUtil' |
| 9 | 9 | ||
| 10 | -import { | ||
| 11 | - SpConstants | ||
| 12 | -} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' | ||
| 13 | import { HttpUrlUtils } from 'wdNetwork/src/main/ets/http/HttpUrlUtils' | 10 | import { HttpUrlUtils } from 'wdNetwork/src/main/ets/http/HttpUrlUtils' |
| 11 | +import { SpConstants } from 'wdConstant/Index' | ||
| 14 | 12 | ||
| 15 | const TAG = "LoginViewModel" | 13 | const TAG = "LoginViewModel" |
| 16 | 14 | ||
| @@ -61,8 +59,8 @@ export class LoginViewModel { | @@ -61,8 +59,8 @@ export class LoginViewModel { | ||
| 61 | HttpUrlUtils.setUserType(data.userType+"") | 59 | HttpUrlUtils.setUserType(data.userType+"") |
| 62 | HttpUrlUtils.setUserToken(data.jwtToken) | 60 | HttpUrlUtils.setUserToken(data.jwtToken) |
| 63 | success(data) | 61 | success(data) |
| 64 | - }).catch(() => { | ||
| 65 | - fail() | 62 | + }).catch((error:string) => { |
| 63 | + fail(error) | ||
| 66 | }) | 64 | }) |
| 67 | }) | 65 | }) |
| 68 | } | 66 | } |
| @@ -171,8 +169,8 @@ export class LoginViewModel { | @@ -171,8 +169,8 @@ export class LoginViewModel { | ||
| 171 | } | 169 | } |
| 172 | 170 | ||
| 173 | changeBindPhone(phone: string, verificationCode: string) { | 171 | changeBindPhone(phone: string, verificationCode: string) { |
| 174 | - return new Promise<LoginBean>((success, fail) => { | ||
| 175 | - this.loginModel.changeBindPhone(phone, verificationCode).then((data: LoginBean) => { | 172 | + return new Promise<object>((success, fail) => { |
| 173 | + this.loginModel.changeBindPhone(phone, verificationCode).then((data: object) => { | ||
| 176 | success(data) | 174 | success(data) |
| 177 | }).catch(() => { | 175 | }).catch(() => { |
| 178 | fail() | 176 | fail() |
| @@ -180,7 +178,15 @@ export class LoginViewModel { | @@ -180,7 +178,15 @@ export class LoginViewModel { | ||
| 180 | }) | 178 | }) |
| 181 | } | 179 | } |
| 182 | 180 | ||
| 183 | - | 181 | + querySecurity(){ |
| 182 | + return new Promise<object>((success, fail) => { | ||
| 183 | + this.loginModel.querySecurity().then((data: object) => { | ||
| 184 | + success(data) | ||
| 185 | + }).catch(() => { | ||
| 186 | + fail() | ||
| 187 | + }) | ||
| 188 | + }) | ||
| 189 | + } | ||
| 184 | 190 | ||
| 185 | async doMd(content: string): Promise<string> { | 191 | async doMd(content: string): Promise<string> { |
| 186 | let mdAlgName = 'SHA256'; // 摘要算法名 | 192 | let mdAlgName = 'SHA256'; // 摘要算法名 |
| @@ -22,6 +22,7 @@ export class WDPlayerController { | @@ -22,6 +22,7 @@ export class WDPlayerController { | ||
| 22 | public onVolumeUpdate?: (volume: number) => void; | 22 | public onVolumeUpdate?: (volume: number) => void; |
| 23 | public continue?: () => void; | 23 | public continue?: () => void; |
| 24 | public onCanplay?: () => void; | 24 | public onCanplay?: () => void; |
| 25 | + public onStatusChange?: (status: number) => void; | ||
| 25 | 26 | ||
| 26 | constructor() { | 27 | constructor() { |
| 27 | Logger.error("初始化") | 28 | Logger.error("初始化") |
| @@ -146,7 +147,7 @@ export class WDPlayerController { | @@ -146,7 +147,7 @@ export class WDPlayerController { | ||
| 146 | if (this.avPlayer == null) { | 147 | if (this.avPlayer == null) { |
| 147 | return | 148 | return |
| 148 | } | 149 | } |
| 149 | - Logger.error("开始播放") | 150 | + Logger.error("开始播放", this.url) |
| 150 | this.avPlayer.url = this.url; | 151 | this.avPlayer.url = this.url; |
| 151 | } | 152 | } |
| 152 | 153 | ||
| @@ -163,92 +164,92 @@ export class WDPlayerController { | @@ -163,92 +164,92 @@ export class WDPlayerController { | ||
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | async pause() { | 166 | async pause() { |
| 166 | - if (this.avPlayer == null) { | ||
| 167 | - await this.initPromise; | ||
| 168 | - } | ||
| 169 | - if (this.avPlayer == null) { | ||
| 170 | - return | ||
| 171 | - } | ||
| 172 | - this.avPlayer.pause(); | 167 | + // if (this.avPlayer == null) { |
| 168 | + // await this.initPromise; | ||
| 169 | + // } | ||
| 170 | + // if (this.avPlayer == null) { | ||
| 171 | + // return | ||
| 172 | + // } | ||
| 173 | + this.avPlayer?.pause(); | ||
| 173 | } | 174 | } |
| 174 | 175 | ||
| 175 | async play() { | 176 | async play() { |
| 176 | - if (this.avPlayer == null) { | ||
| 177 | - await this.initPromise; | ||
| 178 | - } | ||
| 179 | - if (this.avPlayer == null) { | ||
| 180 | - return | ||
| 181 | - } | ||
| 182 | - this.avPlayer.play(); | 177 | + // if (this.avPlayer == null) { |
| 178 | + // await this.initPromise; | ||
| 179 | + // } | ||
| 180 | + // if (this.avPlayer == null) { | ||
| 181 | + // return | ||
| 182 | + // } | ||
| 183 | + this.avPlayer?.play(); | ||
| 183 | } | 184 | } |
| 184 | 185 | ||
| 185 | async stop() { | 186 | async stop() { |
| 186 | - if (this.avPlayer == null) { | ||
| 187 | - await this.initPromise; | ||
| 188 | - } | ||
| 189 | - if (this.avPlayer == null) { | ||
| 190 | - return | ||
| 191 | - } | ||
| 192 | - this.avPlayer.stop(); | 187 | + // if (this.avPlayer == null) { |
| 188 | + // await this.initPromise; | ||
| 189 | + // } | ||
| 190 | + // if (this.avPlayer == null) { | ||
| 191 | + // return | ||
| 192 | + // } | ||
| 193 | + this.avPlayer?.stop(); | ||
| 193 | } | 194 | } |
| 194 | 195 | ||
| 195 | async setLoop() { | 196 | async setLoop() { |
| 196 | - if (this.avPlayer == null) { | ||
| 197 | - await this.initPromise; | ||
| 198 | - } | ||
| 199 | - if (this.avPlayer == null) { | ||
| 200 | - return | ||
| 201 | - } | 197 | + // if (this.avPlayer == null) { |
| 198 | + // await this.initPromise; | ||
| 199 | + // } | ||
| 200 | + // if (this.avPlayer == null) { | ||
| 201 | + // return | ||
| 202 | + // } | ||
| 202 | this.loop = !this.loop; | 203 | this.loop = !this.loop; |
| 203 | } | 204 | } |
| 204 | 205 | ||
| 205 | async setSpeed(playSpeed: number) { | 206 | async setSpeed(playSpeed: number) { |
| 206 | - if (this.avPlayer == null) { | ||
| 207 | - await this.initPromise; | ||
| 208 | - } | ||
| 209 | - if (this.avPlayer == null) { | ||
| 210 | - return | ||
| 211 | - } | ||
| 212 | - if (PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) { | 207 | + // if (this.avPlayer == null) { |
| 208 | + // await this.initPromise; | ||
| 209 | + // } | ||
| 210 | + // if (this.avPlayer == null) { | ||
| 211 | + // return | ||
| 212 | + // } | ||
| 213 | + if (this.avPlayer && PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer?.state) === -1) { | ||
| 213 | return; | 214 | return; |
| 214 | } | 215 | } |
| 215 | this.playSpeed = playSpeed; | 216 | this.playSpeed = playSpeed; |
| 216 | - this.avPlayer.setSpeed(this.playSpeed); | 217 | + this.avPlayer?.setSpeed(this.playSpeed); |
| 217 | } | 218 | } |
| 218 | 219 | ||
| 219 | async switchPlayOrPause() { | 220 | async switchPlayOrPause() { |
| 220 | - if (this.avPlayer == null) { | ||
| 221 | - await this.initPromise; | ||
| 222 | - } | ||
| 223 | - if (this.avPlayer == null) { | ||
| 224 | - return | ||
| 225 | - } | 221 | + // if (this.avPlayer == null) { |
| 222 | + // await this.initPromise; | ||
| 223 | + // } | ||
| 224 | + // if (this.avPlayer == null) { | ||
| 225 | + // return | ||
| 226 | + // } | ||
| 226 | if (this.status === PlayerConstants.STATUS_START) { | 227 | if (this.status === PlayerConstants.STATUS_START) { |
| 227 | - this.avPlayer.pause(); | 228 | + this.avPlayer?.pause(); |
| 228 | } else { | 229 | } else { |
| 229 | - this.avPlayer.play(); | 230 | + this.avPlayer?.play(); |
| 230 | } | 231 | } |
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | async setSeekTime(value: number, mode: SliderChangeMode) { | 234 | async setSeekTime(value: number, mode: SliderChangeMode) { |
| 234 | - if (this.avPlayer == null) { | ||
| 235 | - await this.initPromise; | ||
| 236 | - } | ||
| 237 | - if (this.avPlayer == null) { | ||
| 238 | - return | ||
| 239 | - } | ||
| 240 | - if (mode == SliderChangeMode.Begin) { | ||
| 241 | - this.seekTime = value * 1000; | ||
| 242 | - this.avPlayer.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); | ||
| 243 | - } | 235 | + // if (this.avPlayer == null) { |
| 236 | + // await this.initPromise; | ||
| 237 | + // } | ||
| 238 | + // if (this.avPlayer == null) { | ||
| 239 | + // return | ||
| 240 | + // } | ||
| 241 | + // if (mode == SliderChangeMode.Begin) { | ||
| 242 | + // this.seekTime = value * 1000; | ||
| 243 | + // this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); | ||
| 244 | + // } | ||
| 244 | if (mode === SliderChangeMode.Moving) { | 245 | if (mode === SliderChangeMode.Moving) { |
| 245 | // this.progressThis.progressVal = value; | 246 | // this.progressThis.progressVal = value; |
| 246 | // this.progressThis.currentTime = DateFormatUtil.secondToTime(Math.floor(value * this.duration / | 247 | // this.progressThis.currentTime = DateFormatUtil.secondToTime(Math.floor(value * this.duration / |
| 247 | // 100 / 1000)); | 248 | // 100 / 1000)); |
| 248 | } | 249 | } |
| 249 | if (mode === SliderChangeMode.End) { | 250 | if (mode === SliderChangeMode.End) { |
| 250 | - this.seekTime = value * this.duration / 100; | ||
| 251 | - this.avPlayer.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); | 251 | + this.seekTime = value * this.duration; |
| 252 | + this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); | ||
| 252 | } | 253 | } |
| 253 | } | 254 | } |
| 254 | 255 | ||
| @@ -333,6 +334,10 @@ export class WDPlayerController { | @@ -333,6 +334,10 @@ export class WDPlayerController { | ||
| 333 | } | 334 | } |
| 334 | 335 | ||
| 335 | watchStatus() { | 336 | watchStatus() { |
| 337 | + console.log('watchStatus', this.status) | ||
| 338 | + if (this.onStatusChange) { | ||
| 339 | + this.onStatusChange(this.status) | ||
| 340 | + } | ||
| 336 | // if (this.status === PlayConstants.STATUS_START) { | 341 | // if (this.status === PlayConstants.STATUS_START) { |
| 337 | // globalThis.windowClass.setWindowKeepScreenOn(true); | 342 | // globalThis.windowClass.setWindowKeepScreenOn(true); |
| 338 | // } else { | 343 | // } else { |
| @@ -94,17 +94,27 @@ export struct WDPlayerRenderView { | @@ -94,17 +94,27 @@ export struct WDPlayerRenderView { | ||
| 94 | }) | 94 | }) |
| 95 | .width(this.selfSize.width) | 95 | .width(this.selfSize.width) |
| 96 | .height(this.selfSize.height) | 96 | .height(this.selfSize.height) |
| 97 | + .margin({ top: this.getPlayerMarginTop() }) | ||
| 97 | } | 98 | } |
| 98 | .id(this.insId) | 99 | .id(this.insId) |
| 99 | .onAreaChange(() => { | 100 | .onAreaChange(() => { |
| 100 | // this.updateLayout() | 101 | // this.updateLayout() |
| 101 | }) | 102 | }) |
| 102 | .backgroundColor("#000000") | 103 | .backgroundColor("#000000") |
| 104 | + .alignItems(VerticalAlign.Center) | ||
| 103 | .justifyContent(FlexAlign.Center) | 105 | .justifyContent(FlexAlign.Center) |
| 106 | + .alignItems(this.selfSize.width === '100%' ? VerticalAlign.Top : VerticalAlign.Center) | ||
| 104 | .height('100%') | 107 | .height('100%') |
| 105 | .width('100%') | 108 | .width('100%') |
| 106 | } | 109 | } |
| 107 | 110 | ||
| 111 | + /** | ||
| 112 | + * 横屏播放器非居中展示 | ||
| 113 | + */ | ||
| 114 | + getPlayerMarginTop() { | ||
| 115 | + return this.selfSize.width === '100%' && this.videoWidth > this.videoHeight ? 218 : 0 | ||
| 116 | + } | ||
| 117 | + | ||
| 108 | updateLayout() { | 118 | updateLayout() { |
| 109 | let info = componentUtils.getRectangleById(this.insId); | 119 | let info = componentUtils.getRectangleById(this.insId); |
| 110 | if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { | 120 | if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { |
| @@ -4,8 +4,8 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | @@ -4,8 +4,8 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | ||
| 4 | import Want from '@ohos.app.ability.Want'; | 4 | import Want from '@ohos.app.ability.Want'; |
| 5 | import window from '@ohos.window'; | 5 | import window from '@ohos.window'; |
| 6 | import { registerRouter } from 'wdRouter'; | 6 | import { registerRouter } from 'wdRouter'; |
| 7 | -import { SPHelper, WindowModel } from 'wdKit'; | ||
| 8 | -import { WDHttp } from 'wdNetwork' | 7 | +import { SPHelper, StringUtils, WindowModel } from 'wdKit'; |
| 8 | +import { HttpUrlUtils, WDHttp } from 'wdNetwork'; | ||
| 9 | 9 | ||
| 10 | export default class EntryAbility extends UIAbility { | 10 | export default class EntryAbility extends UIAbility { |
| 11 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { | 11 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| @@ -13,6 +13,10 @@ export default class EntryAbility extends UIAbility { | @@ -13,6 +13,10 @@ export default class EntryAbility extends UIAbility { | ||
| 13 | hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); | 13 | hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); |
| 14 | registerRouter(); | 14 | registerRouter(); |
| 15 | WDHttp.initHttpHeader() | 15 | WDHttp.initHttpHeader() |
| 16 | + const spHostUrl = SPHelper.default.getSync('hostUrl', '') as string | ||
| 17 | + if (StringUtils.isNotEmpty(spHostUrl)) { | ||
| 18 | + HttpUrlUtils.hostUrl = spHostUrl | ||
| 19 | + } | ||
| 16 | } | 20 | } |
| 17 | 21 | ||
| 18 | onDestroy(): void { | 22 | onDestroy(): void { |
| 1 | -import { BottomNavigationComponent} from 'wdComponent'; | 1 | +import { BottomNavigationComponent, LogoutViewModel} from 'wdComponent'; |
| 2 | import { BreakpointConstants } from 'wdConstant'; | 2 | import { BreakpointConstants } from 'wdConstant'; |
| 3 | 3 | ||
| 4 | -import { BreakpointSystem, Logger } from 'wdKit'; | 4 | +import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger } from 'wdKit'; |
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| 6 | +import { promptAction } from '@kit.ArkUI'; | ||
| 6 | 7 | ||
| 7 | 8 | ||
| 8 | const TAG = 'MainPage'; | 9 | const TAG = 'MainPage'; |
| @@ -22,6 +23,9 @@ struct MainPage { | @@ -22,6 +23,9 @@ struct MainPage { | ||
| 22 | aboutToAppear() { | 23 | aboutToAppear() { |
| 23 | this.breakpointSystem.register() | 24 | this.breakpointSystem.register() |
| 24 | Logger.info(TAG, `aboutToAppear `); | 25 | Logger.info(TAG, `aboutToAppear `); |
| 26 | + EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | ||
| 27 | + LogoutViewModel.clearLoginInfo() | ||
| 28 | + }) | ||
| 25 | } | 29 | } |
| 26 | 30 | ||
| 27 | aboutToDisappear() { | 31 | aboutToDisappear() { |
| 1 | +import { Action } from 'wdBean'; | ||
| 2 | +import { SpacialTopicPageComponent } from 'wdComponent' | ||
| 3 | +import { Logger } from 'wdKit' | ||
| 4 | +import router from '@ohos.router'; | ||
| 5 | + | ||
| 6 | +const TAG = 'SpacialPage'; | ||
| 7 | + | ||
| 8 | +@Entry | ||
| 9 | +@Component | ||
| 10 | +struct SpacialTopicPage { | ||
| 11 | + action: Action = {} as Action | ||
| 12 | + | ||
| 13 | + build() { | ||
| 14 | + Column() { | ||
| 15 | + SpacialTopicPageComponent() | ||
| 16 | + } | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + pageTransition(){ | ||
| 20 | + // 定义页面进入时的效果,从右边侧滑入 | ||
| 21 | + PageTransitionEnter({ type: RouteType.None, duration: 300 }) | ||
| 22 | + .slide(SlideEffect.Right) | ||
| 23 | + // 定义页面退出时的效果,向右边侧滑出 | ||
| 24 | + PageTransitionExit({ type: RouteType.None, duration: 300 }) | ||
| 25 | + .slide(SlideEffect.Right) | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + aboutToAppear() { | ||
| 30 | + Logger.info(TAG, 'aboutToAppear'); | ||
| 31 | + let action: Action = router.getParams() as Action | ||
| 32 | + this.action = action | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + aboutToDisappear() { | ||
| 36 | + Logger.info(TAG, 'aboutToDisappear'); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + onPageShow() { | ||
| 40 | + Logger.info(TAG, 'onPageShow'); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + onPageHide() { | ||
| 44 | + Logger.info(TAG, 'onPageHide'); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + onBackPress() { | ||
| 48 | + Logger.info(TAG, 'onBackPress'); | ||
| 49 | + } | ||
| 50 | +} |
| 1 | +import { Logger } from 'wdKit'; | ||
| 2 | +import { AudioDetailComponent } from 'wdComponent'; | ||
| 3 | +import router from '@ohos.router'; | ||
| 4 | +import { Params, Action } from 'wdBean'; | ||
| 5 | +const TAG = 'DynamicDetailPage'; | ||
| 6 | +@Entry | ||
| 7 | +@Component | ||
| 8 | +struct DynamicDetailPage { | ||
| 9 | + | ||
| 10 | + @State relId: string = '' | ||
| 11 | + @State contentId: string = '' | ||
| 12 | + @State relType: string = '' | ||
| 13 | + | ||
| 14 | + build() { | ||
| 15 | + Column() { | ||
| 16 | + AudioDetailComponent({ | ||
| 17 | + relId: this.relId, | ||
| 18 | + contentId: this.contentId, | ||
| 19 | + relType: this.relType | ||
| 20 | + }) | ||
| 21 | + } | ||
| 22 | + .height('100%') | ||
| 23 | + .width('100%') | ||
| 24 | + .backgroundColor('#20272E') | ||
| 25 | + } | ||
| 26 | + aboutToAppear() { | ||
| 27 | + let par:Action = router.getParams() as Action; | ||
| 28 | + let params = par?.params; | ||
| 29 | + this.relId = params?.extra?.relId || ''; | ||
| 30 | + this.relType = params?.extra?.relType || ''; | ||
| 31 | + this.contentId = params?.contentID || ''; | ||
| 32 | + } | ||
| 33 | +} |
| @@ -26,6 +26,16 @@ export class LaunchModel { | @@ -26,6 +26,16 @@ export class LaunchModel { | ||
| 26 | SPHelper.default.save(SpConstants.USER_PROTOCOL, data.data[i].linkUrl) | 26 | SPHelper.default.save(SpConstants.USER_PROTOCOL, data.data[i].linkUrl) |
| 27 | } else if (data.data[i].type == 2) { | 27 | } else if (data.data[i].type == 2) { |
| 28 | SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl) | 28 | SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl) |
| 29 | + }else if (data.data[i].type == 4) { | ||
| 30 | + SPHelper.default.save(SpConstants.LOGOUT_PROTOCOL, data.data[i].linkUrl) | ||
| 31 | + }else if (data.data[i].type == 5) { | ||
| 32 | + SPHelper.default.save(SpConstants.MESSAGE_BOARD_USER_PROTOCOL, data.data[i].linkUrl) | ||
| 33 | + }else if (data.data[i].type == 6) { | ||
| 34 | + SPHelper.default.save(SpConstants.MESSAGE_BOARD_NOTICE_PROTOCOL, data.data[i].linkUrl) | ||
| 35 | + }else if (data.data[i].type == 7) { | ||
| 36 | + SPHelper.default.save(SpConstants.MESSAGE_BOARD_QUESTION_PROTOCOL, data.data[i].linkUrl) | ||
| 37 | + }else if (data.data[i].type == 8) { | ||
| 38 | + SPHelper.default.save(SpConstants.MESSAGE_BOARD_PRIVATE_PROTOCOL, data.data[i].linkUrl) | ||
| 29 | } | 39 | } |
| 30 | } | 40 | } |
| 31 | 41 |
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | "pages/launchPage/PrivacyPage", | 10 | "pages/launchPage/PrivacyPage", |
| 11 | "pages/launchPage/LaunchPage", | 11 | "pages/launchPage/LaunchPage", |
| 12 | "pages/launchPage/LaunchAdvertisingPage", | 12 | "pages/launchPage/LaunchAdvertisingPage", |
| 13 | - "pages/broadcast/BroadcastPage" | 13 | + "pages/broadcast/BroadcastPage", |
| 14 | + "pages/SpacialTopicPage" | ||
| 14 | ] | 15 | ] |
| 15 | } | 16 | } |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "hasNext": 1, | ||
| 5 | + "list": [{ | ||
| 6 | + "authorLike": 0, | ||
| 7 | + "avatarFrame": "", | ||
| 8 | + "checkStatus": 2, | ||
| 9 | + "childCommentNum": 0, | ||
| 10 | + "childComments": [], | ||
| 11 | + "commentContent": "走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。", | ||
| 12 | + "commentContentSensitive": "", | ||
| 13 | + "commentLevel": 1, | ||
| 14 | + "commentPics": "", | ||
| 15 | + "commentSensitive": "", | ||
| 16 | + "commentType": "1", | ||
| 17 | + "contentAuthor": 0, | ||
| 18 | + "createTime": "2024-04-09 18:07:24", | ||
| 19 | + "creatorFlag": 0, | ||
| 20 | + "fromCreatorId": "", | ||
| 21 | + "fromDeviceId": "", | ||
| 22 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202010/rmrb_mMCZxkBw1602498775.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 23 | + "fromUserId": "531160058210565", | ||
| 24 | + "fromUserName": "**勇", | ||
| 25 | + "fromUserType": 1, | ||
| 26 | + "id": 57187947, | ||
| 27 | + "likeNum": 4, | ||
| 28 | + "mySelf": 0, | ||
| 29 | + "parentId": -1, | ||
| 30 | + "region": "新疆维吾尔自治区乌鲁木齐市", | ||
| 31 | + "replyNum": 0, | ||
| 32 | + "rootCommentId": 57187947, | ||
| 33 | + "sensitiveExist": 0, | ||
| 34 | + "sensitiveShow": 1, | ||
| 35 | + "toUserContentAuthor": 0, | ||
| 36 | + "toUserId": "", | ||
| 37 | + "toUserName": "", | ||
| 38 | + "toUserType": null, | ||
| 39 | + "topFlag": 0, | ||
| 40 | + "uuid": "c31fe10c-38b4-48f9-a847-eeb33ffae35e" | ||
| 41 | + }, { | ||
| 42 | + "authorLike": 0, | ||
| 43 | + "avatarFrame": "", | ||
| 44 | + "checkStatus": 2, | ||
| 45 | + "childCommentNum": 0, | ||
| 46 | + "childComments": [], | ||
| 47 | + "commentContent": "咎由自取", | ||
| 48 | + "commentContentSensitive": "", | ||
| 49 | + "commentLevel": 1, | ||
| 50 | + "commentPics": "", | ||
| 51 | + "commentSensitive": "", | ||
| 52 | + "commentType": "1", | ||
| 53 | + "contentAuthor": 0, | ||
| 54 | + "createTime": "2024-04-09 17:59:17", | ||
| 55 | + "creatorFlag": 0, | ||
| 56 | + "fromCreatorId": "", | ||
| 57 | + "fromDeviceId": "", | ||
| 58 | + "fromUserHeader": "http://thirdqq.qlogo.cn/qqapp/100857255/F4069650B754E8DEDB65DFCCB6261211/100", | ||
| 59 | + "fromUserId": "530949198104837", | ||
| 60 | + "fromUserName": "[@王者之师@]", | ||
| 61 | + "fromUserType": 1, | ||
| 62 | + "id": 57255431, | ||
| 63 | + "likeNum": 3, | ||
| 64 | + "mySelf": 0, | ||
| 65 | + "parentId": -1, | ||
| 66 | + "region": "河南省商丘市", | ||
| 67 | + "replyNum": 0, | ||
| 68 | + "rootCommentId": 57255431, | ||
| 69 | + "sensitiveExist": 0, | ||
| 70 | + "sensitiveShow": 1, | ||
| 71 | + "toUserContentAuthor": 0, | ||
| 72 | + "toUserId": "", | ||
| 73 | + "toUserName": "", | ||
| 74 | + "toUserType": null, | ||
| 75 | + "topFlag": 0, | ||
| 76 | + "uuid": "a44b8513-4e7e-4644-b0ed-37fa3fd98788" | ||
| 77 | + }, { | ||
| 78 | + "authorLike": 0, | ||
| 79 | + "avatarFrame": "", | ||
| 80 | + "checkStatus": 2, | ||
| 81 | + "childCommentNum": 0, | ||
| 82 | + "childComments": [], | ||
| 83 | + "commentContent": "违纪违法,严惩不贷!", | ||
| 84 | + "commentContentSensitive": "", | ||
| 85 | + "commentLevel": 1, | ||
| 86 | + "commentPics": "", | ||
| 87 | + "commentSensitive": "", | ||
| 88 | + "commentType": "1", | ||
| 89 | + "contentAuthor": 0, | ||
| 90 | + "createTime": "2024-04-09 17:44:10", | ||
| 91 | + "creatorFlag": 0, | ||
| 92 | + "fromCreatorId": "", | ||
| 93 | + "fromDeviceId": "", | ||
| 94 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202010/rmrb_ZTKHKDIA1603932748.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 95 | + "fromUserId": "531165579823365", | ||
| 96 | + "fromUserName": "哆啦A梦伴我同行", | ||
| 97 | + "fromUserType": 1, | ||
| 98 | + "id": 57186915, | ||
| 99 | + "likeNum": 3, | ||
| 100 | + "mySelf": 0, | ||
| 101 | + "parentId": -1, | ||
| 102 | + "region": "安徽省铜陵市", | ||
| 103 | + "replyNum": 0, | ||
| 104 | + "rootCommentId": 57186915, | ||
| 105 | + "sensitiveExist": 0, | ||
| 106 | + "sensitiveShow": 1, | ||
| 107 | + "toUserContentAuthor": 0, | ||
| 108 | + "toUserId": "", | ||
| 109 | + "toUserName": "", | ||
| 110 | + "toUserType": null, | ||
| 111 | + "topFlag": 0, | ||
| 112 | + "uuid": "d9c7bd8f-59e8-46cb-9525-d4414049a8ea" | ||
| 113 | + }, { | ||
| 114 | + "authorLike": 0, | ||
| 115 | + "avatarFrame": "", | ||
| 116 | + "checkStatus": 2, | ||
| 117 | + "childCommentNum": 0, | ||
| 118 | + "childComments": [], | ||
| 119 | + "commentContent": "反腐倡廉,没有禁区", | ||
| 120 | + "commentContentSensitive": "", | ||
| 121 | + "commentLevel": 1, | ||
| 122 | + "commentPics": "", | ||
| 123 | + "commentSensitive": "", | ||
| 124 | + "commentType": "1", | ||
| 125 | + "contentAuthor": 0, | ||
| 126 | + "createTime": "2024-04-09 17:36:44", | ||
| 127 | + "creatorFlag": 0, | ||
| 128 | + "fromCreatorId": "", | ||
| 129 | + "fromDeviceId": "", | ||
| 130 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201709/rmrb_RIg022m31504938430.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 131 | + "fromUserId": "530884188965125", | ||
| 132 | + "fromUserName": "太宗裔仁寿李登榜", | ||
| 133 | + "fromUserType": 1, | ||
| 134 | + "id": 57186467, | ||
| 135 | + "likeNum": 4, | ||
| 136 | + "mySelf": 0, | ||
| 137 | + "parentId": -1, | ||
| 138 | + "region": "", | ||
| 139 | + "replyNum": 0, | ||
| 140 | + "rootCommentId": 57186467, | ||
| 141 | + "sensitiveExist": 0, | ||
| 142 | + "sensitiveShow": 1, | ||
| 143 | + "toUserContentAuthor": 0, | ||
| 144 | + "toUserId": "", | ||
| 145 | + "toUserName": "", | ||
| 146 | + "toUserType": null, | ||
| 147 | + "topFlag": 0, | ||
| 148 | + "uuid": "e54c1396-441e-450e-9714-632d9e097b08" | ||
| 149 | + }, { | ||
| 150 | + "authorLike": 0, | ||
| 151 | + "avatarFrame": "", | ||
| 152 | + "checkStatus": 2, | ||
| 153 | + "childCommentNum": 0, | ||
| 154 | + "childComments": [], | ||
| 155 | + "commentContent": "严惩!", | ||
| 156 | + "commentContentSensitive": "", | ||
| 157 | + "commentLevel": 1, | ||
| 158 | + "commentPics": "", | ||
| 159 | + "commentSensitive": "", | ||
| 160 | + "commentType": "1", | ||
| 161 | + "contentAuthor": 0, | ||
| 162 | + "createTime": "2024-04-09 17:29:56", | ||
| 163 | + "creatorFlag": 0, | ||
| 164 | + "fromCreatorId": "", | ||
| 165 | + "fromDeviceId": "", | ||
| 166 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201906/rmrb_sfiKkJEo1561260739.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 167 | + "fromUserId": "530983644408069", | ||
| 168 | + "fromUserName": "时间的折叠", | ||
| 169 | + "fromUserType": 1, | ||
| 170 | + "id": 57186157, | ||
| 171 | + "likeNum": 1, | ||
| 172 | + "mySelf": 0, | ||
| 173 | + "parentId": -1, | ||
| 174 | + "region": "河南省郑州市", | ||
| 175 | + "replyNum": 0, | ||
| 176 | + "rootCommentId": 57186157, | ||
| 177 | + "sensitiveExist": 0, | ||
| 178 | + "sensitiveShow": 1, | ||
| 179 | + "toUserContentAuthor": 0, | ||
| 180 | + "toUserId": "", | ||
| 181 | + "toUserName": "", | ||
| 182 | + "toUserType": null, | ||
| 183 | + "topFlag": 0, | ||
| 184 | + "uuid": "daebe242-5e10-430f-8de8-7ff1d8fae27b" | ||
| 185 | + }, { | ||
| 186 | + "authorLike": 0, | ||
| 187 | + "avatarFrame": "", | ||
| 188 | + "checkStatus": 2, | ||
| 189 | + "childCommentNum": 0, | ||
| 190 | + "childComments": [], | ||
| 191 | + "commentContent": "孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。", | ||
| 192 | + "commentContentSensitive": "", | ||
| 193 | + "commentLevel": 1, | ||
| 194 | + "commentPics": "", | ||
| 195 | + "commentSensitive": "", | ||
| 196 | + "commentType": "1", | ||
| 197 | + "contentAuthor": 0, | ||
| 198 | + "createTime": "2024-04-09 17:28:14", | ||
| 199 | + "creatorFlag": 0, | ||
| 200 | + "fromCreatorId": "", | ||
| 201 | + "fromDeviceId": "", | ||
| 202 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201912/rmrb_a_393944911428186112.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 203 | + "fromUserId": "530796590283333", | ||
| 204 | + "fromUserName": "爱我中华", | ||
| 205 | + "fromUserType": 1, | ||
| 206 | + "id": 57185773, | ||
| 207 | + "likeNum": 20, | ||
| 208 | + "mySelf": 0, | ||
| 209 | + "parentId": -1, | ||
| 210 | + "region": "陕西省榆林市", | ||
| 211 | + "replyNum": 0, | ||
| 212 | + "rootCommentId": 57185773, | ||
| 213 | + "sensitiveExist": 0, | ||
| 214 | + "sensitiveShow": 1, | ||
| 215 | + "toUserContentAuthor": 0, | ||
| 216 | + "toUserId": "", | ||
| 217 | + "toUserName": "", | ||
| 218 | + "toUserType": null, | ||
| 219 | + "topFlag": 0, | ||
| 220 | + "uuid": "a1371f97-ccfa-4477-893d-4f46144f320d" | ||
| 221 | + }, { | ||
| 222 | + "authorLike": 0, | ||
| 223 | + "avatarFrame": "", | ||
| 224 | + "checkStatus": 2, | ||
| 225 | + "childCommentNum": 0, | ||
| 226 | + "childComments": [], | ||
| 227 | + "commentContent": "违法乱纪必究!", | ||
| 228 | + "commentContentSensitive": "", | ||
| 229 | + "commentLevel": 1, | ||
| 230 | + "commentPics": "", | ||
| 231 | + "commentSensitive": "", | ||
| 232 | + "commentType": "1", | ||
| 233 | + "contentAuthor": 0, | ||
| 234 | + "createTime": "2024-04-09 17:27:10", | ||
| 235 | + "creatorFlag": 0, | ||
| 236 | + "fromCreatorId": "", | ||
| 237 | + "fromDeviceId": "", | ||
| 238 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202403/rmrb_pMPU7m4t1711116925.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 239 | + "fromUserId": "530911710439685", | ||
| 240 | + "fromUserName": "上善若水", | ||
| 241 | + "fromUserType": 1, | ||
| 242 | + "id": 57185770, | ||
| 243 | + "likeNum": 5, | ||
| 244 | + "mySelf": 0, | ||
| 245 | + "parentId": -1, | ||
| 246 | + "region": "", | ||
| 247 | + "replyNum": 0, | ||
| 248 | + "rootCommentId": 57185770, | ||
| 249 | + "sensitiveExist": 0, | ||
| 250 | + "sensitiveShow": 1, | ||
| 251 | + "toUserContentAuthor": 0, | ||
| 252 | + "toUserId": "", | ||
| 253 | + "toUserName": "", | ||
| 254 | + "toUserType": null, | ||
| 255 | + "topFlag": 0, | ||
| 256 | + "uuid": "60779cde-36cc-4fec-a984-58035dea35ea" | ||
| 257 | + }, { | ||
| 258 | + "authorLike": 0, | ||
| 259 | + "avatarFrame": "", | ||
| 260 | + "checkStatus": 2, | ||
| 261 | + "childCommentNum": 0, | ||
| 262 | + "childComments": [], | ||
| 263 | + "commentContent": "反腐永遠吹衝鋒號", | ||
| 264 | + "commentContentSensitive": "", | ||
| 265 | + "commentLevel": 1, | ||
| 266 | + "commentPics": "", | ||
| 267 | + "commentSensitive": "", | ||
| 268 | + "commentType": "1", | ||
| 269 | + "contentAuthor": 0, | ||
| 270 | + "createTime": "2024-04-09 17:26:34", | ||
| 271 | + "creatorFlag": 0, | ||
| 272 | + "fromCreatorId": "", | ||
| 273 | + "fromDeviceId": "", | ||
| 274 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 275 | + "fromUserId": "531302591987589", | ||
| 276 | + "fromUserName": "荒菴", | ||
| 277 | + "fromUserType": 1, | ||
| 278 | + "id": 57185761, | ||
| 279 | + "likeNum": 4, | ||
| 280 | + "mySelf": 0, | ||
| 281 | + "parentId": -1, | ||
| 282 | + "region": "", | ||
| 283 | + "replyNum": 0, | ||
| 284 | + "rootCommentId": 57185761, | ||
| 285 | + "sensitiveExist": 0, | ||
| 286 | + "sensitiveShow": 1, | ||
| 287 | + "toUserContentAuthor": 0, | ||
| 288 | + "toUserId": "", | ||
| 289 | + "toUserName": "", | ||
| 290 | + "toUserType": null, | ||
| 291 | + "topFlag": 0, | ||
| 292 | + "uuid": "6d4bc2e1-78b8-4c71-af77-db3b460f35c8" | ||
| 293 | + }, { | ||
| 294 | + "authorLike": 0, | ||
| 295 | + "avatarFrame": "", | ||
| 296 | + "checkStatus": 2, | ||
| 297 | + "childCommentNum": 0, | ||
| 298 | + "childComments": [], | ||
| 299 | + "commentContent": "丧失理想信念;\n背弃初心使命。\n无视八项规定;\n依法审查起诉。👈👈", | ||
| 300 | + "commentContentSensitive": "", | ||
| 301 | + "commentLevel": 1, | ||
| 302 | + "commentPics": "", | ||
| 303 | + "commentSensitive": "", | ||
| 304 | + "commentType": "1", | ||
| 305 | + "contentAuthor": 0, | ||
| 306 | + "createTime": "2024-04-09 17:12:59", | ||
| 307 | + "creatorFlag": 0, | ||
| 308 | + "fromCreatorId": "", | ||
| 309 | + "fromDeviceId": "", | ||
| 310 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202312/rmrb_KVwjcPrp1701846404.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 311 | + "fromUserId": "531592816140165", | ||
| 312 | + "fromUserName": "佛系生存", | ||
| 313 | + "fromUserType": 1, | ||
| 314 | + "id": 57254110, | ||
| 315 | + "likeNum": 20, | ||
| 316 | + "mySelf": 0, | ||
| 317 | + "parentId": -1, | ||
| 318 | + "region": "新疆维吾尔自治区乌鲁木齐市", | ||
| 319 | + "replyNum": 0, | ||
| 320 | + "rootCommentId": 57254110, | ||
| 321 | + "sensitiveExist": 0, | ||
| 322 | + "sensitiveShow": 1, | ||
| 323 | + "toUserContentAuthor": 0, | ||
| 324 | + "toUserId": "", | ||
| 325 | + "toUserName": "", | ||
| 326 | + "toUserType": null, | ||
| 327 | + "topFlag": 0, | ||
| 328 | + "uuid": "a5a61f24-6c97-479f-8ff4-0b23330fe6c2" | ||
| 329 | + }, { | ||
| 330 | + "authorLike": 0, | ||
| 331 | + "avatarFrame": "", | ||
| 332 | + "checkStatus": 2, | ||
| 333 | + "childCommentNum": 0, | ||
| 334 | + "childComments": [], | ||
| 335 | + "commentContent": "作恶必受报应👊🏻👊🏻", | ||
| 336 | + "commentContentSensitive": "", | ||
| 337 | + "commentLevel": 1, | ||
| 338 | + "commentPics": "", | ||
| 339 | + "commentSensitive": "", | ||
| 340 | + "commentType": "1", | ||
| 341 | + "contentAuthor": 0, | ||
| 342 | + "createTime": "2024-04-09 17:11:32", | ||
| 343 | + "creatorFlag": 0, | ||
| 344 | + "fromCreatorId": "", | ||
| 345 | + "fromDeviceId": "", | ||
| 346 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202402/rmrb_QEU4YSVc1708676160.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 347 | + "fromUserId": "522520907165062", | ||
| 348 | + "fromUserName": "天耀中华888合十", | ||
| 349 | + "fromUserType": 1, | ||
| 350 | + "id": 57184951, | ||
| 351 | + "likeNum": 5, | ||
| 352 | + "mySelf": 0, | ||
| 353 | + "parentId": -1, | ||
| 354 | + "region": "山东省烟台市", | ||
| 355 | + "replyNum": 0, | ||
| 356 | + "rootCommentId": 57184951, | ||
| 357 | + "sensitiveExist": 0, | ||
| 358 | + "sensitiveShow": 1, | ||
| 359 | + "toUserContentAuthor": 0, | ||
| 360 | + "toUserId": "", | ||
| 361 | + "toUserName": "", | ||
| 362 | + "toUserType": null, | ||
| 363 | + "topFlag": 0, | ||
| 364 | + "uuid": "81f86371-83b8-4144-8699-23e4ee876378" | ||
| 365 | + }], | ||
| 366 | + "pageNum": 0, | ||
| 367 | + "pageSize": 10, | ||
| 368 | + "totalCommentNum": 11, | ||
| 369 | + "totalCount": 11 | ||
| 370 | + }, | ||
| 371 | + "message": "Success", | ||
| 372 | + "meta": null, | ||
| 373 | + "requestId": "", | ||
| 374 | + "success": true, | ||
| 375 | + "timestamp": 1712667900724 | ||
| 376 | +} |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "hasNext": 1, | ||
| 5 | + "list": [{ | ||
| 6 | + "authorLike": 0, | ||
| 7 | + "avatarFrame": "", | ||
| 8 | + "checkStatus": 2, | ||
| 9 | + "commentContent": "好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主好棒的号主", | ||
| 10 | + "commentContentSensitive": "", | ||
| 11 | + "commentLevel": 1, | ||
| 12 | + "commentPics": "", | ||
| 13 | + "commentSensitive": "", | ||
| 14 | + "commentType": "2", | ||
| 15 | + "contentAuthor": 0, | ||
| 16 | + "createTime": "2024-04-15 14:23:10", | ||
| 17 | + "creatorFlag": 0, | ||
| 18 | + "fromCreatorId": "", | ||
| 19 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20220101/a_661756798214074368.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 20 | + "fromUserId": "522455831285125", | ||
| 21 | + "fromUserName": "新志说", | ||
| 22 | + "fromUserType": 1, | ||
| 23 | + "h5Url": "", | ||
| 24 | + "highQualityExpireTime": "2024-04-15T18:32:32+0800", | ||
| 25 | + "highQualityTime": "2024-04-12T18:32:32+0800", | ||
| 26 | + "id": 57148720, | ||
| 27 | + "likeNum": 0, | ||
| 28 | + "mySelf": 0, | ||
| 29 | + "pageId": null, | ||
| 30 | + "parentId": -1, | ||
| 31 | + "region": "北京", | ||
| 32 | + "replyNum": 0, | ||
| 33 | + "rootCommentId": 57148720, | ||
| 34 | + "sensitiveExist": 0, | ||
| 35 | + "sensitiveShow": 1, | ||
| 36 | + "shareInfo": { | ||
| 37 | + "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240320/a_955037763411898368.jpeg", | ||
| 38 | + "shareSummary": "苏东坡的家风里藏着怎样的精神原力?", | ||
| 39 | + "shareTitle": "苏东坡的家风里藏着怎样的精神原力?", | ||
| 40 | + "shareUrl": "https://people.pdnews.cn/rmhvideo/30043985346" | ||
| 41 | + }, | ||
| 42 | + "targetId": "30043985346", | ||
| 43 | + "targetRelId": "", | ||
| 44 | + "targetRelObjectId": "", | ||
| 45 | + "targetRelType": null, | ||
| 46 | + "targetStatus": 0, | ||
| 47 | + "targetTitle": "苏东坡的家风里藏着怎样的精神原力?", | ||
| 48 | + "targetType": 1, | ||
| 49 | + "toUserContentAuthor": 0, | ||
| 50 | + "toUserName": "", | ||
| 51 | + "topFlag": 0, | ||
| 52 | + "topicType": null, | ||
| 53 | + "uuid": "267385e2-f333-422a-9552-e67d2043845c", | ||
| 54 | + "visitorComment": 1 | ||
| 55 | + }, { | ||
| 56 | + "authorLike": 0, | ||
| 57 | + "avatarFrame": "", | ||
| 58 | + "checkStatus": 2, | ||
| 59 | + "commentContent": "啦啦啦啦", | ||
| 60 | + "commentContentSensitive": "", | ||
| 61 | + "commentLevel": 1, | ||
| 62 | + "commentPics": "", | ||
| 63 | + "commentSensitive": "", | ||
| 64 | + "commentType": "2", | ||
| 65 | + "contentAuthor": 0, | ||
| 66 | + "createTime": "2024-04-13 14:45:14", | ||
| 67 | + "creatorFlag": 0, | ||
| 68 | + "fromCreatorId": "", | ||
| 69 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn/null20240322/1681921291/1711108111670.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 70 | + "fromUserId": "574601020679237", | ||
| 71 | + "fromUserName": "Zirui", | ||
| 72 | + "fromUserType": 1, | ||
| 73 | + "h5Url": "", | ||
| 74 | + "highQualityExpireTime": "2024-04-15T18:32:27+0800", | ||
| 75 | + "highQualityTime": "2024-04-12T18:32:27+0800", | ||
| 76 | + "id": 57027343, | ||
| 77 | + "likeNum": 0, | ||
| 78 | + "mySelf": 0, | ||
| 79 | + "pageId": null, | ||
| 80 | + "parentId": -1, | ||
| 81 | + "region": "北京", | ||
| 82 | + "replyNum": 0, | ||
| 83 | + "rootCommentId": 57027343, | ||
| 84 | + "sensitiveExist": 0, | ||
| 85 | + "sensitiveShow": 1, | ||
| 86 | + "shareInfo": { | ||
| 87 | + "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240330/a_958638228225650688.png", | ||
| 88 | + "shareSummary": "黄金地块!昌平今年计划供应这7宗住宅用地", | ||
| 89 | + "shareTitle": "黄金地块!昌平今年计划供应这7宗住宅用地", | ||
| 90 | + "shareUrl": "https://people.pdnews.cn/rmharticle/30044144003" | ||
| 91 | + }, | ||
| 92 | + "targetId": "30044144003", | ||
| 93 | + "targetRelId": "", | ||
| 94 | + "targetRelObjectId": "", | ||
| 95 | + "targetRelType": null, | ||
| 96 | + "targetStatus": 0, | ||
| 97 | + "targetTitle": "黄金地块!昌平今年计划供应这7宗住宅用地", | ||
| 98 | + "targetType": 8, | ||
| 99 | + "toUserContentAuthor": 0, | ||
| 100 | + "toUserName": "", | ||
| 101 | + "topFlag": 0, | ||
| 102 | + "topicType": null, | ||
| 103 | + "uuid": "b41ba843-f2ff-47e6-8a97-3f70e50b094c", | ||
| 104 | + "visitorComment": 1 | ||
| 105 | + }, { | ||
| 106 | + "authorLike": 0, | ||
| 107 | + "avatarFrame": "", | ||
| 108 | + "checkStatus": 2, | ||
| 109 | + "commentContent": "大家好", | ||
| 110 | + "commentContentSensitive": "", | ||
| 111 | + "commentLevel": 1, | ||
| 112 | + "commentPics": "", | ||
| 113 | + "commentSensitive": "", | ||
| 114 | + "commentType": "2", | ||
| 115 | + "contentAuthor": 0, | ||
| 116 | + "createTime": "2024-04-02 16:05:12", | ||
| 117 | + "creatorFlag": 1, | ||
| 118 | + "fromCreatorId": "2495230", | ||
| 119 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn/vod/content/202404/20240402152130124/mpi.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 120 | + "fromUserId": "488915066770949", | ||
| 121 | + "fromUserName": "极目新闻客户端", | ||
| 122 | + "fromUserType": 2, | ||
| 123 | + "h5Url": "", | ||
| 124 | + "highQualityExpireTime": "2024-04-15T18:32:24+0800", | ||
| 125 | + "highQualityTime": "2024-04-12T18:32:24+0800", | ||
| 126 | + "id": 57003773, | ||
| 127 | + "likeNum": 0, | ||
| 128 | + "mySelf": 0, | ||
| 129 | + "pageId": null, | ||
| 130 | + "parentId": -1, | ||
| 131 | + "region": "北京", | ||
| 132 | + "replyNum": 0, | ||
| 133 | + "rootCommentId": 57003773, | ||
| 134 | + "sensitiveExist": 0, | ||
| 135 | + "sensitiveShow": 1, | ||
| 136 | + "shareInfo": { | ||
| 137 | + "shareCoverUrl": "", | ||
| 138 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 139 | + "shareTitle": "探索营养新高度 三只小牛推出功能牛奶系列新品", | ||
| 140 | + "shareUrl": "https://people.pdnews.cn/column/30002004812-500000215456" | ||
| 141 | + }, | ||
| 142 | + "targetId": "30002004812", | ||
| 143 | + "targetRelId": "500000215456", | ||
| 144 | + "targetRelObjectId": "2017", | ||
| 145 | + "targetRelType": 1, | ||
| 146 | + "targetStatus": 0, | ||
| 147 | + "targetTitle": "探索营养新高度 三只小牛推出功能牛奶系列新品", | ||
| 148 | + "targetType": 8, | ||
| 149 | + "toUserContentAuthor": 0, | ||
| 150 | + "toUserName": "", | ||
| 151 | + "topFlag": 0, | ||
| 152 | + "topicType": null, | ||
| 153 | + "uuid": "045fbe86-7227-447a-a9ea-d991d4c4bb02", | ||
| 154 | + "visitorComment": 1 | ||
| 155 | + }, { | ||
| 156 | + "authorLike": 0, | ||
| 157 | + "avatarFrame": "", | ||
| 158 | + "checkStatus": 2, | ||
| 159 | + "commentContent": "大家好", | ||
| 160 | + "commentContentSensitive": "", | ||
| 161 | + "commentLevel": 1, | ||
| 162 | + "commentPics": "", | ||
| 163 | + "commentSensitive": "", | ||
| 164 | + "commentType": "2", | ||
| 165 | + "contentAuthor": 0, | ||
| 166 | + "createTime": "2024-04-02 16:04:54", | ||
| 167 | + "creatorFlag": 1, | ||
| 168 | + "fromCreatorId": "2495230", | ||
| 169 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn/vod/content/202404/20240402152130124/mpi.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 170 | + "fromUserId": "488915066770949", | ||
| 171 | + "fromUserName": "极目新闻客户端", | ||
| 172 | + "fromUserType": 2, | ||
| 173 | + "h5Url": "", | ||
| 174 | + "highQualityExpireTime": "2024-04-15T18:32:19+0800", | ||
| 175 | + "highQualityTime": "2024-04-12T18:32:19+0800", | ||
| 176 | + "id": 57003731, | ||
| 177 | + "likeNum": 0, | ||
| 178 | + "mySelf": 0, | ||
| 179 | + "pageId": null, | ||
| 180 | + "parentId": -1, | ||
| 181 | + "region": "北京", | ||
| 182 | + "replyNum": 0, | ||
| 183 | + "rootCommentId": 57003731, | ||
| 184 | + "sensitiveExist": 0, | ||
| 185 | + "sensitiveShow": 1, | ||
| 186 | + "shareInfo": { | ||
| 187 | + "shareCoverUrl": "", | ||
| 188 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 189 | + "shareTitle": "探索营养新高度 三只小牛推出功能牛奶系列新品", | ||
| 190 | + "shareUrl": "https://people.pdnews.cn/column/30002004812-500000215456" | ||
| 191 | + }, | ||
| 192 | + "targetId": "30002004812", | ||
| 193 | + "targetRelId": "500000215456", | ||
| 194 | + "targetRelObjectId": "2017", | ||
| 195 | + "targetRelType": 1, | ||
| 196 | + "targetStatus": 0, | ||
| 197 | + "targetTitle": "探索营养新高度 三只小牛推出功能牛奶系列新品", | ||
| 198 | + "targetType": 8, | ||
| 199 | + "toUserContentAuthor": 0, | ||
| 200 | + "toUserName": "", | ||
| 201 | + "topFlag": 0, | ||
| 202 | + "topicType": null, | ||
| 203 | + "uuid": "e98533d4-832c-46fc-b6c8-fcfbcf8dec81", | ||
| 204 | + "visitorComment": 1 | ||
| 205 | + }, { | ||
| 206 | + "authorLike": 0, | ||
| 207 | + "avatarFrame": "", | ||
| 208 | + "checkStatus": 2, | ||
| 209 | + "commentContent": "😉", | ||
| 210 | + "commentContentSensitive": "", | ||
| 211 | + "commentLevel": 1, | ||
| 212 | + "commentPics": "", | ||
| 213 | + "commentSensitive": "", | ||
| 214 | + "commentType": "2", | ||
| 215 | + "contentAuthor": 0, | ||
| 216 | + "createTime": "2024-04-02 09:27:37", | ||
| 217 | + "creatorFlag": 0, | ||
| 218 | + "fromCreatorId": "", | ||
| 219 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024010916/61A1BB7793074AEFA58F1A6B629B0575.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 220 | + "fromUserId": "507102106399685", | ||
| 221 | + "fromUserName": "小土豆", | ||
| 222 | + "fromUserType": 1, | ||
| 223 | + "h5Url": "http://people.pdnews.cn/h/audiotopic/21622-10000002141", | ||
| 224 | + "highQualityExpireTime": "2024-04-15T18:32:17+0800", | ||
| 225 | + "highQualityTime": "2024-04-12T18:32:17+0800", | ||
| 226 | + "id": 56897011, | ||
| 227 | + "likeNum": 0, | ||
| 228 | + "mySelf": 0, | ||
| 229 | + "pageId": 21622, | ||
| 230 | + "parentId": -1, | ||
| 231 | + "region": "上海", | ||
| 232 | + "replyNum": 0, | ||
| 233 | + "rootCommentId": 56897011, | ||
| 234 | + "sensitiveExist": 0, | ||
| 235 | + "sensitiveShow": 1, | ||
| 236 | + "shareInfo": { | ||
| 237 | + "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/seminar_img/201808/rmrb_60441534322948.png", | ||
| 238 | + "shareSummary": "经典文章", | ||
| 239 | + "shareTitle": "夜读", | ||
| 240 | + "shareUrl": "http://people.pdnews.cn/audiotopic/21622-10000002141" | ||
| 241 | + }, | ||
| 242 | + "targetId": "10000002141", | ||
| 243 | + "targetRelId": "", | ||
| 244 | + "targetRelObjectId": "", | ||
| 245 | + "targetRelType": null, | ||
| 246 | + "targetStatus": 0, | ||
| 247 | + "targetTitle": "夜读", | ||
| 248 | + "targetType": 5, | ||
| 249 | + "toUserContentAuthor": 0, | ||
| 250 | + "toUserName": "", | ||
| 251 | + "topFlag": 0, | ||
| 252 | + "topicType": 22, | ||
| 253 | + "uuid": "4dad103a-de92-4db8-9ee4-9c1bb294ea69", | ||
| 254 | + "visitorComment": 1 | ||
| 255 | + }, { | ||
| 256 | + "authorLike": 0, | ||
| 257 | + "avatarFrame": "", | ||
| 258 | + "checkStatus": 2, | ||
| 259 | + "commentContent": "2", | ||
| 260 | + "commentContentSensitive": "", | ||
| 261 | + "commentLevel": 1, | ||
| 262 | + "commentPics": "", | ||
| 263 | + "commentSensitive": "", | ||
| 264 | + "commentType": "2", | ||
| 265 | + "contentAuthor": 0, | ||
| 266 | + "createTime": "2024-04-02 08:59:00", | ||
| 267 | + "creatorFlag": 0, | ||
| 268 | + "fromCreatorId": "", | ||
| 269 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202403/rmrb_MqZfPsdm1711510425.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 270 | + "fromUserId": "497856912963077", | ||
| 271 | + "fromUserName": "李冉冉", | ||
| 272 | + "fromUserType": 1, | ||
| 273 | + "h5Url": "", | ||
| 274 | + "highQualityExpireTime": "2024-04-15T18:32:13+0800", | ||
| 275 | + "highQualityTime": "2024-04-12T18:32:13+0800", | ||
| 276 | + "id": 56896568, | ||
| 277 | + "likeNum": 0, | ||
| 278 | + "mySelf": 0, | ||
| 279 | + "pageId": null, | ||
| 280 | + "parentId": -1, | ||
| 281 | + "region": "安徽", | ||
| 282 | + "replyNum": 0, | ||
| 283 | + "rootCommentId": 56896568, | ||
| 284 | + "sensitiveExist": 0, | ||
| 285 | + "sensitiveShow": 1, | ||
| 286 | + "shareInfo": { | ||
| 287 | + "shareCoverUrl": "", | ||
| 288 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 289 | + "shareTitle": "尺素金声丨净息差20年来最低,背后是银行让利实体经济", | ||
| 290 | + "shareUrl": "https://people.pdnews.cn/column/30044175615-500005272796" | ||
| 291 | + }, | ||
| 292 | + "targetId": "30044175615", | ||
| 293 | + "targetRelId": "500005272796", | ||
| 294 | + "targetRelObjectId": "2002", | ||
| 295 | + "targetRelType": 1, | ||
| 296 | + "targetStatus": 0, | ||
| 297 | + "targetTitle": "尺素金声丨净息差20年来最低,背后是银行让利实体经济", | ||
| 298 | + "targetType": 8, | ||
| 299 | + "toUserContentAuthor": 0, | ||
| 300 | + "toUserName": "", | ||
| 301 | + "topFlag": 0, | ||
| 302 | + "topicType": null, | ||
| 303 | + "uuid": "959e017c-b84b-4ff3-ae58-0df0e8a14dcc", | ||
| 304 | + "visitorComment": 1 | ||
| 305 | + }, { | ||
| 306 | + "authorLike": 0, | ||
| 307 | + "avatarFrame": "", | ||
| 308 | + "checkStatus": 2, | ||
| 309 | + "commentContent": "我中午", | ||
| 310 | + "commentContentSensitive": "", | ||
| 311 | + "commentLevel": 1, | ||
| 312 | + "commentPics": "", | ||
| 313 | + "commentSensitive": "", | ||
| 314 | + "commentType": "2", | ||
| 315 | + "contentAuthor": 0, | ||
| 316 | + "createTime": "2024-04-01 14:22:48", | ||
| 317 | + "creatorFlag": 0, | ||
| 318 | + "fromCreatorId": "", | ||
| 319 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 320 | + "fromUserId": "574444396143685", | ||
| 321 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 322 | + "fromUserType": 1, | ||
| 323 | + "h5Url": "", | ||
| 324 | + "highQualityExpireTime": "2024-04-15T18:32:09+0800", | ||
| 325 | + "highQualityTime": "2024-04-12T18:32:09+0800", | ||
| 326 | + "id": 56792967, | ||
| 327 | + "likeNum": 1, | ||
| 328 | + "mySelf": 0, | ||
| 329 | + "pageId": null, | ||
| 330 | + "parentId": -1, | ||
| 331 | + "region": "安徽", | ||
| 332 | + "replyNum": 0, | ||
| 333 | + "rootCommentId": 56792967, | ||
| 334 | + "sensitiveExist": 0, | ||
| 335 | + "sensitiveShow": 1, | ||
| 336 | + "shareInfo": { | ||
| 337 | + "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0328/647894_957794402615422976.jpeg", | ||
| 338 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 339 | + "shareTitle": "日本小林制药称已有4人因服用其含红曲成分保健品而死亡", | ||
| 340 | + "shareUrl": "https://people.pdnews.cn/rmharticle/30044103222" | ||
| 341 | + }, | ||
| 342 | + "targetId": "30044103222", | ||
| 343 | + "targetRelId": "", | ||
| 344 | + "targetRelObjectId": "", | ||
| 345 | + "targetRelType": null, | ||
| 346 | + "targetStatus": 0, | ||
| 347 | + "targetTitle": "日本小林制药称已有4人因服用其含红曲成分保健品而死亡", | ||
| 348 | + "targetType": 8, | ||
| 349 | + "toUserContentAuthor": 0, | ||
| 350 | + "toUserName": "", | ||
| 351 | + "topFlag": 0, | ||
| 352 | + "topicType": null, | ||
| 353 | + "uuid": "591871f2-bddf-4dae-9e6e-a003e1f6e718", | ||
| 354 | + "visitorComment": 1 | ||
| 355 | + }, { | ||
| 356 | + "authorLike": 0, | ||
| 357 | + "avatarFrame": "", | ||
| 358 | + "checkStatus": 2, | ||
| 359 | + "commentContent": "你好", | ||
| 360 | + "commentContentSensitive": "", | ||
| 361 | + "commentLevel": 1, | ||
| 362 | + "commentPics": "", | ||
| 363 | + "commentSensitive": "", | ||
| 364 | + "commentType": "2", | ||
| 365 | + "contentAuthor": 0, | ||
| 366 | + "createTime": "2024-04-01 14:22:12", | ||
| 367 | + "creatorFlag": 0, | ||
| 368 | + "fromCreatorId": "", | ||
| 369 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 370 | + "fromUserId": "574444396143685", | ||
| 371 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 372 | + "fromUserType": 1, | ||
| 373 | + "h5Url": "", | ||
| 374 | + "highQualityExpireTime": "2024-04-15T18:26:14+0800", | ||
| 375 | + "highQualityTime": "2024-04-12T18:26:14+0800", | ||
| 376 | + "id": 56882995, | ||
| 377 | + "likeNum": 0, | ||
| 378 | + "mySelf": 0, | ||
| 379 | + "pageId": null, | ||
| 380 | + "parentId": -1, | ||
| 381 | + "region": "安徽", | ||
| 382 | + "replyNum": 0, | ||
| 383 | + "rootCommentId": 56882995, | ||
| 384 | + "sensitiveExist": 0, | ||
| 385 | + "sensitiveShow": 1, | ||
| 386 | + "shareInfo": { | ||
| 387 | + "shareCoverUrl": "", | ||
| 388 | + "shareSummary": "努力过好当下,让每一个今天的自己,都比昨天有进步,就是对人生最大的敬意。", | ||
| 389 | + "shareTitle": "2024年进度条:■■■□□□□□□□□□", | ||
| 390 | + "shareUrl": "https://people.pdnews.cn/column/30044157156-500005269319" | ||
| 391 | + }, | ||
| 392 | + "targetId": "30044157156", | ||
| 393 | + "targetRelId": "500005269319", | ||
| 394 | + "targetRelObjectId": "2003", | ||
| 395 | + "targetRelType": 1, | ||
| 396 | + "targetStatus": 0, | ||
| 397 | + "targetTitle": "2024年进度条:■■■□□□□□□□□□", | ||
| 398 | + "targetType": 13, | ||
| 399 | + "toUserContentAuthor": 0, | ||
| 400 | + "toUserName": "", | ||
| 401 | + "topFlag": 0, | ||
| 402 | + "topicType": null, | ||
| 403 | + "uuid": "6562a44e-5010-4691-9c06-a31d4dd24b80", | ||
| 404 | + "visitorComment": 1 | ||
| 405 | + }, { | ||
| 406 | + "authorLike": 0, | ||
| 407 | + "avatarFrame": "", | ||
| 408 | + "checkStatus": 2, | ||
| 409 | + "commentContent": "你晚上", | ||
| 410 | + "commentContentSensitive": "", | ||
| 411 | + "commentLevel": 1, | ||
| 412 | + "commentPics": "", | ||
| 413 | + "commentSensitive": "", | ||
| 414 | + "commentType": "2", | ||
| 415 | + "contentAuthor": 0, | ||
| 416 | + "createTime": "2024-04-01 14:22:25", | ||
| 417 | + "creatorFlag": 0, | ||
| 418 | + "fromCreatorId": "", | ||
| 419 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 420 | + "fromUserId": "574444396143685", | ||
| 421 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 422 | + "fromUserType": 1, | ||
| 423 | + "h5Url": "", | ||
| 424 | + "highQualityExpireTime": "2024-04-15T18:26:09+0800", | ||
| 425 | + "highQualityTime": "2024-04-12T18:26:09+0800", | ||
| 426 | + "id": 56883010, | ||
| 427 | + "likeNum": 0, | ||
| 428 | + "mySelf": 0, | ||
| 429 | + "pageId": null, | ||
| 430 | + "parentId": -1, | ||
| 431 | + "region": "安徽", | ||
| 432 | + "replyNum": 0, | ||
| 433 | + "rootCommentId": 56883010, | ||
| 434 | + "sensitiveExist": 0, | ||
| 435 | + "sensitiveShow": 1, | ||
| 436 | + "shareInfo": { | ||
| 437 | + "shareCoverUrl": "", | ||
| 438 | + "shareSummary": "行业的健康发展,不能对消费者玩“套路”,凭借质量取胜才是王道。", | ||
| 439 | + "shareTitle": "微短剧付费“无底洞”跌进了谁", | ||
| 440 | + "shareUrl": "https://people.pdnews.cn/column/30044103669-500005258426" | ||
| 441 | + }, | ||
| 442 | + "targetId": "30044103669", | ||
| 443 | + "targetRelId": "500005258426", | ||
| 444 | + "targetRelObjectId": "2003", | ||
| 445 | + "targetRelType": 1, | ||
| 446 | + "targetStatus": 0, | ||
| 447 | + "targetTitle": "微短剧付费“无底洞”跌进了谁", | ||
| 448 | + "targetType": 8, | ||
| 449 | + "toUserContentAuthor": 0, | ||
| 450 | + "toUserName": "", | ||
| 451 | + "topFlag": 0, | ||
| 452 | + "topicType": null, | ||
| 453 | + "uuid": "2d16b876-b311-49a7-aa46-c3cf631a992e", | ||
| 454 | + "visitorComment": 1 | ||
| 455 | + }, { | ||
| 456 | + "authorLike": 0, | ||
| 457 | + "avatarFrame": "", | ||
| 458 | + "checkStatus": 2, | ||
| 459 | + "commentContent": "外婆企图", | ||
| 460 | + "commentContentSensitive": "", | ||
| 461 | + "commentLevel": 1, | ||
| 462 | + "commentPics": "", | ||
| 463 | + "commentSensitive": "", | ||
| 464 | + "commentType": "2", | ||
| 465 | + "contentAuthor": 0, | ||
| 466 | + "createTime": "2024-04-01 14:22:37", | ||
| 467 | + "creatorFlag": 0, | ||
| 468 | + "fromCreatorId": "", | ||
| 469 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 470 | + "fromUserId": "574444396143685", | ||
| 471 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 472 | + "fromUserType": 1, | ||
| 473 | + "h5Url": "", | ||
| 474 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 475 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 476 | + "id": 56792966, | ||
| 477 | + "likeNum": 0, | ||
| 478 | + "mySelf": 0, | ||
| 479 | + "pageId": null, | ||
| 480 | + "parentId": -1, | ||
| 481 | + "region": "安徽", | ||
| 482 | + "replyNum": 0, | ||
| 483 | + "rootCommentId": 56792966, | ||
| 484 | + "sensitiveExist": 0, | ||
| 485 | + "sensitiveShow": 1, | ||
| 486 | + "shareInfo": { | ||
| 487 | + "shareCoverUrl": "", | ||
| 488 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 489 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 490 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 491 | + }, | ||
| 492 | + "targetId": "30044115488", | ||
| 493 | + "targetRelId": "500005262017", | ||
| 494 | + "targetRelObjectId": "2003", | ||
| 495 | + "targetRelType": 1, | ||
| 496 | + "targetStatus": 0, | ||
| 497 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 498 | + "targetType": 13, | ||
| 499 | + "toUserContentAuthor": 0, | ||
| 500 | + "toUserName": "", | ||
| 501 | + "topFlag": 0, | ||
| 502 | + "topicType": null, | ||
| 503 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 504 | + "visitorComment": 1 | ||
| 505 | + }], | ||
| 506 | + "pageNum": 1, | ||
| 507 | + "pageSize": 10, | ||
| 508 | + "totalCommentNum": 0, | ||
| 509 | + "totalCount": 16 | ||
| 510 | + }, | ||
| 511 | + "message": "Success", | ||
| 512 | + "meta": null, | ||
| 513 | + "requestId": "", | ||
| 514 | + "success": true, | ||
| 515 | + "timestamp": 1713162597102 | ||
| 516 | +} |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment