Showing
50 changed files
with
1456 additions
and
892 deletions
| @@ -16,6 +16,7 @@ interface dataObject { | @@ -16,6 +16,7 @@ interface dataObject { | ||
| 16 | operateType?: string | 16 | operateType?: string |
| 17 | webViewHeight?: string | 17 | webViewHeight?: string |
| 18 | dataJson?: string | 18 | dataJson?: string |
| 19 | + appInnerLink?: string | ||
| 19 | } | 20 | } |
| 20 | /** | 21 | /** |
| 21 | * 消息Message | 22 | * 消息Message |
| @@ -52,7 +52,7 @@ export class WDRouterPage { | @@ -52,7 +52,7 @@ export class WDRouterPage { | ||
| 52 | // 点播详情页 | 52 | // 点播详情页 |
| 53 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); | 53 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); |
| 54 | // 直播详情页 | 54 | // 直播详情页 |
| 55 | - static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); | 55 | + // static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); |
| 56 | static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage"); | 56 | static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage"); |
| 57 | static detailPlayLiveCommon = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLiveCommon"); | 57 | static detailPlayLiveCommon = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLiveCommon"); |
| 58 | // 多图(图集)详情页 | 58 | // 多图(图集)详情页 |
| @@ -138,7 +138,7 @@ export class ProcessUtils { | @@ -138,7 +138,7 @@ export class ProcessUtils { | ||
| 138 | * 动态详情页(动态视频/动态图片) | 138 | * 动态详情页(动态视频/动态图片) |
| 139 | * @param content | 139 | * @param content |
| 140 | * */ | 140 | * */ |
| 141 | - private static gotoDynamicDetailPage(content: ContentDTO) { | 141 | + public static gotoDynamicDetailPage(content: ContentDTO) { |
| 142 | let taskAction: Action = { | 142 | let taskAction: Action = { |
| 143 | type: 'JUMP_DETAIL_PAGE', | 143 | type: 'JUMP_DETAIL_PAGE', |
| 144 | params: { | 144 | params: { |
| @@ -172,7 +172,7 @@ export class ProcessUtils { | @@ -172,7 +172,7 @@ export class ProcessUtils { | ||
| 172 | Logger.debug(TAG, `gotoMultiPictureListPage`); | 172 | Logger.debug(TAG, `gotoMultiPictureListPage`); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | - private static gotoSpecialTopic(content: ContentDTO) { | 175 | + public static gotoSpecialTopic(content: ContentDTO) { |
| 176 | let taskAction: Action = { | 176 | let taskAction: Action = { |
| 177 | type: 'JUMP_INNER_NEW_PAGE', | 177 | type: 'JUMP_INNER_NEW_PAGE', |
| 178 | params: { | 178 | params: { |
| @@ -183,7 +183,7 @@ export class ProcessUtils { | @@ -183,7 +183,7 @@ export class ProcessUtils { | ||
| 183 | WDRouterRule.jumpWithAction(taskAction) | 183 | WDRouterRule.jumpWithAction(taskAction) |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | - private static gotoDefaultWeb(content: ContentDTO) { | 186 | + public static gotoDefaultWeb(content: ContentDTO) { |
| 187 | let taskAction: Action = { | 187 | let taskAction: Action = { |
| 188 | type: 'JUMP_H5_BY_WEB_VIEW', | 188 | type: 'JUMP_H5_BY_WEB_VIEW', |
| 189 | params: { | 189 | params: { |
| @@ -212,7 +212,7 @@ export class ProcessUtils { | @@ -212,7 +212,7 @@ export class ProcessUtils { | ||
| 212 | Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`); | 212 | Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`); |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | - private static gotoWeb(content: ContentDTO) { | 215 | + public static gotoWeb(content: ContentDTO) { |
| 216 | let taskAction: Action = { | 216 | let taskAction: Action = { |
| 217 | type: 'JUMP_INNER_NEW_PAGE', | 217 | type: 'JUMP_INNER_NEW_PAGE', |
| 218 | params: { | 218 | params: { |
| @@ -231,7 +231,7 @@ export class ProcessUtils { | @@ -231,7 +231,7 @@ export class ProcessUtils { | ||
| 231 | Logger.debug(TAG, `gotoWeb, ${content.objectId}`); | 231 | Logger.debug(TAG, `gotoWeb, ${content.objectId}`); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | - private static gotoVod(content: ContentDTO) { | 234 | + public static gotoVod(content: ContentDTO) { |
| 235 | let taskAction: Action = { | 235 | let taskAction: Action = { |
| 236 | type: 'JUMP_DETAIL_PAGE', | 236 | type: 'JUMP_DETAIL_PAGE', |
| 237 | params: { | 237 | params: { |
| @@ -247,7 +247,7 @@ export class ProcessUtils { | @@ -247,7 +247,7 @@ export class ProcessUtils { | ||
| 247 | Logger.debug(TAG, `gotoVod, ${content.objectId}`); | 247 | Logger.debug(TAG, `gotoVod, ${content.objectId}`); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | - private static async gotoLive(content: ContentDTO) { | 250 | + public static async gotoLive(content: ContentDTO) { |
| 251 | let taskAction: Action = { | 251 | let taskAction: Action = { |
| 252 | type: 'JUMP_DETAIL_PAGE', | 252 | type: 'JUMP_DETAIL_PAGE', |
| 253 | params: { | 253 | params: { |
| @@ -263,7 +263,7 @@ export class ProcessUtils { | @@ -263,7 +263,7 @@ export class ProcessUtils { | ||
| 263 | Logger.debug(TAG, `gotoLive, ${content.objectId}`); | 263 | Logger.debug(TAG, `gotoLive, ${content.objectId}`); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | - private static gotoAudio(content: ContentDTO) { | 266 | + public static gotoAudio(content: ContentDTO) { |
| 267 | let taskAction: Action = { | 267 | let taskAction: Action = { |
| 268 | type: 'JUMP_DETAIL_PAGE', | 268 | type: 'JUMP_DETAIL_PAGE', |
| 269 | params: { | 269 | params: { |
| @@ -283,7 +283,7 @@ export class ProcessUtils { | @@ -283,7 +283,7 @@ export class ProcessUtils { | ||
| 283 | * 金刚位聚合页 | 283 | * 金刚位聚合页 |
| 284 | * @param content | 284 | * @param content |
| 285 | * */ | 285 | * */ |
| 286 | - private static gotoThemeListPage(content: ContentDTO) { | 286 | + public static gotoThemeListPage(content: ContentDTO) { |
| 287 | let taskAction: Action = { | 287 | let taskAction: Action = { |
| 288 | type: 'JUMP_DETAIL_PAGE', | 288 | type: 'JUMP_DETAIL_PAGE', |
| 289 | params: { | 289 | params: { |
| @@ -303,7 +303,7 @@ export class ProcessUtils { | @@ -303,7 +303,7 @@ export class ProcessUtils { | ||
| 303 | * 图片预览页 | 303 | * 图片预览页 |
| 304 | * @param content | 304 | * @param content |
| 305 | * */ | 305 | * */ |
| 306 | - private static gotoAtlasDetailPage(content: ContentDTO) { | 306 | + public static gotoAtlasDetailPage(content: ContentDTO) { |
| 307 | let taskAction: Action = { | 307 | let taskAction: Action = { |
| 308 | type: 'JUMP_DETAIL_PAGE', | 308 | type: 'JUMP_DETAIL_PAGE', |
| 309 | params: { | 309 | params: { |
| @@ -351,5 +351,43 @@ export class ProcessUtils { | @@ -351,5 +351,43 @@ export class ProcessUtils { | ||
| 351 | WDRouterRule.jumpWithAction(taskAction) | 351 | WDRouterRule.jumpWithAction(taskAction) |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | + /** | ||
| 355 | + * 打开早晚报 | ||
| 356 | + */ | ||
| 357 | + public static gotoMorningEveningPaper() { | ||
| 358 | + let taskAction: Action = { | ||
| 359 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 360 | + params: { | ||
| 361 | + pageID: 'MorningEveningPaper' | ||
| 362 | + } as Params, | ||
| 363 | + }; | ||
| 364 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + /** | ||
| 368 | + * 打开电子报 | ||
| 369 | + */ | ||
| 370 | + public static gotoENewsPaper() { | ||
| 371 | + let taskAction: Action = { | ||
| 372 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 373 | + params: { | ||
| 374 | + pageID: 'E_NEWSPAPER' | ||
| 375 | + } as Params, | ||
| 376 | + }; | ||
| 377 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 378 | + } | ||
| 354 | 379 | ||
| 380 | + /** | ||
| 381 | + * 打开播报 | ||
| 382 | + */ | ||
| 383 | + public static gotoBroadcastPage(pageId: number) { | ||
| 384 | + let taskAction: Action = { | ||
| 385 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 386 | + params: { | ||
| 387 | + pageID: 'BroadcastPage', | ||
| 388 | + id: pageId | ||
| 389 | + } as Params, | ||
| 390 | + }; | ||
| 391 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 392 | + } | ||
| 355 | } | 393 | } |
| 1 | +export class H5OperateType { | ||
| 2 | + /* jsCall_currentPageOperate#operateType | ||
| 3 | + 1、关闭页面 | ||
| 4 | + 2、页面reload, | ||
| 5 | + 3、返回上一级历史, | ||
| 6 | + 4、允许蜂窝网络播放视频 | ||
| 7 | + 5、邮件订阅关闭事件 | ||
| 8 | + 6、H5进入沉浸式播放 (android) | ||
| 9 | + 7、H5退出沉浸式播放(andriod) | ||
| 10 | + 8、WebView高度更新 | ||
| 11 | + 9、App播放视频 | ||
| 12 | + 10、H5开始播放音频 (处理音视频互斥问题) | ||
| 13 | + 12、关闭 App原生默认顶部导航,并通顶显示Webview (专题页使用) | ||
| 14 | + 13、显示 App原生默认顶部导航,支持返回按钮和标题显示(专题页使用,默认不用设置) | ||
| 15 | + 14、关闭 底部评论交互BAR (专题页使用,默认不用设置) | ||
| 16 | + 15、显示 底部评论交互BAR(专题页使用) | ||
| 17 | + 16、显示 顶导分享按钮(专题页使用,针对默认顶导情况) | ||
| 18 | + 17、关闭 顶导分享按钮(专题页使用,针对默认顶导情况) | ||
| 19 | + 18、设置页面标题 (专题页使用,针对默认顶导情况) | ||
| 20 | + 19、设置页面状态栏颜色(专题页使用,针对默认顶导情况) | ||
| 21 | + 20、设置页面底部蒙层效果显示(专题页使用,针对默认顶导情况) | ||
| 22 | + 21、设置页面底部蒙层效果 隐藏(专题页使用,针对默认顶导情况) | ||
| 23 | + 22、页面加载失败后重试操作 | ||
| 24 | + 23、开启H5自己的返回操作(默认关闭,当开启后 App返回/物理按键返回 都需要调用H5的返回方法,参见:jsCall_appNotifyEvent) | ||
| 25 | + 24、号主关注操作 状态更新 | ||
| 26 | + 30、关闭当前页面左滑事件 | ||
| 27 | + 31、打开当前页面左滑事件 | ||
| 28 | + 32、开始弹全局弹框事件(原生代码确保Webview底部到底) | ||
| 29 | + 33、结束全局弹框事件(原生代码确保Webview正常恢复) | ||
| 30 | + 40、抽奖 阅读、评论、点赞、关注等任务--跳首页 (默认) | ||
| 31 | + 41、抽奖 签到任务–-跳积分中心签到 | ||
| 32 | + 42、抽奖 意见反馈–跳意见反馈页面 | ||
| 33 | + 43、抽奖 关注号主任务–跳关注列表页 | ||
| 34 | + 44、抽奖 创作者认证 页面,H5 直接跳人民号申请页? | ||
| 35 | + 45、打开APP直接使用goBack(安卓使用,使用场景:h5页面跳转新页面,但url没有变化,不能返回上一级页面) | ||
| 36 | + 46、关闭APP直接使用goBack(安卓使用) | ||
| 37 | + */ | ||
| 38 | + | ||
| 39 | + // 1、关闭页面 | ||
| 40 | + static readonly TYPE_ONE: string = "1"; | ||
| 41 | +} |
| @@ -2,11 +2,22 @@ import { Callback } from 'wdJsBridge'; | @@ -2,11 +2,22 @@ import { Callback } 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 } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { H5CallNativeType } from './H5CallNativeType'; | 4 | import { H5CallNativeType } from './H5CallNativeType'; |
| 5 | -import { ContentDTO } from 'wdBean'; | ||
| 6 | -import { ProcessUtils } from 'wdRouter/src/main/ets/utils/ProcessUtils'; | 5 | +import { H5OperateType } from './H5OperateType'; |
| 6 | +import { ContentConstants } from 'wdConstant'; | ||
| 7 | +import { ProcessUtils } from 'wdRouter'; | ||
| 8 | +import router from '@ohos.router'; | ||
| 9 | +import Url from '@ohos.url' | ||
| 10 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 7 | 11 | ||
| 8 | const TAG = 'JsBridgeBiz' | 12 | const TAG = 'JsBridgeBiz' |
| 9 | 13 | ||
| 14 | +class AppInfo { | ||
| 15 | + plat: string = '' | ||
| 16 | + system: string = '' | ||
| 17 | + networkStatus: number = 1 | ||
| 18 | + // TODO 完善 | ||
| 19 | +} | ||
| 20 | + | ||
| 10 | /** | 21 | /** |
| 11 | * h5调用native代码 | 22 | * h5调用native代码 |
| 12 | * @param data | 23 | * @param data |
| @@ -17,6 +28,7 @@ export function performJSCallNative(data: Message, call: Callback) { | @@ -17,6 +28,7 @@ export function performJSCallNative(data: Message, call: Callback) { | ||
| 17 | 28 | ||
| 18 | switch (data.handlerName) { | 29 | switch (data.handlerName) { |
| 19 | case H5CallNativeType.jsCall_currentPageOperate: | 30 | case H5CallNativeType.jsCall_currentPageOperate: |
| 31 | + handleJsCallCurrentPageOperate(data) | ||
| 20 | break; | 32 | break; |
| 21 | case H5CallNativeType.jsCall_getAppPublicInfo: | 33 | case H5CallNativeType.jsCall_getAppPublicInfo: |
| 22 | // h5获取app配置信息 | 34 | // h5获取app配置信息 |
| @@ -33,27 +45,25 @@ export function performJSCallNative(data: Message, call: Callback) { | @@ -33,27 +45,25 @@ export function performJSCallNative(data: Message, call: Callback) { | ||
| 33 | case H5CallNativeType.jsCall_appInnerLinkMethod: | 45 | case H5CallNativeType.jsCall_appInnerLinkMethod: |
| 34 | handleJsCallAppInnerLinkMethod(data) | 46 | handleJsCallAppInnerLinkMethod(data) |
| 35 | break; | 47 | break; |
| 36 | - case 'changeNativeMessage': | ||
| 37 | - call("this is change Web Message") | ||
| 38 | - break; | ||
| 39 | default: | 48 | default: |
| 40 | - call("this is def value") | 49 | + break; |
| 41 | } | 50 | } |
| 42 | - | ||
| 43 | } | 51 | } |
| 44 | 52 | ||
| 45 | -class AppInfo { | ||
| 46 | - plat: string = '' | ||
| 47 | - system: string = '' | ||
| 48 | - networkStatus: number = 1 | ||
| 49 | - // TODO 完善 | 53 | +function handleJsCallCurrentPageOperate(data: Message) { |
| 54 | + switch (data?.data?.operateType) { | ||
| 55 | + case H5OperateType.TYPE_ONE: | ||
| 56 | + router.back() | ||
| 57 | + break; | ||
| 58 | + default: | ||
| 59 | + break; | ||
| 60 | + } | ||
| 50 | } | 61 | } |
| 51 | 62 | ||
| 52 | /** | 63 | /** |
| 53 | * 获取App公共信息 | 64 | * 获取App公共信息 |
| 54 | */ | 65 | */ |
| 55 | function getAppPublicInfo(): string { | 66 | function getAppPublicInfo(): string { |
| 56 | - | ||
| 57 | let info = new AppInfo() | 67 | let info = new AppInfo() |
| 58 | info.plat = 'Phone' | 68 | info.plat = 'Phone' |
| 59 | // 直接用Android,后续适配再新增鸿蒙 | 69 | // 直接用Android,后续适配再新增鸿蒙 |
| @@ -73,7 +83,6 @@ function handleJsCallReceiveH5Data(data: Message) { | @@ -73,7 +83,6 @@ function handleJsCallReceiveH5Data(data: Message) { | ||
| 73 | } | 83 | } |
| 74 | break; | 84 | break; |
| 75 | default: | 85 | default: |
| 76 | - | ||
| 77 | break; | 86 | break; |
| 78 | } | 87 | } |
| 79 | } | 88 | } |
| @@ -83,5 +92,61 @@ function handleJsCallCallAppService(data: Message) { | @@ -83,5 +92,61 @@ function handleJsCallCallAppService(data: Message) { | ||
| 83 | } | 92 | } |
| 84 | 93 | ||
| 85 | function handleJsCallAppInnerLinkMethod(data: Message) { | 94 | function handleJsCallAppInnerLinkMethod(data: Message) { |
| 86 | -} | 95 | + let urlObject = Url.URL.parseURL(data?.data?.appInnerLink); |
| 96 | + let urlParams = new Url.URLParams(urlObject.search); | ||
| 97 | + console.log('urlObject:', `${JSON.stringify(urlParams)}`) | ||
| 98 | + let content: ContentDTO = { | ||
| 99 | + objectId: urlParams.get('contentId') || '', | ||
| 100 | + relId: urlParams.get('relId') || '', | ||
| 101 | + relType: urlParams.get('relType') || '', | ||
| 102 | + pageId:urlParams.get('pageId') || '', | ||
| 103 | + objectType: '' | ||
| 104 | + } as ContentDTO | ||
| 105 | + if (urlParams.get('skipType') === '1') { | ||
| 87 | 106 | ||
| 107 | + switch (urlParams.get('type')) { | ||
| 108 | + case 'video': | ||
| 109 | + content.objectType = ContentConstants.TYPE_VOD | ||
| 110 | + ProcessUtils.processPage(content) | ||
| 111 | + break; | ||
| 112 | + case 'live': | ||
| 113 | + content.objectType = ContentConstants.TYPE_LIVE | ||
| 114 | + ProcessUtils.processPage(content) | ||
| 115 | + break; | ||
| 116 | + case 'article': | ||
| 117 | + content.objectType = ContentConstants.TYPE_TELETEXT | ||
| 118 | + ProcessUtils.processPage(content) | ||
| 119 | + break; | ||
| 120 | + case 'picture': | ||
| 121 | + content.objectType = ContentConstants.TYPE_NINE | ||
| 122 | + ProcessUtils.processPage(content) | ||
| 123 | + break; | ||
| 124 | + case 'audio': | ||
| 125 | + content.objectType = ContentConstants.TYPE_AUDIO | ||
| 126 | + ProcessUtils.processPage(content) | ||
| 127 | + break; | ||
| 128 | + case 'h5': | ||
| 129 | + content.objectType = ContentConstants.TYPE_LINK | ||
| 130 | + ProcessUtils.processPage(content) | ||
| 131 | + break; | ||
| 132 | + case 'topic': | ||
| 133 | + if(urlParams.get('subType') === 'h5'){ | ||
| 134 | + content.objectType = ContentConstants.TYPE_SPECIAL_TOPIC | ||
| 135 | + ProcessUtils.processPage(content) | ||
| 136 | + } | ||
| 137 | + if(urlParams.get('subType') === 'moring_evening_news'){ | ||
| 138 | + ProcessUtils.gotoMorningEveningPaper() | ||
| 139 | + } | ||
| 140 | + if(urlParams.get('subType') === 'electronic_newspapers'){ | ||
| 141 | + ProcessUtils.gotoENewsPaper() | ||
| 142 | + } | ||
| 143 | + break; | ||
| 144 | + case 'dynamic': | ||
| 145 | + content.objectType = ContentConstants.TYPE_FOURTEEN | ||
| 146 | + ProcessUtils.processPage(content) | ||
| 147 | + break; | ||
| 148 | + default: | ||
| 149 | + break; | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | +} |
| @@ -18,9 +18,15 @@ export interface LiveRoomItemBean { | @@ -18,9 +18,15 @@ export interface LiveRoomItemBean { | ||
| 18 | role: string | 18 | role: string |
| 19 | //ZH_TEXT_AND_IMAGE_MSG :图文,ZH_TEXT_MSG:文本,ZH_VIDEO_MSG:视频,ZH_AUDIO_MSG:音频 | 19 | //ZH_TEXT_AND_IMAGE_MSG :图文,ZH_TEXT_MSG:文本,ZH_VIDEO_MSG:视频,ZH_AUDIO_MSG:音频 |
| 20 | dataType: string | 20 | dataType: string |
| 21 | + //视频封面图 | ||
| 21 | transcodeImageUrl: string | 22 | transcodeImageUrl: string |
| 23 | + //视频地址 | ||
| 22 | videoUrl: string | 24 | videoUrl: string |
| 25 | + //图片宽高 | ||
| 23 | pictureResolutions: string[] | 26 | pictureResolutions: string[] |
| 24 | //音视频长度 | 27 | //音视频长度 |
| 25 | duration: number | 28 | duration: number |
| 29 | + //音频地址 | ||
| 30 | + audioUrl: string | ||
| 31 | + | ||
| 26 | } | 32 | } |
| @@ -4,6 +4,8 @@ export { CompUtils } from "./src/main/ets/utils/CompUtils" | @@ -4,6 +4,8 @@ export { CompUtils } from "./src/main/ets/utils/CompUtils" | ||
| 4 | 4 | ||
| 5 | export { EmptyComponent } from "./src/main/ets/components/view/EmptyComponent" | 5 | export { EmptyComponent } from "./src/main/ets/components/view/EmptyComponent" |
| 6 | 6 | ||
| 7 | +export { LiveEmptyComponent } from './src/main/ets/components/view/LiveEmptyComponent' | ||
| 8 | + | ||
| 7 | export { ErrorComponent } from "./src/main/ets/components/view/ErrorComponent" | 9 | export { ErrorComponent } from "./src/main/ets/components/view/ErrorComponent" |
| 8 | 10 | ||
| 9 | export { LoadingComponent } from "./src/main/ets/components/view/LoadingComponent" | 11 | export { LoadingComponent } from "./src/main/ets/components/view/LoadingComponent" |
| @@ -75,3 +77,7 @@ export { LiveCommentComponent } from "./src/main/ets/components/comment/view/Liv | @@ -75,3 +77,7 @@ export { LiveCommentComponent } from "./src/main/ets/components/comment/view/Liv | ||
| 75 | 77 | ||
| 76 | export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent" | 78 | export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent" |
| 77 | 79 | ||
| 80 | +export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowComponent" | ||
| 81 | + | ||
| 82 | +export { WDLiveViewDefaultType } from "./src/main/ets/components/view/LiveEmptyComponent" | ||
| 83 | + |
| @@ -17,6 +17,8 @@ | @@ -17,6 +17,8 @@ | ||
| 17 | "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo", | 17 | "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo", |
| 18 | "wdRouter": "file:../../commons/wdRouter", | 18 | "wdRouter": "file:../../commons/wdRouter", |
| 19 | "wdNetwork": "file:../../commons/wdNetwork", | 19 | "wdNetwork": "file:../../commons/wdNetwork", |
| 20 | - "wdJsBridge": "file:../../commons/wdJsBridge" | 20 | + "wdJsBridge": "file:../../commons/wdJsBridge", |
| 21 | + "wdDetailPlayApi":"file:../../features/wdDetailPlayApi", | ||
| 22 | + "wdHwAbility": "file:../../features/wdHwAbility" | ||
| 21 | } | 23 | } |
| 22 | } | 24 | } |
| 1 | -import { Logger } from 'wdKit'; | ||
| 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 1 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 3 | import { ContentDetailDTO } from 'wdBean'; | 2 | import { ContentDetailDTO } from 'wdBean'; |
| 4 | import media from '@ohos.multimedia.media'; | 3 | import media from '@ohos.multimedia.media'; |
| @@ -6,9 +5,10 @@ import { OperRowListView } from './view/OperRowListView'; | @@ -6,9 +5,10 @@ import { OperRowListView } from './view/OperRowListView'; | ||
| 6 | import { WDPlayerController } from 'wdPlayer/Index'; | 5 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 7 | 6 | ||
| 8 | const TAG = 'AudioDetailComponent' | 7 | const TAG = 'AudioDetailComponent' |
| 9 | -interface Arr{ | ||
| 10 | - image:string, | ||
| 11 | - title:string | 8 | + |
| 9 | +interface Arr { | ||
| 10 | + image: string, | ||
| 11 | + title: string | ||
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | @Component | 14 | @Component |
| @@ -18,174 +18,176 @@ export struct AudioDetailComponent { | @@ -18,174 +18,176 @@ export struct AudioDetailComponent { | ||
| 18 | private relType: string = '' | 18 | private relType: string = '' |
| 19 | private avPlayer?: media.AVPlayer; | 19 | private avPlayer?: media.AVPlayer; |
| 20 | @State playerController: WDPlayerController = new WDPlayerController(); | 20 | @State playerController: WDPlayerController = new WDPlayerController(); |
| 21 | - | ||
| 22 | - private arr:Arr[]=[ | ||
| 23 | - {image:'clock',title:'定时'}, | ||
| 24 | - {image:'theOriginal',title:'原文'}, | ||
| 25 | - {image:'list',title:'列表'}, | 21 | + private arr: Arr[] = [ |
| 22 | + { image: 'clock', title: '定时' }, | ||
| 23 | + { image: 'theOriginal', title: '原文' }, | ||
| 24 | + { image: 'list', title: '列表' }, | ||
| 26 | ] | 25 | ] |
| 27 | - | ||
| 28 | - @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情 | ||
| 29 | - @State coverImage:string = '' //封面图 | ||
| 30 | - @State newsTitle:string = '' //标题 | ||
| 31 | - @State audioUrl:string = '' //音频路径 | ||
| 32 | - @State duration:number = 0 //时长 | ||
| 33 | - @State outSetValueOne:number = 40 //播放进度 | ||
| 34 | - | 26 | + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[] //详情 |
| 27 | + @State coverImage: string = '' //封面图 | ||
| 28 | + @State newsTitle: string = '' //标题 | ||
| 29 | + @State audioUrl: string = '' //音频路径 | ||
| 30 | + @State duration: number = 0 //时长 | ||
| 31 | + @State outSetValueOne: number = 40 //播放进度 | ||
| 35 | @State isPlay: boolean = false | 32 | @State isPlay: boolean = false |
| 33 | + | ||
| 36 | async aboutToAppear() { | 34 | async aboutToAppear() { |
| 37 | await this.getContentDetailData() | 35 | await this.getContentDetailData() |
| 38 | this.playerController.firstPlay(this.audioUrl); | 36 | this.playerController.firstPlay(this.audioUrl); |
| 39 | - this.playerController.onCanplay = () => { | ||
| 40 | - this.playerController.play() | ||
| 41 | - this.isPlay = true | ||
| 42 | - } | ||
| 43 | - this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) =>{ | ||
| 44 | - console.log('现在时间',nowSeconds) | ||
| 45 | - console.log('总时间',totalSeconds) | 37 | + this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) => { |
| 38 | + console.log('现在时间', nowSeconds) | ||
| 39 | + console.log('总时间', totalSeconds) | ||
| 46 | this.outSetValueOne = nowSeconds | 40 | this.outSetValueOne = nowSeconds |
| 47 | this.duration = totalSeconds | 41 | this.duration = totalSeconds |
| 48 | } | 42 | } |
| 49 | } | 43 | } |
| 44 | + | ||
| 50 | onPageHide() { | 45 | onPageHide() { |
| 51 | this.playerController?.pause(); | 46 | this.playerController?.pause(); |
| 52 | } | 47 | } |
| 48 | + | ||
| 53 | build() { | 49 | build() { |
| 54 | - Row() { | 50 | + Row() { |
| 51 | + Column() { | ||
| 52 | + // 封面 | ||
| 53 | + Row() { | ||
| 54 | + Image(this.coverImage) | ||
| 55 | + .width(240) | ||
| 56 | + .height(160) | ||
| 57 | + .borderRadius('0') | ||
| 58 | + } | ||
| 59 | + .justifyContent(FlexAlign.Center) | ||
| 60 | + .width('100%') | ||
| 61 | + .margin({ top: 64 }) | ||
| 62 | + | ||
| 63 | + // 标题 | ||
| 64 | + Row() { | ||
| 65 | + Text(this.newsTitle) | ||
| 66 | + .fontSize(20) | ||
| 67 | + .fontWeight(FontWeight.Bold) | ||
| 68 | + .fontColor('#ffffff') | ||
| 69 | + .textAlign(TextAlign.Center) | ||
| 70 | + .lineHeight(28) | ||
| 71 | + .fontFamily('PingFang SC, PingFang SC') | ||
| 72 | + } | ||
| 73 | + .padding({ left: 34, right: 34 }) | ||
| 74 | + .margin({ top: 32 }) | ||
| 75 | + | ||
| 76 | + // 操作矩阵 | ||
| 77 | + Row() { | ||
| 78 | + ForEach(this.arr, (item: Arr) => { | ||
| 79 | + Column() { | ||
| 80 | + Image(item.image == 'clock' ? $r('app.media.clock_close') : item.image == 'theOriginal' ? $r('app.media.theOriginal_close') : item.image == 'list' ? $r('app.media.list_close') : '') | ||
| 81 | + .width(28) | ||
| 82 | + .height(28) | ||
| 83 | + Text(item.title) | ||
| 84 | + .fontColor('#4D5258') | ||
| 85 | + .fontSize(12) | ||
| 86 | + .lineHeight(16) | ||
| 87 | + .margin(2) | ||
| 88 | + } | ||
| 89 | + }) | ||
| 90 | + | ||
| 91 | + } | ||
| 92 | + .width('100%') | ||
| 93 | + .padding({ left: 49, right: 49 }) | ||
| 94 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 95 | + .margin({ top: 60 }) | ||
| 96 | + | ||
| 55 | Column() { | 97 | Column() { |
| 56 | - // 封面 | ||
| 57 | - Row() { | ||
| 58 | - Image(this.coverImage) | ||
| 59 | - .width(240) | ||
| 60 | - .height(160) | ||
| 61 | - .borderRadius('0') | ||
| 62 | - } | ||
| 63 | - .justifyContent(FlexAlign.Center) | ||
| 64 | - .width('100%') | ||
| 65 | - .margin({ top: 64 }) | ||
| 66 | - // 标题 | ||
| 67 | - Row() { | ||
| 68 | - Text(this.newsTitle) | ||
| 69 | - .fontSize(20) | ||
| 70 | - .fontWeight(FontWeight.Bold) | ||
| 71 | - .fontColor('#ffffff') | ||
| 72 | - .textAlign(TextAlign.Center) | ||
| 73 | - .lineHeight(28) | ||
| 74 | - .fontFamily('PingFang SC, PingFang SC') | ||
| 75 | - } | ||
| 76 | - .padding({ left: 34, right: 34 }) | ||
| 77 | - .margin({ top: 32 }) | ||
| 78 | - // 操作矩阵 | 98 | + // 进度条 |
| 79 | Row() { | 99 | Row() { |
| 80 | - ForEach(this.arr,(item:Arr)=>{ | ||
| 81 | - Column() { | ||
| 82 | - Image(item.image=='clock'?$r('app.media.clock_close'):item.image=='theOriginal'?$r('app.media.theOriginal_close'):item.image=='list'?$r('app.media.list_close'):'') | ||
| 83 | - .width(28) | ||
| 84 | - .height(28) | ||
| 85 | - Text(item.title) | ||
| 86 | - .fontColor('#4D5258') | ||
| 87 | - .fontSize(12) | ||
| 88 | - .lineHeight(16) | ||
| 89 | - .margin(2) | ||
| 90 | - } | 100 | + Slider({ |
| 101 | + value: this.outSetValueOne, | ||
| 102 | + step: 1 | ||
| 91 | }) | 103 | }) |
| 92 | - | 104 | + .showTips(true) |
| 105 | + .trackColor('rgba(0,0,0,0.5)') | ||
| 106 | + .selectedColor('#ED2800') | ||
| 107 | + .onChange((value: number, mode: SliderChangeMode) => { | ||
| 108 | + console.log('滑块长度', value) | ||
| 109 | + this.playerController?.setSeekTime(value, mode); | ||
| 110 | + }) | ||
| 93 | } | 111 | } |
| 94 | .width('100%') | 112 | .width('100%') |
| 95 | - .padding({ left: 49, right: 49 }) | ||
| 96 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 97 | - .margin({ top: 60 }) | ||
| 98 | - | ||
| 99 | - Column(){ | ||
| 100 | - // 进度条 | ||
| 101 | - Row(){ | ||
| 102 | - Slider({ | ||
| 103 | - value: this.outSetValueOne, | ||
| 104 | - step: 1 | ||
| 105 | - }) | ||
| 106 | - .showTips(true) | ||
| 107 | - .trackColor('rgba(0,0,0,0.5)') | ||
| 108 | - .selectedColor('#ED2800') | ||
| 109 | - .onChange((value: number, mode: SliderChangeMode) => { | ||
| 110 | - console.log('滑块长度',value) | ||
| 111 | - this.playerController?.setSeekTime(value, mode); | ||
| 112 | - }) | ||
| 113 | - } | ||
| 114 | - .width('100%') | ||
| 115 | - .padding({left:24,right:24}) | ||
| 116 | - .margin({top:110}) | ||
| 117 | - // 播放按钮 | ||
| 118 | - Row(){ | ||
| 119 | - Column(){ | ||
| 120 | - Image($r('app.media.loop_close')) | ||
| 121 | - .width(24) | ||
| 122 | - .height(24) | ||
| 123 | - Text('循环') | ||
| 124 | - .fontColor('#4D5258') | ||
| 125 | - .fontSize(12) | ||
| 126 | - .lineHeight(16) | ||
| 127 | - .margin(2) | ||
| 128 | - } | 113 | + .padding({ left: 24, right: 24 }) |
| 114 | + .margin({ top: 110 }) | ||
| 129 | 115 | ||
| 130 | - Image($r('app.media.Backward_close')) | 116 | + // 播放按钮 |
| 117 | + Row() { | ||
| 118 | + Column() { | ||
| 119 | + Image($r('app.media.loop_close')) | ||
| 131 | .width(24) | 120 | .width(24) |
| 132 | .height(24) | 121 | .height(24) |
| 133 | - Stack({ alignContent: Alignment.Center }){ | ||
| 134 | - Image(this.isPlay?$r('app.media.suspend'):$r('app.media.playicon')) | ||
| 135 | - .width(32) | ||
| 136 | - .height(32) | 122 | + Text('循环') |
| 123 | + .fontColor('#4D5258') | ||
| 124 | + .fontSize(12) | ||
| 125 | + .lineHeight(16) | ||
| 126 | + .margin(2) | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + Image($r('app.media.Backward_close')) | ||
| 130 | + .width(24) | ||
| 131 | + .height(24) | ||
| 132 | + Stack({ alignContent: Alignment.Center }) { | ||
| 133 | + Image(this.isPlay ? $r('app.media.suspend') : $r('app.media.playicon')) | ||
| 134 | + .width(32) | ||
| 135 | + .height(32) | ||
| 136 | + } | ||
| 137 | + .padding(28) | ||
| 138 | + .backgroundColor('#4D5258') | ||
| 139 | + .borderRadius(50) | ||
| 140 | + .onClick(() => { | ||
| 141 | + if (this.isPlay) { | ||
| 142 | + this.playerController.pause() | ||
| 143 | + } else { | ||
| 144 | + this.playerController.play() | ||
| 137 | } | 145 | } |
| 138 | - .padding(28) | ||
| 139 | - .backgroundColor('#4D5258') | ||
| 140 | - .borderRadius(50) | ||
| 141 | - .onClick(()=>{ | ||
| 142 | - if(this.isPlay){ | ||
| 143 | - this.playerController.pause() | ||
| 144 | - }else{ | ||
| 145 | - this.playerController.play() | ||
| 146 | - } | ||
| 147 | - this.isPlay = !this.isPlay | ||
| 148 | - }) | ||
| 149 | - Image($r('app.media.fastForward_close')) | 146 | + this.isPlay = !this.isPlay |
| 147 | + }) | ||
| 148 | + | ||
| 149 | + Image($r('app.media.fastForward_close')) | ||
| 150 | + .width(24) | ||
| 151 | + .height(24) | ||
| 152 | + Column() { | ||
| 153 | + Image($r('app.media.doubleSpeed_close')) | ||
| 150 | .width(24) | 154 | .width(24) |
| 151 | .height(24) | 155 | .height(24) |
| 152 | - Column(){ | ||
| 153 | - Image($r('app.media.doubleSpeed_close')) | ||
| 154 | - .width(24) | ||
| 155 | - .height(24) | ||
| 156 | - Text('倍速') | ||
| 157 | - .fontColor('#4D5258') | ||
| 158 | - .fontSize(12) | ||
| 159 | - .lineHeight(16) | ||
| 160 | - .margin(2) | ||
| 161 | - } | 156 | + Text('倍速') |
| 157 | + .fontColor('#4D5258') | ||
| 158 | + .fontSize(12) | ||
| 159 | + .lineHeight(16) | ||
| 160 | + .margin(2) | ||
| 162 | } | 161 | } |
| 163 | - .width('100%') | ||
| 164 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 165 | - .margin({top:56}) | ||
| 166 | - .padding({left:32,right:32}) | ||
| 167 | } | 162 | } |
| 168 | - .layoutWeight(1) | ||
| 169 | - OperRowListView() | 163 | + .width('100%') |
| 164 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 165 | + .margin({ top: 56 }) | ||
| 166 | + .padding({ left: 32, right: 32 }) | ||
| 170 | } | 167 | } |
| 168 | + .layoutWeight(1) | ||
| 169 | + | ||
| 170 | + OperRowListView() | ||
| 171 | } | 171 | } |
| 172 | + } | ||
| 172 | 173 | ||
| 173 | } | 174 | } |
| 175 | + | ||
| 174 | private async getContentDetailData() { | 176 | private async getContentDetailData() { |
| 175 | try { | 177 | try { |
| 176 | let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) | 178 | let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) |
| 177 | this.contentDetailData = data; | 179 | this.contentDetailData = data; |
| 178 | - console.log('音乐详情',JSON.stringify(this.contentDetailData)) | 180 | + console.log('音乐详情', JSON.stringify(this.contentDetailData)) |
| 179 | this.newsTitle = this.contentDetailData[0].newsTitle | 181 | this.newsTitle = this.contentDetailData[0].newsTitle |
| 180 | - console.log('标题',JSON.stringify(this.newsTitle)) | 182 | + console.log('标题', JSON.stringify(this.newsTitle)) |
| 181 | this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url | 183 | this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url |
| 182 | - console.log('封面图',JSON.stringify(this.coverImage)) | 184 | + console.log('封面图', JSON.stringify(this.coverImage)) |
| 183 | this.duration = this.contentDetailData[0].audioList[0].duration | 185 | this.duration = this.contentDetailData[0].audioList[0].duration |
| 184 | - console.log('音频时长',JSON.stringify(this.duration)) | 186 | + console.log('音频时长', JSON.stringify(this.duration)) |
| 185 | this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl | 187 | this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl |
| 186 | - console.log('音频时长',JSON.stringify(this.audioUrl)) | 188 | + console.log('音频时长', JSON.stringify(this.audioUrl)) |
| 187 | } catch (exception) { | 189 | } catch (exception) { |
| 188 | - console.log('请求失败',JSON.stringify(exception)) | 190 | + console.log('请求失败', JSON.stringify(exception)) |
| 189 | } | 191 | } |
| 190 | } | 192 | } |
| 191 | } | 193 | } |
| @@ -20,9 +20,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -20,9 +20,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 20 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 20 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 21 | import { PageRepository } from '../repository/PageRepository'; | 21 | import { PageRepository } from '../repository/PageRepository'; |
| 22 | import { detailedSkeleton } from './skeleton/detailSkeleton'; | 22 | import { detailedSkeleton } from './skeleton/detailSkeleton'; |
| 23 | + | ||
| 23 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 24 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 24 | 25 | ||
| 25 | const TAG = 'ImageAndTextPageComponent' | 26 | const TAG = 'ImageAndTextPageComponent' |
| 27 | + | ||
| 26 | @Component | 28 | @Component |
| 27 | export struct ImageAndTextPageComponent { | 29 | export struct ImageAndTextPageComponent { |
| 28 | scroller: Scroller = new Scroller(); | 30 | scroller: Scroller = new Scroller(); |
| @@ -33,39 +35,35 @@ export struct ImageAndTextPageComponent { | @@ -33,39 +35,35 @@ export struct ImageAndTextPageComponent { | ||
| 33 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 35 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 34 | @State isPageEnd: boolean = false | 36 | @State isPageEnd: boolean = false |
| 35 | @State publishTime: string = '' | 37 | @State publishTime: string = '' |
| 38 | + | ||
| 36 | build() { | 39 | build() { |
| 37 | Column() { | 40 | Column() { |
| 38 | - if (!this.isPageEnd) { | ||
| 39 | - detailedSkeleton() | ||
| 40 | - } else { | ||
| 41 | - // 发布时间 | ||
| 42 | - Row() { | ||
| 43 | - Image(this.contentDetailData[0]?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | ||
| 44 | - .width(80) | ||
| 45 | - .height(28) | ||
| 46 | - Text(this.publishTime) | ||
| 47 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 48 | - .fontSize($r('app.float.font_size_13')) | ||
| 49 | - .height('100%') | ||
| 50 | - .align(Alignment.End) | ||
| 51 | - } | ||
| 52 | - .width(CommonConstants.FULL_WIDTH) | ||
| 53 | - .height(32) | ||
| 54 | - .padding({ left: 15, right: 15, }) | ||
| 55 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 56 | - .backgroundColor(Color.White) | ||
| 57 | - | ||
| 58 | - Row() { | ||
| 59 | - Image($r('app.media.line')) | ||
| 60 | - .width('100%') | ||
| 61 | - .height(6) | ||
| 62 | - .objectFit(ImageFit.Cover) | ||
| 63 | - .margin({ top: 10 }) | ||
| 64 | - } | ||
| 65 | - .padding({ left: 15, right: 15 }) | ||
| 66 | - .backgroundColor(Color.White) | 41 | + // 发布时间 |
| 42 | + Row() { | ||
| 43 | + Image(this.contentDetailData[0]?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | ||
| 44 | + .width(80) | ||
| 45 | + .height(28) | ||
| 46 | + Text(this.publishTime) | ||
| 47 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 48 | + .fontSize($r('app.float.font_size_13')) | ||
| 49 | + .height('100%') | ||
| 50 | + .align(Alignment.End) | ||
| 67 | } | 51 | } |
| 52 | + .width(CommonConstants.FULL_WIDTH) | ||
| 53 | + .height(32) | ||
| 54 | + .padding({ left: 15, right: 15, }) | ||
| 55 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 56 | + .backgroundColor(Color.White) | ||
| 68 | 57 | ||
| 58 | + Row() { | ||
| 59 | + Image($r('app.media.line')) | ||
| 60 | + .width('100%') | ||
| 61 | + .height(6) | ||
| 62 | + .objectFit(ImageFit.Cover) | ||
| 63 | + .margin({ top: 10 }) | ||
| 64 | + } | ||
| 65 | + .padding({ left: 15, right: 15 }) | ||
| 66 | + .backgroundColor(Color.White) | ||
| 69 | 67 | ||
| 70 | Stack({ alignContent: Alignment.Bottom }) { | 68 | Stack({ alignContent: Alignment.Bottom }) { |
| 71 | Scroll(this.scroller) { | 69 | Scroll(this.scroller) { |
| @@ -88,6 +86,10 @@ export struct ImageAndTextPageComponent { | @@ -88,6 +86,10 @@ export struct ImageAndTextPageComponent { | ||
| 88 | .padding({ bottom: 76 }) | 86 | .padding({ bottom: 76 }) |
| 89 | .scrollBar(BarState.Off) | 87 | .scrollBar(BarState.Off) |
| 90 | 88 | ||
| 89 | + if (!this.isPageEnd) { | ||
| 90 | + detailedSkeleton() | ||
| 91 | + } | ||
| 92 | + | ||
| 91 | //底部交互区 | 93 | //底部交互区 |
| 92 | Row() { | 94 | Row() { |
| 93 | Image($r('app.media.icon_arrow_left')) | 95 | Image($r('app.media.icon_arrow_left')) |
| @@ -126,6 +128,7 @@ export struct ImageAndTextPageComponent { | @@ -126,6 +128,7 @@ export struct ImageAndTextPageComponent { | ||
| 126 | .justifyContent(FlexAlign.SpaceBetween) | 128 | .justifyContent(FlexAlign.SpaceBetween) |
| 127 | .backgroundColor(Color.White) | 129 | .backgroundColor(Color.White) |
| 128 | } | 130 | } |
| 131 | + | ||
| 129 | } | 132 | } |
| 130 | .width(CommonConstants.FULL_WIDTH) | 133 | .width(CommonConstants.FULL_WIDTH) |
| 131 | .height(CommonConstants.FULL_HEIGHT) | 134 | .height(CommonConstants.FULL_HEIGHT) |
| @@ -152,7 +155,7 @@ export struct ImageAndTextPageComponent { | @@ -152,7 +155,7 @@ export struct ImageAndTextPageComponent { | ||
| 152 | if (detailBeans && detailBeans.length > 0) { | 155 | if (detailBeans && detailBeans.length > 0) { |
| 153 | this.contentDetailData = detailBeans; | 156 | this.contentDetailData = detailBeans; |
| 154 | let dateTime = DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); | 157 | let dateTime = DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); |
| 155 | - this.publishTime = DateTimeUtils.formatDate(dateTime,PATTERN_DATE_CN_RN) | 158 | + this.publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) |
| 156 | if (this.contentDetailData[0]?.recommendShow === 1) { | 159 | if (this.contentDetailData[0]?.recommendShow === 1) { |
| 157 | this.getRecommend() | 160 | this.getRecommend() |
| 158 | } | 161 | } |
| @@ -220,7 +220,7 @@ struct ChildCommentItem { | @@ -220,7 +220,7 @@ struct ChildCommentItem { | ||
| 220 | Span(this.item.fromUserName) | 220 | Span(this.item.fromUserName) |
| 221 | if (this.item.toUserName) { | 221 | if (this.item.toUserName) { |
| 222 | Span(' ') | 222 | Span(' ') |
| 223 | - ImageSpan($r('app.media.comment_reply')).size({ width: 6, height: 9 }).offset({ y: -2.5 }) | 223 | + ImageSpan($r('app.media.comment_reply')).size({ width: 6, height: 9 }).offset({ y: -2.7 }) |
| 224 | Span(' ') | 224 | Span(' ') |
| 225 | Span(this.item.toUserName) | 225 | Span(this.item.toUserName) |
| 226 | } | 226 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -7,6 +7,7 @@ import { CustomTitleUI } from '../../reusable/CustomTitleUI' | @@ -7,6 +7,7 @@ import { CustomTitleUI } from '../../reusable/CustomTitleUI' | ||
| 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' | 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' |
| 8 | import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils' | 8 | import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils' |
| 9 | import { HttpUrlUtils } from 'wdNetwork/Index' | 9 | import { HttpUrlUtils } from 'wdNetwork/Index' |
| 10 | +import PageModel from '../../../viewmodel/PageModel' | ||
| 10 | 11 | ||
| 11 | const TAG = 'QualityCommentsComponent'; | 12 | const TAG = 'QualityCommentsComponent'; |
| 12 | 13 | ||
| @@ -14,12 +15,14 @@ const TAG = 'QualityCommentsComponent'; | @@ -14,12 +15,14 @@ const TAG = 'QualityCommentsComponent'; | ||
| 14 | @Preview | 15 | @Preview |
| 15 | @Component | 16 | @Component |
| 16 | export struct QualityCommentsComponent { | 17 | export struct QualityCommentsComponent { |
| 18 | + | ||
| 19 | + @State private browSingModel: PageModel = new PageModel() | ||
| 20 | + isloading : boolean = false | ||
| 21 | + | ||
| 17 | @State tileOpacity: number = 0; | 22 | @State tileOpacity: number = 0; |
| 18 | firstPositionY: number = 0; | 23 | firstPositionY: number = 0; |
| 19 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | 24 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; |
| 20 | topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | 25 | topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; |
| 21 | - // @State private browSingModel: commentListModel = new commentListModel() | ||
| 22 | - isloading: boolean = false | ||
| 23 | lastWindowColor: string = '#ffffff' | 26 | lastWindowColor: string = '#ffffff' |
| 24 | currentWindowColor: string = '#FF4202' | 27 | currentWindowColor: string = '#FF4202' |
| 25 | @State allDatas: MyCommentDataSource = new MyCommentDataSource(); | 28 | @State allDatas: MyCommentDataSource = new MyCommentDataSource(); |
| 1 | +import { DateTimeUtils, Logger } from 'wdKit/Index'; | ||
| 2 | +import { WDPlayerController } from 'wdPlayer/Index'; | ||
| 3 | + | ||
| 4 | +let TAG: string = 'AudioRowComponent' | ||
| 5 | + | ||
| 6 | +@Component | ||
| 7 | +export struct AudioRowComponent { | ||
| 8 | + @State playerController: WDPlayerController = new WDPlayerController(); | ||
| 9 | + @State audioUrl: string = '' //音频路径 | ||
| 10 | + @State duration: number = 0 //时长 | ||
| 11 | + @State outSetValueOne: number = 0 //播放进度 | ||
| 12 | + @State isPlaying: boolean = false | ||
| 13 | + | ||
| 14 | + aboutToAppear(): void { | ||
| 15 | + this.playerController.firstPlay(this.audioUrl) | ||
| 16 | + // this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) => { | ||
| 17 | + // console.log('现在时间', nowSeconds) | ||
| 18 | + // console.log('总时间', totalSeconds) | ||
| 19 | + // this.outSetValueOne = nowSeconds | ||
| 20 | + // this.duration = totalSeconds | ||
| 21 | + // } | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + build() { | ||
| 25 | + Row() { | ||
| 26 | + Image($r('app.media.icon_voice')) | ||
| 27 | + .width(20) | ||
| 28 | + .aspectRatio(1) | ||
| 29 | + .margin({ | ||
| 30 | + left: 8, | ||
| 31 | + right: 6 | ||
| 32 | + }) | ||
| 33 | + .visibility(this.isPlaying ? Visibility.Visible : Visibility.Hidden) | ||
| 34 | + Text(`${DateTimeUtils.getFormattedDuration(this.duration)}`) | ||
| 35 | + .fontColor('#666666') | ||
| 36 | + .fontWeight(400) | ||
| 37 | + .fontSize('14fp') | ||
| 38 | + } | ||
| 39 | + .backgroundColor(Color.White) | ||
| 40 | + .height(36) | ||
| 41 | + .borderRadius(4) | ||
| 42 | + .margin({ top: 8, right: 16 }) | ||
| 43 | + .width('100%') | ||
| 44 | + .onClick(() => { | ||
| 45 | + this.isPlaying = !this.isPlaying | ||
| 46 | + this.playerController?.switchPlayOrPause() | ||
| 47 | + }) | ||
| 48 | + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | ||
| 49 | + Logger.debug(TAG, `当前屏幕可见区域大小: currentRatio:' +${currentRatio}`) | ||
| 50 | + // if (isVisible && currentRatio >= 1.0) { | ||
| 51 | + // Logger.debug(TAG, `播放器-播放. currentRatio:' +${currentRatio}`) | ||
| 52 | + // this.playerController?.play() | ||
| 53 | + // } | ||
| 54 | + | ||
| 55 | + if (!isVisible && currentRatio <= 0.0) { | ||
| 56 | + Logger.debug(TAG, `播放器-暂停. currentRatio:' +${currentRatio}`) | ||
| 57 | + this.playerController?.pause() | ||
| 58 | + } | ||
| 59 | + }) | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + aboutToDisappear(): void { | ||
| 63 | + this.playerController?.release() | ||
| 64 | + } | ||
| 65 | +} |
| @@ -10,6 +10,7 @@ import { QueryListIsFollowedItem } from '../../../viewmodel/QueryListIsFollowedI | @@ -10,6 +10,7 @@ import { QueryListIsFollowedItem } from '../../../viewmodel/QueryListIsFollowedI | ||
| 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 11 | import { FollowChildComponent } from './FollowChildComponent'; | 11 | import { FollowChildComponent } from './FollowChildComponent'; |
| 12 | import dataPreferences from '@ohos.data.preferences'; | 12 | import dataPreferences from '@ohos.data.preferences'; |
| 13 | +import { EmptyComponent } from '../../view/EmptyComponent'; | ||
| 13 | 14 | ||
| 14 | const TAG = "FollowListDetailUI" | 15 | const TAG = "FollowListDetailUI" |
| 15 | 16 | ||
| @@ -32,8 +33,9 @@ export struct FollowListDetailUI { | @@ -32,8 +33,9 @@ export struct FollowListDetailUI { | ||
| 32 | build() { | 33 | build() { |
| 33 | Column() { | 34 | Column() { |
| 34 | if (this.count === 0) { | 35 | if (this.count === 0) { |
| 35 | - ListHasNoMoreDataUI({ style: 2 }) | ||
| 36 | - .height('100%') | 36 | + EmptyComponent({emptyType:14}) |
| 37 | + .layoutWeight(1) | ||
| 38 | + .width('100%') | ||
| 37 | } else { | 39 | } else { |
| 38 | List({ space: 3 }) { | 40 | List({ space: 3 }) { |
| 39 | LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => { | 41 | LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => { |
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
0 → 100644
| 1 | +import { ContentDTO } from 'wdBean/Index' | ||
| 2 | +import { StringUtils, UserDataLocal } from 'wdKit/Index' | ||
| 3 | +import { ProcessUtils } from 'wdRouter/Index' | ||
| 4 | +import MinePageDatasModel from '../../../model/MinePageDatasModel' | ||
| 5 | +import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | ||
| 6 | +import { CommentListItem } from '../../../viewmodel/CommentListItem' | ||
| 7 | +import measure from '@ohos.measure' | ||
| 8 | + | ||
| 9 | +@Component | ||
| 10 | +export struct ChildCommentComponent { | ||
| 11 | + @ObjectLink data: CommentListItem | ||
| 12 | + @State levelHead: string = "" | ||
| 13 | + isLastItem: boolean = false | ||
| 14 | + @State isExpand: boolean = false; | ||
| 15 | + @State isExpandParent: boolean = false; | ||
| 16 | + @State isOverLines: boolean = false | ||
| 17 | + @State isOverLinesParent: boolean = false | ||
| 18 | + | ||
| 19 | + build() { | ||
| 20 | + Column() { | ||
| 21 | + Row() { | ||
| 22 | + Stack({ alignContent: Alignment.Center }) { | ||
| 23 | + Image(this.data.fromUserHeader) | ||
| 24 | + .alt($r('app.media.default_head')) | ||
| 25 | + .objectFit(ImageFit.Auto) | ||
| 26 | + .width('69lpx') | ||
| 27 | + .height('69lpx') | ||
| 28 | + .borderRadius(50) | ||
| 29 | + Image(this.levelHead) | ||
| 30 | + .width('89lpx') | ||
| 31 | + .height('89lpx') | ||
| 32 | + .objectFit(ImageFit.Cover) | ||
| 33 | + .borderRadius(50) | ||
| 34 | + }.width('89lpx') | ||
| 35 | + .height('89lpx') | ||
| 36 | + .margin({ right: '15lpx' }) | ||
| 37 | + | ||
| 38 | + Column() { | ||
| 39 | + Text(this.data.fromUserName) | ||
| 40 | + .fontSize('25lpx') | ||
| 41 | + .lineHeight('35lpx') | ||
| 42 | + .fontWeight('600lpx') | ||
| 43 | + .fontColor($r('app.color.color_222222')) | ||
| 44 | + .margin({ bottom: '6lpx' }) | ||
| 45 | + .maxLines(1) | ||
| 46 | + Text(`${this.data.createTime}`) | ||
| 47 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 48 | + .fontSize('23lpx') | ||
| 49 | + .lineHeight('31lpx') | ||
| 50 | + .fontWeight('400lpx') | ||
| 51 | + .maxLines(1) | ||
| 52 | + }.layoutWeight(1) | ||
| 53 | + .alignItems(HorizontalAlign.Start) | ||
| 54 | + | ||
| 55 | + if (this.data.checkStatus === 2) { | ||
| 56 | + Row() { | ||
| 57 | + Text(this.data.likeNum.toString()) | ||
| 58 | + .fontWeight("500lpx") | ||
| 59 | + .fontSize("27lpx") | ||
| 60 | + .lineHeight("31lpx") | ||
| 61 | + .fontColor(this.data.like_status === 0 ? $r('app.color.color_666666') : $r('app.color.color_ED2800')) | ||
| 62 | + .margin({ right: '8lpx' }) | ||
| 63 | + Image(this.data.like_status === 0 ? $r('app.media.like_default_status') : $r('app.media.liked_status')) | ||
| 64 | + .width('31lpx') | ||
| 65 | + .height('31lpx') | ||
| 66 | + .objectFit(ImageFit.Auto) | ||
| 67 | + .interpolation(ImageInterpolation.Medium) | ||
| 68 | + .borderRadius(50) | ||
| 69 | + }.onClick(() => { | ||
| 70 | + this.commentLikeOperation() | ||
| 71 | + }) | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + .margin({ bottom: '10lpx' }) | ||
| 75 | + .width('100%') | ||
| 76 | + .height('108lpx') | ||
| 77 | + .padding({ left: '31lpx', right: '31lpx' }) | ||
| 78 | + | ||
| 79 | + Row() { | ||
| 80 | + if (this.isExpand) { | ||
| 81 | + Text() { | ||
| 82 | + Span(this.data.commentContent) | ||
| 83 | + } | ||
| 84 | + .textStyle() | ||
| 85 | + } else { | ||
| 86 | + Text() { | ||
| 87 | + Span(this.clipText(this.data.commentContent, 31, 5, 630, 0)) | ||
| 88 | + if (this.isOverLines) { | ||
| 89 | + Span('...展开') | ||
| 90 | + .fontColor($r('app.color.color_999999')) | ||
| 91 | + .onClick(() => { | ||
| 92 | + this.isExpand = true | ||
| 93 | + }) | ||
| 94 | + } | ||
| 95 | + }.maxLines(5) | ||
| 96 | + .textStyle() | ||
| 97 | + } | ||
| 98 | + }.padding({ left: '31lpx', right: '31lpx' }) | ||
| 99 | + .width('100%') | ||
| 100 | + | ||
| 101 | + Column() { | ||
| 102 | + if (StringUtils.isNotEmpty(this.data.parentCommentContent)) { | ||
| 103 | + //父评论 | ||
| 104 | + Row() { | ||
| 105 | + if (this.isExpandParent) { | ||
| 106 | + Text() { | ||
| 107 | + Span(`@${this.data.parentCommentUserName}:`) | ||
| 108 | + .fontColor($r('app.color.color_000000')) | ||
| 109 | + .fontWeight('500lpx') | ||
| 110 | + .fontSize('27lpx') | ||
| 111 | + .lineHeight('40lpx') | ||
| 112 | + Span(this.data.parentCommentContent) | ||
| 113 | + .fontColor($r('app.color.color_000000')) | ||
| 114 | + .fontWeight('400lpx') | ||
| 115 | + .fontSize('27lpx') | ||
| 116 | + .lineHeight('40lpx') | ||
| 117 | + } | ||
| 118 | + .width('100%') | ||
| 119 | + .textAlign(TextAlign.Start) | ||
| 120 | + } else { | ||
| 121 | + Text() { | ||
| 122 | + Span(`@${this.data.parentCommentUserName}:`) | ||
| 123 | + .fontColor($r('app.color.color_000000')) | ||
| 124 | + .fontWeight('500lpx') | ||
| 125 | + .fontSize('27lpx') | ||
| 126 | + .lineHeight('40lpx') | ||
| 127 | + | ||
| 128 | + Span(this.clipText(this.data.parentCommentContent, 31, 5, 630, 1)) | ||
| 129 | + .fontColor($r('app.color.color_000000')) | ||
| 130 | + .fontWeight('400lpx') | ||
| 131 | + .fontSize('27lpx') | ||
| 132 | + .lineHeight('40lpx') | ||
| 133 | + if (this.isOverLinesParent) { | ||
| 134 | + Span('...展开') | ||
| 135 | + .fontColor($r('app.color.color_999999')) | ||
| 136 | + .onClick(() => { | ||
| 137 | + this.isExpandParent = true | ||
| 138 | + }) | ||
| 139 | + } | ||
| 140 | + }.maxLines(5) | ||
| 141 | + .textAlign(TextAlign.Start) | ||
| 142 | + .width('100%') | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + .width('100%') | ||
| 146 | + .padding({ top: '23lpx', bottom: '15lpx', right: '23lpx' }) | ||
| 147 | + | ||
| 148 | + Divider() | ||
| 149 | + .width('100%') | ||
| 150 | + .height('1lpx') | ||
| 151 | + .strokeWidth('1lpx') | ||
| 152 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 153 | + .margin({ top: '4lpx', bottom: '4lpx' }) | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + Column() { | ||
| 157 | + Row() { | ||
| 158 | + Row() { | ||
| 159 | + Image($r('app.media.comment_link_icon')) | ||
| 160 | + .objectFit(ImageFit.Auto) | ||
| 161 | + .width('31lpx') | ||
| 162 | + .height('31lpx') | ||
| 163 | + .margin({ right: '10lpx' }) | ||
| 164 | + | ||
| 165 | + Column() { | ||
| 166 | + Row() { | ||
| 167 | + Text(`${this.data.targetTitle}`) | ||
| 168 | + .fontWeight('400lpx') | ||
| 169 | + .fontColor($r('app.color.color_666666')) | ||
| 170 | + .lineHeight('38lpx') | ||
| 171 | + .fontSize('27lpx') | ||
| 172 | + .layoutWeight(1) | ||
| 173 | + .maxLines(1) | ||
| 174 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 175 | + }.width('100%') | ||
| 176 | + } | ||
| 177 | + .layoutWeight(1) | ||
| 178 | + .alignItems(HorizontalAlign.Start) | ||
| 179 | + }.layoutWeight(1) | ||
| 180 | + | ||
| 181 | + Image($r('app.media.arrow_icon_right')) | ||
| 182 | + .margin({ right: '4lpx' }) | ||
| 183 | + .width('23lpx') | ||
| 184 | + .height('23lpx') | ||
| 185 | + .margin({right:'23lpx'}) | ||
| 186 | + } | ||
| 187 | + .width('100%') | ||
| 188 | + .height('69lpx') | ||
| 189 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 190 | + | ||
| 191 | + }.height('69lpx') | ||
| 192 | + .justifyContent(FlexAlign.Center) | ||
| 193 | + .onClick(() => { | ||
| 194 | + ProcessUtils.processPage( | ||
| 195 | + { | ||
| 196 | + objectId: this.data.targetId, | ||
| 197 | + relType: this.data.targetRelType + "", | ||
| 198 | + relId: this.data.targetRelId, | ||
| 199 | + objectType: this.data.targetType + "", | ||
| 200 | + } as ContentDTO) | ||
| 201 | + }) | ||
| 202 | + } | ||
| 203 | + .margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' }) | ||
| 204 | + .padding({ left: '23lpx' }) | ||
| 205 | + .width('662lpx') | ||
| 206 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 207 | + | ||
| 208 | + if (!this.isLastItem) { | ||
| 209 | + Divider().width('100%') | ||
| 210 | + .height('12lpx') | ||
| 211 | + .strokeWidth('12lpx') | ||
| 212 | + .color($r('app.color.color_F5F5F5')) | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + .justifyContent(FlexAlign.Center) | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + commentLikeOperation() { | ||
| 219 | + let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0) | ||
| 220 | + MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => { | ||
| 221 | + if (value != null) { | ||
| 222 | + if (value.code === 0 || value.code.toString() === "0") { | ||
| 223 | + this.data.like_status = this.data.like_status === 0 ? 1 : 0 | ||
| 224 | + this.data.likeNum = this.data.like_status === 0 ? this.data.likeNum - 1 : this.data.likeNum + 1 | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + }) | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + /** | ||
| 231 | + * 截断文本 | ||
| 232 | + * @author liuzhendong(猩猩G) | ||
| 233 | + * @param {string} str 要截断的文本 '啊啊啊啊啊' | ||
| 234 | + * @param {number} fontSize 字体大小(px) | ||
| 235 | + * @param {number} maxLines 最大行数 3 | ||
| 236 | + * @param {number} textWidth 文本宽度(px) vp 需要转换vp2px() | ||
| 237 | + * @returns {string} clipStr 截断后的文本 '啊啊' | ||
| 238 | + * @param {type} 0 我的评论 1 父评论 | ||
| 239 | + */ | ||
| 240 | + clipText(str: string, fontSize: number, maxLines: number, textWidth: number, type: number): string { | ||
| 241 | + let strArr: string[] = str.split("") | ||
| 242 | + let truncateContent: string = '啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算 | ||
| 243 | + let measureTruncateWidth: number = measure.measureText({ | ||
| 244 | + textContent: truncateContent, | ||
| 245 | + fontSize: px2fp(fontSize), | ||
| 246 | + }) | ||
| 247 | + if(type === 1){ | ||
| 248 | + measureTruncateWidth = measureTruncateWidth + measure.measureText({ | ||
| 249 | + textContent: `@${this.data.parentCommentUserName}:`, | ||
| 250 | + fontSize: px2fp(fontSize), | ||
| 251 | + }) | ||
| 252 | + } | ||
| 253 | + let clipStr: string = '' | ||
| 254 | + for (let i = 0; i < strArr.length; i++) { | ||
| 255 | + if (measure.measureText({ | ||
| 256 | + textContent: clipStr, | ||
| 257 | + fontSize: px2fp(fontSize), | ||
| 258 | + }) >= textWidth * maxLines - measureTruncateWidth) { | ||
| 259 | + if (type === 0) { | ||
| 260 | + this.isOverLines = true | ||
| 261 | + } else { | ||
| 262 | + this.isOverLinesParent = true | ||
| 263 | + } | ||
| 264 | + break; | ||
| 265 | + } | ||
| 266 | + clipStr += strArr[i] | ||
| 267 | + } | ||
| 268 | + return clipStr | ||
| 269 | + } | ||
| 270 | +} | ||
| 271 | + | ||
| 272 | +@Extend(Text) | ||
| 273 | +function textStyle() { | ||
| 274 | + .width('630lpx') | ||
| 275 | + .fontSize('31lpx') | ||
| 276 | + .fontWeight('400lpx') | ||
| 277 | + .fontColor($r('app.color.color_222222')) | ||
| 278 | + .lineHeight('46lpx') | ||
| 279 | +} | ||
| 280 | + |
| @@ -8,6 +8,10 @@ import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetail | @@ -8,6 +8,10 @@ import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetail | ||
| 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | +import { EmptyComponent } from '../../view/EmptyComponent'; | ||
| 12 | +import { ChildCommentComponent } from './ChildCommentComponent'; | ||
| 13 | +import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; | ||
| 14 | +import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; | ||
| 11 | 15 | ||
| 12 | const TAG = "HomePageBottomComponent" | 16 | const TAG = "HomePageBottomComponent" |
| 13 | @Component | 17 | @Component |
| @@ -90,6 +94,10 @@ export struct HomePageBottomComponent{ | @@ -90,6 +94,10 @@ export struct HomePageBottomComponent{ | ||
| 90 | } | 94 | } |
| 91 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | 95 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) |
| 92 | }) | 96 | }) |
| 97 | + | ||
| 98 | + EmptyComponent({emptyType:14}) | ||
| 99 | + .layoutWeight(1) | ||
| 100 | + .width('100%') | ||
| 93 | }.layoutWeight(1) | 101 | }.layoutWeight(1) |
| 94 | .justifyContent(FlexAlign.Start) | 102 | .justifyContent(FlexAlign.Start) |
| 95 | }else{ | 103 | }else{ |
| @@ -161,7 +169,7 @@ export struct HomePageBottomComponent{ | @@ -161,7 +169,7 @@ export struct HomePageBottomComponent{ | ||
| 161 | List({ space: 3 }) { | 169 | List({ space: 3 }) { |
| 162 | LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | 170 | LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { |
| 163 | ListItem() { | 171 | ListItem() { |
| 164 | - ChildCommentComponent({data: item,isLastItem:index===this.data_comment.totalCount()-1}) | 172 | + ChildCommentComponent({data: item,levelHead:UserDataLocal.getUserLevelHeaderUrl(),isLastItem:index===this.data_comment.totalCount()-1}) |
| 165 | } | 173 | } |
| 166 | .onClick(() => { | 174 | .onClick(() => { |
| 167 | }) | 175 | }) |
| @@ -263,17 +271,7 @@ export struct HomePageBottomComponent{ | @@ -263,17 +271,7 @@ export struct HomePageBottomComponent{ | ||
| 263 | if (!this.data_comment || value.list.length == 0){ | 271 | if (!this.data_comment || value.list.length == 0){ |
| 264 | this.hasMore = false | 272 | this.hasMore = false |
| 265 | }else{ | 273 | }else{ |
| 266 | - value.list.forEach((value)=>{ | ||
| 267 | - let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 268 | - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType,value.targetRelId,value.targetRelObjectId,value.targetRelType,value.targetStatus)) | ||
| 269 | - }) | ||
| 270 | - this.data_comment.notifyDataReload() | ||
| 271 | - this.count = this.data_comment.totalCount() | ||
| 272 | - if (this.data_comment.totalCount() < value.totalCount) { | ||
| 273 | - this.curPageNum++ | ||
| 274 | - }else { | ||
| 275 | - this.hasMore = false | ||
| 276 | - } | 274 | + this.getCommentListStatus(value) |
| 277 | } | 275 | } |
| 278 | this.isLoading = false | 276 | this.isLoading = false |
| 279 | this.commentNum = value.totalCount | 277 | this.commentNum = value.totalCount |
| @@ -286,102 +284,59 @@ export struct HomePageBottomComponent{ | @@ -286,102 +284,59 @@ export struct HomePageBottomComponent{ | ||
| 286 | } | 284 | } |
| 287 | } | 285 | } |
| 288 | } | 286 | } |
| 289 | -} | ||
| 290 | 287 | ||
| 291 | -@Component | ||
| 292 | -struct ChildCommentComponent { | ||
| 293 | - @ObjectLink data: CommentListItem | ||
| 294 | - isLastItem: boolean = false | 288 | + getCommentListStatus(value:MineCommentListDetailItem){ |
| 295 | 289 | ||
| 296 | - build() { | ||
| 297 | - Column(){ | ||
| 298 | - Row() { | ||
| 299 | - Stack({alignContent: Alignment.Center}){ | ||
| 300 | - Image(this.data.fromUserHeader) | ||
| 301 | - .alt($r('app.media.default_head')) | ||
| 302 | - .objectFit(ImageFit.Auto) | ||
| 303 | - .width('69lpx') | ||
| 304 | - .height('69lpx') | ||
| 305 | - .borderRadius(50) | ||
| 306 | - Image(UserDataLocal.getUserLevelHeaderUrl()) | ||
| 307 | - .width('89lpx') | ||
| 308 | - .height('89lpx') | ||
| 309 | - .objectFit(ImageFit.Cover) | ||
| 310 | - .borderRadius(50) | ||
| 311 | - }.width('89lpx') | ||
| 312 | - .height('89lpx') | ||
| 313 | - .margin({right:'15lpx'}) | ||
| 314 | - | ||
| 315 | - Column(){ | ||
| 316 | - Text(this.data.fromUserName) | ||
| 317 | - .fontSize('25lpx') | ||
| 318 | - .lineHeight('35lpx') | ||
| 319 | - .fontWeight('600lpx') | ||
| 320 | - .fontColor($r('app.color.color_222222')) | ||
| 321 | - .margin({bottom:'6lpx'}) | ||
| 322 | - .maxLines(1) | ||
| 323 | - Text(`${this.data.createTime}`) | ||
| 324 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 325 | - .fontSize('23lpx') | ||
| 326 | - .lineHeight('31lpx') | ||
| 327 | - .fontWeight('400lpx') | ||
| 328 | - .maxLines(1) | ||
| 329 | - }.layoutWeight(1) | ||
| 330 | - .alignItems(HorizontalAlign.Start) | 290 | + let status = new OtherUserCommentLikeStatusRequestItem() |
| 291 | + let data : CommentListItem[] = [] | ||
| 292 | + value.list.forEach((item)=>{ | ||
| 293 | + if(item.checkStatus === 2){ | ||
| 294 | + status.commentIdList.push(item.id) | ||
| 295 | + } | ||
| 296 | + let commentContent = item.commentContent | ||
| 297 | + if(item.sensitiveShow === 0 && item.sensitiveExist === 1){ | ||
| 298 | + commentContent = item.commentContentSensitive | ||
| 299 | + } | ||
| 300 | + let parentCommentContent = "" | ||
| 301 | + if(item.parentCommentVo!=null ){ | ||
| 302 | + parentCommentContent = item.parentCommentVo.commentContent | ||
| 303 | + } | ||
| 304 | + let parentCommentUserName = "" | ||
| 305 | + if(item.parentCommentVo!=null ){ | ||
| 306 | + parentCommentUserName = item.parentCommentVo.fromUserName | ||
| 331 | } | 307 | } |
| 332 | - .margin({bottom:'10lpx'}) | ||
| 333 | - .width('100%') | ||
| 334 | - .height('108lpx') | ||
| 335 | - .padding({left:'31lpx',right:'31lpx'}) | 308 | + data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) |
| 309 | + }) | ||
| 336 | 310 | ||
| 337 | - Row(){ | ||
| 338 | - Text(this.data.commentContent) | ||
| 339 | - .maxLines(3) | ||
| 340 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 341 | - .fontWeight('400lpx') | ||
| 342 | - .fontSize('31lpx') | ||
| 343 | - .lineHeight('46lpx') | ||
| 344 | - .fontColor($r('app.color.color_222222')) | ||
| 345 | - .margin({bottom:'10lpx'}) | ||
| 346 | - }.padding({left:'31lpx',right:'31lpx'}) | ||
| 347 | - .width('100%') | 311 | + MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ |
| 312 | + newValue.forEach((item)=>{ | ||
| 313 | + data.forEach((list)=>{ | ||
| 314 | + if (item.commentId == list.id) { | ||
| 315 | + list.like_status = item.status | ||
| 316 | + } | ||
| 317 | + }) | ||
| 318 | + }) | ||
| 348 | 319 | ||
| 349 | - Row(){ | ||
| 350 | - Text(this.data.targetTitle) | ||
| 351 | - .fontWeight('400lpx') | ||
| 352 | - .fontColor($r('app.color.color_222222')) | ||
| 353 | - .lineHeight('38lpx') | ||
| 354 | - .fontSize('27lpx') | ||
| 355 | - .textAlign(TextAlign.Center) | ||
| 356 | - .margin({right:'4lpx'}) | ||
| 357 | - .maxLines(3) | ||
| 358 | - .width('616lpx') | ||
| 359 | - Image($r('app.media.arrow_icon_right')) | ||
| 360 | - .objectFit(ImageFit.Auto) | ||
| 361 | - .width('27lpx') | ||
| 362 | - .height('27lpx') | ||
| 363 | - } | ||
| 364 | - .padding({top:'17lpx',bottom:'17lpx',left:'23lpx',right:'23lpx'}) | ||
| 365 | - .width('662lpx') | ||
| 366 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 367 | - .margin({top:'19lpx',bottom:'31lpx'}) | ||
| 368 | - .onClick(()=>{ | ||
| 369 | - ProcessUtils.processPage( | ||
| 370 | - {objectId: this.data.targetId, | ||
| 371 | - relType:this.data.targetRelType+"", | ||
| 372 | - relId:this.data.targetRelId, | ||
| 373 | - objectType:this.data.targetType+"", | ||
| 374 | - } as ContentDTO ) | 320 | + data.forEach((item)=>{ |
| 321 | + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 322 | + this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,publishTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,item.parentCommentContent,item.parentCommentUserName)) | ||
| 375 | }) | 323 | }) |
| 376 | 324 | ||
| 377 | - if(!this.isLastItem){ | ||
| 378 | - Divider().width('100%') | ||
| 379 | - .height('12lpx') | ||
| 380 | - .strokeWidth('12lpx') | ||
| 381 | - .color($r('app.color.color_F5F5F5')) | 325 | + this.data_comment.notifyDataReload() |
| 326 | + | ||
| 327 | + this.count = this.data_comment.totalCount() | ||
| 328 | + this.commentNum = value.totalCount | ||
| 329 | + if (this.data_comment.totalCount() < value.totalCount) { | ||
| 330 | + this.curPageNum++ | ||
| 331 | + }else { | ||
| 332 | + this.hasMore = false | ||
| 382 | } | 333 | } |
| 383 | 334 | ||
| 384 | - } | ||
| 385 | - .justifyContent(FlexAlign.Center) | 335 | + this.isLoading = false |
| 336 | + }).catch((err:Error)=>{ | ||
| 337 | + console.log(TAG,"请求失败") | ||
| 338 | + this.isLoading = false | ||
| 339 | + }) | ||
| 386 | } | 340 | } |
| 341 | + | ||
| 387 | } | 342 | } |
| @@ -5,9 +5,7 @@ import { OtherUserCommentListRequestItem } from '../../../viewmodel/OtherUserCom | @@ -5,9 +5,7 @@ import { OtherUserCommentListRequestItem } from '../../../viewmodel/OtherUserCom | ||
| 5 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 5 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 6 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; | 6 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; |
| 7 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; | 7 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; |
| 8 | -import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'; | ||
| 9 | -import { ProcessUtils } from 'wdRouter/Index'; | ||
| 10 | -import { ContentDTO } from 'wdBean/Index'; | 8 | +import { ChildCommentComponent } from './ChildCommentComponent'; |
| 11 | 9 | ||
| 12 | const TAG = "HomePageBottomComponent" | 10 | const TAG = "HomePageBottomComponent" |
| 13 | @Component | 11 | @Component |
| @@ -108,8 +106,22 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -108,8 +106,22 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 108 | let status = new OtherUserCommentLikeStatusRequestItem() | 106 | let status = new OtherUserCommentLikeStatusRequestItem() |
| 109 | let data : CommentListItem[] = [] | 107 | let data : CommentListItem[] = [] |
| 110 | value.list.forEach((item)=>{ | 108 | value.list.forEach((item)=>{ |
| 111 | - status.commentIdList.push(item.id) | ||
| 112 | - data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus)) | 109 | + if(item.checkStatus === 2){ |
| 110 | + status.commentIdList.push(item.id) | ||
| 111 | + } | ||
| 112 | + let commentContent = item.commentContent | ||
| 113 | + if(item.sensitiveShow === 0 && item.sensitiveExist === 1){ | ||
| 114 | + commentContent = item.commentContentSensitive | ||
| 115 | + } | ||
| 116 | + let parentCommentContent = "" | ||
| 117 | + if(item.parentCommentVo!=null ){ | ||
| 118 | + parentCommentContent = item.parentCommentVo.commentContent | ||
| 119 | + } | ||
| 120 | + let parentCommentUserName = "" | ||
| 121 | + if(item.parentCommentVo!=null ){ | ||
| 122 | + parentCommentUserName = item.parentCommentVo.fromUserName | ||
| 123 | + } | ||
| 124 | + data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) | ||
| 113 | }) | 125 | }) |
| 114 | 126 | ||
| 115 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ | 127 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ |
| @@ -122,7 +134,7 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -122,7 +134,7 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 122 | }) | 134 | }) |
| 123 | 135 | ||
| 124 | data.forEach((item)=>{ | 136 | data.forEach((item)=>{ |
| 125 | - this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus)) | 137 | + this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,item.parentCommentContent,item.parentCommentUserName)) |
| 126 | }) | 138 | }) |
| 127 | 139 | ||
| 128 | this.data_comment.notifyDataReload() | 140 | this.data_comment.notifyDataReload() |
| @@ -141,133 +153,4 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -141,133 +153,4 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 141 | this.isLoading = false | 153 | this.isLoading = false |
| 142 | }) | 154 | }) |
| 143 | } | 155 | } |
| 144 | - | ||
| 145 | -} | ||
| 146 | - | ||
| 147 | -@Component | ||
| 148 | -struct ChildCommentComponent { | ||
| 149 | - @ObjectLink data: CommentListItem | ||
| 150 | - @Prop levelHead:string | ||
| 151 | - isLastItem: boolean = false | ||
| 152 | - | ||
| 153 | - build() { | ||
| 154 | - Column(){ | ||
| 155 | - Row() { | ||
| 156 | - Stack({alignContent: Alignment.Center}){ | ||
| 157 | - Image(this.data.fromUserHeader) | ||
| 158 | - .alt($r('app.media.default_head')) | ||
| 159 | - .objectFit(ImageFit.Auto) | ||
| 160 | - .width('69lpx') | ||
| 161 | - .height('69lpx') | ||
| 162 | - .borderRadius(50) | ||
| 163 | - Image(this.levelHead) | ||
| 164 | - .width('89lpx') | ||
| 165 | - .height('89lpx') | ||
| 166 | - .objectFit(ImageFit.Cover) | ||
| 167 | - .borderRadius(50) | ||
| 168 | - }.width('89lpx') | ||
| 169 | - .height('89lpx') | ||
| 170 | - .margin({right:'15lpx'}) | ||
| 171 | - | ||
| 172 | - Column(){ | ||
| 173 | - Text(this.data.fromUserName) | ||
| 174 | - .fontSize('25lpx') | ||
| 175 | - .lineHeight('35lpx') | ||
| 176 | - .fontWeight('600lpx') | ||
| 177 | - .fontColor($r('app.color.color_222222')) | ||
| 178 | - .margin({bottom:'6lpx'}) | ||
| 179 | - .maxLines(1) | ||
| 180 | - Text(`${this.data.createTime}`) | ||
| 181 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 182 | - .fontSize('23lpx') | ||
| 183 | - .lineHeight('31lpx') | ||
| 184 | - .fontWeight('400lpx') | ||
| 185 | - .maxLines(1) | ||
| 186 | - }.layoutWeight(1) | ||
| 187 | - .alignItems(HorizontalAlign.Start) | ||
| 188 | - | ||
| 189 | - Row(){ | ||
| 190 | - Text(this.data.likeNum.toString()) | ||
| 191 | - .fontWeight("500lpx") | ||
| 192 | - .fontSize("27lpx") | ||
| 193 | - .lineHeight("31lpx") | ||
| 194 | - .fontColor(this.data.like_status===0?$r('app.color.color_666666'):$r('app.color.color_ED2800')) | ||
| 195 | - .margin({right:'8lpx'}) | ||
| 196 | - Image(this.data.like_status===0?$r('app.media.like_default_status'):$r('app.media.liked_status')) | ||
| 197 | - .width('31lpx') | ||
| 198 | - .height('31lpx') | ||
| 199 | - .objectFit(ImageFit.Auto) | ||
| 200 | - .interpolation(ImageInterpolation.Medium) | ||
| 201 | - .borderRadius(50) | ||
| 202 | - }.onClick(()=>{ | ||
| 203 | - this.commentLikeOperation() | ||
| 204 | - }) | ||
| 205 | - } | ||
| 206 | - .margin({bottom:'10lpx'}) | ||
| 207 | - .width('100%') | ||
| 208 | - .height('108lpx') | ||
| 209 | - .padding({left:'31lpx',right:'31lpx'}) | ||
| 210 | - | ||
| 211 | - Row(){ | ||
| 212 | - Text(this.data.commentContent) | ||
| 213 | - .maxLines(3) | ||
| 214 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 215 | - .fontWeight('400lpx') | ||
| 216 | - .fontSize('31lpx') | ||
| 217 | - .lineHeight('46lpx') | ||
| 218 | - .fontColor($r('app.color.color_222222')) | ||
| 219 | - .margin({bottom:'10lpx'}) | ||
| 220 | - }.padding({left:'31lpx',right:'31lpx'}) | ||
| 221 | - .width('100%') | ||
| 222 | - | ||
| 223 | - Row(){ | ||
| 224 | - Text(this.data.targetTitle) | ||
| 225 | - .fontWeight('400lpx') | ||
| 226 | - .fontColor($r('app.color.color_222222')) | ||
| 227 | - .lineHeight('38lpx') | ||
| 228 | - .fontSize('27lpx') | ||
| 229 | - .textAlign(TextAlign.Center) | ||
| 230 | - .margin({right:'4lpx'}) | ||
| 231 | - .maxLines(3) | ||
| 232 | - .width('616lpx') | ||
| 233 | - Image($r('app.media.arrow_icon_right')) | ||
| 234 | - .objectFit(ImageFit.Auto) | ||
| 235 | - .width('27lpx') | ||
| 236 | - .height('27lpx') | ||
| 237 | - } | ||
| 238 | - .padding({top:'17lpx',bottom:'17lpx',left:'23lpx',right:'23lpx'}) | ||
| 239 | - .width('662lpx') | ||
| 240 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 241 | - .margin({top:'19lpx',bottom:'31lpx'}) | ||
| 242 | - .onClick(()=>{ | ||
| 243 | - ProcessUtils.processPage( | ||
| 244 | - {objectId: this.data.targetId, | ||
| 245 | - relType:this.data.targetRelType+"", | ||
| 246 | - relId:this.data.targetRelId, | ||
| 247 | - objectType:this.data.targetType+"", | ||
| 248 | - } as ContentDTO ) | ||
| 249 | - }) | ||
| 250 | - | ||
| 251 | - if(!this.isLastItem){ | ||
| 252 | - Divider().width('100%') | ||
| 253 | - .height('12lpx') | ||
| 254 | - .strokeWidth('12lpx') | ||
| 255 | - .color($r('app.color.color_F5F5F5')) | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - } | ||
| 259 | - .justifyContent(FlexAlign.Center) | ||
| 260 | - } | ||
| 261 | - | ||
| 262 | - commentLikeOperation(){ | ||
| 263 | - let item = new CommentLikeOperationRequestItem(this.data.targetId,this.data.id+"",this.data.targetType+"",UserDataLocal.getUserName(),UserDataLocal.getUserHeaderUrl(),this.data.like_status===0?1:0) | ||
| 264 | - MinePageDatasModel.getCommentLikeOperation(item,getContext(this)).then((value)=>{ | ||
| 265 | - if(value!=null){ | ||
| 266 | - if (value.code === 0 || value.code.toString() === "0") { | ||
| 267 | - this.data.like_status = this.data.like_status===0?1:0 | ||
| 268 | - this.data.likeNum = this.data.like_status===0?this.data.likeNum-1:this.data.likeNum+1 | ||
| 269 | - } | ||
| 270 | - } | ||
| 271 | - }) | ||
| 272 | - } | ||
| 273 | } | 156 | } |
| @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; | 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; |
| 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 8 | +import { EmptyComponent } from '../../view/EmptyComponent'; | ||
| 8 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 9 | 10 | ||
| 10 | const TAG = "HomePageBottomComponent" | 11 | const TAG = "HomePageBottomComponent" |
| @@ -30,8 +31,37 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -30,8 +31,37 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 30 | .backgroundColor($r('app.color.color_EDEDED')) | 31 | .backgroundColor($r('app.color.color_EDEDED')) |
| 31 | 32 | ||
| 32 | if(this.count === 0){ | 33 | if(this.count === 0){ |
| 33 | - ListHasNoMoreDataUI({style:2}) | ||
| 34 | - .height('100%') | 34 | + Column(){ |
| 35 | + Row(){ | ||
| 36 | + Text("关注更多人民号") | ||
| 37 | + .fontWeight('400lpx') | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .lineHeight('38lpx') | ||
| 40 | + .fontSize('27lpx') | ||
| 41 | + .textAlign(TextAlign.Center) | ||
| 42 | + .margin({right:'4lpx'}) | ||
| 43 | + Image($r('app.media.arrow_icon_right')) | ||
| 44 | + .objectFit(ImageFit.Auto) | ||
| 45 | + .width('27lpx') | ||
| 46 | + .height('27lpx') | ||
| 47 | + }.height('69lpx') | ||
| 48 | + .width('659lpx') | ||
| 49 | + .alignItems(VerticalAlign.Center) | ||
| 50 | + .justifyContent(FlexAlign.Center) | ||
| 51 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 52 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 53 | + .onClick(()=>{ | ||
| 54 | + let params: Params = { | ||
| 55 | + pageID: "1" | ||
| 56 | + } | ||
| 57 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 58 | + }) | ||
| 59 | + | ||
| 60 | + EmptyComponent({emptyType:14}) | ||
| 61 | + .layoutWeight(1) | ||
| 62 | + .width('100%') | ||
| 63 | + }.layoutWeight(1) | ||
| 64 | + .justifyContent(FlexAlign.Start) | ||
| 35 | }else{ | 65 | }else{ |
| 36 | List({ space: 3 }) { | 66 | List({ space: 3 }) { |
| 37 | 67 |
| @@ -15,12 +15,14 @@ import { CompDTO } from 'wdBean'; | @@ -15,12 +15,14 @@ import { CompDTO } from 'wdBean'; | ||
| 15 | import PageHelper from '../../viewmodel/PageHelper'; | 15 | import PageHelper from '../../viewmodel/PageHelper'; |
| 16 | import { channelSkeleton } from '../skeleton/channelSkeleton' | 16 | import { channelSkeleton } from '../skeleton/channelSkeleton' |
| 17 | import { ProcessUtils } from 'wdRouter/Index'; | 17 | import { ProcessUtils } from 'wdRouter/Index'; |
| 18 | +import PageAdModel from '../../viewmodel/PageAdvModel'; | ||
| 18 | 19 | ||
| 19 | const TAG = 'PageComponent'; | 20 | const TAG = 'PageComponent'; |
| 20 | 21 | ||
| 21 | @Component | 22 | @Component |
| 22 | export struct PageComponent { | 23 | export struct PageComponent { |
| 23 | @State private pageModel: PageModel = new PageModel(); | 24 | @State private pageModel: PageModel = new PageModel(); |
| 25 | + @State private pageAdvModel: PageAdModel = new PageAdModel(); | ||
| 24 | navIndex: number = 0; | 26 | navIndex: number = 0; |
| 25 | pageId: string = ""; | 27 | pageId: string = ""; |
| 26 | channelId: string = ""; | 28 | channelId: string = ""; |
| @@ -44,7 +46,7 @@ export struct PageComponent { | @@ -44,7 +46,7 @@ export struct PageComponent { | ||
| 44 | .onTouch((event: TouchEvent | undefined) => { | 46 | .onTouch((event: TouchEvent | undefined) => { |
| 45 | if (event) { | 47 | if (event) { |
| 46 | if (this.pageModel.viewType === ViewType.LOADED) { | 48 | if (this.pageModel.viewType === ViewType.LOADED) { |
| 47 | - listTouchEvent(this.pageModel, event); | 49 | + listTouchEvent(this.pageModel, this.pageAdvModel, event); |
| 48 | } | 50 | } |
| 49 | } | 51 | } |
| 50 | }) | 52 | }) |
| @@ -120,12 +122,12 @@ export struct PageComponent { | @@ -120,12 +122,12 @@ export struct PageComponent { | ||
| 120 | @Builder | 122 | @Builder |
| 121 | pageHornAd() { | 123 | pageHornAd() { |
| 122 | 124 | ||
| 123 | - if (this.pageModel.isShowAds) { | ||
| 124 | - if (this.pageModel.pageCornerAdv.matInfo != null) { | 125 | + if (this.pageAdvModel.isShowAds) { |
| 126 | + if (this.pageAdvModel.pageCornerAdv.matInfo != null) { | ||
| 125 | // 页面右边挂角 | 127 | // 页面右边挂角 |
| 126 | - this.drawPageCornerAdvView(1, 1 == this.pageModel.isRightAdv) | ||
| 127 | - } else if (this.pageModel.pageCornerContentInfo.advert != null) { | ||
| 128 | - this.drawPageCornerAdvView(2, 1 == this.pageModel.isRightAdv) | 128 | + this.drawPageCornerAdvView(1, 1 == this.pageAdvModel.isRightAdv) |
| 129 | + } else if (this.pageAdvModel.pageCornerContentInfo.advert != null) { | ||
| 130 | + this.drawPageCornerAdvView(2, 1 == this.pageAdvModel.isRightAdv) | ||
| 129 | } | 131 | } |
| 130 | } | 132 | } |
| 131 | 133 | ||
| @@ -140,8 +142,8 @@ export struct PageComponent { | @@ -140,8 +142,8 @@ export struct PageComponent { | ||
| 140 | @Builder | 142 | @Builder |
| 141 | drawPageCornerAdvView(type: number, isRightCorne: boolean) { | 143 | drawPageCornerAdvView(type: number, isRightCorne: boolean) { |
| 142 | // 页面左挂角 | 144 | // 页面左挂角 |
| 143 | - Image(type === 1 ? this.pageModel.pageCornerAdv.matInfo.matImageUrl[0] | ||
| 144 | - : this.pageModel.pageCornerContentInfo.advert.displayUrl) | 145 | + Image(type === 1 ? this.pageAdvModel.pageCornerAdv.matInfo.matImageUrl[0] |
| 146 | + : this.pageAdvModel.pageCornerContentInfo.advert.displayUrl) | ||
| 145 | .width($r('app.float.vp_80')) | 147 | .width($r('app.float.vp_80')) |
| 146 | .height($r('app.float.vp_80')) | 148 | .height($r('app.float.vp_80')) |
| 147 | .id("left_iv") | 149 | .id("left_iv") |
| @@ -159,10 +161,10 @@ export struct PageComponent { | @@ -159,10 +161,10 @@ export struct PageComponent { | ||
| 159 | .onClick(() => { | 161 | .onClick(() => { |
| 160 | if (type === 1) { | 162 | if (type === 1) { |
| 161 | // 广告业务跳转 | 163 | // 广告业务跳转 |
| 162 | - ProcessUtils.openAdvDetail(this.pageModel.pageCornerAdv.matInfo); | 164 | + ProcessUtils.openAdvDetail(this.pageAdvModel.pageCornerAdv.matInfo); |
| 163 | } else { | 165 | } else { |
| 164 | // 展现中心的业务跳转 | 166 | // 展现中心的业务跳转 |
| 165 | - ProcessUtils.advJumpMainPage(this.pageModel.pageCornerContentInfo.advert) | 167 | + ProcessUtils.advJumpMainPage(this.pageAdvModel.pageCornerContentInfo.advert) |
| 166 | } | 168 | } |
| 167 | }) | 169 | }) |
| 168 | // 关闭按钮 | 170 | // 关闭按钮 |
| @@ -180,7 +182,7 @@ export struct PageComponent { | @@ -180,7 +182,7 @@ export struct PageComponent { | ||
| 180 | }) | 182 | }) |
| 181 | .onClick(() => { | 183 | .onClick(() => { |
| 182 | // 关闭挂角广告 | 184 | // 关闭挂角广告 |
| 183 | - this.pageModel.isShowAds = false; | 185 | + this.pageAdvModel.isShowAds = false; |
| 184 | 186 | ||
| 185 | }) | 187 | }) |
| 186 | 188 | ||
| @@ -228,7 +230,7 @@ export struct PageComponent { | @@ -228,7 +230,7 @@ export struct PageComponent { | ||
| 228 | this.pageModel.groupId = this.pageId; | 230 | this.pageModel.groupId = this.pageId; |
| 229 | this.pageModel.channelId = this.channelId; | 231 | this.pageModel.channelId = this.channelId; |
| 230 | this.pageModel.currentPage = 1; | 232 | this.pageModel.currentPage = 1; |
| 231 | - PageHelper.getInitData(this.pageModel) | 233 | + PageHelper.getInitData(this.pageModel, this.pageAdvModel) |
| 232 | // let pageInfo = await PageViewModel.getPageInfo(this.pageModel.pageId); | 234 | // let pageInfo = await PageViewModel.getPageInfo(this.pageModel.pageId); |
| 233 | // if (pageInfo == null) { | 235 | // if (pageInfo == null) { |
| 234 | // this.pageModel.viewType = ViewType.EMPTY; | 236 | // this.pageModel.viewType = ViewType.EMPTY; |
| @@ -5,6 +5,7 @@ import hilog from '@ohos.hilog'; | @@ -5,6 +5,7 @@ import hilog from '@ohos.hilog'; | ||
| 5 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' | 5 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' |
| 6 | import { Params } from 'wdBean'; | 6 | import { Params } from 'wdBean'; |
| 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 8 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'PrivacySettingPage'; | 10 | const TAG = 'PrivacySettingPage'; |
| 10 | const DiyString = '开启个性化推荐' | 11 | const DiyString = '开启个性化推荐' |
| @@ -23,6 +24,9 @@ export struct PrivacySettingPage { | @@ -23,6 +24,9 @@ export struct PrivacySettingPage { | ||
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | aboutToAppear() { | 26 | aboutToAppear() { |
| 27 | + if (!HttpUrlUtils.getUserId()) { | ||
| 28 | + this.listData.splice(0, 1); | ||
| 29 | + } | ||
| 26 | // 获取权限= | 30 | // 获取权限= |
| 27 | // SPHelper.default.save('sdf','sdf'); | 31 | // SPHelper.default.save('sdf','sdf'); |
| 28 | // this.initListData(); | 32 | // this.initListData(); |
| @@ -60,7 +64,7 @@ export struct PrivacySettingPage { | @@ -60,7 +64,7 @@ export struct PrivacySettingPage { | ||
| 60 | List({ space: '23lpx' }) { | 64 | List({ space: '23lpx' }) { |
| 61 | ForEach(this.listData, (item: PrivacySettingModel, index:number) => { | 65 | ForEach(this.listData, (item: PrivacySettingModel, index:number) => { |
| 62 | ListItem() { | 66 | ListItem() { |
| 63 | - if (index == 0) { | 67 | + if (item.privacyName == DiyString) { |
| 64 | getTuiJianCell({ item:item, index:index }); | 68 | getTuiJianCell({ item:item, index:index }); |
| 65 | } else { | 69 | } else { |
| 66 | getArrowCell({ item:item, index:index }); | 70 | getArrowCell({ item:item, index:index }); |
| @@ -73,6 +77,8 @@ export struct PrivacySettingPage { | @@ -73,6 +77,8 @@ export struct PrivacySettingPage { | ||
| 73 | PermissionUtil.reqPermissionsFromUser([item.permissionKey], this).then((res)=>{ | 77 | PermissionUtil.reqPermissionsFromUser([item.permissionKey], this).then((res)=>{ |
| 74 | item.permission = res; | 78 | item.permission = res; |
| 75 | }); | 79 | }); |
| 80 | + }else{ | ||
| 81 | + PermissionUtil.openPermissionsInSystemSettings(this); | ||
| 76 | } | 82 | } |
| 77 | } | 83 | } |
| 78 | }) | 84 | }) |
| 1 | import { Action, CompDTO, Params, TopNavDTO } from 'wdBean'; | 1 | import { Action, CompDTO, Params, TopNavDTO } from 'wdBean'; |
| 2 | import { LazyDataSource, Logger } from 'wdKit'; | 2 | import { LazyDataSource, Logger } from 'wdKit'; |
| 3 | -import { WDRouterRule } from 'wdRouter'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { PageComponent } from './PageComponent'; | 4 | import { PageComponent } from './PageComponent'; |
| 5 | import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; | 5 | import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; |
| 6 | import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent'; | 6 | import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent'; |
| @@ -135,16 +135,6 @@ export struct TopNavigationComponent { | @@ -135,16 +135,6 @@ export struct TopNavigationComponent { | ||
| 135 | return item.name === '版面' | 135 | return item.name === '版面' |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | - jumpToENewPaper() { | ||
| 139 | - let taskAction: Action = { | ||
| 140 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 141 | - params: { | ||
| 142 | - pageID: 'E_NEWSPAPER' | ||
| 143 | - } as Params, | ||
| 144 | - }; | ||
| 145 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 146 | - } | ||
| 147 | - | ||
| 148 | build() { | 138 | build() { |
| 149 | Column() { | 139 | Column() { |
| 150 | // 顶部搜索、日报logo、早晚报 | 140 | // 顶部搜索、日报logo、早晚报 |
| @@ -156,7 +146,7 @@ export struct TopNavigationComponent { | @@ -156,7 +146,7 @@ export struct TopNavigationComponent { | ||
| 156 | .width(72) | 146 | .width(72) |
| 157 | .height(29) | 147 | .height(29) |
| 158 | .onClick(() => { | 148 | .onClick(() => { |
| 159 | - this.jumpToENewPaper() | 149 | + ProcessUtils.gotoENewsPaper() |
| 160 | }) | 150 | }) |
| 161 | Stack({ alignContent: Alignment.Center }) { | 151 | Stack({ alignContent: Alignment.Center }) { |
| 162 | Image($r('app.media.background_read_paper_home')) | 152 | Image($r('app.media.background_read_paper_home')) |
| @@ -177,13 +167,7 @@ export struct TopNavigationComponent { | @@ -177,13 +167,7 @@ export struct TopNavigationComponent { | ||
| 177 | .height(30) | 167 | .height(30) |
| 178 | .width(124) | 168 | .width(124) |
| 179 | .onClick(() => { | 169 | .onClick(() => { |
| 180 | - let taskAction: Action = { | ||
| 181 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 182 | - params: { | ||
| 183 | - pageID: 'MorningEveningPaper' | ||
| 184 | - } as Params, | ||
| 185 | - }; | ||
| 186 | - WDRouterRule.jumpWithAction(taskAction) | 170 | + ProcessUtils.gotoMorningEveningPaper() |
| 187 | }) | 171 | }) |
| 188 | }.width('100%') | 172 | }.width('100%') |
| 189 | .justifyContent(FlexAlign.SpaceBetween) | 173 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -236,18 +220,11 @@ export struct TopNavigationComponent { | @@ -236,18 +220,11 @@ export struct TopNavigationComponent { | ||
| 236 | } | 220 | } |
| 237 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 221 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 238 | // 跳转到播报页面 | 222 | // 跳转到播报页面 |
| 239 | - let taskAction: Action = { | ||
| 240 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 241 | - params: { | ||
| 242 | - pageID: 'BroadcastPage', | ||
| 243 | - id: this.myChannelList[index].pageId | ||
| 244 | - } as Params, | ||
| 245 | - }; | ||
| 246 | - WDRouterRule.jumpWithAction(taskAction) | 223 | + ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| 247 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 224 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) |
| 248 | } | 225 | } |
| 249 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 226 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 250 | - this.jumpToENewPaper() | 227 | + ProcessUtils.gotoENewsPaper() |
| 251 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 228 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) |
| 252 | } | 229 | } |
| 253 | }) | 230 | }) |
| @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | ||
| 24 | // 列表 | 24 | // 列表 |
| 25 | else if (this.publishCount == 0) { | 25 | else if (this.publishCount == 0) { |
| 26 | // 无数据展示 | 26 | // 无数据展示 |
| 27 | - EmptyComponent().height(DisplayUtils.getDeviceHeight() - this.topHeight) | 27 | + EmptyComponent({emptyType: 13}).height(DisplayUtils.getDeviceHeight() - this.topHeight) |
| 28 | } else { | 28 | } else { |
| 29 | Column() { | 29 | Column() { |
| 30 | Column() { | 30 | Column() { |
| @@ -46,6 +46,7 @@ export struct PeopleShipHomeListComponent { | @@ -46,6 +46,7 @@ export struct PeopleShipHomeListComponent { | ||
| 46 | .alignItems(VerticalAlign.Bottom) | 46 | .alignItems(VerticalAlign.Bottom) |
| 47 | .width('100%') | 47 | .width('100%') |
| 48 | } | 48 | } |
| 49 | + .height('44vp') | ||
| 49 | .alignItems(HorizontalAlign.Start) | 50 | .alignItems(HorizontalAlign.Start) |
| 50 | .width('100%') | 51 | .width('100%') |
| 51 | 52 | ||
| @@ -109,8 +110,8 @@ export struct PeopleShipHomeListComponent { | @@ -109,8 +110,8 @@ export struct PeopleShipHomeListComponent { | ||
| 109 | .justifyContent(FlexAlign.Center) | 110 | .justifyContent(FlexAlign.Center) |
| 110 | .constraintSize({ minWidth: 35 }) | 111 | .constraintSize({ minWidth: 35 }) |
| 111 | .margin({ | 112 | .margin({ |
| 112 | - left: '16vp', | ||
| 113 | - right: '16vp' | 113 | + left: index == 0 ? '16vp' : '10vp', |
| 114 | + right: index == this.tabArr.length - 1 ? '16vp' : '10vp' | ||
| 114 | }) | 115 | }) |
| 115 | .height('44vp') | 116 | .height('44vp') |
| 116 | .onClick(() => { | 117 | .onClick(() => { |
| @@ -6,6 +6,7 @@ import { Logger } from 'wdKit' | @@ -6,6 +6,7 @@ import { Logger } from 'wdKit' | ||
| 6 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 6 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' | 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' |
| 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' | 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' |
| 9 | +import { HWLocationUtils } from 'wdHwAbility' | ||
| 9 | 10 | ||
| 10 | 11 | ||
| 11 | @Component | 12 | @Component |
| @@ -29,6 +30,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -29,6 +30,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 29 | @State topFixedHeight: number = 320 | 30 | @State topFixedHeight: number = 320 |
| 30 | @State lineInNum: number = 1 | 31 | @State lineInNum: number = 1 |
| 31 | @Link topHeight: number | 32 | @Link topHeight: number |
| 33 | + @State provinceName: string = '' | ||
| 32 | build() { | 34 | build() { |
| 33 | Column() { | 35 | Column() { |
| 34 | Stack({ alignContent: Alignment.TopStart}) { | 36 | Stack({ alignContent: Alignment.TopStart}) { |
| @@ -136,7 +138,6 @@ export struct PeopleShipHomePageTopComponent { | @@ -136,7 +138,6 @@ export struct PeopleShipHomePageTopComponent { | ||
| 136 | .margin({ | 138 | .margin({ |
| 137 | left: '16vp', | 139 | left: '16vp', |
| 138 | right: '16vp', | 140 | right: '16vp', |
| 139 | - bottom: '10vp' | ||
| 140 | }) | 141 | }) |
| 141 | }.width('100%') | 142 | }.width('100%') |
| 142 | .alignItems(VerticalAlign.Top) | 143 | .alignItems(VerticalAlign.Top) |
| @@ -151,24 +152,26 @@ export struct PeopleShipHomePageTopComponent { | @@ -151,24 +152,26 @@ export struct PeopleShipHomePageTopComponent { | ||
| 151 | .margin({ | 152 | .margin({ |
| 152 | left: '16vp', | 153 | left: '16vp', |
| 153 | right: '16vp', | 154 | right: '16vp', |
| 154 | - bottom: '10vp' | ||
| 155 | }) | 155 | }) |
| 156 | }.width('100%') | 156 | }.width('100%') |
| 157 | .alignItems(VerticalAlign.Top) | 157 | .alignItems(VerticalAlign.Top) |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | // IP归属地 | 160 | // IP归属地 |
| 161 | - Text(`IP归属地:${this.detailModel.region}`) | ||
| 162 | - .lineHeight('18vp') | ||
| 163 | - .fontSize($r('app.float.vp_12')) | ||
| 164 | - .fontColor($r('app.color.color_999999')) | ||
| 165 | - .textAlign(TextAlign.Start) | ||
| 166 | - .width('100%') | ||
| 167 | - .alignSelf(ItemAlign.Start) | ||
| 168 | - .margin({ | ||
| 169 | - right: '16vp', | ||
| 170 | - left: '16vp', | ||
| 171 | - }) | 161 | + if (this.provinceName && this.provinceName.length > 0) { |
| 162 | + Text(`IP归属地:${this.provinceName}`) | ||
| 163 | + .lineHeight('18vp') | ||
| 164 | + .fontSize($r('app.float.vp_12')) | ||
| 165 | + .fontColor($r('app.color.color_999999')) | ||
| 166 | + .textAlign(TextAlign.Start) | ||
| 167 | + .width('100%') | ||
| 168 | + .alignSelf(ItemAlign.Start) | ||
| 169 | + .margin({ | ||
| 170 | + right: '16vp', | ||
| 171 | + left: '16vp', | ||
| 172 | + top: '10vp' | ||
| 173 | + }) | ||
| 174 | + } | ||
| 172 | 175 | ||
| 173 | // 发布, 粉丝, 影响力 | 176 | // 发布, 粉丝, 影响力 |
| 174 | Row() { | 177 | Row() { |
| @@ -294,8 +297,9 @@ export struct PeopleShipHomePageTopComponent { | @@ -294,8 +297,9 @@ export struct PeopleShipHomePageTopComponent { | ||
| 294 | }) | 297 | }) |
| 295 | } | 298 | } |
| 296 | 299 | ||
| 297 | - onIntroductionUpdated() { | ||
| 298 | - if (this.content.length == 0 && this.detailModel.introduction ) { | 300 | + async onIntroductionUpdated() { |
| 301 | + | ||
| 302 | + if (this.content.length == 0 && this.detailModel.introduction ) { | ||
| 299 | this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | 303 | this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) |
| 300 | if (this.lineInNum > 3) { | 304 | if (this.lineInNum > 3) { |
| 301 | this.compIntroductionTextHeights() | 305 | this.compIntroductionTextHeights() |
| @@ -303,7 +307,12 @@ export struct PeopleShipHomePageTopComponent { | @@ -303,7 +307,12 @@ export struct PeopleShipHomePageTopComponent { | ||
| 303 | } | 307 | } |
| 304 | } | 308 | } |
| 305 | if (this.detailModel) { | 309 | if (this.detailModel) { |
| 306 | - this.topFixedHeight = 336 | 310 | + this.topFixedHeight = 308 |
| 311 | + if (this.detailModel.region && this.detailModel.region.length > 0) { | ||
| 312 | + this.provinceName = this.detailModel.region | ||
| 313 | + }else { | ||
| 314 | + this.provinceName = await this.computeIPRegion(this.detailModel.province) | ||
| 315 | + } | ||
| 307 | if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { | 316 | if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { |
| 308 | this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22 | 317 | this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22 |
| 309 | } | 318 | } |
| @@ -325,6 +334,10 @@ export struct PeopleShipHomePageTopComponent { | @@ -325,6 +334,10 @@ export struct PeopleShipHomePageTopComponent { | ||
| 325 | }else { | 334 | }else { |
| 326 | this.topHeight = this.topFixedHeight + (this.isCollapse ? 21*3 : 21 * this.lineInNum ) | 335 | this.topHeight = this.topFixedHeight + (this.isCollapse ? 21*3 : 21 * this.lineInNum ) |
| 327 | } | 336 | } |
| 337 | + // IP归属地 | ||
| 338 | + if (this.provinceName && this.provinceName.length > 0) { | ||
| 339 | + this.topHeight += 28 | ||
| 340 | + } | ||
| 328 | } | 341 | } |
| 329 | } | 342 | } |
| 330 | 343 | ||
| @@ -335,4 +348,17 @@ export struct PeopleShipHomePageTopComponent { | @@ -335,4 +348,17 @@ export struct PeopleShipHomePageTopComponent { | ||
| 335 | return `${count}` | 348 | return `${count}` |
| 336 | } | 349 | } |
| 337 | 350 | ||
| 351 | + // 通过省份code获取IP问题 | ||
| 352 | + private async computeIPRegion(province: string) { | ||
| 353 | + if (province && province.length) { | ||
| 354 | + try { | ||
| 355 | + let provinceName = await HWLocationUtils.getProvinceName(province) ; | ||
| 356 | + return provinceName | ||
| 357 | + } catch (e) { | ||
| 358 | + return '' | ||
| 359 | + } | ||
| 360 | + } | ||
| 361 | + return '' | ||
| 362 | + } | ||
| 363 | + | ||
| 338 | } | 364 | } |
| @@ -25,6 +25,7 @@ export struct SearchComponent { | @@ -25,6 +25,7 @@ export struct SearchComponent { | ||
| 25 | @State relatedSearchContentsData: SearchRelatedItem[] = [] | 25 | @State relatedSearchContentsData: SearchRelatedItem[] = [] |
| 26 | scroller: Scroller = new Scroller() | 26 | scroller: Scroller = new Scroller() |
| 27 | @State count:string[] = [] | 27 | @State count:string[] = [] |
| 28 | + @State isGetRequest:boolean = false; | ||
| 28 | 29 | ||
| 29 | aboutToAppear() { | 30 | aboutToAppear() { |
| 30 | //获取提示滚动 | 31 | //获取提示滚动 |
| @@ -112,7 +113,7 @@ export struct SearchComponent { | @@ -112,7 +113,7 @@ export struct SearchComponent { | ||
| 112 | } else { | 113 | } else { |
| 113 | if (this.hasChooseSearch) { | 114 | if (this.hasChooseSearch) { |
| 114 | //搜索结果 | 115 | //搜索结果 |
| 115 | - SearchResultComponent({count:this.count,searchText:this.searchText,isInit:true}) | 116 | + SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) |
| 116 | } else { | 117 | } else { |
| 117 | //联想搜索 | 118 | //联想搜索 |
| 118 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) | 119 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) |
| @@ -287,8 +288,10 @@ export struct SearchComponent { | @@ -287,8 +288,10 @@ export struct SearchComponent { | ||
| 287 | this.count.push("活动") | 288 | this.count.push("活动") |
| 288 | } | 289 | } |
| 289 | } | 290 | } |
| 291 | + this.isGetRequest = true | ||
| 290 | }).catch((err: Error) => { | 292 | }).catch((err: Error) => { |
| 291 | console.log(TAG, JSON.stringify(err)) | 293 | console.log(TAG, JSON.stringify(err)) |
| 294 | + this.isGetRequest = true | ||
| 292 | }) | 295 | }) |
| 293 | } | 296 | } |
| 294 | } | 297 | } |
| @@ -17,7 +17,7 @@ const TAG = "SearchResultComponent" | @@ -17,7 +17,7 @@ const TAG = "SearchResultComponent" | ||
| 17 | export struct SearchResultComponent { | 17 | export struct SearchResultComponent { |
| 18 | @Prop count: string[] | 18 | @Prop count: string[] |
| 19 | @Prop searchText: string | 19 | @Prop searchText: string |
| 20 | - @State isInit:boolean = false; | 20 | + @Prop isGetRequest:boolean = false; |
| 21 | @State currentIndex: number = 0 | 21 | @State currentIndex: number = 0 |
| 22 | private controller: TabsController = new TabsController() | 22 | private controller: TabsController = new TabsController() |
| 23 | fontColor: string = '#999999' | 23 | fontColor: string = '#999999' |
| @@ -28,7 +28,7 @@ export struct SearchResultComponent { | @@ -28,7 +28,7 @@ export struct SearchResultComponent { | ||
| 28 | scroller: Scroller = new Scroller() | 28 | scroller: Scroller = new Scroller() |
| 29 | 29 | ||
| 30 | aboutToAppear(): void { | 30 | aboutToAppear(): void { |
| 31 | - if (this.count.length === 0 && this.isInit == true) { | 31 | + if (this.count.length === 0 && this.isGetRequest == true) { |
| 32 | this.getSuggestData() | 32 | this.getSuggestData() |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| @@ -40,18 +40,7 @@ export struct SearchResultComponent { | @@ -40,18 +40,7 @@ export struct SearchResultComponent { | ||
| 40 | 40 | ||
| 41 | SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => { | 41 | SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => { |
| 42 | value.forEach((item) => { | 42 | value.forEach((item) => { |
| 43 | - this.data.push({ | ||
| 44 | - appStyle: item.appStyle, | ||
| 45 | - channelId: item.channelId + "", | ||
| 46 | - coverType: item.coverType, | ||
| 47 | - coverUrl: item.coverUrl, | ||
| 48 | - newsTitle: item.newsTitle, | ||
| 49 | - objectId: item.objectId, | ||
| 50 | - publishTime: item.publishTime, | ||
| 51 | - relId: item.relId + "", | ||
| 52 | - relType: item.relType + "", | ||
| 53 | - source: item.source, | ||
| 54 | - } as ContentDTO) | 43 | + this.data.push(item) |
| 55 | }) | 44 | }) |
| 56 | this.data.notifyDataReload() | 45 | this.data.notifyDataReload() |
| 57 | this.suggest_count = this.data.totalCount() | 46 | this.suggest_count = this.data.totalCount() |
| @@ -61,7 +50,7 @@ export struct SearchResultComponent { | @@ -61,7 +50,7 @@ export struct SearchResultComponent { | ||
| 61 | 50 | ||
| 62 | build() { | 51 | build() { |
| 63 | Column() { | 52 | Column() { |
| 64 | - if (this.count != null && this.count.length === 0 && this.isInit == true) { | 53 | + if (this.count != null && this.count.length === 0 && this.isGetRequest == true) { |
| 65 | List() { | 54 | List() { |
| 66 | ListItem() { | 55 | ListItem() { |
| 67 | //缺省图 | 56 | //缺省图 |
| @@ -6,8 +6,8 @@ const TAG = 'LiveEmptyComponent'; | @@ -6,8 +6,8 @@ const TAG = 'LiveEmptyComponent'; | ||
| 6 | /** | 6 | /** |
| 7 | * WDViewDefaultType 缺省页 | 7 | * WDViewDefaultType 缺省页 |
| 8 | */ | 8 | */ |
| 9 | -export const enum WDViewDefaultType { | ||
| 10 | - /// 1.默认 | 9 | +export const enum WDLiveViewDefaultType { |
| 10 | + /// 1.默认 | ||
| 11 | WDViewDefaultType_Default, | 11 | WDViewDefaultType_Default, |
| 12 | /// 16.直播结束 | 12 | /// 16.直播结束 |
| 13 | WDViewDefaultType_NoLiveEnd, | 13 | WDViewDefaultType_NoLiveEnd, |
| @@ -24,7 +24,7 @@ export struct LiveEmptyComponent { | @@ -24,7 +24,7 @@ export struct LiveEmptyComponent { | ||
| 24 | // private emptySize: SizeOptions = {}; | 24 | // private emptySize: SizeOptions = {}; |
| 25 | @State emptyWidth: string | number = CommonConstants.FULL_PARENT; | 25 | @State emptyWidth: string | number = CommonConstants.FULL_PARENT; |
| 26 | @State emptyHeight: string | number = CommonConstants.FULL_PARENT; | 26 | @State emptyHeight: string | number = CommonConstants.FULL_PARENT; |
| 27 | - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举 | 27 | + @State emptyType: number = WDLiveViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举 |
| 28 | @State emptyButton: boolean = false | 28 | @State emptyButton: boolean = false |
| 29 | @State timeNum: number = 10 | 29 | @State timeNum: number = 10 |
| 30 | /** | 30 | /** |
| @@ -46,38 +46,12 @@ export struct LiveEmptyComponent { | @@ -46,38 +46,12 @@ export struct LiveEmptyComponent { | ||
| 46 | private timer: number = -1 | 46 | private timer: number = -1 |
| 47 | retry: () => void = () => { | 47 | retry: () => void = () => { |
| 48 | } | 48 | } |
| 49 | - | ||
| 50 | - createTimer() { | ||
| 51 | - if (this.emptyType === 8) { | ||
| 52 | - this.timer = setInterval(() => { | ||
| 53 | - this.timeNum--; | ||
| 54 | - if (this.timeNum === 0) { | ||
| 55 | - clearInterval(this.timer); | ||
| 56 | - } | ||
| 57 | - }, 1000); | ||
| 58 | - } | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - destroyTimer() { | ||
| 62 | - if (this.emptyType === 8) { | ||
| 63 | - clearInterval(this.timer); | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - onPageShow(): void { | ||
| 68 | - this.createTimer() | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - aboutToAppear(): void { | ||
| 72 | - this.createTimer() | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | onPageHide(): void { | 49 | onPageHide(): void { |
| 76 | - this.destroyTimer() | 50 | + |
| 77 | } | 51 | } |
| 78 | 52 | ||
| 79 | aboutToDisappear() { | 53 | aboutToDisappear() { |
| 80 | - this.destroyTimer() | 54 | + |
| 81 | } | 55 | } |
| 82 | 56 | ||
| 83 | build() { | 57 | build() { |
| @@ -98,7 +72,7 @@ export struct LiveEmptyComponent { | @@ -98,7 +72,7 @@ export struct LiveEmptyComponent { | ||
| 98 | // .width('this.EMPTY_IMAGE_WIDTH') | 72 | // .width('this.EMPTY_IMAGE_WIDTH') |
| 99 | // .height(this.EMPTY_IMAGE_HEIGHT) | 73 | // .height(this.EMPTY_IMAGE_HEIGHT) |
| 100 | 74 | ||
| 101 | - Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`) | 75 | + Text(this.buildNoDataTip()) |
| 102 | .fontSize($r('app.float.font_size_14')) | 76 | .fontSize($r('app.float.font_size_14')) |
| 103 | .fontColor('#FF999999') | 77 | .fontColor('#FF999999') |
| 104 | .fontWeight(FontWeight.Normal) | 78 | .fontWeight(FontWeight.Normal) |
| @@ -107,43 +81,7 @@ export struct LiveEmptyComponent { | @@ -107,43 +81,7 @@ export struct LiveEmptyComponent { | ||
| 107 | .onClick((event: ClickEvent) => { | 81 | .onClick((event: ClickEvent) => { |
| 108 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | 82 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); |
| 109 | }) | 83 | }) |
| 110 | - | ||
| 111 | - if (this.isShowButton()) { | ||
| 112 | - if (this.emptyType !== 15) { | ||
| 113 | - Button('点击重试') | ||
| 114 | - .type(ButtonType.Normal) | ||
| 115 | - .width(80) | ||
| 116 | - .height(28) | ||
| 117 | - .backgroundColor('#fffffff') | ||
| 118 | - .fontColor('#FF666666') | ||
| 119 | - .border({ width: 1 }) | ||
| 120 | - .borderColor('#FFEDEDED') | ||
| 121 | - .borderRadius(4) | ||
| 122 | - .fontSize($r('app.float.font_size_12')) | ||
| 123 | - .margin({ top: 16 }) | ||
| 124 | - .padding(0) | ||
| 125 | - .onClick(() => { | ||
| 126 | - this.retry() | ||
| 127 | - }) | ||
| 128 | - } else { | ||
| 129 | - Button('点击重试') | ||
| 130 | - .type(ButtonType.Normal) | ||
| 131 | - .width(80) | ||
| 132 | - .height(28) | ||
| 133 | - .backgroundColor(Color.Black) | ||
| 134 | - .fontColor('#FFCCCCCC') | ||
| 135 | - .border({ width: 1 }) | ||
| 136 | - .borderColor('#4DFFFFFF') | ||
| 137 | - .borderRadius(4) | ||
| 138 | - .fontSize($r('app.float.font_size_12')) | ||
| 139 | - .margin({ top: 16 }) | ||
| 140 | - .padding(0) | ||
| 141 | - .onClick(() => { | ||
| 142 | - this.retry() | ||
| 143 | - }) | ||
| 144 | - } | ||
| 145 | - } | ||
| 146 | - } | 84 | + } |
| 147 | .justifyContent(FlexAlign.Center) | 85 | .justifyContent(FlexAlign.Center) |
| 148 | .width(this.emptyWidth) | 86 | .width(this.emptyWidth) |
| 149 | .height(this.emptyHeight) | 87 | .height(this.emptyHeight) |
| @@ -154,29 +92,22 @@ export struct LiveEmptyComponent { | @@ -154,29 +92,22 @@ export struct LiveEmptyComponent { | ||
| 154 | buildNoDataTip(): string { | 92 | buildNoDataTip(): string { |
| 155 | Logger.info(TAG, "buildNoDataTip"); | 93 | Logger.info(TAG, "buildNoDataTip"); |
| 156 | let contentString: string = '暂无内容' | 94 | let contentString: string = '暂无内容' |
| 157 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveEnd) { | 95 | + if (this.emptyType === WDLiveViewDefaultType.WDViewDefaultType_NoLiveEnd) { |
| 158 | contentString = '直播已结束' // 前方拥堵,请耐心等待 | 96 | contentString = '直播已结束' // 前方拥堵,请耐心等待 |
| 159 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveSuspend) { | 97 | + } else if (this.emptyType === WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend) { |
| 160 | contentString = '主播暂时离开,马上回来' // 前方拥堵,请耐心等待 | 98 | contentString = '主播暂时离开,马上回来' // 前方拥堵,请耐心等待 |
| 161 | } | 99 | } |
| 162 | return contentString | 100 | return contentString |
| 163 | } | 101 | } |
| 102 | + | ||
| 164 | buildNoDataTipImage(): Resource | string { | 103 | buildNoDataTipImage(): Resource | string { |
| 165 | Logger.info(TAG, "buildNoDataTip"); | 104 | Logger.info(TAG, "buildNoDataTip"); |
| 166 | let imageString: Resource | string = $r('app.media.icon_no_content') | 105 | let imageString: Resource | string = $r('app.media.icon_no_content') |
| 167 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveEnd) { | 106 | + if (this.emptyType === WDLiveViewDefaultType.WDViewDefaultType_NoLiveEnd) { |
| 168 | imageString = $r('app.media.icon_no_end') | 107 | imageString = $r('app.media.icon_no_end') |
| 169 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveSuspend) { | 108 | + } else if (this.emptyType === WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend) { |
| 170 | imageString = $r('app.media.icon_no_liver') | 109 | imageString = $r('app.media.icon_no_liver') |
| 171 | } | 110 | } |
| 172 | return imageString | 111 | return imageString |
| 173 | } | 112 | } |
| 174 | - | ||
| 175 | - isShowButton() { | ||
| 176 | - if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) { | ||
| 177 | - return true | ||
| 178 | - } else { | ||
| 179 | - return false | ||
| 180 | - } | ||
| 181 | - } | ||
| 182 | } | 113 | } |
| @@ -323,6 +323,7 @@ class MinePageDatasModel{ | @@ -323,6 +323,7 @@ class MinePageDatasModel{ | ||
| 323 | Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | 323 | Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); |
| 324 | let navigationBean = navResDTO.data as MineCommentListDetailItem | 324 | let navigationBean = navResDTO.data as MineCommentListDetailItem |
| 325 | success(navigationBean); | 325 | success(navigationBean); |
| 326 | + // success(this.getMineCommentListDataLocal(context)) | ||
| 326 | }).catch((err: Error) => { | 327 | }).catch((err: Error) => { |
| 327 | Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | 328 | Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); |
| 328 | success(this.getMineCommentListDataLocal(context)) | 329 | success(this.getMineCommentListDataLocal(context)) |
| @@ -338,7 +339,7 @@ class MinePageDatasModel{ | @@ -338,7 +339,7 @@ class MinePageDatasModel{ | ||
| 338 | 339 | ||
| 339 | async getMineCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> { | 340 | async getMineCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> { |
| 340 | Logger.info(TAG, `getMineFollowListDataLocal start`); | 341 | Logger.info(TAG, `getMineFollowListDataLocal start`); |
| 341 | - let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'mine_comment_list_data.json' ); | 342 | + let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'mine_comment_list_data2.json' ); |
| 342 | if (!compRes || !compRes.data) { | 343 | if (!compRes || !compRes.data) { |
| 343 | Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`); | 344 | Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`); |
| 344 | return new MineCommentListDetailItem() | 345 | return new MineCommentListDetailItem() |
| @@ -6,10 +6,9 @@ import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; | @@ -6,10 +6,9 @@ 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 | import { SearchResultContentData } from '../viewmodel/SearchResultContentData'; |
| 9 | -import { contentListParams, InteractDataDTO } from 'wdBean/Index'; | 9 | +import { ContentDTO, contentListParams, InteractDataDTO } from 'wdBean/Index'; |
| 10 | import { CreatorDetailRequestItem } from '../viewmodel/CreatorDetailRequestItem'; | 10 | import { CreatorDetailRequestItem } from '../viewmodel/CreatorDetailRequestItem'; |
| 11 | import { CreatorDetailResponseItem } from '../viewmodel/CreatorDetailResponseItem'; | 11 | import { CreatorDetailResponseItem } from '../viewmodel/CreatorDetailResponseItem'; |
| 12 | -import { SearchSuggestData } from '../viewmodel/SearchSuggestData'; | ||
| 13 | import { SearchSuggestRequestItem } from '../viewmodel/SearchSuggestRequestItem'; | 12 | import { SearchSuggestRequestItem } from '../viewmodel/SearchSuggestRequestItem'; |
| 14 | 13 | ||
| 15 | const TAG = "SearcherAboutDataModel" | 14 | const TAG = "SearcherAboutDataModel" |
| @@ -354,17 +353,17 @@ class SearcherAboutDataModel{ | @@ -354,17 +353,17 @@ class SearcherAboutDataModel{ | ||
| 354 | /** | 353 | /** |
| 355 | * 搜索推荐 展示列表 | 354 | * 搜索推荐 展示列表 |
| 356 | */ | 355 | */ |
| 357 | - getSearchSuggestData(object:SearchSuggestRequestItem,context: Context): Promise<SearchSuggestData[]> { | ||
| 358 | - return new Promise<SearchSuggestData[]>((success, error) => { | 356 | + getSearchSuggestData(object:SearchSuggestRequestItem,context: Context): Promise<ContentDTO[]> { |
| 357 | + return new Promise<ContentDTO[]>((success, error) => { | ||
| 359 | Logger.info(TAG, `getSearchSuggestData start`); | 358 | Logger.info(TAG, `getSearchSuggestData start`); |
| 360 | - this.fetchSearchSuggestData(object).then((navResDTO: ResponseDTO<SearchSuggestData[]>) => { | 359 | + this.fetchSearchSuggestData(object).then((navResDTO: ResponseDTO<ContentDTO[]>) => { |
| 361 | if (!navResDTO || navResDTO.code != 0 /*|| navResDTO.data == null*/) { | 360 | if (!navResDTO || navResDTO.code != 0 /*|| navResDTO.data == null*/) { |
| 362 | // success(this.getSearchSuggestDataLocal(context)) | 361 | // success(this.getSearchSuggestDataLocal(context)) |
| 363 | success([]) | 362 | success([]) |
| 364 | return | 363 | return |
| 365 | } | 364 | } |
| 366 | Logger.info(TAG, "getSearchSuggestData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); | 365 | Logger.info(TAG, "getSearchSuggestData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); |
| 367 | - let navigationBean = navResDTO.data as SearchSuggestData[] | 366 | + let navigationBean = navResDTO.data as ContentDTO[] |
| 368 | success(navigationBean); | 367 | success(navigationBean); |
| 369 | }).catch((err: Error) => { | 368 | }).catch((err: Error) => { |
| 370 | Logger.error(TAG, `getSearchSuggestData catch, error.name : ${err.name}, error.message:${err.message}`); | 369 | Logger.error(TAG, `getSearchSuggestData catch, error.name : ${err.name}, error.message:${err.message}`); |
| @@ -377,12 +376,12 @@ class SearcherAboutDataModel{ | @@ -377,12 +376,12 @@ class SearcherAboutDataModel{ | ||
| 377 | fetchSearchSuggestData(object:SearchSuggestRequestItem) { | 376 | fetchSearchSuggestData(object:SearchSuggestRequestItem) { |
| 378 | let url = HttpUrlUtils.getSearchSuggestDataUrl() | 377 | let url = HttpUrlUtils.getSearchSuggestDataUrl() |
| 379 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 378 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 380 | - return WDHttp.post<ResponseDTO<SearchSuggestData[]>>(url,object, headers) | 379 | + return WDHttp.post<ResponseDTO<ContentDTO[]>>(url,object, headers) |
| 381 | }; | 380 | }; |
| 382 | 381 | ||
| 383 | - async getSearchSuggestDataLocal(context: Context): Promise<SearchSuggestData[]> { | 382 | + async getSearchSuggestDataLocal(context: Context): Promise<ContentDTO[]> { |
| 384 | Logger.info(TAG, `getInteractListDataLocal start`); | 383 | Logger.info(TAG, `getInteractListDataLocal start`); |
| 385 | - let compRes: ResponseDTO<SearchSuggestData[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<SearchSuggestData[]>>(context,'search_suggest_data.json' ); | 384 | + let compRes: ResponseDTO<ContentDTO[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<ContentDTO[]>>(context,'search_suggest_data.json' ); |
| 386 | if (!compRes || !compRes.data) { | 385 | if (!compRes || !compRes.data) { |
| 387 | Logger.info(TAG, `getInteractListDataLocal compRes is empty`); | 386 | Logger.info(TAG, `getInteractListDataLocal compRes is empty`); |
| 388 | return [] | 387 | return [] |
| @@ -6,8 +6,9 @@ import PageModel from '../viewmodel/PageModel'; | @@ -6,8 +6,9 @@ import PageModel from '../viewmodel/PageModel'; | ||
| 6 | import PageViewModel from '../viewmodel/PageViewModel'; | 6 | import PageViewModel from '../viewmodel/PageViewModel'; |
| 7 | import { DateTimeUtils } from 'wdKit'; | 7 | import { DateTimeUtils } from 'wdKit'; |
| 8 | import PageHelper from '../viewmodel/PageHelper'; | 8 | import PageHelper from '../viewmodel/PageHelper'; |
| 9 | +import PageAdModel from '../viewmodel/PageAdvModel'; | ||
| 9 | 10 | ||
| 10 | -export function listTouchEvent(pageModel: PageModel, event: TouchEvent) { | 11 | +export function listTouchEvent(pageModel: PageModel,pageAdvModel:PageAdModel, event: TouchEvent) { |
| 11 | switch (event.type) { | 12 | switch (event.type) { |
| 12 | case TouchType.Down: | 13 | case TouchType.Down: |
| 13 | pageModel.downY = event.touches[0].y; | 14 | pageModel.downY = event.touches[0].y; |
| @@ -35,7 +36,7 @@ export function listTouchEvent(pageModel: PageModel, event: TouchEvent) { | @@ -35,7 +36,7 @@ export function listTouchEvent(pageModel: PageModel, event: TouchEvent) { | ||
| 35 | } | 36 | } |
| 36 | if ((pageModel.isPullRefreshOperation === true)) { | 37 | if ((pageModel.isPullRefreshOperation === true)) { |
| 37 | // Lift your finger and pull down to refresh. | 38 | // Lift your finger and pull down to refresh. |
| 38 | - touchUpPullRefresh(pageModel); | 39 | + touchUpPullRefresh(pageModel,pageAdvModel); |
| 39 | } else { | 40 | } else { |
| 40 | // Fingers up, handle loading more. | 41 | // Fingers up, handle loading more. |
| 41 | touchUpLoadMore(pageModel); | 42 | touchUpLoadMore(pageModel); |
| @@ -65,14 +66,15 @@ export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { | @@ -65,14 +66,15 @@ export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { | ||
| 65 | } | 66 | } |
| 66 | } | 67 | } |
| 67 | 68 | ||
| 68 | -export function touchUpPullRefresh(pageModel: PageModel) { | 69 | +export function touchUpPullRefresh(pageModel: PageModel,pageAdvModel:PageAdModel) { |
| 69 | if (pageModel.isCanRefresh === true) { | 70 | if (pageModel.isCanRefresh === true) { |
| 70 | pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); | 71 | pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); |
| 71 | pullRefreshState(pageModel, RefreshState.Refreshing); | 72 | pullRefreshState(pageModel, RefreshState.Refreshing); |
| 72 | pageModel.currentPage = 1; | 73 | pageModel.currentPage = 1; |
| 73 | setTimeout(() => { | 74 | setTimeout(() => { |
| 74 | let self: PageModel = pageModel; | 75 | let self: PageModel = pageModel; |
| 75 | - PageHelper.refreshUI(self) | 76 | + let advSelf: PageAdModel = pageAdvModel; |
| 77 | + PageHelper.refreshUI(self,advSelf) | ||
| 76 | // PageViewModel.getPageData(self.bizCopy(2)) | 78 | // PageViewModel.getPageData(self.bizCopy(2)) |
| 77 | // .then((data: PageDTO) => { | 79 | // .then((data: PageDTO) => { |
| 78 | // self.timestamp = DateTimeUtils.getTimeStamp().toString() | 80 | // self.timestamp = DateTimeUtils.getTimeStamp().toString() |
| @@ -24,7 +24,7 @@ export class CommentListItem{ | @@ -24,7 +24,7 @@ export class CommentListItem{ | ||
| 24 | keyArticle: number = -1 | 24 | keyArticle: number = -1 |
| 25 | likeNum: number = 0 | 25 | likeNum: number = 0 |
| 26 | // pageId: null | 26 | // pageId: null |
| 27 | - // parentCommentVo: null | 27 | + parentCommentVo: ParentCommentVo = new ParentCommentVo() |
| 28 | parentId: number = -1 | 28 | parentId: number = -1 |
| 29 | rootCommentId: number = -1 | 29 | rootCommentId: number = -1 |
| 30 | sensitiveExist: number = -1 | 30 | sensitiveExist: number = -1 |
| @@ -39,9 +39,12 @@ export class CommentListItem{ | @@ -39,9 +39,12 @@ export class CommentListItem{ | ||
| 39 | targetTitle: string = "" | 39 | targetTitle: string = "" |
| 40 | // topicType: null | 40 | // topicType: null |
| 41 | uuid: string = "" | 41 | uuid: string = "" |
| 42 | + parentCommentContent = "" | ||
| 43 | + parentCommentUserName = "" | ||
| 44 | + isShowAll:boolean = false | ||
| 42 | 45 | ||
| 43 | 46 | ||
| 44 | - constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number,targetRelId: string,targetRelObjectId: string,targetRelType: number,targetStatus: number,) { | 47 | + constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string,likeNum:number,like_status:number,id:number,targetId:string,targetType:number,targetRelId: string,targetRelObjectId: string,targetRelType: number,targetStatus: number,checkStatus:number,parentCommentContent:string,parentCommentUserName:string) { |
| 45 | this.fromUserHeader = fromUserHeader | 48 | this.fromUserHeader = fromUserHeader |
| 46 | this.fromUserName = fromUserName | 49 | this.fromUserName = fromUserName |
| 47 | this.commentContent = commentContent | 50 | this.commentContent = commentContent |
| @@ -56,5 +59,18 @@ export class CommentListItem{ | @@ -56,5 +59,18 @@ export class CommentListItem{ | ||
| 56 | this.targetRelObjectId = targetRelObjectId | 59 | this.targetRelObjectId = targetRelObjectId |
| 57 | this.targetRelType = targetRelType | 60 | this.targetRelType = targetRelType |
| 58 | this.targetStatus = targetStatus | 61 | this.targetStatus = targetStatus |
| 62 | + this.checkStatus = checkStatus | ||
| 63 | + this.parentCommentContent = parentCommentContent | ||
| 64 | + this.parentCommentUserName = parentCommentUserName | ||
| 59 | } | 65 | } |
| 60 | } | 66 | } |
| 67 | + | ||
| 68 | +class ParentCommentVo{ | ||
| 69 | + avatarFrame: string = "" | ||
| 70 | + checkStatus: number = -1 | ||
| 71 | + commentContent: string = "" | ||
| 72 | + commentPics: string = "" | ||
| 73 | + commentType: string = "" | ||
| 74 | + fromUserName: string = "" | ||
| 75 | + id: number = -1 | ||
| 76 | +} |
| 1 | +import { PageInfoDTO } from 'wdBean/Index'; | ||
| 2 | +import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * @Description: 处理页面的广告业务 | ||
| 6 | + * @Author: lyb | ||
| 7 | + * @Email: liyubing@wondertek.com.cn | ||
| 8 | + * @CreateDate: | ||
| 9 | + * @UpdateRemark: 更新说明 | ||
| 10 | + * @Version: 1.0 | ||
| 11 | + */ | ||
| 12 | +export default class PageAdModel { | ||
| 13 | + //左右挂角广告对象 | ||
| 14 | + pageCornerAdv: CompAdvBean = {} as CompAdvBean | ||
| 15 | + // 挂角广告 | ||
| 16 | + isShowAds: boolean = false; | ||
| 17 | + isRightAdv: number = 1; | ||
| 18 | + // 1:右边;2:左边 -> 默认右边 | ||
| 19 | + pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean | ||
| 20 | + | ||
| 21 | + // 展现中心业务信息 | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 解析广告资源 | ||
| 28 | + * @param pageInfo | ||
| 29 | + */ | ||
| 30 | + analysisAdvSource(pageInfo: PageInfoDTO): void { | ||
| 31 | + | ||
| 32 | + if (pageInfo.hasAdInfo === 1 && pageInfo.cornersAdv != null) { | ||
| 33 | + // 优先展示展现中心广告 | ||
| 34 | + let cornersAdv = pageInfo.cornersAdv | ||
| 35 | + | ||
| 36 | + if (cornersAdv == null) { | ||
| 37 | + return | ||
| 38 | + } | ||
| 39 | + if (cornersAdv.advert == null) { | ||
| 40 | + return | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + if ("left_down" == cornersAdv.pos) { | ||
| 44 | + // 左边挂角广告 | ||
| 45 | + this.isRightAdv = 2 | ||
| 46 | + } else { | ||
| 47 | + // 右边挂角广告 | ||
| 48 | + this.isRightAdv = 1 | ||
| 49 | + | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + this.pageCornerContentInfo = cornersAdv; | ||
| 53 | + this.isShowAds = true | ||
| 54 | + | ||
| 55 | + } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) { | ||
| 56 | + // 广告中心-挂角广告信息 | ||
| 57 | + let cornersAdv2 = pageInfo.cornersAdv2 | ||
| 58 | + // 获取 | ||
| 59 | + let showCompAdvBean = cornersAdv2[0] | ||
| 60 | + | ||
| 61 | + if (showCompAdvBean.matInfo == null) { | ||
| 62 | + return | ||
| 63 | + } | ||
| 64 | + // | ||
| 65 | + let slotInfo = showCompAdvBean.slotInfo; | ||
| 66 | + let postion = slotInfo.position | ||
| 67 | + if (postion == 0) { | ||
| 68 | + //左边挂角 | ||
| 69 | + this.isRightAdv = 2 | ||
| 70 | + } else { | ||
| 71 | + // 右边挂角 | ||
| 72 | + this.isRightAdv = 1 | ||
| 73 | + } | ||
| 74 | + this.pageCornerAdv = showCompAdvBean | ||
| 75 | + this.isShowAds = true | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + } | ||
| 79 | +} |
| @@ -6,6 +6,7 @@ import PageModel from './PageModel'; | @@ -6,6 +6,7 @@ import PageModel from './PageModel'; | ||
| 6 | import PageViewModel from './PageViewModel'; | 6 | import PageViewModel from './PageViewModel'; |
| 7 | import { promptAction } from '@kit.ArkUI'; | 7 | import { promptAction } from '@kit.ArkUI'; |
| 8 | import { AdvRuleBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 8 | import { AdvRuleBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 9 | +import PageAdModel from './PageAdvModel'; | ||
| 9 | 10 | ||
| 10 | const TAG = 'PageHelper'; | 11 | const TAG = 'PageHelper'; |
| 11 | 12 | ||
| @@ -13,12 +14,14 @@ const TAG = 'PageHelper'; | @@ -13,12 +14,14 @@ const TAG = 'PageHelper'; | ||
| 13 | * 处理返回后的数据 | 14 | * 处理返回后的数据 |
| 14 | */ | 15 | */ |
| 15 | export class PageHelper { | 16 | export class PageHelper { |
| 17 | + | ||
| 18 | + | ||
| 16 | /** | 19 | /** |
| 17 | * 刷新数据 | 20 | * 刷新数据 |
| 18 | */ | 21 | */ |
| 19 | - async refreshUI(pageModel: PageModel) { | 22 | + async refreshUI(pageModel: PageModel,pageAdvModel:PageAdModel) { |
| 20 | pageModel.loadStrategy = 2 | 23 | pageModel.loadStrategy = 2 |
| 21 | - this.getPageInfo(pageModel) | 24 | + this.getPageInfo(pageModel,pageAdvModel) |
| 22 | } | 25 | } |
| 23 | 26 | ||
| 24 | /** | 27 | /** |
| @@ -33,12 +36,12 @@ export class PageHelper { | @@ -33,12 +36,12 @@ export class PageHelper { | ||
| 33 | /** | 36 | /** |
| 34 | * 进页面请求数据 | 37 | * 进页面请求数据 |
| 35 | */ | 38 | */ |
| 36 | - async getInitData(pageModel: PageModel) { | 39 | + async getInitData(pageModel: PageModel,pageAdvModel:PageAdModel) { |
| 37 | pageModel.loadStrategy = 1 | 40 | pageModel.loadStrategy = 1 |
| 38 | - this.getPageInfo(pageModel) | 41 | + this.getPageInfo(pageModel,pageAdvModel) |
| 39 | } | 42 | } |
| 40 | 43 | ||
| 41 | - async getPageInfo(pageModel: PageModel) { | 44 | + async getPageInfo(pageModel: PageModel,pageAdvModel:PageAdModel) { |
| 42 | pageModel.currentPage = 1; | 45 | pageModel.currentPage = 1; |
| 43 | let pageInfo = await PageViewModel.getPageInfo(pageModel.pageId); | 46 | let pageInfo = await PageViewModel.getPageInfo(pageModel.pageId); |
| 44 | if (pageInfo == null) { | 47 | if (pageInfo == null) { |
| @@ -47,67 +50,12 @@ export class PageHelper { | @@ -47,67 +50,12 @@ export class PageHelper { | ||
| 47 | } | 50 | } |
| 48 | pageModel.pageInfo = pageInfo; | 51 | pageModel.pageInfo = pageInfo; |
| 49 | //解析广告资源 | 52 | //解析广告资源 |
| 50 | - this.analysisAdvSource(pageModel); | 53 | + pageAdvModel.analysisAdvSource(pageInfo) |
| 51 | 54 | ||
| 52 | this.parseGroup(pageModel) | 55 | this.parseGroup(pageModel) |
| 53 | 56 | ||
| 54 | } | 57 | } |
| 55 | 58 | ||
| 56 | - /** | ||
| 57 | - * 解析广告资源 | ||
| 58 | - * @param pageInfo | ||
| 59 | - */ | ||
| 60 | - analysisAdvSource(pageModel: PageModel) { | ||
| 61 | - | ||
| 62 | - let pageInfo = pageModel.pageInfo | ||
| 63 | - if (pageInfo.hasAdInfo === 1 && pageInfo.cornersAdv != null) { | ||
| 64 | - // 优先展示展现中心广告 | ||
| 65 | - let cornersAdv = pageInfo.cornersAdv | ||
| 66 | - | ||
| 67 | - if (cornersAdv == null) { | ||
| 68 | - return | ||
| 69 | - } | ||
| 70 | - if (cornersAdv.advert == null) { | ||
| 71 | - return | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - if ("left_down" == cornersAdv.pos) { | ||
| 75 | - // 左边挂角广告 | ||
| 76 | - pageModel.isRightAdv = 2 | ||
| 77 | - } else { | ||
| 78 | - // 右边挂角广告 | ||
| 79 | - pageModel.isRightAdv = 1 | ||
| 80 | - | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - pageModel.pageCornerContentInfo = cornersAdv; | ||
| 84 | - pageModel.isShowAds = true | ||
| 85 | - | ||
| 86 | - } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) { | ||
| 87 | - // 广告中心-挂角广告信息 | ||
| 88 | - let cornersAdv2 = pageInfo.cornersAdv2 | ||
| 89 | - // 获取 | ||
| 90 | - let showCompAdvBean = cornersAdv2[0] | ||
| 91 | - | ||
| 92 | - if (showCompAdvBean.matInfo == null) { | ||
| 93 | - return | ||
| 94 | - } | ||
| 95 | - // | ||
| 96 | - let slotInfo = showCompAdvBean.slotInfo; | ||
| 97 | - let postion = slotInfo.position | ||
| 98 | - if (postion == 0) { | ||
| 99 | - //左边挂角 | ||
| 100 | - pageModel.isRightAdv = 2 | ||
| 101 | - } else { | ||
| 102 | - // 右边挂角 | ||
| 103 | - pageModel.isRightAdv = 1 | ||
| 104 | - } | ||
| 105 | - pageModel.pageCornerAdv = showCompAdvBean | ||
| 106 | - pageModel.isShowAds = true | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | - | ||
| 110 | - } | ||
| 111 | 59 | ||
| 112 | 60 | ||
| 113 | async parseGroup(pageModel: PageModel) { | 61 | async parseGroup(pageModel: PageModel) { |
| @@ -51,11 +51,11 @@ export default class PageModel { | @@ -51,11 +51,11 @@ export default class PageModel { | ||
| 51 | // keyGenerator相关字符串,用于刷新list布局 | 51 | // keyGenerator相关字符串,用于刷新list布局 |
| 52 | timestamp: String = '1'; | 52 | timestamp: String = '1'; |
| 53 | 53 | ||
| 54 | - //左右挂角广告对象 | ||
| 55 | - pageCornerAdv:CompAdvBean = {} as CompAdvBean // 挂角广告 | ||
| 56 | - isShowAds : boolean = false; | ||
| 57 | - isRightAdv : number = 1;// 1:右边;2:左边 -> 默认右边 | ||
| 58 | - pageCornerContentInfo:AdvRuleBean = {} as AdvRuleBean // 展现中心业务信息 | 54 | + // //左右挂角广告对象 |
| 55 | + // pageCornerAdv:CompAdvBean = {} as CompAdvBean // 挂角广告 | ||
| 56 | + // isShowAds : boolean = false; | ||
| 57 | + // isRightAdv : number = 1;// 1:右边;2:左边 -> 默认右边 | ||
| 58 | + // pageCornerContentInfo:AdvRuleBean = {} as AdvRuleBean // 展现中心业务信息 | ||
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 1 | -@Observed | ||
| 2 | -export class SearchSuggestData{ | ||
| 3 | - // activityExt: null | ||
| 4 | - appStyle: string = "" | ||
| 5 | - // askInfo: null | ||
| 6 | - axisColor: string = "" | ||
| 7 | - // bestNoticer: null | ||
| 8 | - // bottomNavId: null | ||
| 9 | - cardItemId: string = "" | ||
| 10 | - channelId: number = -1 | ||
| 11 | - // commentInfo: null | ||
| 12 | - corner: string = "" | ||
| 13 | - coverSize: string = "" | ||
| 14 | - coverType: number = -1 | ||
| 15 | - coverUrl: string = "" | ||
| 16 | - expIds: string = "" | ||
| 17 | - extra: string = "" | ||
| 18 | - fullColumnImgUrls: Array<FullColumnImgUrls> = [] | ||
| 19 | - // hasMore: null | ||
| 20 | - itemId: string = "" | ||
| 21 | - itemType: string = "" | ||
| 22 | - itemTypeCode: string = "" | ||
| 23 | - keyArticle: number = -1 | ||
| 24 | - // landscape: null | ||
| 25 | - // likeStyle: null | ||
| 26 | - linkUrl: string = "" | ||
| 27 | - // liveInfo: null | ||
| 28 | - menuShow: number = -1 | ||
| 29 | - newTags: string = "" | ||
| 30 | - newsAuthor: string = "" | ||
| 31 | - newsSubTitle: string = "" | ||
| 32 | - newsSummary: string = "" | ||
| 33 | - newsTitle: string = "" | ||
| 34 | - newsTitleColor: string = "" | ||
| 35 | - objectId: string = "" | ||
| 36 | - objectLevel: string = "" | ||
| 37 | - objectType: string = "" | ||
| 38 | - // openComment: null | ||
| 39 | - // openLikes: null | ||
| 40 | - pageId: string = "" | ||
| 41 | - // photoNum: null | ||
| 42 | - // position: null | ||
| 43 | - // productNum: null | ||
| 44 | - publishTime: string = "" | ||
| 45 | - // pushTime: null | ||
| 46 | - // pushUnqueId: null | ||
| 47 | - readFlag: number = -1 | ||
| 48 | - recommend: number = -1 | ||
| 49 | - relId: number = -1 | ||
| 50 | - relObjectId: string = "" | ||
| 51 | - relType: number = -1 | ||
| 52 | - // rmhInfo: null | ||
| 53 | - rmhPlatform: number = -1 | ||
| 54 | - sceneId: string = "" | ||
| 55 | - // shareInfo: null | ||
| 56 | - // slideShows: Array< unknown > | ||
| 57 | - // sortValue: null | ||
| 58 | - source: string = "" | ||
| 59 | - subObjectType: string = "" | ||
| 60 | - subSceneId: string = "" | ||
| 61 | - // tagIds: Array< unknown > | ||
| 62 | - // tagWord: null | ||
| 63 | - // titleShow: null | ||
| 64 | - // titleShowPolicy: null | ||
| 65 | - // topicTemplate: null | ||
| 66 | - traceId: string = "" | ||
| 67 | - traceInfo: string = "" | ||
| 68 | - // userInfo: null | ||
| 69 | - videoInfo: VideoInfo = new VideoInfo() | ||
| 70 | - visitorComment: number = -1 | ||
| 71 | - // voiceInfo: null | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -class FullColumnImgUrls{ | ||
| 75 | - // format: null | ||
| 76 | - fullUrl: string = "" | ||
| 77 | - height: number = -1 | ||
| 78 | - landscape: number = -1 | ||
| 79 | - size: number = -1 | ||
| 80 | - url: string = "" | ||
| 81 | - weight: number = -1 | ||
| 82 | -} | ||
| 83 | - | ||
| 84 | -class VideoInfo{ | ||
| 85 | - firstFrameImageUri: string = "" | ||
| 86 | - videoDuration: number = -1 | ||
| 87 | - videoLandscape: number = -1 | ||
| 88 | - videoUrl: string = "" | ||
| 89 | -} | ||
| 90 | - |
735 Bytes
| @@ -11,6 +11,6 @@ | @@ -11,6 +11,6 @@ | ||
| 11 | "wdKit": "file:../../commons/wdKit", | 11 | "wdKit": "file:../../commons/wdKit", |
| 12 | "wdBean": "file:../../features/wdBean", | 12 | "wdBean": "file:../../features/wdBean", |
| 13 | "wdRouter": "file:../../commons/wdRouter", | 13 | "wdRouter": "file:../../commons/wdRouter", |
| 14 | - "wdNetwork": "file:../../commons/wdNetwork" | 14 | + "wdNetwork": "file:../../commons/wdNetwork", |
| 15 | } | 15 | } |
| 16 | } | 16 | } |
| @@ -2,15 +2,15 @@ import { Action, LiveDetailsBean } from 'wdBean/Index'; | @@ -2,15 +2,15 @@ import { Action, LiveDetailsBean } from 'wdBean/Index'; | ||
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | 4 | ||
| 5 | -import { DetailPlayLivePage } from './DetailPlayLivePage' | ||
| 6 | -import { DetailPlayVLivePage } from './DetailPlayVLivePage' | 5 | +import { DetailPlayLivePage } from './DetailPlayLivePage'; |
| 6 | +import { DetailPlayVLivePage } from './DetailPlayVLivePage'; | ||
| 7 | +import { Logger } from 'wdKit/Index'; | ||
| 7 | 8 | ||
| 8 | const TAG = 'DetailPlayLiveCommon' | 9 | const TAG = 'DetailPlayLiveCommon' |
| 9 | 10 | ||
| 10 | -@Entry() | 11 | +@Entry |
| 11 | @Component | 12 | @Component |
| 12 | export struct DetailPlayLiveCommon { | 13 | export struct DetailPlayLiveCommon { |
| 13 | - TAG: string = 'DetailPlayLiveCommon'; | ||
| 14 | private liveViewModel: LiveViewModel = new LiveViewModel() | 14 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 15 | @State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | 15 | @State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 16 | @State liveState: string = '' | 16 | @State liveState: string = '' |
| @@ -18,8 +18,12 @@ export struct DetailPlayLiveCommon { | @@ -18,8 +18,12 @@ export struct DetailPlayLiveCommon { | ||
| 18 | @State relId: string = '' | 18 | @State relId: string = '' |
| 19 | @State contentId: string = '' | 19 | @State contentId: string = '' |
| 20 | @State relType: string = '' | 20 | @State relType: string = '' |
| 21 | + @Provide pageShow: number = -1 | ||
| 22 | + @Provide pageHide: number = -1 | ||
| 23 | + @Provide pageBackPress: number = -1 | ||
| 21 | 24 | ||
| 22 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 26 | + Logger.debug(TAG, 'aboutToAppear') | ||
| 23 | //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 | 27 | //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 |
| 24 | const par: Action = router.getParams() as Action; | 28 | const par: Action = router.getParams() as Action; |
| 25 | const params = par?.params; | 29 | const params = par?.params; |
| @@ -56,5 +60,21 @@ export struct DetailPlayLiveCommon { | @@ -56,5 +60,21 @@ export struct DetailPlayLiveCommon { | ||
| 56 | 60 | ||
| 57 | }) | 61 | }) |
| 58 | } | 62 | } |
| 63 | + | ||
| 64 | + onPageShow() { | ||
| 65 | + this.pageShow = 0 | ||
| 66 | + Logger.debug(TAG, 'onPageShow') | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + onPageHide() { | ||
| 70 | + this.pageHide = 0 | ||
| 71 | + Logger.debug(TAG, 'onPageHide') | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + onBackPress(): boolean | void { | ||
| 75 | + this.pageBackPress = 0 | ||
| 76 | + Logger.debug(TAG, 'onBackPress') | ||
| 77 | + return true | ||
| 78 | + } | ||
| 59 | } | 79 | } |
| 60 | 80 |
| 1 | -import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { TabComponent } from '../widgets/details/TabComponent'; | 3 | import { TabComponent } from '../widgets/details/TabComponent'; |
| 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; |
| 5 | -import router from '@ohos.router'; | ||
| 6 | import { DisplayDirection } from 'wdConstant/Index'; | 5 | import { DisplayDirection } from 'wdConstant/Index'; |
| 7 | import mediaquery from '@ohos.mediaquery'; | 6 | import mediaquery from '@ohos.mediaquery'; |
| 8 | import { Logger, WindowModel } from 'wdKit/Index'; | 7 | import { Logger, WindowModel } from 'wdKit/Index'; |
| 9 | -import { window } from '@kit.ArkUI'; | 8 | +import { router, window } from '@kit.ArkUI'; |
| 10 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; | 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; |
| 11 | import { LiveCommentComponent } from 'wdComponent/Index'; | 10 | import { LiveCommentComponent } from 'wdComponent/Index'; |
| 12 | import { WDPlayerController } from 'wdPlayer/Index'; | 11 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 13 | 12 | ||
| 14 | -@Entry | 13 | +let TAG: string = 'DetailPlayLivePage'; |
| 14 | + | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct DetailPlayLivePage { | 16 | export struct DetailPlayLivePage { |
| 17 | //横竖屏,默认竖屏 | 17 | //横竖屏,默认竖屏 |
| 18 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL | 18 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL |
| 19 | playerController: WDPlayerController = new WDPlayerController(); | 19 | playerController: WDPlayerController = new WDPlayerController(); |
| 20 | - TAG: string = 'DetailPlayLivePage'; | ||
| 21 | liveViewModel: LiveViewModel = new LiveViewModel() | 20 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 22 | @State relId: string = '' | 21 | @State relId: string = '' |
| 23 | @State contentId: string = '' | 22 | @State contentId: string = '' |
| @@ -27,11 +26,14 @@ export struct DetailPlayLivePage { | @@ -27,11 +26,14 @@ export struct DetailPlayLivePage { | ||
| 27 | @State tabs: string[] = [] | 26 | @State tabs: string[] = [] |
| 28 | //监听屏幕横竖屏变化 | 27 | //监听屏幕横竖屏变化 |
| 29 | listener = mediaquery.matchMediaSync('(orientation: landscape)'); | 28 | listener = mediaquery.matchMediaSync('(orientation: landscape)'); |
| 29 | + @Consume @Watch('onPageShowCus') pageShow: number | ||
| 30 | + @Consume @Watch('onPageHideCus') pageHide: number | ||
| 31 | + @Consume @Watch('onBackPressCus') pageBackPress: number | ||
| 30 | 32 | ||
| 31 | aboutToAppear(): void { | 33 | aboutToAppear(): void { |
| 32 | - Logger.info(this.TAG, `wyj-aboutToAppear`) | 34 | + Logger.info(TAG, `wyj-aboutToAppear`) |
| 33 | this.listener?.on("change", (mediaQueryResult) => { | 35 | this.listener?.on("change", (mediaQueryResult) => { |
| 34 | - Logger.info(this.TAG, `change;${mediaQueryResult.matches}`) | 36 | + Logger.info(TAG, `change;${mediaQueryResult.matches}`) |
| 35 | if (mediaQueryResult?.matches) { | 37 | if (mediaQueryResult?.matches) { |
| 36 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL | 38 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL |
| 37 | } else { | 39 | } else { |
| @@ -39,11 +41,6 @@ export struct DetailPlayLivePage { | @@ -39,11 +41,6 @@ export struct DetailPlayLivePage { | ||
| 39 | } | 41 | } |
| 40 | WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) | 42 | WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) |
| 41 | }) | 43 | }) |
| 42 | - let par: Action = router.getParams() as Action; | ||
| 43 | - let params = par?.params; | ||
| 44 | - this.relId = params?.extra?.relId || ''; | ||
| 45 | - this.relType = params?.extra?.relType || ''; | ||
| 46 | - this.contentId = params?.contentID || ''; | ||
| 47 | this.getLiveDetails() | 44 | this.getLiveDetails() |
| 48 | this.getLiveRoomData() | 45 | this.getLiveRoomData() |
| 49 | } | 46 | } |
| @@ -62,18 +59,39 @@ export struct DetailPlayLivePage { | @@ -62,18 +59,39 @@ export struct DetailPlayLivePage { | ||
| 62 | .width('100%') | 59 | .width('100%') |
| 63 | } | 60 | } |
| 64 | 61 | ||
| 65 | - onPageShow(): void { | ||
| 66 | - Logger.info(this.TAG, `wyj-onPageShow`) | 62 | + aboutToDisappear(): void { |
| 63 | + Logger.info(TAG, `wyj-aboutToDisappear`) | ||
| 64 | + this.playerController?.stop() | ||
| 65 | + this.playerController?.release() | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + onPageShowCus(): void { | ||
| 69 | + Logger.info(TAG, `wyj-onPageShowCus`) | ||
| 67 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); | 70 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); |
| 68 | } | 71 | } |
| 69 | 72 | ||
| 70 | - onPageHide(): void { | ||
| 71 | - Logger.info(this.TAG, `wyj-onPageHide`) | 73 | + onPageHideCus(): void { |
| 74 | + Logger.info(TAG, `wyj-onPageHideCus`) | ||
| 72 | devicePLSensorManager.devicePLSensorOff(); | 75 | devicePLSensorManager.devicePLSensorOff(); |
| 73 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); | 76 | // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); |
| 74 | this.playerController?.pause() | 77 | this.playerController?.pause() |
| 75 | } | 78 | } |
| 76 | 79 | ||
| 80 | + onBackPressCus(): boolean | void { | ||
| 81 | + if (this.displayDirection == DisplayDirection.VERTICAL) { | ||
| 82 | + router.back() | ||
| 83 | + } else { | ||
| 84 | + this.displayDirection = DisplayDirection.VERTICAL | ||
| 85 | + } | ||
| 86 | + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 87 | + window.Orientation.PORTRAIT : | ||
| 88 | + window.Orientation.LANDSCAPE) | ||
| 89 | + devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 90 | + window.Orientation.PORTRAIT : | ||
| 91 | + window.Orientation.LANDSCAPE); | ||
| 92 | + return true | ||
| 93 | + } | ||
| 94 | + | ||
| 77 | getLiveDetails() { | 95 | getLiveDetails() { |
| 78 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) | 96 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) |
| 79 | .then( | 97 | .then( |
| @@ -102,23 +120,4 @@ export struct DetailPlayLivePage { | @@ -102,23 +120,4 @@ export struct DetailPlayLivePage { | ||
| 102 | 120 | ||
| 103 | }) | 121 | }) |
| 104 | } | 122 | } |
| 105 | - | ||
| 106 | - aboutToDisappear(): void { | ||
| 107 | - Logger.info(this.TAG, `wyj-aboutToDisappear`) | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - onBackPress(): boolean | void { | ||
| 111 | - if (this.displayDirection == DisplayDirection.VERTICAL) { | ||
| 112 | - router.back() | ||
| 113 | - } else { | ||
| 114 | - this.displayDirection = DisplayDirection.VERTICAL | ||
| 115 | - } | ||
| 116 | - WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 117 | - window.Orientation.PORTRAIT : | ||
| 118 | - window.Orientation.LANDSCAPE) | ||
| 119 | - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 120 | - window.Orientation.PORTRAIT : | ||
| 121 | - window.Orientation.LANDSCAPE); | ||
| 122 | - return true | ||
| 123 | - } | ||
| 124 | } | 123 | } |
| @@ -6,6 +6,7 @@ import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | @@ -6,6 +6,7 @@ import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | ||
| 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; | 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; |
| 7 | import { WDPlayerController } from 'wdPlayer/Index'; | 7 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | +import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; | ||
| 9 | 10 | ||
| 10 | const storage = LocalStorage.getShared(); | 11 | const storage = LocalStorage.getShared(); |
| 11 | const TAG = 'DetailPlayVLivePage' | 12 | const TAG = 'DetailPlayVLivePage' |
| @@ -22,6 +23,7 @@ export struct DetailPlayVLivePage { | @@ -22,6 +23,7 @@ export struct DetailPlayVLivePage { | ||
| 22 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 23 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 23 | @Provide isShowControl: boolean = false | 24 | @Provide isShowControl: boolean = false |
| 24 | @Provide liveState: string = '' | 25 | @Provide liveState: string = '' |
| 26 | + @Provide playUrl: string = '' | ||
| 25 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 | 27 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 |
| 26 | @State relId: string = '' | 28 | @State relId: string = '' |
| 27 | @State contentId: string = '' | 29 | @State contentId: string = '' |
| @@ -50,30 +52,45 @@ export struct DetailPlayVLivePage { | @@ -50,30 +52,45 @@ export struct DetailPlayVLivePage { | ||
| 50 | 52 | ||
| 51 | build() { | 53 | build() { |
| 52 | Column() { | 54 | Column() { |
| 53 | - Stack() { | ||
| 54 | - PlayerComponent({ | ||
| 55 | - playerController: this.playerController | ||
| 56 | - }) | ||
| 57 | - | ||
| 58 | - PlayerInfoComponent({ | ||
| 59 | - playerController: this.playerController, | ||
| 60 | - swiperController: this.swiperController, | ||
| 61 | - swiperIndex: $swiperIndex | 55 | + // 直播结束且无回看 |
| 56 | + if (this.liveState === 'end' || !this.playUrl) { | ||
| 57 | + LiveEmptyComponent({ | ||
| 58 | + emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveEnd | ||
| 62 | }) | 59 | }) |
| 60 | + } else { | ||
| 61 | + Stack() { | ||
| 62 | + // 直播暂停,仍然可以评论 | ||
| 63 | + if (this.liveState === 'pause') { | ||
| 64 | + LiveEmptyComponent({ | ||
| 65 | + emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | ||
| 66 | + }) | ||
| 67 | + } else { | ||
| 68 | + PlayerComponent({ | ||
| 69 | + playerController: this.playerController | ||
| 70 | + }) | ||
| 71 | + } | ||
| 63 | 72 | ||
| 64 | - Image($r('app.media.icon_live_more')) | ||
| 65 | - .width(40) | ||
| 66 | - .aspectRatio(1) | ||
| 67 | - .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 68 | - .animation({ duration: 500 }) | ||
| 69 | - .position({ x: '100%', y: '100%' }) | ||
| 70 | - .markAnchor({ x: 56, y: 56 }) | ||
| 71 | - .onClick(() => { | ||
| 72 | - this.swiperController.showNext() | 73 | + PlayerInfoComponent({ |
| 74 | + playerController: this.playerController, | ||
| 75 | + swiperController: this.swiperController, | ||
| 76 | + swiperIndex: $swiperIndex | ||
| 73 | }) | 77 | }) |
| 78 | + | ||
| 79 | + Image($r('app.media.icon_live_more')) | ||
| 80 | + .width(40) | ||
| 81 | + .aspectRatio(1) | ||
| 82 | + .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 83 | + .animation({ duration: 500 }) | ||
| 84 | + .position({ x: '100%', y: '100%' }) | ||
| 85 | + .markAnchor({ x: 56, y: 56 }) | ||
| 86 | + .onClick(() => { | ||
| 87 | + this.swiperController.showNext() | ||
| 88 | + }) | ||
| 89 | + } | ||
| 90 | + .height('100%') | ||
| 91 | + .width('100%') | ||
| 74 | } | 92 | } |
| 75 | - .height('100%') | ||
| 76 | - .width('100%') | 93 | + |
| 77 | 94 | ||
| 78 | } | 95 | } |
| 79 | .height('100%') | 96 | .height('100%') |
| @@ -86,7 +103,10 @@ export struct DetailPlayVLivePage { | @@ -86,7 +103,10 @@ export struct DetailPlayVLivePage { | ||
| 86 | (data) => { | 103 | (data) => { |
| 87 | if (data.length > 0) { | 104 | if (data.length > 0) { |
| 88 | this.liveDetailsBean = data[0] | 105 | this.liveDetailsBean = data[0] |
| 89 | - this.liveState = this.liveDetailsBean.liveInfo?.liveState | 106 | + this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 107 | + if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 108 | + this.playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | ||
| 109 | + } | ||
| 90 | console.log(TAG, 'getLiveDetails', JSON.stringify((this.liveDetailsBean))) | 110 | console.log(TAG, 'getLiveDetails', JSON.stringify((this.liveDetailsBean))) |
| 91 | } | 111 | } |
| 92 | }, | 112 | }, |
| 1 | import { LiveRoomItemBean } from 'wdBean/Index' | 1 | import { LiveRoomItemBean } from 'wdBean/Index' |
| 2 | +import { StringUtils } from 'wdKit/Index' | ||
| 2 | 3 | ||
| 3 | @Component | 4 | @Component |
| 4 | export struct TabChatItemComponent { | 5 | export struct TabChatItemComponent { |
| @@ -9,7 +10,7 @@ export struct TabChatItemComponent { | @@ -9,7 +10,7 @@ export struct TabChatItemComponent { | ||
| 9 | 10 | ||
| 10 | build() { | 11 | build() { |
| 11 | Row() { | 12 | Row() { |
| 12 | - Image(this.item.senderUserAvatarUrl) | 13 | + Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl) |
| 13 | .borderRadius(90) | 14 | .borderRadius(90) |
| 14 | .width(24) | 15 | .width(24) |
| 15 | .height(24) | 16 | .height(24) |
| 1 | import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index' | 1 | import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index' |
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 3 | +import { AudioRowComponent } from 'wdComponent/Index' | ||
| 3 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' | 4 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' |
| 4 | import { WDRouterRule } from 'wdRouter/Index' | 5 | import { WDRouterRule } from 'wdRouter/Index' |
| 5 | 6 | ||
| @@ -111,24 +112,10 @@ export struct TabLiveItemComponent { | @@ -111,24 +112,10 @@ export struct TabLiveItemComponent { | ||
| 111 | } | 112 | } |
| 112 | //音频 | 113 | //音频 |
| 113 | else if (this.item.dataType === 'ZH_AUDIO_MSG') { | 114 | else if (this.item.dataType === 'ZH_AUDIO_MSG') { |
| 114 | - Row() { | ||
| 115 | - Image($r('app.media.icon_voice')) | ||
| 116 | - .width(20) | ||
| 117 | - .aspectRatio(1) | ||
| 118 | - .margin({ | ||
| 119 | - left: 8, | ||
| 120 | - right: 6 | ||
| 121 | - }) | ||
| 122 | - Text(DateTimeUtils.getFormattedDuration(this.item.duration)) | ||
| 123 | - .fontColor('#666666') | ||
| 124 | - .fontWeight(400) | ||
| 125 | - .fontSize('14fp') | ||
| 126 | - } | ||
| 127 | - .backgroundColor(Color.White) | ||
| 128 | - .height(36) | ||
| 129 | - .borderRadius(4) | ||
| 130 | - .margin({ top: 8, right: 16 }) | ||
| 131 | - .width('100%') | 115 | + AudioRowComponent({ |
| 116 | + audioUrl: this.item.audioUrl, | ||
| 117 | + duration: this.item.duration | ||
| 118 | + }) | ||
| 132 | } | 119 | } |
| 133 | //视频 | 120 | //视频 |
| 134 | else if (this.item.dataType === 'ZH_VIDEO_MSG') { | 121 | else if (this.item.dataType === 'ZH_VIDEO_MSG') { |
| 1 | import { LiveDetailsBean } from 'wdBean/Index'; | 1 | import { LiveDetailsBean } from 'wdBean/Index'; |
| 2 | -import { Logger } from 'wdKit/Index'; | ||
| 3 | import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; | 2 | import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; |
| 4 | import { PlayUIComponent } from './PlayUIComponent'; | 3 | import { PlayUIComponent } from './PlayUIComponent'; |
| 5 | 4 | ||
| @@ -7,13 +6,15 @@ import { PlayUIComponent } from './PlayUIComponent'; | @@ -7,13 +6,15 @@ import { PlayUIComponent } from './PlayUIComponent'; | ||
| 7 | export struct TopPlayComponent { | 6 | export struct TopPlayComponent { |
| 8 | TAG: string = 'TopPlayComponent' | 7 | TAG: string = 'TopPlayComponent' |
| 9 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 8 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 10 | - playerController: WDPlayerController = new WDPlayerController(); | 9 | + playerController?: WDPlayerController |
| 11 | @State imgUrl: string = '' | 10 | @State imgUrl: string = '' |
| 12 | @State isWait: boolean = false | 11 | @State isWait: boolean = false |
| 13 | 12 | ||
| 14 | aboutToAppear(): void { | 13 | aboutToAppear(): void { |
| 15 | - this.playerController.onCanplay = () => { | ||
| 16 | - this.playerController.play() | 14 | + if (this.playerController) { |
| 15 | + this.playerController.onCanplay = () => { | ||
| 16 | + this.playerController?.play() | ||
| 17 | + } | ||
| 17 | } | 18 | } |
| 18 | } | 19 | } |
| 19 | 20 | ||
| @@ -30,7 +31,7 @@ export struct TopPlayComponent { | @@ -30,7 +31,7 @@ export struct TopPlayComponent { | ||
| 30 | } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | 31 | } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { |
| 31 | playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | 32 | playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri |
| 32 | } | 33 | } |
| 33 | - this.playerController.firstPlay(playUrl); | 34 | + this.playerController?.firstPlay(playUrl); |
| 34 | } | 35 | } |
| 35 | } | 36 | } |
| 36 | 37 | ||
| @@ -44,18 +45,6 @@ export struct TopPlayComponent { | @@ -44,18 +45,6 @@ export struct TopPlayComponent { | ||
| 44 | .height('100%') | 45 | .height('100%') |
| 45 | .width('100%') | 46 | .width('100%') |
| 46 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) | 47 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) |
| 47 | - .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | ||
| 48 | - Logger.debug(this.TAG, `当前屏幕可见区域大小: currentRatio:' +${currentRatio}`) | ||
| 49 | - if (isVisible && currentRatio >= 1.0) { | ||
| 50 | - Logger.debug(this.TAG, `播放器-暂停. currentRatio:' +${currentRatio}`) | ||
| 51 | - this.playerController.play() | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - if (!isVisible && currentRatio <= 0.0) { | ||
| 55 | - Logger.debug(this.TAG, `播放器-播放. currentRatio:' +${currentRatio}`) | ||
| 56 | - this.playerController.pause() | ||
| 57 | - } | ||
| 58 | - }) | ||
| 59 | Image(this.imgUrl) | 48 | Image(this.imgUrl) |
| 60 | .objectFit(ImageFit.Contain) | 49 | .objectFit(ImageFit.Contain) |
| 61 | .visibility(this.isWait ? Visibility.Visible : Visibility.None) | 50 | .visibility(this.isWait ? Visibility.Visible : Visibility.None) |
| @@ -65,8 +54,5 @@ export struct TopPlayComponent { | @@ -65,8 +54,5 @@ export struct TopPlayComponent { | ||
| 65 | } | 54 | } |
| 66 | 55 | ||
| 67 | aboutToDisappear(): void { | 56 | aboutToDisappear(): void { |
| 68 | - this.playerController.pause() | ||
| 69 | - this.playerController.stop() | ||
| 70 | - this.playerController.release() | ||
| 71 | } | 57 | } |
| 72 | } | 58 | } |
| @@ -152,6 +152,22 @@ export class HWLocationUtils { | @@ -152,6 +152,22 @@ export class HWLocationUtils { | ||
| 152 | } | 152 | } |
| 153 | return '' | 153 | return '' |
| 154 | } | 154 | } |
| 155 | + | ||
| 156 | + // 通过省份code获取省份名称 | ||
| 157 | + static async getProvinceName(provinceCode: string) { | ||
| 158 | + let bean = await ResourcesUtils.getResourcesJson<ResponseDTO<Array<LocalData>>>(getContext(), 'areaList_data.json'); | ||
| 159 | + if (bean) { | ||
| 160 | + if (bean.code == 0 && bean.data) { | ||
| 161 | + for (let i = 0; i < bean.data.length; i++) { | ||
| 162 | + if (bean.data[i].code == provinceCode) { | ||
| 163 | + return bean.data[i].label | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + return '' | ||
| 169 | + } | ||
| 170 | + | ||
| 155 | } | 171 | } |
| 156 | 172 | ||
| 157 | interface LocalData { | 173 | interface LocalData { |
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo", | 15 | "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo", |
| 16 | "wdRouter": "file:../../commons/wdRouter", | 16 | "wdRouter": "file:../../commons/wdRouter", |
| 17 | "wdNetwork": "file:../../commons/wdNetwork", | 17 | "wdNetwork": "file:../../commons/wdNetwork", |
| 18 | - "wdHwAbility": "file:../../features/wdHwAbility" | 18 | + "wdHwAbility": "file:../../features/wdHwAbility", |
| 19 | + "wdJsBridge": "file:../../commons/wdJsBridge" | ||
| 19 | } | 20 | } |
| 20 | } | 21 | } |
| 1 | -import router from '@ohos.router'; | ||
| 2 | import { Action } from 'wdBean'; | 1 | import { Action } from 'wdBean'; |
| 3 | -import { Logger } from 'wdKit'; | ||
| 4 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 5 | - | ||
| 6 | -const TAG = 'DefaultWebPage'; | ||
| 7 | - | 3 | +import router from '@ohos.router'; |
| 4 | +import { CommonConstants } from 'wdConstant' | ||
| 5 | +import { BridgeWebViewControl } from 'wdJsBridge'; | ||
| 6 | +import { detailedSkeleton } from 'wdComponent/src/main/ets/components/skeleton/detailSkeleton' | ||
| 7 | +const TAG = 'DefaultWebPage' | ||
| 8 | @Entry | 8 | @Entry |
| 9 | @Component | 9 | @Component |
| 10 | struct DefaultWebPage { | 10 | struct DefaultWebPage { |
| 11 | - private url?: string; | ||
| 12 | - @State reload: number = 0; | ||
| 13 | - @State isPageEnd : boolean = false | ||
| 14 | - aboutToAppear() { | ||
| 15 | - let action: Action = router.getParams() as Action | ||
| 16 | - if (action) { | ||
| 17 | - this.url = action.params?.url | ||
| 18 | - } | ||
| 19 | - } | ||
| 20 | - | ||
| 21 | - onPageShow() { | ||
| 22 | - Logger.info(TAG, `DefaultWebPage# onPageShow:::refresh`); | ||
| 23 | - this.reload = ++this.reload | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | - onPageHide() { | ||
| 27 | - this.reload = 0 | ||
| 28 | - } | 11 | + webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 12 | + scroller: Scroller = new Scroller(); | ||
| 13 | + action: Action = {} as Action | ||
| 14 | + @State webUrl: string = ''; | ||
| 15 | + @State isPageEnd: boolean = false | ||
| 29 | 16 | ||
| 30 | build() { | 17 | build() { |
| 31 | Column() { | 18 | Column() { |
| 32 | - WdWebComponent({ | ||
| 33 | - webUrl: this.url, | ||
| 34 | - backVisibility: false, | ||
| 35 | - // reload: this.reload, | ||
| 36 | - isPageEnd:$isPageEnd | ||
| 37 | - }) | 19 | + if (!this.isPageEnd) { |
| 20 | + detailedSkeleton() | ||
| 21 | + } | ||
| 22 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 23 | + Column() { | ||
| 24 | + WdWebComponent({ | ||
| 25 | + webviewControl: this.webviewControl, | ||
| 26 | + webUrl: this.webUrl, | ||
| 27 | + backVisibility: false, | ||
| 28 | + isPageEnd: $isPageEnd | ||
| 29 | + }) | ||
| 30 | + } | ||
| 31 | + .padding({ bottom: 56 }) | ||
| 32 | + .width(CommonConstants.FULL_WIDTH) | ||
| 33 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 34 | + } | ||
| 35 | + }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + aboutToAppear() { | ||
| 39 | + let action: Action = router.getParams() as Action | ||
| 40 | + if (action) { | ||
| 41 | + this.webUrl = action.params?.url || '' | ||
| 38 | } | 42 | } |
| 39 | } | 43 | } |
| 40 | -} | 44 | +} |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "hasNext": 0, | ||
| 5 | + "list": [ | ||
| 6 | + { | ||
| 7 | + "avatarFrame": "", | ||
| 8 | + "checkStatus": 0, | ||
| 9 | + "commentContent": "说得很好啊你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突", | ||
| 10 | + "commentContentSensitive": "", | ||
| 11 | + "commentLevel": 2, | ||
| 12 | + "commentPics": "", | ||
| 13 | + "commentSensitive": "", | ||
| 14 | + "commentType": "2", | ||
| 15 | + "createTime": "2024-04-24 10:22:37", | ||
| 16 | + "fromCreatorId": "", | ||
| 17 | + "fromDeviceId": "", | ||
| 18 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 19 | + "fromUserId": "559509019499205", | ||
| 20 | + "fromUserName": "人民wH38q", | ||
| 21 | + "fromUserType": 1, | ||
| 22 | + "h5Url": "", | ||
| 23 | + "id": 58110548, | ||
| 24 | + "keyArticle": 0, | ||
| 25 | + "likeNum": 0, | ||
| 26 | + "pageId": null, | ||
| 27 | + "parentCommentVo": { | ||
| 28 | + "avatarFrame": "", | ||
| 29 | + "checkStatus": 2, | ||
| 30 | + "commentContent": "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸", | ||
| 31 | + "commentPics": "", | ||
| 32 | + "commentType": "1", | ||
| 33 | + "fromUserName": "胡德清", | ||
| 34 | + "id": 58109773 | ||
| 35 | + }, | ||
| 36 | + "parentId": 58109773, | ||
| 37 | + "rootCommentId": 58109773, | ||
| 38 | + "sensitiveExist": 0, | ||
| 39 | + "sensitiveShow": 1, | ||
| 40 | + "shareInfo": { | ||
| 41 | + "shareCoverUrl": "", | ||
| 42 | + "shareSummary": "读书,就是一个让生命变得更加辽阔的过程", | ||
| 43 | + "shareTitle": "读书,就是低着头向上看", | ||
| 44 | + "shareUrl": "https://people.pdnews.cn/column/30044549051-500005339313" | ||
| 45 | + }, | ||
| 46 | + "targetId": "30044549051", | ||
| 47 | + "targetRelId": "500005339313", | ||
| 48 | + "targetRelObjectId": "2002", | ||
| 49 | + "targetRelType": 1, | ||
| 50 | + "targetStatus": 0, | ||
| 51 | + "targetTitle": "读书,就是低着头向上看", | ||
| 52 | + "targetType": 13, | ||
| 53 | + "topicType": null, | ||
| 54 | + "uuid": "6425f699-d762-4d33-b73c-64c780fc9693" | ||
| 55 | + }, | ||
| 56 | + { | ||
| 57 | + "avatarFrame": "", | ||
| 58 | + "checkStatus": 0, | ||
| 59 | + "commentContent": "你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突你牛魔突突突突兔兔突突突", | ||
| 60 | + "commentContentSensitive": "", | ||
| 61 | + "commentLevel": 2, | ||
| 62 | + "commentPics": "", | ||
| 63 | + "commentSensitive": "", | ||
| 64 | + "commentType": "2", | ||
| 65 | + "createTime": "2024-04-24 10:21:42", | ||
| 66 | + "fromCreatorId": "", | ||
| 67 | + "fromDeviceId": "", | ||
| 68 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 69 | + "fromUserId": "559509019499205", | ||
| 70 | + "fromUserName": "人民wH38q", | ||
| 71 | + "fromUserType": 1, | ||
| 72 | + "h5Url": "", | ||
| 73 | + "id": 58092145, | ||
| 74 | + "keyArticle": 0, | ||
| 75 | + "likeNum": 0, | ||
| 76 | + "pageId": null, | ||
| 77 | + "parentCommentVo": { | ||
| 78 | + "avatarFrame": "", | ||
| 79 | + "checkStatus": 2, | ||
| 80 | + "commentContent": "这是继续把自己塑造成受害者角色,其实不过是历史原因造成,这也改不了以色列这半年来对加沙人民的种族灭绝行为!", | ||
| 81 | + "commentPics": "", | ||
| 82 | + "commentType": "1", | ||
| 83 | + "fromUserName": "人民pn5SI", | ||
| 84 | + "id": 58063914 | ||
| 85 | + }, | ||
| 86 | + "parentId": 58063914, | ||
| 87 | + "rootCommentId": 58063914, | ||
| 88 | + "sensitiveExist": 0, | ||
| 89 | + "sensitiveShow": 1, | ||
| 90 | + "shareInfo": { | ||
| 91 | + "shareCoverUrl": "", | ||
| 92 | + "shareSummary": "报道说,福克斯请辞与以国防军军事情报局局长哈利瓦的辞职没有关联。", | ||
| 93 | + "shareTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 94 | + "shareUrl": "https://people.pdnews.cn/column/30044533884-500005335271" | ||
| 95 | + }, | ||
| 96 | + "targetId": "30044533884", | ||
| 97 | + "targetRelId": "500005335271", | ||
| 98 | + "targetRelObjectId": "2002", | ||
| 99 | + "targetRelType": 1, | ||
| 100 | + "targetStatus": 0, | ||
| 101 | + "targetTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 102 | + "targetType": 8, | ||
| 103 | + "topicType": null, | ||
| 104 | + "uuid": "0950adb8-542c-4c11-bc0c-708b1b41554d" | ||
| 105 | + }, | ||
| 106 | + { | ||
| 107 | + "avatarFrame": "", | ||
| 108 | + "checkStatus": 3, | ||
| 109 | + "commentContent": "【华为】您报名的“鸿蒙生态学堂·线上培训 第二期”直播于今晚19:00开始。本次主题:HarmonyOS NEXT 界面开发,点击观看https://url.cloud.huawei.com/q56YcuTFvO。回放观看https://url.cloud.huawei.com/q5Upzl3GOA。【华为】您报名的“鸿蒙生态学堂·线上培训 第二期”直播于今晚19:00开始。本次主题:HarmonyOS NEXT 界面开发,点击观看https://url.cloud.huawei.com/q56YcuTFvO。回放观看https://url.cloud.huawei.com/q5Upzl3GOA。【华为】您报名的“鸿蒙生态学堂·线上培训 第二期”直播于今晚19:00开始。本次主题:HarmonyOS NEXT 界面开发,点击观看https://url.cloud.huawei.com/q56YcuTFvO。回放观看https://url.cloud.huawei.com/q5Upzl3GOA。【华为】您报名的“鸿蒙生态学堂·线上培训 第二期”直播于今晚19:00开始。本次主题:HarmonyOS NEXT 界面开发,点击观看https://url.cloud.huawei.com/q56YcuTFvO。回放观看https://url.cloud.huawei.com/q5Upzl3GOA。", | ||
| 110 | + "commentContentSensitive": "", | ||
| 111 | + "commentLevel": 1, | ||
| 112 | + "commentPics": "", | ||
| 113 | + "commentSensitive": "", | ||
| 114 | + "commentType": "2", | ||
| 115 | + "createTime": "2024-04-24 10:19:22", | ||
| 116 | + "fromCreatorId": "", | ||
| 117 | + "fromDeviceId": "", | ||
| 118 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 119 | + "fromUserId": "559509019499205", | ||
| 120 | + "fromUserName": "人民wH38q", | ||
| 121 | + "fromUserType": 1, | ||
| 122 | + "h5Url": "", | ||
| 123 | + "id": 58091980, | ||
| 124 | + "keyArticle": 0, | ||
| 125 | + "likeNum": 0, | ||
| 126 | + "pageId": null, | ||
| 127 | + "parentCommentVo": null, | ||
| 128 | + "parentId": -1, | ||
| 129 | + "rootCommentId": 58091980, | ||
| 130 | + "sensitiveExist": 0, | ||
| 131 | + "sensitiveShow": 1, | ||
| 132 | + "shareInfo": { | ||
| 133 | + "shareCoverUrl": "", | ||
| 134 | + "shareSummary": "报道说,福克斯请辞与以国防军军事情报局局长哈利瓦的辞职没有关联。", | ||
| 135 | + "shareTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 136 | + "shareUrl": "https://people.pdnews.cn/column/30044533884-500005335271" | ||
| 137 | + }, | ||
| 138 | + "targetId": "30044533884", | ||
| 139 | + "targetRelId": "500005335271", | ||
| 140 | + "targetRelObjectId": "2002", | ||
| 141 | + "targetRelType": 1, | ||
| 142 | + "targetStatus": 0, | ||
| 143 | + "targetTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 144 | + "targetType": 8, | ||
| 145 | + "topicType": null, | ||
| 146 | + "uuid": "320ac584-4ad9-4c38-822d-82dcbf366063" | ||
| 147 | + }, | ||
| 148 | + { | ||
| 149 | + "avatarFrame": "", | ||
| 150 | + "checkStatus": 0, | ||
| 151 | + "commentContent": "说得好", | ||
| 152 | + "commentContentSensitive": "", | ||
| 153 | + "commentLevel": 2, | ||
| 154 | + "commentPics": "", | ||
| 155 | + "commentSensitive": "", | ||
| 156 | + "commentType": "2", | ||
| 157 | + "createTime": "2024-04-24 10:17:30", | ||
| 158 | + "fromCreatorId": "", | ||
| 159 | + "fromDeviceId": "", | ||
| 160 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 161 | + "fromUserId": "559509019499205", | ||
| 162 | + "fromUserName": "人民wH38q", | ||
| 163 | + "fromUserType": 1, | ||
| 164 | + "h5Url": "", | ||
| 165 | + "id": 58091767, | ||
| 166 | + "keyArticle": 0, | ||
| 167 | + "likeNum": 0, | ||
| 168 | + "pageId": null, | ||
| 169 | + "parentCommentVo": { | ||
| 170 | + "avatarFrame": "", | ||
| 171 | + "checkStatus": 2, | ||
| 172 | + "commentContent": "一级战犯!", | ||
| 173 | + "commentPics": "", | ||
| 174 | + "commentType": "1", | ||
| 175 | + "fromUserName": "一把火", | ||
| 176 | + "id": 57995700 | ||
| 177 | + }, | ||
| 178 | + "parentId": 57995700, | ||
| 179 | + "rootCommentId": 57995700, | ||
| 180 | + "sensitiveExist": 0, | ||
| 181 | + "sensitiveShow": 1, | ||
| 182 | + "shareInfo": { | ||
| 183 | + "shareCoverUrl": "", | ||
| 184 | + "shareSummary": "报道说,福克斯请辞与以国防军军事情报局局长哈利瓦的辞职没有关联。", | ||
| 185 | + "shareTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 186 | + "shareUrl": "https://people.pdnews.cn/column/30044533884-500005335271" | ||
| 187 | + }, | ||
| 188 | + "targetId": "30044533884", | ||
| 189 | + "targetRelId": "500005335271", | ||
| 190 | + "targetRelObjectId": "2002", | ||
| 191 | + "targetRelType": 1, | ||
| 192 | + "targetStatus": 0, | ||
| 193 | + "targetTitle": "以色列媒体:以军中央司令部司令请辞", | ||
| 194 | + "targetType": 8, | ||
| 195 | + "topicType": null, | ||
| 196 | + "uuid": "a8f009c7-6fa1-44c9-bc99-107d14acbac7" | ||
| 197 | + }, | ||
| 198 | + { | ||
| 199 | + "avatarFrame": "", | ||
| 200 | + "checkStatus": 2, | ||
| 201 | + "commentContent": "你好", | ||
| 202 | + "commentContentSensitive": "", | ||
| 203 | + "commentLevel": 1, | ||
| 204 | + "commentPics": "", | ||
| 205 | + "commentSensitive": "", | ||
| 206 | + "commentType": "2", | ||
| 207 | + "createTime": "2024-04-19 16:19:02", | ||
| 208 | + "fromCreatorId": "", | ||
| 209 | + "fromDeviceId": "", | ||
| 210 | + "fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 211 | + "fromUserId": "559509019499205", | ||
| 212 | + "fromUserName": "人民wH38q", | ||
| 213 | + "fromUserType": 1, | ||
| 214 | + "h5Url": "", | ||
| 215 | + "id": 57870182, | ||
| 216 | + "keyArticle": 1, | ||
| 217 | + "likeNum": 0, | ||
| 218 | + "pageId": null, | ||
| 219 | + "parentCommentVo": null, | ||
| 220 | + "parentId": -1, | ||
| 221 | + "rootCommentId": 57870182, | ||
| 222 | + "sensitiveExist": 0, | ||
| 223 | + "sensitiveShow": 1, | ||
| 224 | + "shareInfo": { | ||
| 225 | + "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240419/a_965759026988052480.jpeg", | ||
| 226 | + "shareSummary": "中央宣传部直属单位2024年度公开招聘工作人员面试公告", | ||
| 227 | + "shareTitle": "中央宣传部直属单位2024年度公开招聘工作人员面试公告", | ||
| 228 | + "shareUrl": "https://people.pdnews.cn/rmharticle/30044466109" | ||
| 229 | + }, | ||
| 230 | + "targetId": "30044466109", | ||
| 231 | + "targetRelId": "500005326186", | ||
| 232 | + "targetRelObjectId": "2058", | ||
| 233 | + "targetRelType": 1, | ||
| 234 | + "targetStatus": 0, | ||
| 235 | + "targetTitle": "中央宣传部直属单位2024年度公开招聘工作人员面试公告", | ||
| 236 | + "targetType": 8, | ||
| 237 | + "topicType": null, | ||
| 238 | + "uuid": "849612f9-3880-4e7a-a8c3-d7281706ec0e" | ||
| 239 | + } | ||
| 240 | + ], | ||
| 241 | + "pageNum": 1, | ||
| 242 | + "pageSize": 20, | ||
| 243 | + "totalCommentNum": 5, | ||
| 244 | + "totalCount": 5 | ||
| 245 | + }, | ||
| 246 | + "message": "Success", | ||
| 247 | + "meta": null, | ||
| 248 | + "requestId": "", | ||
| 249 | + "success": true, | ||
| 250 | + "timestamp": 1713925942006 | ||
| 251 | +} |
-
Please register or login to post a comment