Showing
15 changed files
with
216 additions
and
56 deletions
| @@ -67,6 +67,8 @@ export function registerRouter() { | @@ -67,6 +67,8 @@ export function registerRouter() { | ||
| 67 | return WDRouterPage.multiPictureDetailPage | 67 | return WDRouterPage.multiPictureDetailPage |
| 68 | } else if (action.params?.detailPageType == 13) { | 68 | } else if (action.params?.detailPageType == 13) { |
| 69 | return WDRouterPage.audioDetail | 69 | return WDRouterPage.audioDetail |
| 70 | + } else if (action.params?.detailPageType == 18) { | ||
| 71 | + return WDRouterPage.multiPictureListPage | ||
| 70 | } | 72 | } |
| 71 | return WDRouterPage.detailPlayVodPage | 73 | return WDRouterPage.detailPlayVodPage |
| 72 | }) | 74 | }) |
| @@ -56,6 +56,8 @@ export class WDRouterPage { | @@ -56,6 +56,8 @@ export class WDRouterPage { | ||
| 56 | static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage"); | 56 | static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage"); |
| 57 | // 多图(图集)详情页 | 57 | // 多图(图集)详情页 |
| 58 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); | 58 | static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); |
| 59 | + //大图列表页 | ||
| 60 | + static multiPictureListPage = new WDRouterPage("wdComponent", "ets/pages/MultiPictureListPage"); | ||
| 59 | // 音乐详情页 | 61 | // 音乐详情页 |
| 60 | static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail"); | 62 | static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail"); |
| 61 | // 动态详情页 | 63 | // 动态详情页 |
| 1 | import { LabelDTO } from './LabelDTO'; | 1 | import { LabelDTO } from './LabelDTO'; |
| 2 | import { ItemDTO } from '../../ItemDTO'; | 2 | import { ItemDTO } from '../../ItemDTO'; |
| 3 | +import { PhotoListBean } from '../../detail/MultiPictureDetailPageDTO'; | ||
| 3 | 4 | ||
| 4 | // 附加字段集合,不同组件,额外附加参数不同 | 5 | // 附加字段集合,不同组件,额外附加参数不同 |
| 5 | export interface ExtraDTO extends ItemDTO { | 6 | export interface ExtraDTO extends ItemDTO { |
| @@ -12,5 +13,6 @@ export interface ExtraDTO extends ItemDTO { | @@ -12,5 +13,6 @@ export interface ExtraDTO extends ItemDTO { | ||
| 12 | sourcePage: string; | 13 | sourcePage: string; |
| 13 | relId: string; | 14 | relId: string; |
| 14 | relType: string; | 15 | relType: string; |
| 15 | - liveStreamType?: number | 16 | + liveStreamType?: number; |
| 17 | + photoList: PhotoListBean[]; | ||
| 16 | } | 18 | } |
| @@ -18,6 +18,7 @@ export interface Params { | @@ -18,6 +18,7 @@ export interface Params { | ||
| 18 | // 8.专辑竖屏详情页 | 18 | // 8.专辑竖屏详情页 |
| 19 | // 13.音频详情页 | 19 | // 13.音频详情页 |
| 20 | // 17.多图(图集)详情页 | 20 | // 17.多图(图集)详情页 |
| 21 | + // 18.大图列表页 | ||
| 21 | detailPageType?: number; // 详情页类型 | 22 | detailPageType?: number; // 详情页类型 |
| 22 | liveStyle?: number; // 直播类型:0横屏,1竖屏 | 23 | liveStyle?: number; // 直播类型:0横屏,1竖屏 |
| 23 | creatorId?: string; //号主id | 24 | creatorId?: string; //号主id |
| @@ -170,7 +170,7 @@ export struct EmptyComponent { | @@ -170,7 +170,7 @@ export struct EmptyComponent { | ||
| 170 | imageString = $r('app.media.icon_no_end') | 170 | imageString = $r('app.media.icon_no_end') |
| 171 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) { | 171 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) { |
| 172 | imageString = $r('app.media.icon_no_content') | 172 | imageString = $r('app.media.icon_no_content') |
| 173 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) { | 173 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1) { |
| 174 | imageString = $r('app.media.icon_no_appointmentMade') | 174 | imageString = $r('app.media.icon_no_appointmentMade') |
| 175 | } | 175 | } |
| 176 | return imageString | 176 | return imageString |
| @@ -12,7 +12,7 @@ import { http } from '@kit.NetworkKit'; | @@ -12,7 +12,7 @@ import { http } from '@kit.NetworkKit'; | ||
| 12 | @Reusable | 12 | @Reusable |
| 13 | @Component | 13 | @Component |
| 14 | export struct ImageItemView { | 14 | export struct ImageItemView { |
| 15 | - @Consume private bgc: Color; | 15 | + // @Consume private bgc: Color; |
| 16 | @Link isEnableSwipe: boolean; // TODO:需求:多图切换 | 16 | @Link isEnableSwipe: boolean; // TODO:需求:多图切换 |
| 17 | @State isEnableOffset: boolean = false; | 17 | @State isEnableOffset: boolean = false; |
| 18 | @State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3); | 18 | @State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3); |
| 1 | +import { PhotoListBean } from 'wdBean/Index'; | ||
| 2 | +import { display, router } from '@kit.ArkUI'; | ||
| 3 | +import { Logger } from 'wdKit/Index'; | ||
| 4 | +import { ImageItemView } from '../components/view/ImageItemView'; | ||
| 5 | +import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; | ||
| 6 | +import { Action } from 'wdBean'; | ||
| 7 | + | ||
| 8 | +const TAG = 'MultiPictureListPage'; | ||
| 9 | + | ||
| 10 | +@Entry | ||
| 11 | +@Component | ||
| 12 | +export struct MultiPictureListPage { | ||
| 13 | + @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' | ||
| 14 | + private scroller: Scroller = new Scroller() | ||
| 15 | + @State swiperIndex: number = 0; | ||
| 16 | + photoList: PhotoListBean[] = []; | ||
| 17 | + private swiperController: SwiperController = new SwiperController() | ||
| 18 | + private displayTool = display.getDefaultDisplaySync() | ||
| 19 | + private screenWidth: number = 0 | ||
| 20 | + private picWidth: number = 0 | ||
| 21 | + @State picHeight: number = 0 | ||
| 22 | + @State isEnableSwipe: boolean = true; | ||
| 23 | + | ||
| 24 | + // @Provide bgc: Color = Color.White; | ||
| 25 | + | ||
| 26 | + //watch监听页码回调 | ||
| 27 | + onCurrentPageNumUpdated(): void { | ||
| 28 | + Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,) | ||
| 29 | + let _swiperIndex = Number.parseInt(this.currentPageNum) | ||
| 30 | + Logger.info(TAG, `_swiperIndex:${_swiperIndex}`) | ||
| 31 | + this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + aboutToAppear(): void { | ||
| 35 | + //获取宽高尺寸 | ||
| 36 | + this.screenWidth = this.displayTool.width | ||
| 37 | + // this.picWidth = this.screenWidth - vp2px(52) | ||
| 38 | + this.picWidth = this.screenWidth | ||
| 39 | + this.picHeight = this.picWidth * 578 / 375 | ||
| 40 | + let par: Action = router.getParams() as Action; | ||
| 41 | + let params = par?.params; | ||
| 42 | + this.photoList = params?.extra?.photoList || []; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + build() { | ||
| 46 | + RelativeContainer() { | ||
| 47 | + Image($r('app.media.icon_arrow_left_white')) | ||
| 48 | + .width(24) | ||
| 49 | + .height(24) | ||
| 50 | + .aspectRatio(1) | ||
| 51 | + .interpolation(ImageInterpolation.High) | ||
| 52 | + .alignRules({ | ||
| 53 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 54 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 55 | + }) | ||
| 56 | + .onClick(() => { | ||
| 57 | + router.back(); | ||
| 58 | + }) | ||
| 59 | + .id("backImg") | ||
| 60 | + | ||
| 61 | + if (this.photoList && this.photoList?.length > 0) { | ||
| 62 | + Swiper(this.swiperController) { | ||
| 63 | + ForEach(this.photoList, (item: PhotoListBean) => { | ||
| 64 | + // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 65 | + ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | ||
| 66 | + }) | ||
| 67 | + } | ||
| 68 | + .index(this.swiperIndex) | ||
| 69 | + .width('100%') | ||
| 70 | + .height(px2vp(this.picHeight) + 32) | ||
| 71 | + .vertical(false) | ||
| 72 | + .autoPlay(false) | ||
| 73 | + .cachedCount(3) | ||
| 74 | + .indicator(false) | ||
| 75 | + .displayCount(1) | ||
| 76 | + .id('e_swiper_content') | ||
| 77 | + .alignRules({ | ||
| 78 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 79 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 80 | + }) | ||
| 81 | + .onChange((index: number) => { | ||
| 82 | + this.swiperIndex = index | ||
| 83 | + }) | ||
| 84 | + | ||
| 85 | + Row() { | ||
| 86 | + Scroll(this.scroller) { | ||
| 87 | + Row() { | ||
| 88 | + Flex({ | ||
| 89 | + direction: FlexDirection.Column, | ||
| 90 | + justifyContent: FlexAlign.Start | ||
| 91 | + }) { | ||
| 92 | + Text() { | ||
| 93 | + Span(`${this.swiperIndex + 1}`) | ||
| 94 | + .fontSize(24) | ||
| 95 | + .fontFamily('PingFang SC-Medium') | ||
| 96 | + .fontWeight(500) | ||
| 97 | + .lineHeight(28) | ||
| 98 | + Span(`/${this.photoList.length}`) | ||
| 99 | + .fontSize(14) | ||
| 100 | + .fontFamily('PingFang SC-Medium') | ||
| 101 | + .fontWeight(500) | ||
| 102 | + .lineHeight(19) | ||
| 103 | + }.fontColor(Color.White).margin(4) | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + .width('100%') | ||
| 107 | + .margin({ | ||
| 108 | + top: 8, | ||
| 109 | + left: 18, | ||
| 110 | + bottom: 24, | ||
| 111 | + right: 18 | ||
| 112 | + }) | ||
| 113 | + } | ||
| 114 | + .scrollable(ScrollDirection.Vertical) | ||
| 115 | + .scrollBarWidth(0) | ||
| 116 | + } | ||
| 117 | + .id('e_swiper_titles') | ||
| 118 | + .alignRules({ | ||
| 119 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 120 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 121 | + }) | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath }) | ||
| 125 | + .alignRules({ | ||
| 126 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 127 | + right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 128 | + }) | ||
| 129 | + .margin({ | ||
| 130 | + top: 8, | ||
| 131 | + left: 18, | ||
| 132 | + bottom: 24, | ||
| 133 | + right: 18 | ||
| 134 | + }) | ||
| 135 | + .id("downloadImg") | ||
| 136 | + } | ||
| 137 | + .width('100%') | ||
| 138 | + .height('100%') | ||
| 139 | + .backgroundColor(Color.Black) | ||
| 140 | + .id('e_picture_container') | ||
| 141 | + // 设置顶部绘制延伸到状态栏 | ||
| 142 | + // 设置底部绘制延伸到导航条 | ||
| 143 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 144 | + } | ||
| 145 | +} |
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | "pages/OtherNormalUserHomePage", | 16 | "pages/OtherNormalUserHomePage", |
| 17 | "pages/SearchPage", | 17 | "pages/SearchPage", |
| 18 | "pages/SearchCreatorPage", | 18 | "pages/SearchCreatorPage", |
| 19 | - "components/page/PeopleShipHomePage" | 19 | + "components/page/PeopleShipHomePage", |
| 20 | + "pages/MultiPictureListPage" | ||
| 20 | ] | 21 | ] |
| 21 | } | 22 | } |
| @@ -22,7 +22,7 @@ export struct DetailPlayLivePage { | @@ -22,7 +22,7 @@ export struct DetailPlayLivePage { | ||
| 22 | @State relType: string = '' | 22 | @State relType: string = '' |
| 23 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | 23 | @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean |
| 24 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 24 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 25 | - @State tabs: string[] = ['直播间', '大家聊'] | 25 | + @State tabs: string[] = [] |
| 26 | 26 | ||
| 27 | aboutToAppear(): void { | 27 | aboutToAppear(): void { |
| 28 | //监听屏幕横竖屏变化 | 28 | //监听屏幕横竖屏变化 |
| @@ -75,6 +75,8 @@ export struct DetailPlayLivePage { | @@ -75,6 +75,8 @@ export struct DetailPlayLivePage { | ||
| 75 | if (data.length > 0) { | 75 | if (data.length > 0) { |
| 76 | if (data[0].liveInfo?.liveState == 'wait') { | 76 | if (data[0].liveInfo?.liveState == 'wait') { |
| 77 | this.tabs = ['简介', '直播间', '大家聊'] | 77 | this.tabs = ['简介', '直播间', '大家聊'] |
| 78 | + } else { | ||
| 79 | + this.tabs = ['直播间', '大家聊'] | ||
| 78 | } | 80 | } |
| 79 | this.liveDetailsBean = data[0] | 81 | this.liveDetailsBean = data[0] |
| 80 | } | 82 | } |
| @@ -127,11 +127,8 @@ export struct LiveCountdownComponent { | @@ -127,11 +127,8 @@ export struct LiveCountdownComponent { | ||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | updateData() { | 129 | updateData() { |
| 130 | - if (!this.liveDetailsBean) { | ||
| 131 | - return | ||
| 132 | - } | ||
| 133 | this.getLiveAppointmentStatus() | 130 | this.getLiveAppointmentStatus() |
| 134 | - let startTimeStamp: number = DateTimeUtils.getDateTimestamp(this.liveDetailsBean.liveInfo.planStartTime) | 131 | + let startTimeStamp: number = DateTimeUtils.getDateTimestamp(this.liveDetailsBean.liveInfo?.planStartTime) |
| 135 | let currentTimeStamp: number = DateTimeUtils.getTimeStamp() | 132 | let currentTimeStamp: number = DateTimeUtils.getTimeStamp() |
| 136 | let _differenceTimeStampTmp = startTimeStamp - currentTimeStamp | 133 | let _differenceTimeStampTmp = startTimeStamp - currentTimeStamp |
| 137 | this.isCountDownStart = _differenceTimeStampTmp <= 0 ? false : _differenceTimeStampTmp <= 4 * 60 * 60 * 1000 | 134 | this.isCountDownStart = _differenceTimeStampTmp <= 0 ? false : _differenceTimeStampTmp <= 4 * 60 * 60 * 1000 |
| @@ -140,8 +137,8 @@ export struct LiveCountdownComponent { | @@ -140,8 +137,8 @@ export struct LiveCountdownComponent { | ||
| 140 | return | 137 | return |
| 141 | } | 138 | } |
| 142 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 | 139 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 |
| 143 | - if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo.planStartTime)) { | ||
| 144 | - let playStartTimeTmp = this.liveDetailsBean.liveInfo.planStartTime.trim() | 140 | + if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { |
| 141 | + let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim() | ||
| 145 | this.month = playStartTimeTmp.substring(5, 7) | 142 | this.month = playStartTimeTmp.substring(5, 7) |
| 146 | this.day = playStartTimeTmp.substring(8, 10) | 143 | this.day = playStartTimeTmp.substring(8, 10) |
| 147 | this.hour = playStartTimeTmp.substring(11, 13) | 144 | this.hour = playStartTimeTmp.substring(11, 13) |
| 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,WDViewDefaultType } from 'wdComponent/Index' | 2 | +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } 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' |
| 5 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' | 5 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' |
| 6 | import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean' | 6 | import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean' |
| 7 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | 7 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' |
| 8 | import { ViewType } from 'wdConstant/Index' | 8 | import { ViewType } from 'wdConstant/Index' |
| 9 | +import { Logger } from 'wdKit/Index' | ||
| 9 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 10 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 10 | import { TabChatItemComponent } from './TabChatItemComponent' | 11 | import { TabChatItemComponent } from './TabChatItemComponent' |
| 11 | 12 | ||
| @@ -27,7 +28,7 @@ export struct TabChatComponent { | @@ -27,7 +28,7 @@ export struct TabChatComponent { | ||
| 27 | } else if (this.pageModel.viewType == ViewType.ERROR) { | 28 | } else if (this.pageModel.viewType == ViewType.ERROR) { |
| 28 | ErrorComponent() | 29 | ErrorComponent() |
| 29 | } else if (this.pageModel.viewType == ViewType.EMPTY) { | 30 | } else if (this.pageModel.viewType == ViewType.EMPTY) { |
| 30 | - EmptyComponent() | 31 | + EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 }) |
| 31 | } else { | 32 | } else { |
| 32 | this.ListLayout() | 33 | this.ListLayout() |
| 33 | } | 34 | } |
| @@ -55,16 +56,16 @@ export struct TabChatComponent { | @@ -55,16 +56,16 @@ export struct TabChatComponent { | ||
| 55 | } | 56 | } |
| 56 | }) | 57 | }) |
| 57 | // 加载更多 | 58 | // 加载更多 |
| 58 | - ListItem() { | ||
| 59 | - if (this.pageModel.hasMore) { | ||
| 60 | - LoadMoreLayout({ | ||
| 61 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 62 | - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 63 | - }) | ||
| 64 | - } else { | ||
| 65 | - ListHasNoMoreDataUI() | ||
| 66 | - } | ||
| 67 | - } | 59 | + // ListItem() { |
| 60 | + // if (this.pageModel.hasMore) { | ||
| 61 | + // LoadMoreLayout({ | ||
| 62 | + // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 63 | + // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 64 | + // }) | ||
| 65 | + // } else { | ||
| 66 | + // ListHasNoMoreDataUI() | ||
| 67 | + // } | ||
| 68 | + // } | ||
| 68 | } | 69 | } |
| 69 | } | 70 | } |
| 70 | 71 |
| @@ -18,22 +18,13 @@ export struct TabComponent { | @@ -18,22 +18,13 @@ export struct TabComponent { | ||
| 18 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { | 18 | Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { |
| 19 | ForEach(this.tabs, (item: string, index: number) => { | 19 | ForEach(this.tabs, (item: string, index: number) => { |
| 20 | TabContent() { | 20 | TabContent() { |
| 21 | - if (this.tabs.length == 3) { | ||
| 22 | - if (0 == index) { | 21 | + if ('简介' === item) { |
| 23 | TabInfoComponent() | 22 | TabInfoComponent() |
| 24 | - } else if (1 == index) { | 23 | + } else if ('直播间' === item) { |
| 25 | TabLiveComponent() | 24 | TabLiveComponent() |
| 26 | - } else { | 25 | + } else if ('大家聊' === item) { |
| 27 | TabChatComponent() | 26 | TabChatComponent() |
| 28 | } | 27 | } |
| 29 | - } | ||
| 30 | - else { | ||
| 31 | - if (0 == index) { | ||
| 32 | - TabLiveComponent() | ||
| 33 | - } else { | ||
| 34 | - TabChatComponent() | ||
| 35 | - } | ||
| 36 | - } | ||
| 37 | }.tabBar(this.tabBuilder(index, item)) | 28 | }.tabBar(this.tabBuilder(index, item)) |
| 38 | .backgroundColor('#F5F5F5') | 29 | .backgroundColor('#F5F5F5') |
| 39 | }, (item: string, index: number) => { | 30 | }, (item: string, index: number) => { |
| 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' | ||
| 3 | -import { StringUtils } from 'wdKit/Index' | 2 | +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index' |
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 3 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | import { TabLiveItemComponent } from './TabLiveItemComponent' | 4 | import { TabLiveItemComponent } from './TabLiveItemComponent' |
| 6 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | 5 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' |
| @@ -14,15 +13,11 @@ import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayou | @@ -14,15 +13,11 @@ import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayou | ||
| 14 | export struct TabLiveComponent { | 13 | export struct TabLiveComponent { |
| 15 | liveViewModel: LiveViewModel = new LiveViewModel() | 14 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 16 | @State liveList: Array<LiveRoomItemBean> = [] | 15 | @State liveList: Array<LiveRoomItemBean> = [] |
| 17 | - @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean | 16 | + @Consume liveDetailsBean: LiveDetailsBean |
| 18 | @State private pageModel: PageModel = new PageModel() | 17 | @State private pageModel: PageModel = new PageModel() |
| 19 | 18 | ||
| 20 | - updateDate() { | ||
| 21 | - this.getLiveList() | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 25 | - | 20 | + this.getLiveList() |
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | build() { | 23 | build() { |
| @@ -32,7 +27,7 @@ export struct TabLiveComponent { | @@ -32,7 +27,7 @@ export struct TabLiveComponent { | ||
| 32 | } else if (this.pageModel.viewType == ViewType.ERROR) { | 27 | } else if (this.pageModel.viewType == ViewType.ERROR) { |
| 33 | ErrorComponent() | 28 | ErrorComponent() |
| 34 | } else if (this.pageModel.viewType == ViewType.EMPTY) { | 29 | } else if (this.pageModel.viewType == ViewType.EMPTY) { |
| 35 | - EmptyComponent() | 30 | + EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 }) |
| 36 | } else { | 31 | } else { |
| 37 | this.ListLayout() | 32 | this.ListLayout() |
| 38 | } | 33 | } |
| @@ -99,15 +94,15 @@ export struct TabLiveComponent { | @@ -99,15 +94,15 @@ export struct TabLiveComponent { | ||
| 99 | 2.名称固定:人民日报主持人 | 94 | 2.名称固定:人民日报主持人 |
| 100 | 3.内容:详情接口的简介,newIntroduction | 95 | 3.内容:详情接口的简介,newIntroduction |
| 101 | */ | 96 | */ |
| 102 | - if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) | ||
| 103 | - && this.liveDetailsBean | ||
| 104 | - && this.liveDetailsBean.liveInfo.liveState != 'wait' | ||
| 105 | - && this.pageModel.currentPage == 1) { | ||
| 106 | - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 107 | - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 108 | - liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 109 | - data.barrageResponses.push(liveRoomItemBeanTemp) | ||
| 110 | - } | 97 | + // if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) |
| 98 | + // && this.liveDetailsBean | ||
| 99 | + // && this.liveDetailsBean.liveInfo.liveState != 'wait' | ||
| 100 | + // && this.pageModel.currentPage == 1) { | ||
| 101 | + // let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 102 | + // liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 103 | + // liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 104 | + // data.barrageResponses.push(liveRoomItemBeanTemp) | ||
| 105 | + // } | ||
| 111 | this.pageModel.viewType = ViewType.LOADED; | 106 | this.pageModel.viewType = ViewType.LOADED; |
| 112 | this.liveList.push(...data.barrageResponses) | 107 | this.liveList.push(...data.barrageResponses) |
| 113 | if (data.barrageResponses.length === this.pageModel.pageSize) { | 108 | if (data.barrageResponses.length === this.pageModel.pageSize) { |
| 1 | -import { LiveRoomItemBean, PhotoListBean } from 'wdBean/Index' | ||
| 2 | -import { DateTimeUtils, StringUtils } from 'wdKit/Index' | 1 | +import { LiveRoomItemBean, PhotoListBean, } from 'wdBean/Index'; |
| 2 | +import { DateTimeUtils, StringUtils } from 'wdKit/Index'; | ||
| 3 | +import { Action, Params } from 'wdBean'; | ||
| 4 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | ||
| 5 | +import { WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | 6 | ||
| 4 | @Component | 7 | @Component |
| 5 | export struct TabLiveItemComponent { | 8 | export struct TabLiveItemComponent { |
| @@ -96,6 +99,7 @@ export struct TabLiveItemComponent { | @@ -96,6 +99,7 @@ export struct TabLiveItemComponent { | ||
| 96 | picDesc: '' | 99 | picDesc: '' |
| 97 | }) | 100 | }) |
| 98 | } | 101 | } |
| 102 | + this.gotoMultipleListImagePage() | ||
| 99 | }) | 103 | }) |
| 100 | }) | 104 | }) |
| 101 | }.margin({ | 105 | }.margin({ |
| @@ -112,4 +116,21 @@ export struct TabLiveItemComponent { | @@ -112,4 +116,21 @@ export struct TabLiveItemComponent { | ||
| 112 | aboutToDisappear(): void { | 116 | aboutToDisappear(): void { |
| 113 | 117 | ||
| 114 | } | 118 | } |
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * 大图列表页 | ||
| 122 | + * @param content | ||
| 123 | + * */ | ||
| 124 | + gotoMultipleListImagePage() { | ||
| 125 | + let taskAction: Action = { | ||
| 126 | + type: 'JUMP_DETAIL_PAGE', | ||
| 127 | + params: { | ||
| 128 | + detailPageType: 18, | ||
| 129 | + extra: { | ||
| 130 | + photoList: this.photoList | ||
| 131 | + } as ExtraDTO | ||
| 132 | + } as Params, | ||
| 133 | + }; | ||
| 134 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 135 | + } | ||
| 115 | } | 136 | } |
| @@ -21,7 +21,7 @@ export struct TopPlayComponent { | @@ -21,7 +21,7 @@ export struct TopPlayComponent { | ||
| 21 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 21 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url |
| 22 | } | 22 | } |
| 23 | this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | 23 | this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' |
| 24 | - if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | 24 | + if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { |
| 25 | let playUrl = '' | 25 | let playUrl = '' |
| 26 | if (this.liveDetailsBean.liveInfo.liveState == 'running') { | 26 | if (this.liveDetailsBean.liveInfo.liveState == 'running') { |
| 27 | playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | 27 | playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl |
-
Please register or login to post a comment