Showing
55 changed files
with
1537 additions
and
118 deletions
| @@ -253,6 +253,13 @@ export class HttpUrlUtils { | @@ -253,6 +253,13 @@ export class HttpUrlUtils { | ||
| 253 | * 早晚报获取PAGEID | 253 | * 早晚报获取PAGEID |
| 254 | * */ | 254 | * */ |
| 255 | static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic"; | 255 | static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic"; |
| 256 | + | ||
| 257 | + /** | ||
| 258 | + * app启动页 兴趣偏好 | ||
| 259 | + */ | ||
| 260 | + static readonly INTERESTS_HOTS_DATA_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/queryTags"; | ||
| 261 | + | ||
| 262 | + | ||
| 256 | private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; | 263 | private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; |
| 257 | /** | 264 | /** |
| 258 | * 推荐列表 | 265 | * 推荐列表 |
| @@ -650,6 +657,12 @@ export class HttpUrlUtils { | @@ -650,6 +657,12 @@ export class HttpUrlUtils { | ||
| 650 | return url | 657 | return url |
| 651 | } | 658 | } |
| 652 | 659 | ||
| 660 | + static getInterestsUrl() { | ||
| 661 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERESTS_HOTS_DATA_PATH; | ||
| 662 | + return url; | ||
| 663 | + | ||
| 664 | + } | ||
| 665 | + | ||
| 653 | static getLiveDetailsUrl() { | 666 | static getLiveDetailsUrl() { |
| 654 | let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH | 667 | let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH |
| 655 | return url | 668 | return url |
| @@ -87,6 +87,9 @@ export class WDRouterPage { | @@ -87,6 +87,9 @@ export class WDRouterPage { | ||
| 87 | static launchAdvertisingPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchAdvertisingPage"); | 87 | static launchAdvertisingPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchAdvertisingPage"); |
| 88 | //主页 | 88 | //主页 |
| 89 | static mainPage = new WDRouterPage("phone", "ets/pages/MainPage"); | 89 | static mainPage = new WDRouterPage("phone", "ets/pages/MainPage"); |
| 90 | + | ||
| 91 | + static launchInterestsPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchInterestsHobbiesPage"); | ||
| 92 | + | ||
| 90 | // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | 93 | // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); |
| 91 | 94 | ||
| 92 | //播报页面 | 95 | //播报页面 |
| @@ -18,7 +18,7 @@ export class WDRouterRule { | @@ -18,7 +18,7 @@ export class WDRouterRule { | ||
| 18 | if (page) { | 18 | if (page) { |
| 19 | if (params) { | 19 | if (params) { |
| 20 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) | 20 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) |
| 21 | - console.log('page.url()==',page.url()) | 21 | + console.log('page.url()==',page.url(),JSON.stringify(params)) |
| 22 | router.pushUrl({ url: page.url(), params: params }) | 22 | router.pushUrl({ url: page.url(), params: params }) |
| 23 | } else { | 23 | } else { |
| 24 | router.pushUrl({ url: page.url() }).catch((error:Error)=>{ | 24 | router.pushUrl({ url: page.url() }).catch((error:Error)=>{ |
| @@ -14,7 +14,7 @@ export struct WdWebLocalComponent { | @@ -14,7 +14,7 @@ export struct WdWebLocalComponent { | ||
| 14 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | 14 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 15 | @Prop backVisibility: boolean = false | 15 | @Prop backVisibility: boolean = false |
| 16 | @Prop webResource: Resource = {} as Resource | 16 | @Prop webResource: Resource = {} as Resource |
| 17 | - @State webHeight : string = '100%' | 17 | + @State webHeight: string | number = '100%' |
| 18 | 18 | ||
| 19 | build() { | 19 | build() { |
| 20 | Column() { | 20 | Column() { |
| @@ -39,7 +39,7 @@ export struct WdWebLocalComponent { | @@ -39,7 +39,7 @@ export struct WdWebLocalComponent { | ||
| 39 | .mixedMode(MixedMode.All) | 39 | .mixedMode(MixedMode.All) |
| 40 | .onlineImageAccess(true) | 40 | .onlineImageAccess(true) |
| 41 | .enableNativeEmbedMode(true) | 41 | .enableNativeEmbedMode(true) |
| 42 | - .height(this.webHeight === '100%' ? '100%' : Number(this.webHeight)) | 42 | + .height(this.webHeight) |
| 43 | .onPageBegin((event) => { | 43 | .onPageBegin((event) => { |
| 44 | this.onPageBegin(event?.url); | 44 | this.onPageBegin(event?.url); |
| 45 | }) | 45 | }) |
| @@ -79,9 +79,16 @@ export struct WdWebLocalComponent { | @@ -79,9 +79,16 @@ export struct WdWebLocalComponent { | ||
| 79 | 79 | ||
| 80 | //webview 高度设置 | 80 | //webview 高度设置 |
| 81 | private setCurrentPageOperate: (data: Message) => void = (data) => { | 81 | private setCurrentPageOperate: (data: Message) => void = (data) => { |
| 82 | - console.log("setCurrentPageOperate",JSON.stringify(data)) | 82 | + console.log("setCurrentPageOperate", JSON.stringify(data)) |
| 83 | if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { | 83 | if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { |
| 84 | - this.webHeight = data?.data?.webViewHeight || '100%' | 84 | + if (typeof this.webHeight === 'number') { |
| 85 | + if (Number(data?.data?.webViewHeight) > this.webHeight) { | ||
| 86 | + this.webHeight = Number(data?.data?.webViewHeight) | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + { | ||
| 90 | + this.webHeight = Number(data?.data?.webViewHeight) || '100%' | ||
| 91 | + } | ||
| 85 | } | 92 | } |
| 86 | } | 93 | } |
| 87 | /** | 94 | /** |
| @@ -72,5 +72,6 @@ export interface ContentDTO { | @@ -72,5 +72,6 @@ export interface ContentDTO { | ||
| 72 | corner: string; | 72 | corner: string; |
| 73 | rmhPlatform: number; | 73 | rmhPlatform: number; |
| 74 | newTags: string; | 74 | newTags: string; |
| 75 | + titleShow?: number; | ||
| 75 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 | 76 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 |
| 76 | } | 77 | } |
| @@ -167,14 +167,16 @@ export interface LiveDetailsBean { | @@ -167,14 +167,16 @@ export interface LiveDetailsBean { | ||
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | export interface LiveInfo { | 169 | export interface LiveInfo { |
| 170 | - //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 170 | + //直播新闻-直播状态 wait 待开播 running 直播中 end 已结束cancel已取消paused暂停 |
| 171 | liveState: string | 171 | liveState: string |
| 172 | //2024-04-12 15:00:00 直播开始时间 | 172 | //2024-04-12 15:00:00 直播开始时间 |
| 173 | planStartTime: string | 173 | planStartTime: string |
| 174 | - mliveId:string | ||
| 175 | vlive: Array<Vlive> | 174 | vlive: Array<Vlive> |
| 175 | + mlive:MLive | ||
| 176 | +} | ||
| 177 | +export interface MLive { | ||
| 178 | + mliveId:string | ||
| 176 | } | 179 | } |
| 177 | - | ||
| 178 | export interface FullColumnImgUrls { | 180 | export interface FullColumnImgUrls { |
| 179 | url: string | 181 | url: string |
| 180 | } | 182 | } |
| @@ -58,9 +58,9 @@ export struct CardParser { | @@ -58,9 +58,9 @@ export struct CardParser { | ||
| 58 | } | 58 | } |
| 59 | else { | 59 | else { |
| 60 | // todo:组件未实现 / Component Not Implemented | 60 | // todo:组件未实现 / Component Not Implemented |
| 61 | - Text(contentDTO.appStyle) | ||
| 62 | - .width(CommonConstants.FULL_PARENT) | ||
| 63 | - .padding(10) | 61 | + // Text(contentDTO.appStyle) |
| 62 | + // .width(CommonConstants.FULL_PARENT) | ||
| 63 | + // .padding(10) | ||
| 64 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 64 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle |
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| @@ -66,9 +66,9 @@ export struct CompParser { | @@ -66,9 +66,9 @@ export struct CompParser { | ||
| 66 | } | 66 | } |
| 67 | else { | 67 | else { |
| 68 | // todo:组件未实现 / Component Not Implemented | 68 | // todo:组件未实现 / Component Not Implemented |
| 69 | - Text(compDTO.compStyle) | ||
| 70 | - .width(CommonConstants.FULL_PARENT) | ||
| 71 | - .padding(10) | 69 | + // Text(compDTO.compStyle) |
| 70 | + // .width(CommonConstants.FULL_PARENT) | ||
| 71 | + // .padding(10) | ||
| 72 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 72 | // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| @@ -20,12 +20,18 @@ export struct CardSourceInfo { | @@ -20,12 +20,18 @@ export struct CardSourceInfo { | ||
| 20 | .fontColor($r("app.color.color_B0B0B0")) | 20 | .fontColor($r("app.color.color_B0B0B0")) |
| 21 | .maxLines(1) | 21 | .maxLines(1) |
| 22 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 22 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 23 | + Image($r("app.media.point")) | ||
| 24 | + .width(16) | ||
| 25 | + .height(16) | ||
| 23 | } else if (this.contentDTO.source) { | 26 | } else if (this.contentDTO.source) { |
| 24 | Text(`${this.contentDTO.source}`) | 27 | Text(`${this.contentDTO.source}`) |
| 25 | .fontSize($r("app.float.font_size_12")) | 28 | .fontSize($r("app.float.font_size_12")) |
| 26 | .fontColor($r("app.color.color_B0B0B0")) | 29 | .fontColor($r("app.color.color_B0B0B0")) |
| 27 | .maxLines(1) | 30 | .maxLines(1) |
| 28 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 31 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 32 | + Image($r("app.media.point")) | ||
| 33 | + .width(16) | ||
| 34 | + .height(16) | ||
| 29 | } | 35 | } |
| 30 | // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 | 36 | // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 |
| 31 | if (this.contentDTO.isSearch || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | 37 | if (this.contentDTO.isSearch || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime |
| @@ -34,9 +40,6 @@ export struct CardSourceInfo { | @@ -34,9 +40,6 @@ export struct CardSourceInfo { | ||
| 34 | .contentDTO.publishTime)) | 40 | .contentDTO.publishTime)) |
| 35 | .indexOf | 41 | .indexOf |
| 36 | ('-') === -1) { | 42 | ('-') === -1) { |
| 37 | - Image($r("app.media.point")) | ||
| 38 | - .width(16) | ||
| 39 | - .height(16) | ||
| 40 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | 43 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) |
| 41 | .fontSize($r("app.float.font_size_12")) | 44 | .fontSize($r("app.float.font_size_12")) |
| 42 | .fontColor($r("app.color.color_B0B0B0")) | 45 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -17,7 +17,7 @@ export struct Card10Component { | @@ -17,7 +17,7 @@ export struct Card10Component { | ||
| 17 | build() { | 17 | build() { |
| 18 | Column() { | 18 | Column() { |
| 19 | // 顶部标题,最多两行 | 19 | // 顶部标题,最多两行 |
| 20 | - if (this.contentDTO.newsTitle) { | 20 | + if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { |
| 21 | Text(this.contentDTO.newsTitle) | 21 | Text(this.contentDTO.newsTitle) |
| 22 | .width(CommonConstants.FULL_WIDTH) | 22 | .width(CommonConstants.FULL_WIDTH) |
| 23 | .fontSize($r('app.float.font_size_17')) | 23 | .fontSize($r('app.float.font_size_17')) |
| 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; | 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | - | 3 | +import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 4 | const TAG = 'Card19Component'; | 4 | const TAG = 'Card19Component'; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| @@ -94,6 +94,9 @@ export struct Card19Component { | @@ -94,6 +94,9 @@ export struct Card19Component { | ||
| 94 | top: $r('app.float.card_comp_pagePadding_tb'), | 94 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 95 | bottom: $r('app.float.card_comp_pagePadding_tb') | 95 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 96 | }) | 96 | }) |
| 97 | + .onClick((event: ClickEvent) => { | ||
| 98 | + ProcessUtils.processPage(this.contentDTO) | ||
| 99 | + }) | ||
| 97 | } | 100 | } |
| 98 | } | 101 | } |
| 99 | 102 |
| @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | ||
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | - | 5 | +import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 6 | const TAG = 'Card20Component'; | 6 | const TAG = 'Card20Component'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| @@ -71,6 +71,9 @@ export struct Card20Component { | @@ -71,6 +71,9 @@ export struct Card20Component { | ||
| 71 | top: $r('app.float.card_comp_pagePadding_tb'), | 71 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 72 | bottom: $r('app.float.card_comp_pagePadding_tb') | 72 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 73 | }) | 73 | }) |
| 74 | + .onClick((event: ClickEvent) => { | ||
| 75 | + ProcessUtils.processPage(this.contentDTO) | ||
| 76 | + }) | ||
| 74 | } | 77 | } |
| 75 | } | 78 | } |
| 76 | 79 |
| @@ -42,16 +42,15 @@ export struct Card6Component { | @@ -42,16 +42,15 @@ export struct Card6Component { | ||
| 42 | .alignItems(HorizontalAlign.Start) | 42 | .alignItems(HorizontalAlign.Start) |
| 43 | .justifyContent(FlexAlign.Start) | 43 | .justifyContent(FlexAlign.Start) |
| 44 | .width('58%') | 44 | .width('58%') |
| 45 | - if (this.contentDTO.coverUrl) { | ||
| 46 | - Stack() { | ||
| 47 | - Image(this.contentDTO.coverUrl) | ||
| 48 | - .borderRadius(5) | ||
| 49 | - .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | ||
| 50 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180) | ||
| 51 | - CardMediaInfo({ contentDTO: this.contentDTO }) | ||
| 52 | - } | ||
| 53 | - .alignContent(Alignment.BottomEnd) | 45 | + Stack() { |
| 46 | + Image(this.contentDTO.coverUrl) | ||
| 47 | + .backgroundColor($r('app.color.color_B0B0B0')) | ||
| 48 | + .borderRadius(5) | ||
| 49 | + .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | ||
| 50 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180) | ||
| 51 | + CardMediaInfo({ contentDTO: this.contentDTO }) | ||
| 54 | } | 52 | } |
| 53 | + .alignContent(Alignment.BottomEnd) | ||
| 55 | } | 54 | } |
| 56 | .onClick((event: ClickEvent) => { | 55 | .onClick((event: ClickEvent) => { |
| 57 | ProcessUtils.processPage(this.contentDTO) | 56 | ProcessUtils.processPage(this.contentDTO) |
| @@ -15,7 +15,7 @@ export struct Card9Component { | @@ -15,7 +15,7 @@ export struct Card9Component { | ||
| 15 | build() { | 15 | build() { |
| 16 | Column() { | 16 | Column() { |
| 17 | // 顶部标题,最多两行 | 17 | // 顶部标题,最多两行 |
| 18 | - if (this.contentDTO.newsTitle) { | 18 | + if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { |
| 19 | Text(this.contentDTO.newsTitle) | 19 | Text(this.contentDTO.newsTitle) |
| 20 | .width(CommonConstants.FULL_WIDTH) | 20 | .width(CommonConstants.FULL_WIDTH) |
| 21 | .fontSize($r('app.float.font_size_17')) | 21 | .fontSize($r('app.float.font_size_17')) |
| 1 | +import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | +import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | +import { PageRepository } from '../../repository/PageRepository'; | ||
| 6 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 小视频横划卡 | ||
| 10 | + * Zh_Single_Row-02 | ||
| 11 | + */ | ||
| 12 | +const TAG = 'Zh_Single_Row-02' | ||
| 13 | + | ||
| 14 | +@Entry | ||
| 15 | +@Component | ||
| 16 | +export struct ZhSingleRow02 { | ||
| 17 | + @State compDTO: CompDTO = { | ||
| 18 | + objectTitle: '大标题', | ||
| 19 | + operDataList: [ | ||
| 20 | + { | ||
| 21 | + rmhInfo: { | ||
| 22 | + rmhId: '2489729', | ||
| 23 | + rmhName: '陕西青年职业学院', | ||
| 24 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | + } | ||
| 28 | + }, | ||
| 29 | + { | ||
| 30 | + rmhInfo: { | ||
| 31 | + rmhId: '2489729', | ||
| 32 | + rmhName: '陕西青年职业学院', | ||
| 33 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + rmhInfo: { | ||
| 40 | + rmhId: '2489729', | ||
| 41 | + rmhName: '陕西青年职业学院', | ||
| 42 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + rmhInfo: { | ||
| 49 | + rmhId: '2489729', | ||
| 50 | + rmhName: '陕西青年职业学院', | ||
| 51 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | + } | ||
| 55 | + }, | ||
| 56 | + { | ||
| 57 | + rmhInfo: { | ||
| 58 | + rmhId: '2489729', | ||
| 59 | + rmhName: '陕西青年职业学院', | ||
| 60 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | + } | ||
| 64 | + }, | ||
| 65 | + ] | ||
| 66 | + } as CompDTO | ||
| 67 | + | ||
| 68 | + build() { | ||
| 69 | + Column() { | ||
| 70 | + //顶部 | ||
| 71 | + this.CompHeader(this.compDTO) | ||
| 72 | + Row(){ | ||
| 73 | + // 列表内容 | ||
| 74 | + List() { | ||
| 75 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 76 | + CreatorItem({ | ||
| 77 | + item | ||
| 78 | + }) | ||
| 79 | + .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | ||
| 80 | + }) | ||
| 81 | + } | ||
| 82 | + .listDirection(Axis.Horizontal) | ||
| 83 | + } | ||
| 84 | + .width(CommonConstants.FULL_WIDTH) | ||
| 85 | + .height(208) | ||
| 86 | + } | ||
| 87 | + .padding({ | ||
| 88 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 89 | + // right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 90 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 91 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 92 | + }) | ||
| 93 | + .backgroundColor($r('app.color.white')) | ||
| 94 | + .margin({ bottom: 8 }) | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + @Builder | ||
| 98 | + CompHeader(item: CompDTO) { | ||
| 99 | + Row() { | ||
| 100 | + Row() { | ||
| 101 | + Image($r("app.media.redLine")) | ||
| 102 | + .width(3) | ||
| 103 | + .height(16) | ||
| 104 | + .margin({ right: 4 }) | ||
| 105 | + Text(item.objectTitle) | ||
| 106 | + .fontSize($r("app.float.font_size_17")) | ||
| 107 | + .fontColor($r("app.color.color_222222")) | ||
| 108 | + .fontWeight(600) | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + Row() { | ||
| 112 | + Text("更多") | ||
| 113 | + .fontSize($r("app.float.font_size_14")) | ||
| 114 | + .fontColor($r("app.color.color_999999")) | ||
| 115 | + .margin({ right: 1 }) | ||
| 116 | + Image($r("app.media.more")) | ||
| 117 | + .width(14) | ||
| 118 | + .height(14) | ||
| 119 | + .onClick(() => { | ||
| 120 | + // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | ||
| 121 | + let params: Params = { | ||
| 122 | + pageID: "1" | ||
| 123 | + } | ||
| 124 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 125 | + }) | ||
| 126 | + } | ||
| 127 | + .padding({ | ||
| 128 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 132 | + .margin({ top: 8, bottom: 8 }) | ||
| 133 | + .width('100%') | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +@Extend(Text) | ||
| 138 | +function textOverflowStyle(maxLine: number) { | ||
| 139 | + .maxLines(maxLine) | ||
| 140 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +@Component | ||
| 144 | +struct CreatorItem { | ||
| 145 | + @Prop item: ContentDTO | ||
| 146 | + @State rmhIsAttention: number = 0 | ||
| 147 | + build() { | ||
| 148 | + ListItem() { | ||
| 149 | + Column() { | ||
| 150 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 151 | + Image('') | ||
| 152 | + .width(156) | ||
| 153 | + .height(208) | ||
| 154 | + Row() | ||
| 155 | + .width(156) | ||
| 156 | + .height(80) | ||
| 157 | + .linearGradient({ | ||
| 158 | + direction: GradientDirection.Bottom, | ||
| 159 | + colors: [[0xffffff, 0.0], [0x000000, 1.0]] | ||
| 160 | + }) | ||
| 161 | + .opacity(0.3) | ||
| 162 | + Text('这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题') | ||
| 163 | + .fontColor(0xffffff) | ||
| 164 | + .fontSize(14) | ||
| 165 | + .maxLines(2) | ||
| 166 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 167 | + .width(140) | ||
| 168 | + .height(40) | ||
| 169 | + .margin({bottom: 8}) | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + } | ||
| 173 | + .width(156) | ||
| 174 | + .height(208) | ||
| 175 | + .margin({ right: 11 }) | ||
| 176 | + .borderWidth(1) | ||
| 177 | + .borderColor($r('app.color.color_EDEDED')) | ||
| 178 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 179 | + } | ||
| 180 | + .onClick(() => { | ||
| 181 | + console.log('跳转到rmh'); | ||
| 182 | + }) | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + /** | ||
| 186 | + * 关注号主 TODO 这里后面需要抽离 | ||
| 187 | + */ | ||
| 188 | + handleAccention(item: ContentDTO, status: number) { | ||
| 189 | + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 190 | + return | ||
| 191 | + // 未登录,跳转登录 | ||
| 192 | + if (!HttpUrlUtils.getUserId()) { | ||
| 193 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 194 | + return | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + const params: postInteractAccentionOperateParams = { | ||
| 198 | + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 199 | + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 200 | + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 201 | + // userType: 1, | ||
| 202 | + // userId: '1', // TODO 用户id需要从本地获取 | ||
| 203 | + status: status, | ||
| 204 | + } | ||
| 205 | + PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 206 | + console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 207 | + if (status === 1) { | ||
| 208 | + this.rmhIsAttention = 0 | ||
| 209 | + } else { | ||
| 210 | + this.rmhIsAttention = 1 | ||
| 211 | + } | ||
| 212 | + }) | ||
| 213 | + } | ||
| 214 | +} |
| 1 | +import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | +import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | +import { PageRepository } from '../../repository/PageRepository'; | ||
| 6 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 精选评论卡 | ||
| 10 | + * Zh_Single_Row-06 | ||
| 11 | + */ | ||
| 12 | +const TAG = 'Zh_Single_Row-06' | ||
| 13 | + | ||
| 14 | +@Entry | ||
| 15 | +@Component | ||
| 16 | +export struct ZhSingleRow06 { | ||
| 17 | + @State compDTO: CompDTO = { | ||
| 18 | + objectTitle: '大标题', | ||
| 19 | + operDataList: [ | ||
| 20 | + { | ||
| 21 | + rmhInfo: { | ||
| 22 | + rmhId: '2489729', | ||
| 23 | + rmhName: '陕西青年职业学院', | ||
| 24 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | + } | ||
| 28 | + }, | ||
| 29 | + { | ||
| 30 | + rmhInfo: { | ||
| 31 | + rmhId: '2489729', | ||
| 32 | + rmhName: '陕西青年职业学院', | ||
| 33 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + rmhInfo: { | ||
| 40 | + rmhId: '2489729', | ||
| 41 | + rmhName: '陕西青年职业学院', | ||
| 42 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + rmhInfo: { | ||
| 49 | + rmhId: '2489729', | ||
| 50 | + rmhName: '陕西青年职业学院', | ||
| 51 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | + } | ||
| 55 | + }, | ||
| 56 | + { | ||
| 57 | + rmhInfo: { | ||
| 58 | + rmhId: '2489729', | ||
| 59 | + rmhName: '陕西青年职业学院', | ||
| 60 | + rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | + '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | + } | ||
| 64 | + }, | ||
| 65 | + ] | ||
| 66 | + } as CompDTO | ||
| 67 | + | ||
| 68 | + build() { | ||
| 69 | + Column() { | ||
| 70 | + //顶部 | ||
| 71 | + this.CompHeader(this.compDTO) | ||
| 72 | + Row(){ | ||
| 73 | + // 列表内容 | ||
| 74 | + List() { | ||
| 75 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 76 | + CreatorItem({ | ||
| 77 | + item | ||
| 78 | + }) | ||
| 79 | + .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | ||
| 80 | + }) | ||
| 81 | + } | ||
| 82 | + .listDirection(Axis.Horizontal) | ||
| 83 | + } | ||
| 84 | + .width(CommonConstants.FULL_WIDTH) | ||
| 85 | + .height(208) | ||
| 86 | + } | ||
| 87 | + .padding({ | ||
| 88 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 89 | + // right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 90 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 91 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 92 | + }) | ||
| 93 | + .backgroundColor($r('app.color.white')) | ||
| 94 | + .margin({ bottom: 8 }) | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + @Builder | ||
| 98 | + CompHeader(item: CompDTO) { | ||
| 99 | + Row() { | ||
| 100 | + Row() { | ||
| 101 | + Image($r("app.media.icon_elite_comment")) | ||
| 102 | + .width(24) | ||
| 103 | + .height(24) | ||
| 104 | + .margin({ right: 4 }) | ||
| 105 | + Text('精选评论') | ||
| 106 | + .fontSize($r("app.float.font_size_17")) | ||
| 107 | + .fontColor($r("app.color.color_222222")) | ||
| 108 | + .fontWeight(600) | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + Row() { | ||
| 112 | + Text("更多") | ||
| 113 | + .fontSize($r("app.float.font_size_14")) | ||
| 114 | + .fontColor($r("app.color.color_999999")) | ||
| 115 | + .margin({ right: 1 }) | ||
| 116 | + Image($r("app.media.more")) | ||
| 117 | + .width(14) | ||
| 118 | + .height(14) | ||
| 119 | + .onClick(() => { | ||
| 120 | + // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | ||
| 121 | + let params: Params = { | ||
| 122 | + pageID: "1" | ||
| 123 | + } | ||
| 124 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 125 | + }) | ||
| 126 | + } | ||
| 127 | + .padding({ | ||
| 128 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 132 | + .margin({ top: 8, bottom: 8 }) | ||
| 133 | + .width('100%') | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +@Extend(Text) | ||
| 138 | +function textOverflowStyle(maxLine: number) { | ||
| 139 | + .maxLines(maxLine) | ||
| 140 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +@Component | ||
| 144 | +struct CreatorItem { | ||
| 145 | + @Prop item: ContentDTO | ||
| 146 | + @State rmhIsAttention: number = 0 | ||
| 147 | + build() { | ||
| 148 | + ListItem() { | ||
| 149 | + Column() { | ||
| 150 | + Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) { | ||
| 151 | + Column() { | ||
| 152 | + Row() { | ||
| 153 | + Image('') | ||
| 154 | + .width(20) | ||
| 155 | + .height(20) | ||
| 156 | + .margin({right: 4}) | ||
| 157 | + .border({width: 1, color: 0xcccccc, radius: 10}) | ||
| 158 | + Text('立志之间') | ||
| 159 | + .fontColor(0x212228) | ||
| 160 | + .fontSize(12) | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + Column() { | ||
| 165 | + Row() { | ||
| 166 | + Image($r('app.media.icon_like_no')) | ||
| 167 | + .width(16) | ||
| 168 | + .height(16) | ||
| 169 | + .margin({right: 4}) | ||
| 170 | + Text('3835') | ||
| 171 | + .fontSize(14) | ||
| 172 | + .fontColor(0x999999) | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + .margin({top: 10, left: 10, right: 10, bottom: 8}) | ||
| 177 | + | ||
| 178 | + Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,') | ||
| 179 | + .maxLines(2) | ||
| 180 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 181 | + .margin({left: 10, right: 10, bottom: 8}) | ||
| 182 | + .fontSize(17) | ||
| 183 | + .fontColor(0x212228) | ||
| 184 | + .lineHeight(25) | ||
| 185 | + | ||
| 186 | + Row() { | ||
| 187 | + Image('') | ||
| 188 | + .width(66) | ||
| 189 | + .height(44) | ||
| 190 | + .borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0}) | ||
| 191 | + Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制') | ||
| 192 | + .margin({left: 8}) | ||
| 193 | + .width(172) | ||
| 194 | + .maxLines(2) | ||
| 195 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 196 | + } | ||
| 197 | + .linearGradient({ | ||
| 198 | + direction: GradientDirection.Right, | ||
| 199 | + colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]] | ||
| 200 | + }) | ||
| 201 | + } | ||
| 202 | + .width(276) | ||
| 203 | + .height(150) | ||
| 204 | + .margin({ right: 10 }) | ||
| 205 | + .borderWidth(1) | ||
| 206 | + .borderColor($r('app.color.color_EDEDED')) | ||
| 207 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 208 | + .backgroundColor(0xf9f9f9) | ||
| 209 | + } | ||
| 210 | + .onClick(() => { | ||
| 211 | + console.log('跳转到rmh'); | ||
| 212 | + }) | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + /** | ||
| 216 | + * 关注号主 TODO 这里后面需要抽离 | ||
| 217 | + */ | ||
| 218 | + handleAccention(item: ContentDTO, status: number) { | ||
| 219 | + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 220 | + return | ||
| 221 | + // 未登录,跳转登录 | ||
| 222 | + if (!HttpUrlUtils.getUserId()) { | ||
| 223 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 224 | + return | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + const params: postInteractAccentionOperateParams = { | ||
| 228 | + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 229 | + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 230 | + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 231 | + // userType: 1, | ||
| 232 | + // userId: '1', // TODO 用户id需要从本地获取 | ||
| 233 | + status: status, | ||
| 234 | + } | ||
| 235 | + PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 236 | + console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 237 | + if (status === 1) { | ||
| 238 | + this.rmhIsAttention = 0 | ||
| 239 | + } else { | ||
| 240 | + this.rmhIsAttention = 1 | ||
| 241 | + } | ||
| 242 | + }) | ||
| 243 | + } | ||
| 244 | +} |
| 1 | +import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | +import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | +import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | +import { PageRepository } from '../repository/PageRepository'; | ||
| 6 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 精选评论卡 | ||
| 10 | + * Zh_Single_Row-06 | ||
| 11 | + */ | ||
| 12 | +const TAG = 'Zh_Single_Row-06' | ||
| 13 | + | ||
| 14 | +@Entry | ||
| 15 | +@Component | ||
| 16 | +export struct ZhSingleRow06 { | ||
| 17 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 18 | + @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] | ||
| 19 | + @State activeIndexs: Array<number> = [] | ||
| 20 | + | ||
| 21 | + getItemWidth(index: number) { | ||
| 22 | + if (index % 4 === 0 || index % 4 === 3) { | ||
| 23 | + return 80 | ||
| 24 | + } else { | ||
| 25 | + return 96 | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + build() { | ||
| 30 | + Column() { | ||
| 31 | + //顶部 | ||
| 32 | + this.CompHeader(this.compDTO) | ||
| 33 | + Grid() { | ||
| 34 | + ForEach(this.list, (item: string, index: number) => { | ||
| 35 | + GridItem() { | ||
| 36 | + Text(item) | ||
| 37 | + .fontSize(14) | ||
| 38 | + .fontColor(this.activeIndexs.includes(index) ? 0x222222 : 0x666666) | ||
| 39 | + .fontWeight(this.activeIndexs.includes(index) ? 600 : 400) | ||
| 40 | + .textAlign(TextAlign.Center) | ||
| 41 | + } | ||
| 42 | + .onClick(() => { | ||
| 43 | + if (this.activeIndexs.includes(index)) { | ||
| 44 | + const ind = this.activeIndexs.indexOf(index); | ||
| 45 | + this.activeIndexs.splice(ind, 1) | ||
| 46 | + } else { | ||
| 47 | + this.activeIndexs.push(index) | ||
| 48 | + } | ||
| 49 | + }) | ||
| 50 | + }) | ||
| 51 | + } | ||
| 52 | + .height(70) | ||
| 53 | + .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 54 | + .rowsTemplate('1fr 1fr') | ||
| 55 | + .margin({bottom: 10}) | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 59 | + .fontSize(12) | ||
| 60 | + .fontColor(0xB0B0B0) | ||
| 61 | + .textAlign(TextAlign.Center) | ||
| 62 | + .margin({bottom: 10}) | ||
| 63 | + | ||
| 64 | + Row() { | ||
| 65 | + Text('选好了') | ||
| 66 | + .fontSize(14) | ||
| 67 | + .fontColor(0x000000) | ||
| 68 | + .width('100%') | ||
| 69 | + .textAlign(TextAlign.Center) | ||
| 70 | + } | ||
| 71 | + .height(40) | ||
| 72 | + .backgroundColor(0xf9f9f9) | ||
| 73 | + .width('100%') | ||
| 74 | + .borderRadius(3) | ||
| 75 | + } | ||
| 76 | + .padding({ | ||
| 77 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 78 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 79 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 80 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 81 | + }) | ||
| 82 | + .backgroundColor($r('app.color.white')) | ||
| 83 | + .margin({ bottom: 8 }) | ||
| 84 | + | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @Builder | ||
| 88 | + CompHeader(item: CompDTO) { | ||
| 89 | + Row() { | ||
| 90 | + Row() { | ||
| 91 | + Image($r("app.media.icon_interest_ask")) | ||
| 92 | + .width(24) | ||
| 93 | + .height(24) | ||
| 94 | + .margin({ right: 4 }) | ||
| 95 | + Text('以下是否有您感兴趣?') | ||
| 96 | + .fontSize($r("app.float.font_size_17")) | ||
| 97 | + .fontColor(0x000000) | ||
| 98 | + .fontWeight(600) | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + Row() { | ||
| 102 | + Image($r("app.media.close_button")) | ||
| 103 | + .width(14) | ||
| 104 | + .height(14) | ||
| 105 | + .onClick(() => { | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + .padding({ | ||
| 109 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 110 | + }) | ||
| 111 | + } | ||
| 112 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 113 | + .margin({ top: 8, bottom: 8 }) | ||
| 114 | + .width('100%') | ||
| 115 | + } | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +@Extend(Text) | ||
| 119 | +function textOverflowStyle(maxLine: number) { | ||
| 120 | + .maxLines(maxLine) | ||
| 121 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +@Component | ||
| 125 | +struct CreatorItem { | ||
| 126 | + @Prop item: ContentDTO | ||
| 127 | + @State rmhIsAttention: number = 0 | ||
| 128 | + build() { | ||
| 129 | + ListItem() { | ||
| 130 | + Column() { | ||
| 131 | + Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) { | ||
| 132 | + Column() { | ||
| 133 | + Row() { | ||
| 134 | + Image('') | ||
| 135 | + .width(20) | ||
| 136 | + .height(20) | ||
| 137 | + .margin({right: 4}) | ||
| 138 | + .border({width: 1, color: 0xcccccc, radius: 10}) | ||
| 139 | + Text('立志之间') | ||
| 140 | + .fontColor(0x212228) | ||
| 141 | + .fontSize(12) | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + Column() { | ||
| 146 | + Row() { | ||
| 147 | + Image($r('app.media.icon_like_no')) | ||
| 148 | + .width(16) | ||
| 149 | + .height(16) | ||
| 150 | + .margin({right: 4}) | ||
| 151 | + Text('3835') | ||
| 152 | + .fontSize(14) | ||
| 153 | + .fontColor(0x999999) | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + .margin({top: 10, left: 10, right: 10, bottom: 8}) | ||
| 158 | + | ||
| 159 | + Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,') | ||
| 160 | + .maxLines(2) | ||
| 161 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 162 | + .margin({left: 10, right: 10, bottom: 8}) | ||
| 163 | + .fontSize(17) | ||
| 164 | + .fontColor(0x212228) | ||
| 165 | + .lineHeight(25) | ||
| 166 | + | ||
| 167 | + Row() { | ||
| 168 | + Image('') | ||
| 169 | + .width(66) | ||
| 170 | + .height(44) | ||
| 171 | + .borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0}) | ||
| 172 | + Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制') | ||
| 173 | + .margin({left: 8}) | ||
| 174 | + .width(172) | ||
| 175 | + .maxLines(2) | ||
| 176 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 177 | + } | ||
| 178 | + .linearGradient({ | ||
| 179 | + direction: GradientDirection.Right, | ||
| 180 | + colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]] | ||
| 181 | + }) | ||
| 182 | + } | ||
| 183 | + .width(276) | ||
| 184 | + .height(150) | ||
| 185 | + .margin({ right: 10 }) | ||
| 186 | + .borderWidth(1) | ||
| 187 | + .borderColor($r('app.color.color_EDEDED')) | ||
| 188 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 189 | + .backgroundColor(0xf9f9f9) | ||
| 190 | + } | ||
| 191 | + .onClick(() => { | ||
| 192 | + console.log('跳转到rmh'); | ||
| 193 | + }) | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + /** | ||
| 197 | + * 关注号主 TODO 这里后面需要抽离 | ||
| 198 | + */ | ||
| 199 | + handleAccention(item: ContentDTO, status: number) { | ||
| 200 | + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 201 | + return | ||
| 202 | + // 未登录,跳转登录 | ||
| 203 | + if (!HttpUrlUtils.getUserId()) { | ||
| 204 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 205 | + return | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + const params: postInteractAccentionOperateParams = { | ||
| 209 | + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 210 | + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 211 | + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 212 | + // userType: 1, | ||
| 213 | + // userId: '1', // TODO 用户id需要从本地获取 | ||
| 214 | + status: status, | ||
| 215 | + } | ||
| 216 | + PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 217 | + console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 218 | + if (status === 1) { | ||
| 219 | + this.rmhIsAttention = 0 | ||
| 220 | + } else { | ||
| 221 | + this.rmhIsAttention = 1 | ||
| 222 | + } | ||
| 223 | + }) | ||
| 224 | + } | ||
| 225 | +} |
| @@ -447,5 +447,8 @@ export struct PaperSingleColumn999CardView { | @@ -447,5 +447,8 @@ export struct PaperSingleColumn999CardView { | ||
| 447 | .backgroundColor(Color.White) | 447 | .backgroundColor(Color.White) |
| 448 | .margin({ bottom: 5, left: 12, right: 12 }) | 448 | .margin({ bottom: 5, left: 12, right: 12 }) |
| 449 | .borderRadius(4) | 449 | .borderRadius(4) |
| 450 | + .onClick(()=>{ | ||
| 451 | + ProcessUtils.processPage(this.item) | ||
| 452 | + }) | ||
| 450 | } | 453 | } |
| 451 | } | 454 | } |
| 1 | +/** | ||
| 2 | + * 频道骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct channelSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3,] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + | ||
| 14 | + ForEach(this.quantity, () => { | ||
| 15 | + Row() { | ||
| 16 | + Column() { | ||
| 17 | + textArea('60%', 12) | ||
| 18 | + textArea('60%', 12) | ||
| 19 | + textArea('40%', 12) | ||
| 20 | + } | ||
| 21 | + .RightStyle() | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + Column() { | ||
| 25 | + textArea('35%', 78) | ||
| 26 | + } | ||
| 27 | + .margin({ right: 0 }) | ||
| 28 | + } | ||
| 29 | + .height(100) | ||
| 30 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 31 | + .SkeletonStyle() | ||
| 32 | + }) | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + textArea('100%', 204) | ||
| 37 | + } | ||
| 38 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 39 | + .SkeletonStyle() | ||
| 40 | + | ||
| 41 | + ForEach([1, 2], () => { | ||
| 42 | + Row() { | ||
| 43 | + Column() { | ||
| 44 | + textArea('60%', 12) | ||
| 45 | + textArea('60%', 12) | ||
| 46 | + textArea('40%', 12) | ||
| 47 | + } | ||
| 48 | + .RightStyle() | ||
| 49 | + | ||
| 50 | + Column() { | ||
| 51 | + textArea('35%', 78) | ||
| 52 | + } | ||
| 53 | + .margin({ right: 0 }) | ||
| 54 | + } | ||
| 55 | + .height(100) | ||
| 56 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 57 | + .SkeletonStyle() | ||
| 58 | + }) | ||
| 59 | + } | ||
| 60 | + .width('100%') | ||
| 61 | + } | ||
| 62 | + .height('100%') | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +@Builder | ||
| 67 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 68 | + Row() | ||
| 69 | + .width(width) | ||
| 70 | + .height(height) | ||
| 71 | + .backgroundColor('#FFF2F3F4') | ||
| 72 | + .margin({ top: 10 }) | ||
| 73 | + // .borderRadius(5) | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +// 全局公共样式 | ||
| 77 | +@Styles | ||
| 78 | +function SkeletonStyle() { | ||
| 79 | + .padding({ right: 18, left: 18 }) | ||
| 80 | + .width('100%') | ||
| 81 | + .margin({ top: 10 }) | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +@Extend(Column) | ||
| 85 | +function RightStyle() { | ||
| 86 | + .alignItems(HorizontalAlign.Start) | ||
| 87 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 88 | + .height('100%') | ||
| 89 | +} | ||
| 90 | + |
| 1 | +/** | ||
| 2 | + * 详情骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct detailedSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3, 4, 5, 6, 7] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + Column() { | ||
| 14 | + textArea('100%', 20) | ||
| 15 | + textArea('50%', 20) | ||
| 16 | + } | ||
| 17 | + .SkeletonStyle() | ||
| 18 | + .alignItems(HorizontalAlign.Start) | ||
| 19 | + | ||
| 20 | + Column() { | ||
| 21 | + textArea('40%', 12) | ||
| 22 | + textArea('40%', 12) | ||
| 23 | + } | ||
| 24 | + .SkeletonStyle() | ||
| 25 | + .alignItems(HorizontalAlign.Start) | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + Column() { | ||
| 29 | + textArea('100%', 12) | ||
| 30 | + textArea('100%', 12) | ||
| 31 | + textArea('90%', 12) | ||
| 32 | + } | ||
| 33 | + .SkeletonStyle() | ||
| 34 | + .alignItems(HorizontalAlign.Start) | ||
| 35 | + | ||
| 36 | + Column() { | ||
| 37 | + textArea('100%', 180) | ||
| 38 | + } | ||
| 39 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 40 | + .SkeletonStyle() | ||
| 41 | + | ||
| 42 | + ForEach(this.quantity, () => { | ||
| 43 | + Column() { | ||
| 44 | + textArea('100%', 12) | ||
| 45 | + textArea('90%', 12) | ||
| 46 | + } | ||
| 47 | + .SkeletonStyle() | ||
| 48 | + .alignItems(HorizontalAlign.Start) | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + .width('100%') | ||
| 52 | + } | ||
| 53 | + .height('100%') | ||
| 54 | + } | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +@Builder | ||
| 58 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 59 | + Row() | ||
| 60 | + .width(width) | ||
| 61 | + .height(height) | ||
| 62 | + .backgroundColor('#FFF2F3F4') | ||
| 63 | + .margin({ top: 10 }) | ||
| 64 | + // .borderRadius(5) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 全局公共样式 | ||
| 68 | +@Styles | ||
| 69 | +function SkeletonStyle() { | ||
| 70 | + .padding({ right: 18, left: 18 }) | ||
| 71 | + .width('100%') | ||
| 72 | + .margin({ top: 10 }) | ||
| 73 | +} |
| 1 | +/** | ||
| 2 | + * 电子报骨架屏 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +export struct detailedSkeleton { | ||
| 8 | + @State quantity: Array<number> = [1, 2, 3,] | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Row() { | ||
| 12 | + Column() { | ||
| 13 | + Row() { | ||
| 14 | + Column() { | ||
| 15 | + Row() { | ||
| 16 | + Column() { | ||
| 17 | + Image($rawfile('apph5/image/peopleSeleton.svg')).width('100%').height(47)// 后缀名不能省略 | ||
| 18 | + .interpolation(ImageInterpolation.High) | ||
| 19 | + textArea('100%', 9) | ||
| 20 | + }.width('72.00%').alignItems(HorizontalAlign.Start).margin({ right: 5 }) | ||
| 21 | + | ||
| 22 | + Column() { | ||
| 23 | + textArea(27, 25) | ||
| 24 | + textArea(27, 4) | ||
| 25 | + textArea(27, 20) | ||
| 26 | + } | ||
| 27 | + .border({ width: 1 }) | ||
| 28 | + .borderColor('#FFF5F5F5') | ||
| 29 | + .padding({ right: 2, left: 2, top: 0, bottom: 2 }) | ||
| 30 | + .justifyContent(FlexAlign.SpaceEvenly) | ||
| 31 | + .alignItems(HorizontalAlign.Start) | ||
| 32 | + } | ||
| 33 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 34 | + .width('98%') | ||
| 35 | + | ||
| 36 | + // .height(64) | ||
| 37 | + | ||
| 38 | + BoxAndLine().width('100%') | ||
| 39 | + BoxAndBox({ firstBoxNumber: '65%', boxHeight: 100 }) | ||
| 40 | + Column() { | ||
| 41 | + textArea('100%', 79) | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + BoxAndBox({ firstBoxNumber: '30%', boxHeight: 51 }) | ||
| 45 | + | ||
| 46 | + }.width('45%') | ||
| 47 | + .opacity(1) | ||
| 48 | + .align(Alignment.Start) | ||
| 49 | + .alignItems(HorizontalAlign.Start) | ||
| 50 | + | ||
| 51 | + Column() { | ||
| 52 | + Column() { | ||
| 53 | + textArea('100%', 13) | ||
| 54 | + }.width('100%') | ||
| 55 | + | ||
| 56 | + BoxAndLine() | ||
| 57 | + | ||
| 58 | + Column() { | ||
| 59 | + textArea('95%', 126) | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + Column() { | ||
| 63 | + textArea('95%', 13) | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + Row() { | ||
| 67 | + Column() { | ||
| 68 | + textArea('100%', 30) | ||
| 69 | + }.width('50%').margin({ right: 5 }) | ||
| 70 | + | ||
| 71 | + Column() { | ||
| 72 | + textArea('100%', 30) | ||
| 73 | + }.layoutWeight(1) | ||
| 74 | + }.width('95%').justifyContent(FlexAlign.SpaceBetween) | ||
| 75 | + | ||
| 76 | + Column() { | ||
| 77 | + textArea('95%', 100) | ||
| 78 | + } | ||
| 79 | + }.width('45%') | ||
| 80 | + }.justifyContent(FlexAlign.SpaceBetween) | ||
| 81 | + } | ||
| 82 | + .width('100%') | ||
| 83 | + | ||
| 84 | + } | ||
| 85 | + .height('100%') | ||
| 86 | + } | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +@Component | ||
| 90 | +struct BoxAndLine { | ||
| 91 | + build() { | ||
| 92 | + Column() { | ||
| 93 | + textArea('100%', 130) | ||
| 94 | + textArea('100%', 13) | ||
| 95 | + textArea('80%', 13) | ||
| 96 | + }.width('98%').alignItems(HorizontalAlign.Start) | ||
| 97 | + } | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | + | ||
| 101 | +@Component | ||
| 102 | +struct BoxAndBox { | ||
| 103 | + @Prop firstBoxNumber: number | Resource | string | ||
| 104 | + @Prop boxHeight: number | Resource | string | ||
| 105 | + | ||
| 106 | + build() { | ||
| 107 | + Row() { | ||
| 108 | + Column() { | ||
| 109 | + textArea('100%', this.boxHeight) | ||
| 110 | + }.width(this.firstBoxNumber).margin({ right: 5 }) | ||
| 111 | + | ||
| 112 | + Column() { | ||
| 113 | + textArea('100%', this.boxHeight) | ||
| 114 | + }.layoutWeight(1) | ||
| 115 | + }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||
| 116 | + } | ||
| 117 | +} | ||
| 118 | + | ||
| 119 | +@Builder | ||
| 120 | +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { | ||
| 121 | + Row() | ||
| 122 | + .width(width) | ||
| 123 | + .height(height) | ||
| 124 | + .backgroundColor('#FFF5F5F5') | ||
| 125 | + .margin({ top: 5 }) | ||
| 126 | + // .borderRadius(5) | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +// 全局公共样式 | ||
| 130 | +@Styles | ||
| 131 | +function SkeletonStyle() { | ||
| 132 | + .padding({ right: 14, left: 14 }) | ||
| 133 | + .width('100%') | ||
| 134 | + .margin({ top: 5 }) | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +@Extend(Column) | ||
| 138 | +function RightStyle() { | ||
| 139 | + .alignItems(HorizontalAlign.Start) | ||
| 140 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 141 | + .height('100%') | ||
| 142 | +} | ||
| 143 | + |
| 1 | -import { CommonConstants } from 'wdConstant' | ||
| 2 | -import { CompDTO } from 'wdBean' | 1 | +import { Action, CompDTO, ContentDTO, Params } from 'wdBean' |
| 2 | +import { WDRouterRule } from 'wdRouter/Index' | ||
| 3 | +import { Logger } from 'wdKit/Index' | ||
| 4 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 3 | 5 | ||
| 4 | @Component | 6 | @Component |
| 5 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | 7 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { |
| @@ -57,5 +59,23 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | @@ -57,5 +59,23 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | ||
| 57 | }) | 59 | }) |
| 58 | .backgroundColor($r("app.color.white")) | 60 | .backgroundColor($r("app.color.white")) |
| 59 | .margin({ bottom: 8 }) | 61 | .margin({ bottom: 8 }) |
| 62 | + .onClick(()=>{ | ||
| 63 | + this.gotoLive(this.compDTO?.operDataList[0]) | ||
| 64 | + }) | ||
| 65 | + } | ||
| 66 | + gotoLive(content: ContentDTO) { | ||
| 67 | + let taskAction: Action = { | ||
| 68 | + type: 'JUMP_DETAIL_PAGE', | ||
| 69 | + params: { | ||
| 70 | + detailPageType: 2, | ||
| 71 | + contentID: content?.objectId, | ||
| 72 | + extra: { | ||
| 73 | + relType: content?.relType, | ||
| 74 | + relId: content?.relId, | ||
| 75 | + } as ExtraDTO | ||
| 76 | + } as Params, | ||
| 77 | + }; | ||
| 78 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 79 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 60 | } | 80 | } |
| 61 | } | 81 | } |
| @@ -4,6 +4,9 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean' | @@ -4,6 +4,9 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean' | ||
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | import { WDRouterRule } from 'wdRouter/Index' | 5 | import { WDRouterRule } from 'wdRouter/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 8 | +import { Logger } from 'wdKit/Index' | ||
| 9 | + | ||
| 7 | @Component | 10 | @Component |
| 8 | export struct LiveHorizontalCardComponent { | 11 | export struct LiveHorizontalCardComponent { |
| 9 | @State compDTO: CompDTO = {} as CompDTO | 12 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -79,6 +82,7 @@ export struct LiveHorizontalCardComponent { | @@ -79,6 +82,7 @@ export struct LiveHorizontalCardComponent { | ||
| 79 | .onClick(() => { | 82 | .onClick(() => { |
| 80 | if (item.objectType != '0') { | 83 | if (item.objectType != '0') { |
| 81 | console.log(item.objectId) | 84 | console.log(item.objectId) |
| 85 | + this.gotoLive(item) | ||
| 82 | } | 86 | } |
| 83 | }) | 87 | }) |
| 84 | }) | 88 | }) |
| @@ -96,4 +100,19 @@ export struct LiveHorizontalCardComponent { | @@ -96,4 +100,19 @@ export struct LiveHorizontalCardComponent { | ||
| 96 | }) | 100 | }) |
| 97 | .backgroundColor($r("app.color.white")) | 101 | .backgroundColor($r("app.color.white")) |
| 98 | } | 102 | } |
| 103 | + gotoLive(content: ContentDTO) { | ||
| 104 | + let taskAction: Action = { | ||
| 105 | + type: 'JUMP_DETAIL_PAGE', | ||
| 106 | + params: { | ||
| 107 | + detailPageType: 2, | ||
| 108 | + contentID: content?.objectId, | ||
| 109 | + extra: { | ||
| 110 | + relType: content?.relType, | ||
| 111 | + relId: content?.relId, | ||
| 112 | + } as ExtraDTO | ||
| 113 | + } as Params, | ||
| 114 | + }; | ||
| 115 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 116 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 117 | + } | ||
| 99 | } | 118 | } |
| 1 | // 视频直播直播预约 | 1 | // 视频直播直播预约 |
| 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' | 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' |
| 3 | -import { CompDTO, ContentDTO } from 'wdBean' | 3 | +import { Action, CompDTO, ContentDTO, Params } from 'wdBean' |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | -import { StringUtils } from 'wdKit/Index' | 5 | +import { Logger, StringUtils } from 'wdKit/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 8 | +import { WDRouterRule } from 'wdRouter/Index' | ||
| 9 | + | ||
| 7 | @Component | 10 | @Component |
| 8 | export struct LiveHorizontalReservationComponent { | 11 | export struct LiveHorizontalReservationComponent { |
| 9 | @State compDTO: CompDTO = {} as CompDTO | 12 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -70,6 +73,7 @@ export struct LiveHorizontalReservationComponent { | @@ -70,6 +73,7 @@ export struct LiveHorizontalReservationComponent { | ||
| 70 | .onClick(() => { | 73 | .onClick(() => { |
| 71 | if (item.objectType != '0') { | 74 | if (item.objectType != '0') { |
| 72 | console.log(item.objectId) | 75 | console.log(item.objectId) |
| 76 | + this.gotoLive(item) | ||
| 73 | } | 77 | } |
| 74 | }) | 78 | }) |
| 75 | }) | 79 | }) |
| @@ -87,4 +91,20 @@ export struct LiveHorizontalReservationComponent { | @@ -87,4 +91,20 @@ export struct LiveHorizontalReservationComponent { | ||
| 87 | }) | 91 | }) |
| 88 | .backgroundColor($r("app.color.white")) | 92 | .backgroundColor($r("app.color.white")) |
| 89 | } | 93 | } |
| 94 | + | ||
| 95 | + gotoLive(content: ContentDTO) { | ||
| 96 | + let taskAction: Action = { | ||
| 97 | + type: 'JUMP_DETAIL_PAGE', | ||
| 98 | + params: { | ||
| 99 | + detailPageType: 2, | ||
| 100 | + contentID: content?.objectId, | ||
| 101 | + extra: { | ||
| 102 | + relType: content?.relType, | ||
| 103 | + relId: content?.relId, | ||
| 104 | + } as ExtraDTO | ||
| 105 | + } as Params, | ||
| 106 | + }; | ||
| 107 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 108 | + Logger.debug(`gotoLive, ${content.objectId}`); | ||
| 109 | + } | ||
| 90 | } | 110 | } |
2.55 KB
2.84 KB
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
sight_harmony/features/wdComponent/src/main/resources/rawfile/apph5/image/peopleSeleton.svg
0 → 100644
| 1 | +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1713249268044" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2925" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M884.736 546.88c-1.792-5.12-7.04-9.728-12.8-7.232-3.2 1.344-10.496 12.544-11.072 9.6-2.752-14.08 16.704-18.048 19.52-25.344 3.008-8-4.224-11.52-10.24-13.888a47.232 47.232 0 0 1-16.192-11.072c-4.928-4.992-17.024-12.352-21.568-3.2-1.28 4.352-0.512 12.608-2.176 17.92-1.92 6.272-9.088 6.72-13.44 11.328-6.208 6.848 0.64 9.216 4.8 14.464 3.84 4.992 1.216 40.384-5.248 52.48-3.2 6.016-86.336 72.064-100.032 75.52-15.744 3.84-15.68 20.48-8.96 29.696 8.576 11.712 27.008 6.272 36.16-0.448 5.76-4.352 44.288-45.056 53.44-53.44 3.712-3.392 18.688-22.976 19.84-10.432a46.912 46.912 0 0 1-1.728 16.96c-1.856 5.888-5.568 14.848-5.12 21.248 0.768 10.24 19.2 24.32 28.8 20.096 6.208-2.816 6.72-12.096 6.08-18.816-0.576-7.04 0.768-49.024 2.24-62.72a46.08 46.08 0 0 1 5.952-20.8c5.248-8.768 36.928-27.072 31.744-41.92z m-226.88 26.624c-2.816 6.08-14.272-3.84-17.152-6.528-2.88-2.56-6.464-4.48-6.016-8.896 0.576-4.48 5.76-5.12 5.76-5.12 1.792-0.32 17.792-0.96 18.88 1.856a55.296 55.296 0 0 1-1.472 18.688z m14.72-97.28c-10.816-1.408-23.296 9.472-31.616 14.72-4.096 2.56-27.52 14.4-24 20.48 2.432 4.096 17.024 0.576 21.76-0.512 13.44-3.072 20.48-12.032 23.872-9.792 2.88 1.92 1.024 32.64-4.48 32.064-12.032-1.152-19.2-10.624-32.064-15.872-3.968-1.6-11.776-4.608-9.088 2.624 0.768 2.176 3.648 5.056 4.672 7.168 2.368 4.8 4.48 21.504 2.368 25.152-4.224 6.976-8.704-5.376-9.792-8.064-2.048-5.12-3.328-10.368-5.12-15.552-1.536-4.736-5.568-16.96-10.944-16.256-6.208 0.832-1.664 27.968-2.816 33.728-3.84 19.456-5.504 25.216-6.144 37.952-0.512 10.304 0 27.392 11.84 30.528 15.808 4.224 18.048-9.344 19.456-18.56 0.32-2.176 0.832-6.784 1.92-8.64 1.664-2.752 3.84-3.2 5.888-0.512 1.664 2.304 0.96 5.696 3.456 7.936 2.496 2.304 5.312 1.92 8.576 2.56 5.056 0.96 11.328-0.96 14.464 3.84 3.2 5.12 2.176 10.56 8.32 14.016 13.44 7.36 19.84-7.168 20.864-16.896 1.216-11.648 1.792-22.592 2.368-34.176 0.576-11.712 1.088-24.448 4.096-35.776a244.48 244.48 0 0 1 5.248-17.024 22.72 22.72 0 0 0 0.768-16.256c-3.776-9.728-19.648-18.368-23.936-18.88z m-165.312 2.304c4.48-4.16 12.032-9.664 10.88-16.32-4.352-25.92-44.672-8.384-59.968-0.768-22.208 11.136-11.52 5.824-50.432 24.96-5.888 2.816-3.2 7.04-2.304 9.6 3.2 9.216 17.664 13.632 23.808 9.728 5.12-3.264 54.08-37.76 56.704-34.112 4.032 5.504-20.8 24.512-32.32 29.056-5.12 2.048-13.184 9.408-14.784 15.04a12.992 12.992 0 0 0 0.192 8.96l-0.64-0.256c-1.856 0.64-6.848-0.192-8.512 0.96-1.536 1.024 1.728 20.928 8.128 33.28 2.304 4.352 4.288 8.32-1.088 11.008-6.208 3.072-17.088 15.68-4.928 16.832 2.624 0.256 5.44 0.384 7.68-0.896 1.728-1.024 4.992-2.944 7.488-2.24 2.56 0.768 4.736 8.32 6.4 10.944 5.312 8.064 24.576 43.328 33.728 45.632 8 2.048 21.312-1.152 24-9.984 1.408-4.416 2.56-36.864 2.496-41.664-0.064-4.288 0.256-9.856-0.896-13.76-1.088-3.648-3.84-9.152-8.448-7.872-4.928 1.28-5.184 8.832-6.016 12.8-1.024 4.8-2.24 26.304-7.232 26.368-3.52 0-20.16-26.624-22.016-30.336-1.92-3.776-3.52-7.36-0.96-11.008 4.48-6.464 19.2-14.976 11.264-23.68-6.272-6.784-20.48-4.992-22.592 3.584-0.64 2.56 0.896 12.608-4.416 8.96-3.072-2.112-8.704-17.088-6.656-19.2 0.832-0.832 4.224-1.472 7.296-1.792h3.2c10.88-0.96 26.496-6.72 29.952-15.296 1.152-2.88 2.56-6.592 0.064-8.576-1.984-1.664-2.624-1.92-3.2-4.16-0.64-2.688 19.52-21.504 24.128-25.792z m472.064 56.128c16.384-7.808 49.408-7.424 44.096-39.04-1.088-6.528-4.352-20.032-13.568-19.52-8 0.448-14.272 12.8-17.792 18.816-8.96 15.36-26.496 30.4-38.912 43.264-15.68 16.256-41.088 60.992-43.84 60.992-7.296-0.064 3.264-29.248 4.992-33.536 10.176-25.28 42.88-104.256 47.808-113.28 9.152-16.832 15.808-25.792 26.112-41.664 20.352-31.36-14.848-30.336-14.848-30.336-9.92 0.768-16.256 7.296-21.952 11.776-6.272 4.8-12.8 8.064-19.712 11.904-6.784 3.84-15.36 7.872-9.472 16.128 4.992 7.04 10.752 7.744 18.24 8.512a38.72 38.72 0 0 0 7.36 0.512c-1.216 7.232-25.28 50.112-30.848 66.752-11.392 34.24-20.224 98.368-36.8 128a29.888 29.888 0 0 0-3.392 23.68c2.112 6.912 14.272 11.52 21.952 5.376 6.144-4.864 6.976-29.312 28.48-67.072 6.016-10.496 9.6-6.144 14.592 3.584 4.544 8.768 8.512 31.104 14.592 39.296 19.52 26.176 41.408 18.688 44.352 9.472 4.48-13.632-3.84-23.872-9.792-29.824-16.896-16.704-59.712-28.992-49.152-48 7.872-14.08 28.544-21.504 37.504-25.792zM260.544 386.816c-0.576-9.856-6.912-17.472-16.064-22.72-4.288-2.496-19.52-9.664-23.04-6.144l1.472-0.32c-6.016 2.688-1.92 21.312-2.496 26.688-1.024 9.984-6.336 22.208-9.792 31.872-7.232 20.032-13.888 37.824-21.056 57.856a576.64 576.64 0 0 1-26.944 61.312c-9.984 19.84-19.712 40.256-29.888 59.84-5.76 11.2-11.84 22.272-19.2 32.32-6.848 9.152-14.464 20.352-22.784 28.416-6.848 6.592-15.872 12.8-24.512 16.064-10.496 4.032-20.032 4.864-30.72 6.912-4.928 0.896-26.24 2.304-31.04 4.096-13.696 4.992 7.872 11.648 13.952 11.584 21.76 0 44.992 1.536 64.64-5.568 18.944-6.912 35.84-21.12 47.936-36.736 13.44-17.344 37.632-61.76 46.976-81.216 11.52-23.808 58.24-112.64 62.912-125.312 6.08-16.64 20.544-41.408 19.648-59.008z m550.144 102.4a24.512 24.512 0 0 0 16.96-1.472 25.6 25.6 0 0 1 16.448-2.176c4.736 0.64 8.832 1.28 13.76 0.448 6.08-0.96 7.808-2.112 12.8-5.12 4.864-2.944 9.408-2.496 14.784-3.328a20.8 20.8 0 0 0 11.584-6.912c6.784-7.04 12.16-18.624 3.648-25.728-3.968-3.328-15.552-9.664-27.712-4.736a265.216 265.216 0 0 0-25.664 16.64c-9.728 6.912-21.568 9.472-31.488 15.36-3.84 2.24-9.152 5.248-11.648 8.96-3.264 4.672 1.92 6.784 6.528 8.064zM437.952 595.712c-11.008-4.672-14.912 2.624-21.632 6.464-3.264-5.12 0.128-12.416 0.96-17.856 0.96-6.4 6.72-38.4-17.92-51.008-1.984-1.024-5.568-1.472-5.568 1.408l-2.24 18.24c-5.632 43.2-9.728 53.76-10.112 60.864-0.256 6.848-0.704 16.576 3.712 21.952 3.648 4.288 9.472 7.488 15.488 5.824 5.76-1.472 24.128-17.472 29.056-22.208 5.056-4.8 19.008-19.2 8.256-23.68z m378.88-166.208c4.48 1.472 21.312 1.344 19.008 7.68-1.344 3.776-6.272 6.4-9.088 9.088-1.664 1.664-8.448 7.872-7.68 10.112 1.408 4.544 21.376-7.616 25.344-10.624 4.288-3.328 8.704-6.208 13.696-8.448 4.928-2.304 18.56-7.168 28.736-15.36 10.048-8.256 45.312-69.312 45.888-74.304 1.152-10.368-10.432-23.488-20.928-27.456-4.48-1.728-9.792 7.808-11.072 10.624-2.304 5.12-15.552 30.72-19.712 39.36a61.504 61.504 0 0 1-19.136 23.872c-8.96 6.08-18.56 8.896-28.8 11.904-5.248 1.6-26.688 6.656-28.8 9.792-2.88 4.224 8.192 12.352 12.544 13.76z m-489.088 219.136c-5.248 1.536-35.2 8.96-40.512 7.808-28.928-5.888-30.272-32.832-79.04-75.904-1.664-1.536-19.584-12.032-18.176-4.48 0 0 15.424 26.624 18.816 31.552 3.712 5.312 20.032 42.88 22.592 48.192 2.432 5.056 4.992 10.368 7.68 15.232 5.44 9.344 15.68 22.272 27.072 24.832 5.76 1.28 24.512-4.352 30.144-7.104 11.328-5.632 22.528-12.8 32.192-21.312 3.84-3.328 8.64-7.744 10.112-12.672 2.304-7.808-5.248-7.808-10.88-6.144z" p-id="2926" fill="#f6f6f6"></path></svg> |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "wdKit": "file:../../commons/wdKit", | 13 | "wdKit": "file:../../commons/wdKit", |
| 14 | "wdBean": "file:../../features/wdBean", | 14 | "wdBean": "file:../../features/wdBean", |
| 15 | "wdConstant": "file:../../commons/wdConstant", | 15 | "wdConstant": "file:../../commons/wdConstant", |
| 16 | - "wdDetailPlayApi": "file:../../features/wdDetailPlayApi" | 16 | + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 17 | + "wdRouter": "file:../../commons/wdRouter" | ||
| 17 | } | 18 | } |
| 18 | } | 19 | } |
| @@ -15,8 +15,10 @@ export struct DetailPlayLivePage { | @@ -15,8 +15,10 @@ export struct DetailPlayLivePage { | ||
| 15 | @State relType: string = '' | 15 | @State relType: string = '' |
| 16 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | 16 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 17 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 17 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 18 | + @State tabs: string[] = ['直播间', '大家聊'] | ||
| 18 | 19 | ||
| 19 | aboutToAppear(): void { | 20 | aboutToAppear(): void { |
| 21 | + //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 | ||
| 20 | let par: Action = router.getParams() as Action; | 22 | let par: Action = router.getParams() as Action; |
| 21 | let params = par?.params; | 23 | let params = par?.params; |
| 22 | this.relId = params?.extra?.relId || ''; | 24 | this.relId = params?.extra?.relId || ''; |
| @@ -29,7 +31,7 @@ export struct DetailPlayLivePage { | @@ -29,7 +31,7 @@ export struct DetailPlayLivePage { | ||
| 29 | build() { | 31 | build() { |
| 30 | Column() { | 32 | Column() { |
| 31 | TopPlayComponent() | 33 | TopPlayComponent() |
| 32 | - TabComponent() | 34 | + TabComponent({ tabs: this.tabs }) |
| 33 | BottomComponent() | 35 | BottomComponent() |
| 34 | } | 36 | } |
| 35 | .height('100%') | 37 | .height('100%') |
| @@ -45,6 +47,9 @@ export struct DetailPlayLivePage { | @@ -45,6 +47,9 @@ export struct DetailPlayLivePage { | ||
| 45 | .then( | 47 | .then( |
| 46 | (data) => { | 48 | (data) => { |
| 47 | if (data.length > 0) { | 49 | if (data.length > 0) { |
| 50 | + if (data[0].liveInfo?.liveState == 'wait') { | ||
| 51 | + this.tabs = ['简介', '直播间', '大家聊'] | ||
| 52 | + } | ||
| 48 | this.liveDetailsBean = data[0] | 53 | this.liveDetailsBean = data[0] |
| 49 | } | 54 | } |
| 50 | }, | 55 | }, |
| @@ -170,10 +170,10 @@ export class LiveModel { | @@ -170,10 +170,10 @@ export class LiveModel { | ||
| 170 | * @param isSubscribe | 170 | * @param isSubscribe |
| 171 | * @returns | 171 | * @returns |
| 172 | */ | 172 | */ |
| 173 | - liveAppointment(relationId: string, mLiveId: string, isSubscribe: boolean) { | 173 | + liveAppointment(relationId: string, liveId: string, isSubscribe: boolean) { |
| 174 | let params: Record<string, string> = {}; | 174 | let params: Record<string, string> = {}; |
| 175 | params['relationId'] = relationId | 175 | params['relationId'] = relationId |
| 176 | - params['liveId'] = mLiveId | 176 | + params['liveId'] = liveId |
| 177 | params['isSubscribe'] = `${isSubscribe}` | 177 | params['isSubscribe'] = `${isSubscribe}` |
| 178 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 178 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 179 | return new Promise<ResponseDTO<string>>((success, fail) => { | 179 | return new Promise<ResponseDTO<string>>((success, fail) => { |
| @@ -67,9 +67,9 @@ export class LiveViewModel { | @@ -67,9 +67,9 @@ export class LiveViewModel { | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | //直播预约/取消预约 | 69 | //直播预约/取消预约 |
| 70 | - liveAppointment(relationId: string, mLiveId: string, isSubscribe: boolean) { | 70 | + liveAppointment(relationId: string, liveId: string, isSubscribe: boolean) { |
| 71 | return new Promise<ResponseDTO<string>>((success, fail) => { | 71 | return new Promise<ResponseDTO<string>>((success, fail) => { |
| 72 | - this.liveModel.liveAppointment(relationId, mLiveId, isSubscribe).then((data) => { | 72 | + this.liveModel.liveAppointment(relationId, liveId, isSubscribe).then((data) => { |
| 73 | success(data) | 73 | success(data) |
| 74 | }).catch((message: string) => { | 74 | }).catch((message: string) => { |
| 75 | fail(message) | 75 | fail(message) |
| @@ -2,10 +2,12 @@ import font from '@ohos.font' | @@ -2,10 +2,12 @@ import font from '@ohos.font' | ||
| 2 | import { LiveDetailsBean } from 'wdBean/Index' | 2 | import { LiveDetailsBean } from 'wdBean/Index' |
| 3 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' | 3 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' |
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | +import { HttpUrlUtils } from 'wdNetwork/Index' | ||
| 6 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 5 | 7 | ||
| 6 | @Component | 8 | @Component |
| 7 | export struct LiveCountdownComponent { | 9 | export struct LiveCountdownComponent { |
| 8 | - @Consume @Watch('calculateDataStatus') liveDetailsBean: LiveDetailsBean | 10 | + @State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 9 | textTimerController: TextTimerController = new TextTimerController() | 11 | textTimerController: TextTimerController = new TextTimerController() |
| 10 | @State format: string = 'HH:mm:ss' | 12 | @State format: string = 'HH:mm:ss' |
| 11 | @State month: string = '' | 13 | @State month: string = '' |
| @@ -26,7 +28,8 @@ export struct LiveCountdownComponent { | @@ -26,7 +28,8 @@ export struct LiveCountdownComponent { | ||
| 26 | }) | 28 | }) |
| 27 | setTimeout(() => { | 29 | setTimeout(() => { |
| 28 | this.textTimerController.start() | 30 | this.textTimerController.start() |
| 29 | - }, 2000) | 31 | + }, 0) |
| 32 | + this.updateData() | ||
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | build() { | 35 | build() { |
| @@ -100,7 +103,7 @@ export struct LiveCountdownComponent { | @@ -100,7 +103,7 @@ export struct LiveCountdownComponent { | ||
| 100 | 103 | ||
| 101 | @Builder | 104 | @Builder |
| 102 | showAppointment() { | 105 | showAppointment() { |
| 103 | - Text('我要预约') | 106 | + Text(this.isAppointmentLive ? '取消预约' : '我要预约') |
| 104 | .width('100%') | 107 | .width('100%') |
| 105 | .height(42) | 108 | .height(42) |
| 106 | .textAlign(TextAlign.Center) | 109 | .textAlign(TextAlign.Center) |
| @@ -113,13 +116,17 @@ export struct LiveCountdownComponent { | @@ -113,13 +116,17 @@ export struct LiveCountdownComponent { | ||
| 113 | .border({ radius: 4 }) | 116 | .border({ radius: 4 }) |
| 114 | .backgroundColor(this.isAppointmentLive ? '#CCCCCC' : '#ED2800') | 117 | .backgroundColor(this.isAppointmentLive ? '#CCCCCC' : '#ED2800') |
| 115 | .onClick(() => { | 118 | .onClick(() => { |
| 119 | + if (!HttpUrlUtils.getUserId()) { | ||
| 120 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 121 | + return | ||
| 122 | + } | ||
| 116 | if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { | 123 | if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { |
| 117 | this.liveAppointment() | 124 | this.liveAppointment() |
| 118 | } | 125 | } |
| 119 | }) | 126 | }) |
| 120 | } | 127 | } |
| 121 | 128 | ||
| 122 | - calculateDataStatus() { | 129 | + updateData() { |
| 123 | if (!this.liveDetailsBean) { | 130 | if (!this.liveDetailsBean) { |
| 124 | return | 131 | return |
| 125 | } | 132 | } |
| 1 | -import { LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' | 2 | import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' |
| 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' |
| 4 | import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' | 4 | import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' |
| @@ -14,6 +14,7 @@ export struct TabChatComponent { | @@ -14,6 +14,7 @@ export struct TabChatComponent { | ||
| 14 | @State private pageModel: PageModel = new PageModel() | 14 | @State private pageModel: PageModel = new PageModel() |
| 15 | liveViewModel: LiveViewModel = new LiveViewModel() | 15 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 16 | @State liveChatList: Array<LiveRoomItemBean> = [] | 16 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 17 | + @Consume liveDetailsBean: LiveDetailsBean | ||
| 17 | 18 | ||
| 18 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 19 | this.getLiveChatList() | 20 | this.getLiveChatList() |
| @@ -77,7 +78,11 @@ export struct TabChatComponent { | @@ -77,7 +78,11 @@ export struct TabChatComponent { | ||
| 77 | 78 | ||
| 78 | getLiveChatList() { | 79 | getLiveChatList() { |
| 79 | this.pageModel.currentPage = 1 | 80 | this.pageModel.currentPage = 1 |
| 80 | - this.liveViewModel.getLiveChatList(1, '20000016257', '20000016229', 20,) | 81 | + this.liveViewModel.getLiveChatList( |
| 82 | + 1, | ||
| 83 | + this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | ||
| 84 | + this.liveDetailsBean?.newsId, | ||
| 85 | + 20,) | ||
| 81 | .then( | 86 | .then( |
| 82 | (data) => { | 87 | (data) => { |
| 83 | if (data.barrageResponses && data.barrageResponses.length > 0) { | 88 | if (data.barrageResponses && data.barrageResponses.length > 0) { |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index' | ||
| 2 | import { TabChatComponent } from './TabChatComponent' | 1 | import { TabChatComponent } from './TabChatComponent' |
| 3 | import { TabInfoComponent } from './TabInfoComponent' | 2 | import { TabInfoComponent } from './TabInfoComponent' |
| 4 | import { TabLiveComponent } from './TabLiveComponent' | 3 | import { TabLiveComponent } from './TabLiveComponent' |
| @@ -9,7 +8,7 @@ export struct TabComponent { | @@ -9,7 +8,7 @@ export struct TabComponent { | ||
| 9 | @State selectedFontColor: string = '#222222' | 8 | @State selectedFontColor: string = '#222222' |
| 10 | @State currentIndex: number = 0 | 9 | @State currentIndex: number = 0 |
| 11 | private controller: TabsController = new TabsController() | 10 | private controller: TabsController = new TabsController() |
| 12 | - tabs: string[] = ['简介', '直播间', '大家聊'] | 11 | + @Prop tabs: string[] = [] |
| 13 | 12 | ||
| 14 | aboutToAppear(): void { | 13 | aboutToAppear(): void { |
| 15 | 14 | ||
| @@ -19,12 +18,21 @@ export struct TabComponent { | @@ -19,12 +18,21 @@ export struct TabComponent { | ||
| 19 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { | 18 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { |
| 20 | ForEach(this.tabs, (item: string, index: number) => { | 19 | ForEach(this.tabs, (item: string, index: number) => { |
| 21 | TabContent() { | 20 | TabContent() { |
| 22 | - if (0 == index) { | ||
| 23 | - TabInfoComponent() | ||
| 24 | - } else if (1 == index) { | ||
| 25 | - TabLiveComponent() | ||
| 26 | - } else { | ||
| 27 | - TabChatComponent() | 21 | + if (this.tabs.length == 3) { |
| 22 | + if (0 == index) { | ||
| 23 | + TabInfoComponent() | ||
| 24 | + } else if (1 == index) { | ||
| 25 | + TabLiveComponent() | ||
| 26 | + } else { | ||
| 27 | + TabChatComponent() | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + else { | ||
| 31 | + if (0 == index) { | ||
| 32 | + TabLiveComponent() | ||
| 33 | + } else { | ||
| 34 | + TabChatComponent() | ||
| 35 | + } | ||
| 28 | } | 36 | } |
| 29 | }.tabBar(this.tabBuilder(index, item)) | 37 | }.tabBar(this.tabBuilder(index, item)) |
| 30 | .backgroundColor('#F5F5F5') | 38 | .backgroundColor('#F5F5F5') |
| @@ -12,13 +12,14 @@ export struct TabInfoComponent { | @@ -12,13 +12,14 @@ export struct TabInfoComponent { | ||
| 12 | Column() { | 12 | Column() { |
| 13 | this.showLiveTitle() | 13 | this.showLiveTitle() |
| 14 | this.showLiveDetails() | 14 | this.showLiveDetails() |
| 15 | - LiveCountdownComponent() | 15 | + LiveCountdownComponent({liveDetailsBean:this.liveDetailsBean}) |
| 16 | }.margin({ | 16 | }.margin({ |
| 17 | top: 13, | 17 | top: 13, |
| 18 | left: 16, | 18 | left: 16, |
| 19 | right: 16 | 19 | right: 16 |
| 20 | }) | 20 | }) |
| 21 | .height('100%') | 21 | .height('100%') |
| 22 | + .alignItems(HorizontalAlign.Start) | ||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | aboutToDisappear(): void { | 25 | aboutToDisappear(): void { |
| @@ -8,12 +8,16 @@ import { TabLiveItemComponent } from './TabLiveItemComponent' | @@ -8,12 +8,16 @@ import { TabLiveItemComponent } from './TabLiveItemComponent' | ||
| 8 | export struct TabLiveComponent { | 8 | export struct TabLiveComponent { |
| 9 | liveViewModel: LiveViewModel = new LiveViewModel() | 9 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 10 | @State liveList: Array<LiveRoomItemBean> = [] | 10 | @State liveList: Array<LiveRoomItemBean> = [] |
| 11 | - @Consume liveDetailsBean: LiveDetailsBean | 11 | + @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean |
| 12 | 12 | ||
| 13 | - aboutToAppear(): void { | 13 | + updateDate() { |
| 14 | this.getLiveList() | 14 | this.getLiveList() |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | + aboutToAppear(): void { | ||
| 18 | + | ||
| 19 | + } | ||
| 20 | + | ||
| 17 | build() { | 21 | build() { |
| 18 | Stack() { | 22 | Stack() { |
| 19 | if (this.liveList.length == 0) { | 23 | if (this.liveList.length == 0) { |
| @@ -39,7 +43,11 @@ export struct TabLiveComponent { | @@ -39,7 +43,11 @@ export struct TabLiveComponent { | ||
| 39 | } | 43 | } |
| 40 | 44 | ||
| 41 | getLiveList() { | 45 | getLiveList() { |
| 42 | - this.liveViewModel.getLiveList(1, '20000016257', '20000016229', 20,) | 46 | + this.liveViewModel.getLiveList( |
| 47 | + 1, | ||
| 48 | + this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | ||
| 49 | + this.liveDetailsBean?.newsId, | ||
| 50 | + 20) | ||
| 43 | .then( | 51 | .then( |
| 44 | (data) => { | 52 | (data) => { |
| 45 | /** | 53 | /** |
| @@ -75,6 +75,8 @@ export struct TabLiveItemComponent { | @@ -75,6 +75,8 @@ export struct TabLiveItemComponent { | ||
| 75 | left: 32, | 75 | left: 32, |
| 76 | top: 6 | 76 | top: 6 |
| 77 | }) | 77 | }) |
| 78 | + .width('100%') | ||
| 79 | + .textAlign(TextAlign.Start) | ||
| 78 | List() { | 80 | List() { |
| 79 | ForEach(this.item.pictureUrls, (item: string, index: number) => { | 81 | ForEach(this.item.pictureUrls, (item: string, index: number) => { |
| 80 | ListItem() { | 82 | ListItem() { |
| 1 | import { window } from '@kit.ArkUI' | 1 | import { window } from '@kit.ArkUI' |
| 2 | -import { DateTimeUtils, NumberFormatterUtils, WindowModel } from 'wdKit/Index' | 2 | +import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' |
| 3 | 3 | ||
| 4 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index' | 4 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index' |
| 5 | +import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' | ||
| 5 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 6 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' |
| 6 | -import { WDPlayerController } from 'wdPlayer/Index' | ||
| 7 | 7 | ||
| 8 | @Entry | 8 | @Entry |
| 9 | @Component | 9 | @Component |
| @@ -23,8 +23,8 @@ export struct PlayUIComponent { | @@ -23,8 +23,8 @@ export struct PlayUIComponent { | ||
| 23 | aboutToAppear(): void { | 23 | aboutToAppear(): void { |
| 24 | //播放进度监听 | 24 | //播放进度监听 |
| 25 | this.playerController.onTimeUpdate = (position: number, duration: number) => { | 25 | this.playerController.onTimeUpdate = (position: number, duration: number) => { |
| 26 | - this.currentTime = DateTimeUtils.secondToTime(position); | ||
| 27 | - this.totalTime = DateTimeUtils.secondToTime(duration); | 26 | + this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); |
| 27 | + this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); | ||
| 28 | this.progressVal = Math.floor(position * 100 / duration); | 28 | this.progressVal = Math.floor(position * 100 / duration); |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| @@ -51,14 +51,18 @@ export struct PlayUIComponent { | @@ -51,14 +51,18 @@ export struct PlayUIComponent { | ||
| 51 | .margin({ | 51 | .margin({ |
| 52 | right: 10 | 52 | right: 10 |
| 53 | }) | 53 | }) |
| 54 | - Text(this.liveDetailsBean.newsTitle) | ||
| 55 | - .maxLines(1) | ||
| 56 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 57 | - .fontSize('16fp') | ||
| 58 | - .fontWeight(500) | ||
| 59 | - .fontColor(Color.White) | ||
| 60 | - .textAlign(TextAlign.Start) | ||
| 61 | - .layoutWeight(1) | 54 | + if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { |
| 55 | + Text(this.liveDetailsBean.newsTitle) | ||
| 56 | + .maxLines(1) | ||
| 57 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 58 | + .fontSize('16fp') | ||
| 59 | + .fontWeight(500) | ||
| 60 | + .fontColor(Color.White) | ||
| 61 | + .textAlign(TextAlign.Start) | ||
| 62 | + .layoutWeight(1) | ||
| 63 | + } else { | ||
| 64 | + Blank() | ||
| 65 | + } | ||
| 62 | Image($r('app.media.icon_share')) | 66 | Image($r('app.media.icon_share')) |
| 63 | .width(24) | 67 | .width(24) |
| 64 | .aspectRatio(1) | 68 | .aspectRatio(1) |
| @@ -67,13 +71,13 @@ export struct PlayUIComponent { | @@ -67,13 +71,13 @@ export struct PlayUIComponent { | ||
| 67 | .width('100%') | 71 | .width('100%') |
| 68 | .alignItems(VerticalAlign.Center) | 72 | .alignItems(VerticalAlign.Center) |
| 69 | .margin({ | 73 | .margin({ |
| 70 | - bottom: 5 | 74 | + bottom: 10 |
| 71 | }) | 75 | }) |
| 72 | 76 | ||
| 73 | this.getLiveStatusView() | 77 | this.getLiveStatusView() |
| 74 | }.width('100%') | 78 | }.width('100%') |
| 75 | .padding({ | 79 | .padding({ |
| 76 | - top: 10, | 80 | + top: 20, |
| 77 | bottom: 6, | 81 | bottom: 6, |
| 78 | left: 10, | 82 | left: 10, |
| 79 | right: 10 | 83 | right: 10 |
| @@ -84,29 +88,73 @@ export struct PlayUIComponent { | @@ -84,29 +88,73 @@ export struct PlayUIComponent { | ||
| 84 | 88 | ||
| 85 | @Builder | 89 | @Builder |
| 86 | getLiveStatusView() { | 90 | getLiveStatusView() { |
| 87 | - //预约 | ||
| 88 | - //直播中 | 91 | + // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 92 | + // 预约 | ||
| 93 | + if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { | ||
| 94 | + Row() { | ||
| 95 | + Image($r('app.media.icon_live_status_wait')) | ||
| 96 | + .width(22) | ||
| 97 | + .height(18) | ||
| 98 | + Text('预约') | ||
| 99 | + .fontSize('11fp') | ||
| 100 | + .fontWeight(400) | ||
| 101 | + .fontColor(Color.White) | ||
| 102 | + } | ||
| 103 | + .backgroundColor('#4D000000') | ||
| 104 | + .padding({ | ||
| 105 | + top: 1, | ||
| 106 | + right: 4, | ||
| 107 | + bottom: 1 | ||
| 108 | + }) | ||
| 109 | + } | ||
| 110 | + // 直播中 | ||
| 111 | + else if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | ||
| 112 | + Row() { | ||
| 113 | + Image($r('app.media.icon_live_status_running')) | ||
| 114 | + .width(22) | ||
| 115 | + .height(18) | ||
| 116 | + Text('直播中') | ||
| 117 | + .fontSize('11fp') | ||
| 118 | + .fontWeight(400) | ||
| 119 | + .fontColor(Color.White) | ||
| 120 | + Image($r('app.media.icon_live_player_status_end')) | ||
| 121 | + .width(12) | ||
| 122 | + .height(12) | ||
| 123 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) | ||
| 124 | + .fontSize('11fp') | ||
| 125 | + .fontWeight(400) | ||
| 126 | + .fontColor(Color.White) | ||
| 127 | + } | ||
| 128 | + .backgroundColor('#4D000000') | ||
| 129 | + .padding({ | ||
| 130 | + top: 1, | ||
| 131 | + right: 4, | ||
| 132 | + bottom: 1 | ||
| 133 | + }) | ||
| 134 | + } | ||
| 89 | //回看 | 135 | //回看 |
| 90 | - Row() { | ||
| 91 | - Text('回看') | ||
| 92 | - .fontSize('11fp') | ||
| 93 | - .fontWeight(400) | ||
| 94 | - .fontColor(Color.White) | ||
| 95 | - Image($r('app.media.icon_live_player_status_end')) | ||
| 96 | - .width(12) | ||
| 97 | - .height(12) | ||
| 98 | - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) | ||
| 99 | - .fontSize('11fp') | ||
| 100 | - .fontWeight(400) | ||
| 101 | - .fontColor(Color.White) | 136 | + else if (this.liveDetailsBean.liveInfo?.liveState == 'end') { |
| 137 | + Row() { | ||
| 138 | + Text('回看') | ||
| 139 | + .fontSize('11fp') | ||
| 140 | + .fontWeight(400) | ||
| 141 | + .fontColor(Color.White) | ||
| 142 | + Image($r('app.media.icon_live_player_status_end')) | ||
| 143 | + .width(12) | ||
| 144 | + .height(12) | ||
| 145 | + Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) | ||
| 146 | + .fontSize('11fp') | ||
| 147 | + .fontWeight(400) | ||
| 148 | + .fontColor(Color.White) | ||
| 149 | + } | ||
| 150 | + .backgroundColor('#4D000000') | ||
| 151 | + .padding({ | ||
| 152 | + left: 4, | ||
| 153 | + top: 1, | ||
| 154 | + right: 4, | ||
| 155 | + bottom: 1 | ||
| 156 | + }) | ||
| 102 | } | 157 | } |
| 103 | - .backgroundColor('#4D000000') | ||
| 104 | - .padding({ | ||
| 105 | - left: 4, | ||
| 106 | - top: 1, | ||
| 107 | - right: 4, | ||
| 108 | - bottom: 1 | ||
| 109 | - }) | ||
| 110 | } | 158 | } |
| 111 | 159 | ||
| 112 | @Builder | 160 | @Builder |
| @@ -122,24 +170,28 @@ export struct PlayUIComponent { | @@ -122,24 +170,28 @@ export struct PlayUIComponent { | ||
| 122 | @Builder | 170 | @Builder |
| 123 | getBottomUIComponent() { | 171 | getBottomUIComponent() { |
| 124 | Row() { | 172 | Row() { |
| 125 | - this.playOrPauseBtn() | ||
| 126 | - Text(this.currentTime) | ||
| 127 | - .fontColor(Color.White) | ||
| 128 | - .fontWeight(600) | ||
| 129 | - .fontSize('12fp') | ||
| 130 | - .margin({ | ||
| 131 | - left: 16 | ||
| 132 | - }) | 173 | + if (this.liveDetailsBean?.liveInfo?.liveState == 'end') { |
| 174 | + this.playOrPauseBtn() | ||
| 175 | + Text(this.currentTime) | ||
| 176 | + .fontColor(Color.White) | ||
| 177 | + .fontWeight(600) | ||
| 178 | + .fontSize('12fp') | ||
| 179 | + .margin({ | ||
| 180 | + left: 16 | ||
| 181 | + }) | ||
| 133 | 182 | ||
| 134 | - this.playProgressView() | 183 | + this.playProgressView() |
| 135 | 184 | ||
| 136 | - Text(this.totalTime) | ||
| 137 | - .fontColor(Color.White) | ||
| 138 | - .fontWeight(600) | ||
| 139 | - .fontSize('12fp') | ||
| 140 | - .margin({ | ||
| 141 | - right: 16 | ||
| 142 | - }) | 185 | + Text(this.totalTime) |
| 186 | + .fontColor(Color.White) | ||
| 187 | + .fontWeight(600) | ||
| 188 | + .fontSize('12fp') | ||
| 189 | + .margin({ | ||
| 190 | + right: 16 | ||
| 191 | + }) | ||
| 192 | + } else { | ||
| 193 | + Blank() | ||
| 194 | + } | ||
| 143 | Image($r('app.media.icon_live_player_full_screen')) | 195 | Image($r('app.media.icon_live_player_full_screen')) |
| 144 | .width(24) | 196 | .width(24) |
| 145 | .height(24) | 197 | .height(24) |
| @@ -183,16 +235,19 @@ export struct PlayUIComponent { | @@ -183,16 +235,19 @@ export struct PlayUIComponent { | ||
| 183 | Slider({ | 235 | Slider({ |
| 184 | value: this.progressVal, | 236 | value: this.progressVal, |
| 185 | step: 1, | 237 | step: 1, |
| 186 | - // style: SliderStyle.OutSet | 238 | + style: SliderStyle.OutSet |
| 187 | }) | 239 | }) |
| 188 | - .blockStyle({ | ||
| 189 | - type: SliderBlockType.IMAGE, | ||
| 190 | - image: $r('app.media.ic_player_block') | ||
| 191 | - }) | 240 | + .blockSize({ |
| 241 | + width: 18, | ||
| 242 | + height: 12 | ||
| 243 | + })// .blockStyle({ | ||
| 244 | + // type: SliderBlockType.IMAGE, | ||
| 245 | + // image: $r('app.media.ic_player_block') | ||
| 246 | + // }) | ||
| 192 | .blockColor(Color.White) | 247 | .blockColor(Color.White) |
| 193 | .trackColor('#4DFFFFFF') | 248 | .trackColor('#4DFFFFFF') |
| 194 | .selectedColor('#FFED2800') | 249 | .selectedColor('#FFED2800') |
| 195 | - .height(2) | 250 | + .height(14) |
| 196 | .trackThickness(1) | 251 | .trackThickness(1) |
| 197 | .layoutWeight(1) | 252 | .layoutWeight(1) |
| 198 | .margin({ | 253 | .margin({ |
| @@ -6,6 +6,8 @@ import { PlayUIComponent } from './PlayUIComponent'; | @@ -6,6 +6,8 @@ import { PlayUIComponent } from './PlayUIComponent'; | ||
| 6 | export struct TopPlayComponent { | 6 | export struct TopPlayComponent { |
| 7 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 7 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 8 | playerController: WDPlayerController = new WDPlayerController(); | 8 | playerController: WDPlayerController = new WDPlayerController(); |
| 9 | + @State imgUrl: string = '' | ||
| 10 | + @State isWait: boolean = false | ||
| 9 | 11 | ||
| 10 | aboutToAppear(): void { | 12 | aboutToAppear(): void { |
| 11 | this.playerController.onCanplay = () => { | 13 | this.playerController.onCanplay = () => { |
| @@ -14,8 +16,18 @@ export struct TopPlayComponent { | @@ -14,8 +16,18 @@ export struct TopPlayComponent { | ||
| 14 | } | 16 | } |
| 15 | 17 | ||
| 16 | updateData() { | 18 | updateData() { |
| 19 | + //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | ||
| 20 | + if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | ||
| 21 | + this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | ||
| 22 | + } | ||
| 23 | + this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | ||
| 17 | if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | 24 | if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { |
| 18 | - let playUrl: string = this.liveDetailsBean.liveInfo.vlive[0].replayUri | 25 | + let playUrl = '' |
| 26 | + if (this.liveDetailsBean.liveInfo.liveState == 'running') { | ||
| 27 | + playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | ||
| 28 | + } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 29 | + playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | ||
| 30 | + } | ||
| 19 | this.playerController.firstPlay(playUrl); | 31 | this.playerController.firstPlay(playUrl); |
| 20 | } | 32 | } |
| 21 | } | 33 | } |
| @@ -29,6 +41,10 @@ export struct TopPlayComponent { | @@ -29,6 +41,10 @@ export struct TopPlayComponent { | ||
| 29 | }) | 41 | }) |
| 30 | .height('100%') | 42 | .height('100%') |
| 31 | .width('100%') | 43 | .width('100%') |
| 44 | + .visibility(this.isWait ? Visibility.None : Visibility.Visible) | ||
| 45 | + Image(this.imgUrl) | ||
| 46 | + .objectFit(ImageFit.Contain) | ||
| 47 | + .visibility(this.isWait ? Visibility.Visible : Visibility.None) | ||
| 32 | PlayUIComponent({ playerController: this.playerController }) | 48 | PlayUIComponent({ playerController: this.playerController }) |
| 33 | } | 49 | } |
| 34 | .height(211) | 50 | .height(211) |
| @@ -37,5 +53,7 @@ export struct TopPlayComponent { | @@ -37,5 +53,7 @@ export struct TopPlayComponent { | ||
| 37 | 53 | ||
| 38 | aboutToDisappear(): void { | 54 | aboutToDisappear(): void { |
| 39 | this.playerController.pause() | 55 | this.playerController.pause() |
| 56 | + this.playerController.stop() | ||
| 57 | + this.playerController.release() | ||
| 40 | } | 58 | } |
| 41 | } | 59 | } |
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/icon_live_status_running.png
0 → 100644
1.26 KB
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/icon_live_status_wait.png
0 → 100644
1.83 KB
| @@ -59,7 +59,9 @@ struct GuidePages { | @@ -59,7 +59,9 @@ struct GuidePages { | ||
| 59 | .onClick(() => { | 59 | .onClick(() => { |
| 60 | if (index == 3) { | 60 | if (index == 3) { |
| 61 | // 跳转到首页 | 61 | // 跳转到首页 |
| 62 | - WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 62 | + //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 63 | + //跳转到兴趣偏好选择页 | ||
| 64 | + WDRouterRule.jumpWithReplacePage(WDRouterPage.launchInterestsPage) | ||
| 63 | } | 65 | } |
| 64 | }) | 66 | }) |
| 65 | .id('index') | 67 | .id('index') |
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
0 → 100644
| 1 | +import {InterestsHobbiesModel, InterestsList} from '../viewModel/InterestsHobbiesModel' | ||
| 2 | +import { WDRouterRule } from 'wdRouter'; | ||
| 3 | +import { WDRouterPage } from 'wdRouter'; | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +struct LaunchInterestsHobbiesPage { | ||
| 8 | + @State message: string = 'Hello World' | ||
| 9 | + @State dataArray: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | ||
| 10 | + @State selectCount: number = 0 | ||
| 11 | + @State interestsArray: InterestsList[] = [] | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + aboutToAppear(){ | ||
| 15 | + //请求接口,获取兴趣偏好数据 | ||
| 16 | + this.requestInterestsData() | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + build() { | ||
| 21 | + Column() { | ||
| 22 | + Row(){ | ||
| 23 | + Blank() | ||
| 24 | + Text('跳过') | ||
| 25 | + .fontSize('27lpx') | ||
| 26 | + .fontColor('#333333') | ||
| 27 | + .width('54lpx') | ||
| 28 | + .height('35lpx') | ||
| 29 | + .margin({top:'27lpx',right:'46lpx'}) | ||
| 30 | + .onClick(()=>{ | ||
| 31 | + //直接跳过到首页 | ||
| 32 | + //跳转首页 | ||
| 33 | + WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | ||
| 34 | + }) | ||
| 35 | + } | ||
| 36 | + .width('100%') | ||
| 37 | + .justifyContent(FlexAlign.End) | ||
| 38 | + | ||
| 39 | + Text('选择感兴趣的内容') | ||
| 40 | + .fontSize('46lpx') | ||
| 41 | + .fontWeight(FontWeight.Bold) | ||
| 42 | + .textAlign(TextAlign.Center) | ||
| 43 | + .fontColor('#333333') | ||
| 44 | + .width('100%') | ||
| 45 | + .height('61lpx') | ||
| 46 | + .margin({top:'84lpx'}) | ||
| 47 | + Text('完善信息,将为您推荐个性化的内容') | ||
| 48 | + .fontSize('27lpx') | ||
| 49 | + .textAlign(TextAlign.Center) | ||
| 50 | + .fontColor('#9E9E9E') | ||
| 51 | + .width('100%') | ||
| 52 | + .height('35lpx') | ||
| 53 | + .margin({top:'12lpx'}) | ||
| 54 | + | ||
| 55 | + Grid( ){ | ||
| 56 | + ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | ||
| 57 | + GridItem(){ | ||
| 58 | + Stack({alignContent:Alignment.TopStart}){ | ||
| 59 | + | ||
| 60 | + Image(item.pic) | ||
| 61 | + .width('100%') | ||
| 62 | + .height('100%') | ||
| 63 | + .backgroundColor(Color.White) | ||
| 64 | + .borderRadius(5) | ||
| 65 | + Stack(){ | ||
| 66 | + Column({}){ | ||
| 67 | + Text(item.name) | ||
| 68 | + .fontSize('35lpx') | ||
| 69 | + .fontColor('#FFFFFF') | ||
| 70 | + .margin({top:'21lpx',left:'19lpx'}) | ||
| 71 | + .width('100%') | ||
| 72 | + .height('46lpx') | ||
| 73 | + .fontWeight(FontWeight.Bold) | ||
| 74 | + Text(item.title) | ||
| 75 | + .fontSize('23lpx') | ||
| 76 | + .fontColor('#FFFFFF') | ||
| 77 | + .margin({top:'2lpx',left:'19lpx'}) | ||
| 78 | + .width('100%') | ||
| 79 | + .height('31lpx') | ||
| 80 | + }.justifyContent(FlexAlign.Start) | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + Stack(){ | ||
| 84 | + Image('') | ||
| 85 | + .width('100%') | ||
| 86 | + .height('100%') | ||
| 87 | + .backgroundColor(Color.White) | ||
| 88 | + .opacity(item.choose?0:0.7) | ||
| 89 | + .borderRadius(5) | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + .width('192lpx') | ||
| 94 | + .height('230lpx') | ||
| 95 | + .borderRadius('8lpx') | ||
| 96 | + .onClick(()=>{ | ||
| 97 | + //选择后改变已选择属性 | ||
| 98 | + item.choose = !item.choose | ||
| 99 | + this.interestsArray.splice(index,1,item) | ||
| 100 | + this.selectCount = this.interestsArray.filter(item => item.choose).length | ||
| 101 | + }) | ||
| 102 | + | ||
| 103 | + }) | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + .width('90%') | ||
| 107 | + .height('70%') | ||
| 108 | + .margin({top:'61lpx'}) | ||
| 109 | + .columnsTemplate('1fr 1fr 1fr') | ||
| 110 | + // .rowsTemplate('1fr 1fr 1fr 1fr') | ||
| 111 | + .columnsGap('23lpx') | ||
| 112 | + .rowsGap('23lpx') | ||
| 113 | + | ||
| 114 | + Stack({alignContent:Alignment.Center}){ | ||
| 115 | + Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') | ||
| 116 | + .fontSize('35lpx') | ||
| 117 | + .fontColor('#FFFFFF') | ||
| 118 | + .backgroundColor('#ED2800') | ||
| 119 | + .type(ButtonType.Normal) | ||
| 120 | + .borderRadius('10lpx') | ||
| 121 | + .width('662lpx') | ||
| 122 | + .height('84lpx') | ||
| 123 | + .onClick(()=>{ | ||
| 124 | + //跳转首页 | ||
| 125 | + WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | ||
| 126 | + }) | ||
| 127 | + } | ||
| 128 | + .width('100%') | ||
| 129 | + .height('108lpx') | ||
| 130 | + // .position({y:}) | ||
| 131 | + // .margin({bottom:'1',top:'1'}) | ||
| 132 | + .backgroundColor('#FFFFFF') | ||
| 133 | + | ||
| 134 | + } | ||
| 135 | + .width('100%') | ||
| 136 | + .height('100%') | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + | ||
| 140 | + requestInterestsData() { | ||
| 141 | + //请求隐私协议接口 | ||
| 142 | + let interestsModel = new InterestsHobbiesModel() | ||
| 143 | + interestsModel.getInterestsHobbiesData() | ||
| 144 | + .then((value:InterestsList[])=>{ | ||
| 145 | + this.interestsArray = value | ||
| 146 | + }) | ||
| 147 | + .catch((err:Error)=>{ | ||
| 148 | + console.log('获取兴趣偏好数据出错' + err) | ||
| 149 | + }) | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | +} |
| 1 | +import HashMap from '@ohos.util.HashMap'; | ||
| 2 | +import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | ||
| 3 | +import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; | ||
| 4 | +import { Logger, SPHelper } from 'wdKit/Index'; | ||
| 5 | +import data from '@ohos.telephony.data'; | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +export interface InterestsBean { | ||
| 9 | + | ||
| 10 | + // code : string | ||
| 11 | + // message : string | ||
| 12 | + // success : boolean | ||
| 13 | + // timestamp : number | ||
| 14 | + data : InterestsList[] | ||
| 15 | + | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +export interface InterestsList{ | ||
| 20 | + | ||
| 21 | + id : number | ||
| 22 | + title : string | ||
| 23 | + pic : string | ||
| 24 | + name : string | ||
| 25 | + choose : boolean | ||
| 26 | + | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +export class InterestsHobbiesModel { | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + getInterestsHobbiesData() { | ||
| 34 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 35 | + return new Promise<InterestsList[]>((success, fail) => { | ||
| 36 | + HttpRequest.get<ResponseDTO<InterestsList[]>>(HttpUrlUtils.getInterestsUrl(), headers).then((data: ResponseDTO<InterestsList[]>) => { | ||
| 37 | + if (!data || !data.data) { | ||
| 38 | + fail("数据为空") | ||
| 39 | + return | ||
| 40 | + } | ||
| 41 | + if (data.code != 0) { | ||
| 42 | + fail(data.message) | ||
| 43 | + return | ||
| 44 | + } | ||
| 45 | + Logger.debug("InterestsHobbiesModel兴趣偏好数据获取成功:success ", JSON.stringify(data)) | ||
| 46 | + success(data.data); | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + //保存数据 | ||
| 50 | + // for (let i = 0; i < data.data.length; i++) { | ||
| 51 | + // if (data.data[i].type == 1) { | ||
| 52 | + // SPHelper.default.save(SpConstants.USER_PROTOCOL, data.data[i].linkUrl) | ||
| 53 | + // } else if (data.data[i].type == 2) { | ||
| 54 | + // SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl) | ||
| 55 | + // } | ||
| 56 | + // } | ||
| 57 | + | ||
| 58 | + }, (error: Error) => { | ||
| 59 | + Logger.debug("InterestsHobbiesModel兴趣偏好数据获取失败:error ", error.toString()) | ||
| 60 | + fail(error.message) | ||
| 61 | + }) | ||
| 62 | + }) | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + | ||
| 68 | +} |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | "pages/launchPage/LaunchPage", | 11 | "pages/launchPage/LaunchPage", |
| 12 | "pages/launchPage/LaunchAdvertisingPage", | 12 | "pages/launchPage/LaunchAdvertisingPage", |
| 13 | "pages/broadcast/BroadcastPage", | 13 | "pages/broadcast/BroadcastPage", |
| 14 | + "pages/launchPage/LaunchInterestsHobbiesPage", | ||
| 14 | "pages/SpacialTopicPage" | 15 | "pages/SpacialTopicPage" |
| 15 | ] | 16 | ] |
| 16 | -} | 17 | +} |
-
Please register or login to post a comment