Showing
40 changed files
with
1353 additions
and
178 deletions
| @@ -207,6 +207,14 @@ export class HttpUrlUtils { | @@ -207,6 +207,14 @@ export class HttpUrlUtils { | ||
| 207 | */ | 207 | */ |
| 208 | static readonly LIVE_ROOM_DATA_PATH: string = "/api/live-center-message/zh/a/live/room/number/all"; | 208 | static readonly LIVE_ROOM_DATA_PATH: string = "/api/live-center-message/zh/a/live/room/number/all"; |
| 209 | /** | 209 | /** |
| 210 | + * 直播详情-C端点赞接口 | ||
| 211 | + */ | ||
| 212 | + static readonly LIVE_ROOM_NUMBER_LIKE: string = "/api/live-center-message/zh/c/live/room/number/like"; | ||
| 213 | + /** | ||
| 214 | + * 直播详情-查询是否点赞接口 | ||
| 215 | + */ | ||
| 216 | + static readonly LIVE_LIKE: string = "/api/live-center-message/zh/a/live/like"; | ||
| 217 | + /** | ||
| 210 | * 直播详情-预约直播状态 | 218 | * 直播详情-预约直播状态 |
| 211 | */ | 219 | */ |
| 212 | static readonly LIVE_APPOINTMENT_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe/query"; | 220 | static readonly LIVE_APPOINTMENT_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe/query"; |
| @@ -218,6 +226,15 @@ export class HttpUrlUtils { | @@ -218,6 +226,15 @@ export class HttpUrlUtils { | ||
| 218 | * 预约状态 | 226 | * 预约状态 |
| 219 | */ | 227 | */ |
| 220 | static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch"; | 228 | static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch"; |
| 229 | + | ||
| 230 | + /** | ||
| 231 | + * 查询是否被禁言 | ||
| 232 | + */ | ||
| 233 | + static getLiveBarrageHasBanUrl() { | ||
| 234 | + let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/c/mlive/barrage/ban" | ||
| 235 | + return url | ||
| 236 | + } | ||
| 237 | + | ||
| 221 | /** | 238 | /** |
| 222 | 239 | ||
| 223 | * 搜索结果 显示tab 数 | 240 | * 搜索结果 显示tab 数 |
| @@ -633,11 +650,21 @@ export class HttpUrlUtils { | @@ -633,11 +650,21 @@ export class HttpUrlUtils { | ||
| 633 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_CHAT_LIST_PATH | 650 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_CHAT_LIST_PATH |
| 634 | return url | 651 | return url |
| 635 | } | 652 | } |
| 636 | - | 653 | + // 直播详情-直播数据 |
| 637 | static getLiveRoomDataUrl() { | 654 | static getLiveRoomDataUrl() { |
| 638 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_DATA_PATH | 655 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_DATA_PATH |
| 639 | return url | 656 | return url |
| 640 | } | 657 | } |
| 658 | + // 直播详情-C端点赞接口 | ||
| 659 | + static getLiveRoomNumberLikeUrl() { | ||
| 660 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_NUMBER_LIKE | ||
| 661 | + return url | ||
| 662 | + } | ||
| 663 | + // 直播详情-查询是否点赞接口 | ||
| 664 | + static getLiveLikeUrl() { | ||
| 665 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_LIKE | ||
| 666 | + return url | ||
| 667 | + } | ||
| 641 | 668 | ||
| 642 | static getLiveAppointmentStatusUrl() { | 669 | static getLiveAppointmentStatusUrl() { |
| 643 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH | 670 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH |
| @@ -122,7 +122,7 @@ export { appStyleImagesDTO } from './src/main/ets/bean/content/appStyleImagesDTO | @@ -122,7 +122,7 @@ export { appStyleImagesDTO } from './src/main/ets/bean/content/appStyleImagesDTO | ||
| 122 | 122 | ||
| 123 | export { LiveRoomBean, LiveRoomItemBean } from './src/main/ets/bean/live/LiveRoomBean'; | 123 | export { LiveRoomBean, LiveRoomItemBean } from './src/main/ets/bean/live/LiveRoomBean'; |
| 124 | 124 | ||
| 125 | -export { LiveRoomDataBean } from './src/main/ets/bean/live/LiveRoomDataBean'; | 125 | +export { LiveRoomDataBean, ValueType } from './src/main/ets/bean/live/LiveRoomDataBean'; |
| 126 | 126 | ||
| 127 | export { ReserveBean } from './src/main/ets/bean/live/ReserveBean'; | 127 | export { ReserveBean } from './src/main/ets/bean/live/ReserveBean'; |
| 128 | 128 |
| @@ -11,7 +11,7 @@ import { UserInfoDTO } from './UserInfoDTO' | @@ -11,7 +11,7 @@ import { UserInfoDTO } from './UserInfoDTO' | ||
| 11 | * 接口定义: | 11 | * 接口定义: |
| 12 | * http://192.168.1.3:3300/project/3802/interface/api/200915 | 12 | * http://192.168.1.3:3300/project/3802/interface/api/200915 |
| 13 | */ | 13 | */ |
| 14 | -export interface ContentDetailDTO { | 14 | +export class ContentDetailDTO { |
| 15 | newsId: number; | 15 | newsId: number; |
| 16 | newsTitle: string; | 16 | newsTitle: string; |
| 17 | newsShortTitle: string; | 17 | newsShortTitle: string; |
| @@ -72,4 +72,8 @@ export interface ContentDetailDTO { | @@ -72,4 +72,8 @@ export interface ContentDetailDTO { | ||
| 72 | isNewspaper: boolean; | 72 | isNewspaper: boolean; |
| 73 | oldNewsId: string; | 73 | oldNewsId: string; |
| 74 | serials: any; | 74 | serials: any; |
| 75 | + | ||
| 76 | + | ||
| 77 | + // 本地字段 | ||
| 78 | + showTime:boolean = false; | ||
| 75 | } | 79 | } |
| @@ -5,3 +5,5 @@ export interface LiveRoomDataBean { | @@ -5,3 +5,5 @@ export interface LiveRoomDataBean { | ||
| 5 | pv: number, | 5 | pv: number, |
| 6 | subscribeNum: number, | 6 | subscribeNum: number, |
| 7 | } | 7 | } |
| 8 | + | ||
| 9 | +export type ValueType = number | string | boolean | Array<number> | Array<string> | Array<boolean> | Uint8Array | object | bigint; |
| @@ -90,6 +90,8 @@ export { MultiPictureDetailItemComponent } from './src/main/ets/components/Multi | @@ -90,6 +90,8 @@ export { MultiPictureDetailItemComponent } from './src/main/ets/components/Multi | ||
| 90 | 90 | ||
| 91 | export { OperRowListView } from './src/main/ets/components/view/OperRowListView'; | 91 | export { OperRowListView } from './src/main/ets/components/view/OperRowListView'; |
| 92 | 92 | ||
| 93 | +export { LiveOperRowListView } from './src/main/ets/components/view/LiveOperRowListView'; | ||
| 94 | + | ||
| 93 | export { ImageDownloadComponent } from './src/main/ets/components/ImageDownloadComponent'; | 95 | export { ImageDownloadComponent } from './src/main/ets/components/ImageDownloadComponent'; |
| 94 | 96 | ||
| 95 | export { PageRepository } from './src/main/ets/repository/PageRepository'; | 97 | export { PageRepository } from './src/main/ets/repository/PageRepository'; |
| @@ -61,13 +61,13 @@ export struct Card2Component { | @@ -61,13 +61,13 @@ export struct Card2Component { | ||
| 61 | // } | 61 | // } |
| 62 | // } | 62 | // } |
| 63 | if(this.contentDTO.objectType == '5'){ | 63 | if(this.contentDTO.objectType == '5'){ |
| 64 | - Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) | 64 | + Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center) |
| 65 | } else { | 65 | } else { |
| 66 | if (this.contentDTO.seoTags) { | 66 | if (this.contentDTO.seoTags) { |
| 67 | - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) | 67 | + Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center) |
| 68 | } | 68 | } |
| 69 | if (this.contentDTO.newTags) { | 69 | if (this.contentDTO.newTags) { |
| 70 | - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 70 | + Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | //新闻标题 | 73 | //新闻标题 |
| @@ -42,13 +42,13 @@ export struct Card3Component { | @@ -42,13 +42,13 @@ export struct Card3Component { | ||
| 42 | // Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) | 42 | // Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) |
| 43 | // } | 43 | // } |
| 44 | if(this.contentDTO.objectType == '5'){ | 44 | if(this.contentDTO.objectType == '5'){ |
| 45 | - Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) | 45 | + Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center) |
| 46 | } else { | 46 | } else { |
| 47 | if (this.contentDTO.seoTags) { | 47 | if (this.contentDTO.seoTags) { |
| 48 | - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) | 48 | + Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center) |
| 49 | } | 49 | } |
| 50 | if (this.contentDTO.newTags) { | 50 | if (this.contentDTO.newTags) { |
| 51 | - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 51 | + Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | Text() { | 54 | Text() { |
| @@ -89,18 +89,19 @@ export struct Card6Component { | @@ -89,18 +89,19 @@ export struct Card6Component { | ||
| 89 | ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 89 | ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : |
| 90 | 0 ) | 90 | 0 ) |
| 91 | }.alignContent(Alignment.TopStart) | 91 | }.alignContent(Alignment.TopStart) |
| 92 | + // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) | ||
| 92 | 93 | ||
| 93 | } | 94 | } |
| 94 | .justifyContent(FlexAlign.Start) | 95 | .justifyContent(FlexAlign.Start) |
| 95 | - | ||
| 96 | Blank() | 96 | Blank() |
| 97 | //bottom 评论等信息 | 97 | //bottom 评论等信息 |
| 98 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 98 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 99 | + | ||
| 99 | } | 100 | } |
| 100 | .alignItems(HorizontalAlign.Start) | 101 | .alignItems(HorizontalAlign.Start) |
| 101 | .justifyContent(FlexAlign.Start) | 102 | .justifyContent(FlexAlign.Start) |
| 102 | .width('64%') | 103 | .width('64%') |
| 103 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 104 | + |
| 104 | 105 | ||
| 105 | Stack({alignContent: Alignment.BottomEnd}) { | 106 | Stack({alignContent: Alignment.BottomEnd}) { |
| 106 | Image(this.loadImg ? this.contentDTO.coverUrl || this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') | 107 | Image(this.loadImg ? this.contentDTO.coverUrl || this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| @@ -110,6 +111,7 @@ export struct Card6Component { | @@ -110,6 +111,7 @@ export struct Card6Component { | ||
| 110 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 111 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 111 | CardMediaInfo({ contentDTO: this.contentDTO }) | 112 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 112 | } | 113 | } |
| 114 | + | ||
| 113 | } | 115 | } |
| 114 | .onClick((event: ClickEvent) => { | 116 | .onClick((event: ClickEvent) => { |
| 115 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 117 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| @@ -123,6 +125,7 @@ export struct Card6Component { | @@ -123,6 +125,7 @@ export struct Card6Component { | ||
| 123 | top: $r('app.float.card_comp_pagePadding_tb'), | 125 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 124 | bottom: $r('app.float.card_comp_pagePadding_tb') | 126 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 125 | }) | 127 | }) |
| 128 | + | ||
| 126 | .width(CommonConstants.FULL_WIDTH) | 129 | .width(CommonConstants.FULL_WIDTH) |
| 127 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) | 130 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) |
| 128 | .justifyContent(FlexAlign.SpaceBetween) | 131 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -38,8 +38,12 @@ export struct CommentListDialogView { | @@ -38,8 +38,12 @@ export struct CommentListDialogView { | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | closeAction() { | 40 | closeAction() { |
| 41 | + if (this.onClose) { | ||
| 42 | + this.onClose() | ||
| 43 | + } else { | ||
| 41 | this.showCommentList = false | 44 | this.showCommentList = false |
| 42 | } | 45 | } |
| 46 | + } | ||
| 43 | 47 | ||
| 44 | build() { | 48 | build() { |
| 45 | } | 49 | } |
| @@ -20,12 +20,10 @@ struct ChannelSubscriptionLayout { | @@ -20,12 +20,10 @@ struct ChannelSubscriptionLayout { | ||
| 20 | //当前选中的频道 | 20 | //当前选中的频道 |
| 21 | @Link currentTopNavSelectedIndex: number; | 21 | @Link currentTopNavSelectedIndex: number; |
| 22 | @Prop homeChannelList: TopNavDTO [] | 22 | @Prop homeChannelList: TopNavDTO [] |
| 23 | - @Prop indexSettingChannelId: number | ||
| 24 | @Link myChannelList: TopNavDTO [] | 23 | @Link myChannelList: TopNavDTO [] |
| 25 | @Link moreChannelList: TopNavDTO [] | 24 | @Link moreChannelList: TopNavDTO [] |
| 26 | @Link localChannelList: TopNavDTO [] | 25 | @Link localChannelList: TopNavDTO [] |
| 27 | @Link channelIds: number [] | 26 | @Link channelIds: number [] |
| 28 | - @StorageLink('channelIds') storeChannelIds: string = '' | ||
| 29 | @State isShow: boolean = false | 27 | @State isShow: boolean = false |
| 30 | @State dragItem: number = -1 | 28 | @State dragItem: number = -1 |
| 31 | private dragRefOffsetX: number = 0 | 29 | private dragRefOffsetX: number = 0 |
| @@ -34,7 +32,7 @@ struct ChannelSubscriptionLayout { | @@ -34,7 +32,7 @@ struct ChannelSubscriptionLayout { | ||
| 34 | @State offsetY: number = 0 | 32 | @State offsetY: number = 0 |
| 35 | private FIX_VP_X: number = 80 | 33 | private FIX_VP_X: number = 80 |
| 36 | private FIX_VP_Y: number = 48 | 34 | private FIX_VP_Y: number = 48 |
| 37 | - @State indexSettingTabIndex: number = 0 | 35 | + @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 38 | @State isEditIng: boolean = false | 36 | @State isEditIng: boolean = false |
| 39 | @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO | 37 | @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO |
| 40 | changeTab: (index: number) => void = () => { | 38 | changeTab: (index: number) => void = () => { |
| @@ -50,13 +48,13 @@ struct ChannelSubscriptionLayout { | @@ -50,13 +48,13 @@ struct ChannelSubscriptionLayout { | ||
| 50 | let channelIdTmp = this.channelIds.splice(index1, 1) | 48 | let channelIdTmp = this.channelIds.splice(index1, 1) |
| 51 | this.myChannelList.splice(index2, 0, tmp[0]) | 49 | this.myChannelList.splice(index2, 0, tmp[0]) |
| 52 | this.channelIds.splice(index2, 0, channelIdTmp[0]) | 50 | this.channelIds.splice(index2, 0, channelIdTmp[0]) |
| 53 | - this.storeChannelIds = this.channelIds.join(',') | 51 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 54 | } | 52 | } |
| 55 | //删除频道 | 53 | //删除频道 |
| 56 | delChannelItem(index: number){ | 54 | delChannelItem(index: number){ |
| 57 | let item = this.myChannelList.splice(index, 1)[0] | 55 | let item = this.myChannelList.splice(index, 1)[0] |
| 58 | this.channelIds.splice(index, 1) | 56 | this.channelIds.splice(index, 1) |
| 59 | - this.storeChannelIds = this.channelIds.join(',') | 57 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 60 | if (item.moreChannel === '1') { | 58 | if (item.moreChannel === '1') { |
| 61 | this.moreChannelList.unshift(item) | 59 | this.moreChannelList.unshift(item) |
| 62 | } | 60 | } |
| @@ -68,7 +66,7 @@ struct ChannelSubscriptionLayout { | @@ -68,7 +66,7 @@ struct ChannelSubscriptionLayout { | ||
| 68 | addChannelItem(item: TopNavDTO){ | 66 | addChannelItem(item: TopNavDTO){ |
| 69 | this.channelIds.push(item.channelId) | 67 | this.channelIds.push(item.channelId) |
| 70 | this.myChannelList.push(item) | 68 | this.myChannelList.push(item) |
| 71 | - this.storeChannelIds = this.channelIds.join(',') | 69 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 72 | } | 70 | } |
| 73 | 71 | ||
| 74 | itemMove(index: number, newIndex: number): void { | 72 | itemMove(index: number, newIndex: number): void { |
| @@ -265,6 +263,7 @@ struct ChannelSubscriptionLayout { | @@ -265,6 +263,7 @@ struct ChannelSubscriptionLayout { | ||
| 265 | .alignContent(Alignment.Start) | 263 | .alignContent(Alignment.Start) |
| 266 | .height(36) | 264 | .height(36) |
| 267 | .onClick(() => { | 265 | .onClick(() => { |
| 266 | + this.indexSettingChannelId = item.channelId | ||
| 268 | AppStorage.set('indexSettingChannelId', item.channelId) | 267 | AppStorage.set('indexSettingChannelId', item.channelId) |
| 269 | }) | 268 | }) |
| 270 | }) | 269 | }) |
| @@ -5,6 +5,7 @@ import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | @@ -5,6 +5,7 @@ import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | ||
| 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' |
| 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' | 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' |
| 8 | +import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' | ||
| 8 | import { AreaListModel } from '../../model/AreaListModel'; | 9 | import { AreaListModel } from '../../model/AreaListModel'; |
| 9 | import router from '@ohos.router'; | 10 | import router from '@ohos.router'; |
| 10 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 11 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| @@ -58,6 +59,22 @@ struct EditUserInfoPage { | @@ -58,6 +59,22 @@ struct EditUserInfoPage { | ||
| 58 | }, | 59 | }, |
| 59 | }) | 60 | }) |
| 60 | 61 | ||
| 62 | + sexDialogController: CustomDialogController = new CustomDialogController({ | ||
| 63 | + builder: EditUserSexCustomDialog({ | ||
| 64 | + confirmCallback:(index)=>{ | ||
| 65 | + this.currentUserInfo.userExtend.sex = index; | ||
| 66 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex | ||
| 67 | + this.updateEditModel() | ||
| 68 | + } | ||
| 69 | + }), | ||
| 70 | + alignment: DialogAlignment.Bottom, | ||
| 71 | + customStyle: true, | ||
| 72 | + offset: { | ||
| 73 | + dx: 0, | ||
| 74 | + dy: -this.bottomSafeHeight | ||
| 75 | + }, | ||
| 76 | + }) | ||
| 77 | + | ||
| 61 | async aboutToAppear() { | 78 | async aboutToAppear() { |
| 62 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); | 79 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); |
| 63 | this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | 80 | this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) |
| @@ -174,32 +191,8 @@ struct EditUserInfoPage { | @@ -174,32 +191,8 @@ struct EditUserInfoPage { | ||
| 174 | this.dialogController.open() | 191 | this.dialogController.open() |
| 175 | } else if (i === 4) { | 192 | } else if (i === 4) { |
| 176 | this.dateDialogController.open() | 193 | this.dateDialogController.open() |
| 177 | - | ||
| 178 | - // DatePickerDialog.show({ | ||
| 179 | - // start:new Date('1900-1-1'), | ||
| 180 | - // end:new Date(), | ||
| 181 | - // selected:new Date, | ||
| 182 | - // lunar:false, | ||
| 183 | - // onAccept:(value:DatePickerResult) => { | ||
| 184 | - // let mon = value.month as number + 1 | ||
| 185 | - // let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 186 | - // let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 187 | - // this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 188 | - // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 189 | - // this.updateEditModel() | ||
| 190 | - // } | ||
| 191 | - // }) | ||
| 192 | }else if(i === 5){ | 194 | }else if(i === 5){ |
| 193 | - TextPickerDialog.show({ | ||
| 194 | - range:['男','女'], | ||
| 195 | - canLoop:false, | ||
| 196 | - selected:this.currentUserInfo.userExtend.sex === 0?1:0, | ||
| 197 | - onAccept:(value:TextPickerResult) => { | ||
| 198 | - this.currentUserInfo.userExtend.sex = value.index == 0?1:0; | ||
| 199 | - this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex | ||
| 200 | - this.updateEditModel() | ||
| 201 | - } | ||
| 202 | - }) | 195 | + this.sexDialogController.open() |
| 203 | } | 196 | } |
| 204 | }) | 197 | }) |
| 205 | } | 198 | } |
| @@ -13,9 +13,6 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | @@ -13,9 +13,6 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | ||
| 13 | 13 | ||
| 14 | const TAG = 'TopNavigationComponent'; | 14 | const TAG = 'TopNavigationComponent'; |
| 15 | 15 | ||
| 16 | -PersistentStorage.persistProp('channelIds', ''); | ||
| 17 | -PersistentStorage.persistProp('indexSettingChannelId', 2002); | ||
| 18 | - | ||
| 19 | const storage = LocalStorage.getShared(); | 16 | const storage = LocalStorage.getShared(); |
| 20 | 17 | ||
| 21 | /** | 18 | /** |
| @@ -48,11 +45,11 @@ export struct TopNavigationComponentNew { | @@ -48,11 +45,11 @@ export struct TopNavigationComponentNew { | ||
| 48 | @State currentTopNavSelectedIndex: number = 0; | 45 | @State currentTopNavSelectedIndex: number = 0; |
| 49 | // 顶导数据 | 46 | // 顶导数据 |
| 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 47 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 51 | - @StorageProp('indexSettingChannelId') indexSettingChannelId: number = 2002 | 48 | + @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 52 | //我的频道id列表 | 49 | //我的频道id列表 |
| 53 | @State channelIds: number[] = [] | 50 | @State channelIds: number[] = [] |
| 54 | //本地缓存频道id列表 | 51 | //本地缓存频道id列表 |
| 55 | - @StorageProp('channelIds') storageChannelIds: string = '' | 52 | + @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' |
| 56 | @State homeChannelList: TopNavDTO[] = [] | 53 | @State homeChannelList: TopNavDTO[] = [] |
| 57 | // 我的频道列表 | 54 | // 我的频道列表 |
| 58 | @State myChannelList: TopNavDTO[] = [] | 55 | @State myChannelList: TopNavDTO[] = [] |
| @@ -191,7 +188,6 @@ export struct TopNavigationComponentNew { | @@ -191,7 +188,6 @@ export struct TopNavigationComponentNew { | ||
| 191 | this.topBar() | 188 | this.topBar() |
| 192 | ChannelSubscriptionLayout({ | 189 | ChannelSubscriptionLayout({ |
| 193 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 190 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 194 | - indexSettingChannelId: this.indexSettingChannelId, | ||
| 195 | homeChannelList: this.homeChannelList, | 191 | homeChannelList: this.homeChannelList, |
| 196 | myChannelList: $myChannelList, | 192 | myChannelList: $myChannelList, |
| 197 | moreChannelList: $moreChannelList, | 193 | moreChannelList: $moreChannelList, |
| @@ -406,18 +402,29 @@ export struct TopNavigationComponentNew { | @@ -406,18 +402,29 @@ export struct TopNavigationComponentNew { | ||
| 406 | 402 | ||
| 407 | //频道分类 | 403 | //频道分类 |
| 408 | if (item.name !== '播报') { //暂时隐藏播报 | 404 | if (item.name !== '播报') { //暂时隐藏播报 |
| 409 | - if (item.myChannel === '1') { | 405 | + if (item.myChannel === '1' && !this.storageChannelIds) { |
| 410 | _myChannelList.push(item) | 406 | _myChannelList.push(item) |
| 411 | _channelIds.push(item.channelId) | 407 | _channelIds.push(item.channelId) |
| 412 | - } else if (item.moreChannel === '1') { | 408 | + } |
| 409 | + if (item.moreChannel === '1') { | ||
| 413 | this.moreChannelList.push(item) | 410 | this.moreChannelList.push(item) |
| 414 | - } else if (item.localChannel === '1' && item.myChannel !== '1') { | 411 | + } |
| 412 | + if (item.localChannel === '1' && item.myChannel !== '1') { | ||
| 415 | this.localChannelList.push(item) | 413 | this.localChannelList.push(item) |
| 416 | } | 414 | } |
| 417 | } | 415 | } |
| 418 | 416 | ||
| 419 | }) | 417 | }) |
| 420 | 418 | ||
| 419 | + if(this.storageChannelIds){ | ||
| 420 | + _storageChannelIds.forEach((_item:string)=>{ | ||
| 421 | + let index = defaultList.findIndex(ele => Number(_item) === ele.channelId) | ||
| 422 | + if(index > -1){ | ||
| 423 | + _myChannelList.push(defaultList[index]) | ||
| 424 | + _channelIds.push(defaultList[index].channelId) | ||
| 425 | + } | ||
| 426 | + }) | ||
| 427 | + } | ||
| 421 | if (cityName) { | 428 | if (cityName) { |
| 422 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | 429 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) |
| 423 | const localChannelitem = _myChannelList.splice(index, 1)[0]; | 430 | const localChannelitem = _myChannelList.splice(index, 1)[0]; |
| @@ -466,10 +473,6 @@ export struct TopNavigationComponentNew { | @@ -466,10 +473,6 @@ export struct TopNavigationComponentNew { | ||
| 466 | this.changePage(this.currentTopNavSelectedIndex) | 473 | this.changePage(this.currentTopNavSelectedIndex) |
| 467 | } | 474 | } |
| 468 | 475 | ||
| 469 | - aboutToDisappear() { | ||
| 470 | - AppStorage.set('channelIds', this.channelIds.join(',')) | ||
| 471 | - } | ||
| 472 | - | ||
| 473 | onTopNavigationDataUpdated() { | 476 | onTopNavigationDataUpdated() { |
| 474 | Logger.info(TAG, | 477 | Logger.info(TAG, |
| 475 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); | 478 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); |
| 1 | +import { DisplayUtils, NumberFormatterUtils } from 'wdKit/Index' | ||
| 2 | +import { SPHelper } from 'wdKit'; | ||
| 3 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 4 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 5 | +import measure from '@ohos.measure' | ||
| 6 | +import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | ||
| 7 | +import { | ||
| 8 | + ContentDetailDTO, | ||
| 9 | +} from 'wdBean'; | ||
| 10 | +import { LiveModel } from '../../viewmodel/LiveModel'; | ||
| 11 | +import { HttpUtils } from 'wdNetwork/Index'; | ||
| 12 | + | ||
| 13 | +const TAG = 'LiveLikeComponent'; | ||
| 14 | + | ||
| 15 | +interface ILikeStyleResp { | ||
| 16 | + url: Resource; | ||
| 17 | + name: string; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +@Component | ||
| 21 | +export struct LiveLikeComponent { | ||
| 22 | + private LiveModel: LiveModel = new LiveModel() | ||
| 23 | + @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO | ||
| 24 | + @Prop pageComponentType: number | ||
| 25 | + @State likesStyle: string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 26 | + @State likeStatus: boolean = false | ||
| 27 | + @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | ||
| 28 | + styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景 | ||
| 29 | + @State likeCount: number = 0 //点赞数 | ||
| 30 | + @State likeBean: Record<string, string> = {} | ||
| 31 | + pageParam: ParamType = {} | ||
| 32 | + PageName: string = '' | ||
| 33 | + | ||
| 34 | + //上层传值 样例 | ||
| 35 | + // this.data['contentId'] = '30035444649' //必须 | ||
| 36 | + // this.data['userName'] = '人民日报网友2kD2xW' | ||
| 37 | + // this.data['contentType'] = '8' //必须 | ||
| 38 | + // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学' | ||
| 39 | + // this.data['userHeaderUrl'] = "" | ||
| 40 | + // this.data['channelId'] = "2059" //必须 | ||
| 41 | + // this.data['status'] = "1" | ||
| 42 | + // 内容用 是否开启点赞 1是 0否; | ||
| 43 | + // this.contentDetailData.openLikes == 1 | ||
| 44 | + async aboutToAppear() { | ||
| 45 | + this.onDetailUpdated() | ||
| 46 | + this.contentTrackingDict() | ||
| 47 | + } | ||
| 48 | + async onDetailUpdated() { | ||
| 49 | + // 2:竖屏直播页 4:横屏直播页 | ||
| 50 | + // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 51 | + this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle | ||
| 52 | + this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false | ||
| 53 | + console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData)) | ||
| 54 | + // 点赞需要数据 | ||
| 55 | + this.likeBean['contentId'] = this.contentDetailData.newsId + '' | ||
| 56 | + //获取点赞状态 | ||
| 57 | + this.getLikeStatus() | ||
| 58 | + //获取点赞数 | ||
| 59 | + this.getLikeCount() | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + contentTrackingDict(){ | ||
| 63 | + this.pageParam = { | ||
| 64 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 65 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 66 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 67 | + } | ||
| 68 | + if(this.contentDetailData.newsType == 2) { | ||
| 69 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + build() { | ||
| 74 | + // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 | ||
| 75 | + this.likeCompStyle() | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * 将点赞样式转换为icon | ||
| 80 | + */ | ||
| 81 | + transLikeStyle(): ILikeStyleResp { | ||
| 82 | + if (this.likesStyle === 'love' || this.likesStyle === 'thumb') { | ||
| 83 | + return { | ||
| 84 | + url: this.likeStatus ? $r(`app.media.ic_like_check`) : | ||
| 85 | + this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`), | ||
| 86 | + name: '赞' | ||
| 87 | + } | ||
| 88 | + } else if (this.likesStyle === 'pray') { | ||
| 89 | + return { | ||
| 90 | + url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), | ||
| 91 | + name: '祈祷' | ||
| 92 | + } | ||
| 93 | + } else if (this.likesStyle === 'mourning') { | ||
| 94 | + return { | ||
| 95 | + url: this.likeStatus ? $r(`app.media.ic_candle_check`) : | ||
| 96 | + $r(`app.media.ic_candle_uncheck`), | ||
| 97 | + name: '默哀' | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + return { | ||
| 101 | + url: this.likeStatus ? $r(`app.media.ic_like_check`) : | ||
| 102 | + this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`), | ||
| 103 | + name: '点赞' | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + @Builder | ||
| 108 | + likeCompStyle() { | ||
| 109 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 110 | + Column() { | ||
| 111 | + Image(this.transLikeStyle().url) | ||
| 112 | + .width(24) | ||
| 113 | + .height(24) | ||
| 114 | + .onClick(() => { | ||
| 115 | + this.clickButtonEvent() | ||
| 116 | + }) | ||
| 117 | + } | ||
| 118 | + .justifyContent(FlexAlign.Center) | ||
| 119 | + .width(36) | ||
| 120 | + .height(36) | ||
| 121 | + .borderRadius(18) | ||
| 122 | + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | ||
| 123 | + Row() { | ||
| 124 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | ||
| 125 | + .fontSize(8) | ||
| 126 | + .fontColor(Color.White) | ||
| 127 | + .padding({ left: 8, right: 2 }) | ||
| 128 | + } | ||
| 129 | + .height(12) | ||
| 130 | + .alignItems(VerticalAlign.Center) | ||
| 131 | + .position({ x: '100%', y: 10 }) | ||
| 132 | + .markAnchor({ x: '100%' }) | ||
| 133 | + .backgroundImage($r('app.media.ic_like_back')) | ||
| 134 | + .backgroundImageSize({height: 13}) | ||
| 135 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 136 | + 12) | ||
| 137 | + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 138 | + } | ||
| 139 | + .width(36) | ||
| 140 | + .height(42) | ||
| 141 | + .visibility(this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) | ||
| 142 | + | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + async clickButtonEvent() { | ||
| 146 | + console.log(TAG, 'clickButtonEvent 点赞点击') | ||
| 147 | + // 未登录,跳转登录 | ||
| 148 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 149 | + if (!user_id) { | ||
| 150 | + console.log(TAG, '点赞点击,未登录') | ||
| 151 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 152 | + return | ||
| 153 | + } | ||
| 154 | + this.executeLike() | ||
| 155 | + | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + async executeLike() { | ||
| 159 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 160 | + if (!user_id) { | ||
| 161 | + console.log(TAG, '查询点赞状态,未登录') | ||
| 162 | + return | ||
| 163 | + } | ||
| 164 | + this.LiveModel.getLiveRoomNumberLike(this.likeBean['contentId'], 1, HttpUtils.getDeviceId()).then((data) => { | ||
| 165 | + | ||
| 166 | + console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) | ||
| 167 | + this.likeCount++ | ||
| 168 | + | ||
| 169 | + }).catch(() => { | ||
| 170 | + }) | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + async getLikeStatus() { | ||
| 174 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 175 | + if (!user_id) { | ||
| 176 | + console.log(TAG, '查询点赞状态,未登录') | ||
| 177 | + return | ||
| 178 | + } | ||
| 179 | + this.LiveModel.getLiveLike(this.likeBean['contentId'], user_id, HttpUtils.getDeviceId()).then(data => { | ||
| 180 | + console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(data)) | ||
| 181 | + this.likeStatus = data | ||
| 182 | + }).catch(() => { | ||
| 183 | + this.likeStatus = false | ||
| 184 | + }) | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + /** | ||
| 188 | + * 获取点赞数 | ||
| 189 | + */ | ||
| 190 | + getLikeCount() { | ||
| 191 | + this.LiveModel.getLiveRoomData(this.likeBean['contentId']).then(data => { | ||
| 192 | + console.log(TAG, '查询点赞、收藏数量 res', JSON.stringify(data)) | ||
| 193 | + if (data) { | ||
| 194 | + this.likeCount = Number(data.likeNum) | ||
| 195 | + } else { | ||
| 196 | + this.likeCount = 0 | ||
| 197 | + } | ||
| 198 | + }).catch(() => { | ||
| 199 | + this.likeCount = 0 | ||
| 200 | + }) | ||
| 201 | + } | ||
| 202 | + private getMeasureText(text: string) { | ||
| 203 | + let width = measure.measureText({ | ||
| 204 | + textContent: text, | ||
| 205 | + fontSize: 8, | ||
| 206 | + lineHeight: 12, | ||
| 207 | + constraintWidth: DisplayUtils.getDeviceWidth(), | ||
| 208 | + }) | ||
| 209 | + width = px2vp(width) | ||
| 210 | + return width | ||
| 211 | + } | ||
| 212 | +} |
| 1 | +import { NumberFormatterUtils, SPHelper, ToastUtils } from 'wdKit'; | ||
| 2 | +import promptAction from '@ohos.promptAction'; | ||
| 3 | +import { | ||
| 4 | + batchLikeAndCollectResult, | ||
| 5 | + batchLikeAndCollectParams, | ||
| 6 | + ContentDetailDTO, | ||
| 7 | + contentListParams, | ||
| 8 | + InteractDataDTO, | ||
| 9 | + postExecuteCollectRecordParams | ||
| 10 | +} from 'wdBean'; | ||
| 11 | +import router from '@ohos.router'; | ||
| 12 | +import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | ||
| 13 | +import { LiveLikeComponent } from './LiveLikeComponent'; | ||
| 14 | +import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent'; | ||
| 15 | +import { publishCommentModel } from '../comment/model/PublishCommentModel' | ||
| 16 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 17 | +import { PageRepository } from '../../repository/PageRepository'; | ||
| 18 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 19 | +import { WDShare } from 'wdShare/Index'; | ||
| 20 | +import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | ||
| 21 | +import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | ||
| 22 | +import { CommentCustomDialog, CommentDialogInputContent } from '../comment/view/CommentCustomDialog'; | ||
| 23 | +import { HttpUtils } from 'wdNetwork/Index'; | ||
| 24 | + | ||
| 25 | +const TAG = 'LiveOperRowListView'; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + * 直播详情页底部通栏组件:包含返回、评论、点赞、收藏、分享 | ||
| 29 | + * 上层传值: | ||
| 30 | + * 1、(必传) contentDetailData---直播详情 | ||
| 31 | + * 2、(非必传) operationButtonList---组件展示条件, | ||
| 32 | + * ['comment', 'like', 'collect', 'share'],需要展示什么传什么 | ||
| 33 | + * comment--评论;like--点赞;collect--收藏;share--分享; | ||
| 34 | + * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData | ||
| 35 | + * 传值示例: | ||
| 36 | + LiveOperRowListView({ | ||
| 37 | + | ||
| 38 | + contentDetailData: this.contentDetailData[0], | ||
| 39 | + operationButtonList: ['comment', 'like', 'collect', 'share'] | ||
| 40 | + }) | ||
| 41 | + */ | ||
| 42 | + | ||
| 43 | +@Preview | ||
| 44 | +@Component | ||
| 45 | +export struct LiveOperRowListView { | ||
| 46 | + private onBack: () => void = () => { | ||
| 47 | + } | ||
| 48 | + private onCommentInputFocus?: () => void | ||
| 49 | + private onCommentInputed?: (comment: CommentDialogInputContent) => void | ||
| 50 | + | ||
| 51 | + @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 | ||
| 52 | + /** | ||
| 53 | + * 用于区分页面类型,在哪个页面嵌套就传相应的值 | ||
| 54 | + * 2:竖屏直播页 4:横屏直播页 | ||
| 55 | + * 8: 评论弹框内 | ||
| 56 | + */ | ||
| 57 | + @Prop pageComponentType?: number = -1 | ||
| 58 | + @Prop showBackIcon?: boolean = true | ||
| 59 | + @Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | ||
| 60 | + @State needLike: boolean = true | ||
| 61 | + @State styleType: number = -1 | ||
| 62 | + @State bgColor: ResourceColor = Color.White | ||
| 63 | + @State interactData: InteractDataDTO = {} as InteractDataDTO | ||
| 64 | + @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | ||
| 65 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 66 | + @State dialogController: CustomDialogController | null = null; | ||
| 67 | + pageParam: ParamType = {} | ||
| 68 | + PageName: string = '' | ||
| 69 | + @State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 70 | + @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | ||
| 71 | + | ||
| 72 | + /// comment | ||
| 73 | + @State showCommentInput: boolean = false | ||
| 74 | + private banComment: boolean = true // 是否已禁言 | ||
| 75 | + private commentInputDialogController?: CustomDialogController | ||
| 76 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 77 | + | ||
| 78 | + async aboutToAppear() { | ||
| 79 | + console.info(TAG, 'this.needLike', this.needLike) | ||
| 80 | + this.handleStyle() | ||
| 81 | + this.onDetailUpdated() | ||
| 82 | + this.contentTrackingDict() | ||
| 83 | + this.checkCanInputComment() | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + contentTrackingDict(){ | ||
| 87 | + this.pageParam = { | ||
| 88 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 89 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 90 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 91 | + } | ||
| 92 | + if(this.contentDetailData.newsType == 2) { | ||
| 93 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + async onDetailUpdated() { | ||
| 98 | + console.info(TAG, 'this.styleType', this.styleType) | ||
| 99 | + this.handleStyle() | ||
| 100 | + if (!this.contentDetailData) { | ||
| 101 | + return | ||
| 102 | + } | ||
| 103 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 104 | + if (user_id) { | ||
| 105 | + this.getInteractDataStatus() | ||
| 106 | + } | ||
| 107 | + await this.queryContentInteractCount() | ||
| 108 | + | ||
| 109 | + console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | ||
| 110 | + console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) | ||
| 111 | + // 评论需要数据 | ||
| 112 | + /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' | ||
| 113 | + this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' | ||
| 114 | + this.publishCommentModel.targetTitle = this.contentDetailData.newsTitle + '' | ||
| 115 | + this.publishCommentModel.targetRelType = this.contentDetailData.reLInfo?.relType + '' | ||
| 116 | + this.publishCommentModel.targetRelObjectId = this.contentDetailData.reLInfo?.relObjectId + '' | ||
| 117 | + this.publishCommentModel.keyArticle = this.contentDetailData.keyArticle + '' | ||
| 118 | + this.publishCommentModel.targetType = this.contentDetailData.newsType + ''*/ | ||
| 119 | + // 2:竖屏直播页 3:图集 4:横屏直播页 | ||
| 120 | + // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 121 | + this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle | ||
| 122 | + this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + build() { | ||
| 126 | + // 直播详情页 | ||
| 127 | + | ||
| 128 | + Column() { | ||
| 129 | + if(this.styleType != 3) { | ||
| 130 | + Divider().strokeWidth(1).color(this.styleType == 1 ? '#F5F5F5' : this.styleType == 2 ? '#262626' : 'rgba(0,0,0,0)') | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { | ||
| 134 | + Row() { | ||
| 135 | + Column() { | ||
| 136 | + Image(this.styleType == 1 ? $r('app.media.icon_arrow_left') : | ||
| 137 | + $r('app.media.icon_arrow_left_white')) | ||
| 138 | + .width(24) | ||
| 139 | + .height(24) | ||
| 140 | + .aspectRatio(1) | ||
| 141 | + .interpolation(ImageInterpolation.High) | ||
| 142 | + } | ||
| 143 | + .width(48) | ||
| 144 | + .hoverEffect(HoverEffect.Scale) | ||
| 145 | + .visibility(this.showBackIcon ? Visibility.Visible : Visibility.None) | ||
| 146 | + .onClick(() => { | ||
| 147 | + if (this.onBack) { | ||
| 148 | + this.onBack() | ||
| 149 | + } | ||
| 150 | + router.back(); | ||
| 151 | + }) | ||
| 152 | + | ||
| 153 | + | ||
| 154 | + if (this.contentDetailData?.newsId) { | ||
| 155 | + ForEach(this.operationButtonList, (item: string, index: number) => { | ||
| 156 | + if (item == 'comment') { | ||
| 157 | + this.builderComment() | ||
| 158 | + } else if (item == 'like' && this.needLike) { | ||
| 159 | + this.builderLike() | ||
| 160 | + } else if (item == 'collect') { | ||
| 161 | + this.builderCollect() | ||
| 162 | + } else if (item == 'share') { | ||
| 163 | + this.builderShare() | ||
| 164 | + } else { | ||
| 165 | + } | ||
| 166 | + }) | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + .width('100%') | ||
| 170 | + .justifyContent(FlexAlign.Start) | ||
| 171 | + } | ||
| 172 | + .width('100%') | ||
| 173 | + .backgroundColor(this.bgColor) | ||
| 174 | + .padding({ | ||
| 175 | + top: 10, | ||
| 176 | + // bottom: 10 | ||
| 177 | + bottom: `${this.bottomSafeHeight}px` | ||
| 178 | + // bottom: 50 | ||
| 179 | + }) | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + /** | ||
| 185 | + * 评论组件 | ||
| 186 | + */ | ||
| 187 | + @Builder | ||
| 188 | + builderComment() { | ||
| 189 | + Column() { | ||
| 190 | + if (this.showCommentInput) { | ||
| 191 | + Row() { | ||
| 192 | + Stack({ alignContent: Alignment.Start }) { | ||
| 193 | + RelativeContainer() { | ||
| 194 | + | ||
| 195 | + Image($r('app.media.comment_img_input_hui')) | ||
| 196 | + .objectFit(ImageFit.Fill) | ||
| 197 | + .resizable({ | ||
| 198 | + slice: { | ||
| 199 | + top: 1, | ||
| 200 | + left: 1, | ||
| 201 | + right: 20, | ||
| 202 | + bottom: 1 | ||
| 203 | + } | ||
| 204 | + }) | ||
| 205 | + .alignRules({ | ||
| 206 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 207 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 208 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 209 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 210 | + }) | ||
| 211 | + .id("Image") | ||
| 212 | + Text("说两句...") | ||
| 213 | + .fontSize(12) | ||
| 214 | + .fontColor('#999999') | ||
| 215 | + .margin({ left: 10 }) | ||
| 216 | + .alignRules({ | ||
| 217 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 218 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 219 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 220 | + }) | ||
| 221 | + .id("Text") | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + .height(30) | ||
| 226 | + .onClick(() => { | ||
| 227 | + if (this.onCommentInputFocus) { | ||
| 228 | + this.onCommentInputFocus() | ||
| 229 | + } | ||
| 230 | + this.showCommentDialog() | ||
| 231 | + }) | ||
| 232 | + } else { | ||
| 233 | + Blank() | ||
| 234 | + } | ||
| 235 | + } | ||
| 236 | + .layoutWeight(1) | ||
| 237 | + .margin({ left: 16 }) | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + /** | ||
| 241 | + * 点赞组件 | ||
| 242 | + */ | ||
| 243 | + @Builder | ||
| 244 | + builderLike() { | ||
| 245 | + Column() { | ||
| 246 | + LiveLikeComponent({ | ||
| 247 | + contentDetailData: this.contentDetailData, | ||
| 248 | + styleType: this.styleType, | ||
| 249 | + pageComponentType: this.pageComponentType | ||
| 250 | + }) | ||
| 251 | + } | ||
| 252 | + .width(48) | ||
| 253 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) | ||
| 254 | + } | ||
| 255 | + | ||
| 256 | + /** | ||
| 257 | + * 收藏组件 | ||
| 258 | + */ | ||
| 259 | + @Builder | ||
| 260 | + builderCollect() { | ||
| 261 | + | ||
| 262 | + Stack() { | ||
| 263 | + Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check1') : | ||
| 264 | + this.styleType == 1 ? $r('app.media.iv_live_comment_collect_un') : | ||
| 265 | + $r('app.media.iv_live_comment_collect_un_white')) | ||
| 266 | + .width(24) | ||
| 267 | + .height(24) | ||
| 268 | + .interpolation(ImageInterpolation.High) | ||
| 269 | + /*Text(`${this.interactData?.collectNum}`) | ||
| 270 | + .fontSize(8) | ||
| 271 | + .fontColor(Color.White) | ||
| 272 | + .height(12) | ||
| 273 | + .margin({ left: 6 }) | ||
| 274 | + .backgroundImage($r('app.media.comment_icon_number')) | ||
| 275 | + .offset({ | ||
| 276 | + x: 12 | ||
| 277 | + })*/ | ||
| 278 | + } | ||
| 279 | + .height(36) | ||
| 280 | + .width(48) | ||
| 281 | + .borderRadius(18) | ||
| 282 | + .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | ||
| 283 | + .onClick(() => { | ||
| 284 | + this.toggleCollectStatus() | ||
| 285 | + }) | ||
| 286 | + | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + /** | ||
| 290 | + * 分享组件 | ||
| 291 | + */ | ||
| 292 | + @Builder | ||
| 293 | + builderShare() { | ||
| 294 | + Column() { | ||
| 295 | + Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') : | ||
| 296 | + $r('app.media.iv_live_comment_share_white')) | ||
| 297 | + .width(24) | ||
| 298 | + .height(24) | ||
| 299 | + .aspectRatio(1) | ||
| 300 | + .interpolation(ImageInterpolation.High) | ||
| 301 | + .onClick((event: ClickEvent) => { | ||
| 302 | + // ToastUtils.showToast('分享为公共方法,待开发', 1000); | ||
| 303 | + this.share() | ||
| 304 | + }) | ||
| 305 | + } | ||
| 306 | + .justifyContent(FlexAlign.Center) | ||
| 307 | + .height(36) | ||
| 308 | + .width(48) | ||
| 309 | + .borderRadius(18) | ||
| 310 | + .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + handleStyle() { | ||
| 314 | + if (this.styleType == 1) { | ||
| 315 | + this.bgColor = Color.White | ||
| 316 | + } else if (this.styleType == 2) { | ||
| 317 | + this.bgColor = Color.Black | ||
| 318 | + } else if (this.styleType == 3) { | ||
| 319 | + this.bgColor = Color.Transparent | ||
| 320 | + } | ||
| 321 | + } | ||
| 322 | + | ||
| 323 | + share() { | ||
| 324 | + WDShare.shareContent(this.contentDetailData) | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + showCommentDialog() { | ||
| 328 | + if (this.contentDetailData.liveInfo.openComment != 1) { | ||
| 329 | + ToastUtils.showToast("暂时无法评论", 3000) | ||
| 330 | + return | ||
| 331 | + } | ||
| 332 | + //未登录,游客评论打开 | ||
| 333 | + if (!HttpUtils.isLogin() && this.contentDetailData.visitorComment == 1) { | ||
| 334 | + this.commentDialog() | ||
| 335 | + return | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + if (!HttpUtils.isLogin()) { | ||
| 339 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 340 | + return | ||
| 341 | + } | ||
| 342 | + if (this.banComment) { | ||
| 343 | + ToastUtils.showToast("暂时无法评论", 3000) | ||
| 344 | + return | ||
| 345 | + } | ||
| 346 | + this.commentDialog() | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + private commentDialog() { | ||
| 350 | + this.commentInputDialogController = new CustomDialogController({ | ||
| 351 | + builder: CommentCustomDialog({ | ||
| 352 | + onPublishBtnClick: (content: CommentDialogInputContent) => { | ||
| 353 | + if (this.banComment) { | ||
| 354 | + ToastUtils.showToast("暂时无法评论", 3000) | ||
| 355 | + } else if (this.onCommentInputed) { | ||
| 356 | + this.onCommentInputed(content) | ||
| 357 | + } | ||
| 358 | + this.commentInputDialogController?.close() | ||
| 359 | + return true | ||
| 360 | + }, | ||
| 361 | + publishCommentModel: this.publishCommentModel | ||
| 362 | + }), | ||
| 363 | + autoCancel: true, | ||
| 364 | + alignment: DialogAlignment.Bottom, | ||
| 365 | + customStyle: true, | ||
| 366 | + offset: { | ||
| 367 | + dx: 0, | ||
| 368 | + dy: -20 | ||
| 369 | + }, | ||
| 370 | + backgroundColor: "#50000000", | ||
| 371 | + }) | ||
| 372 | + this.publishCommentModel.rootCommentId = '-1'; | ||
| 373 | + this.publishCommentModel.parentId = '-1'; | ||
| 374 | + this.publishCommentModel.placeHolderText = "说两句..." | ||
| 375 | + this.commentInputDialogController?.open(); | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + // 已登录->查询用户对作品收藏状态 | ||
| 379 | + private async getInteractDataStatus() { | ||
| 380 | + try { | ||
| 381 | + const params: batchLikeAndCollectParams = { | ||
| 382 | + contentList: [ | ||
| 383 | + { | ||
| 384 | + contentId: this.contentDetailData?.newsId + '', | ||
| 385 | + contentType: this.contentDetailData?.newsType + '', | ||
| 386 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 387 | + } | ||
| 388 | + ] | ||
| 389 | + } | ||
| 390 | + console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params)) | ||
| 391 | + // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) | ||
| 392 | + let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | ||
| 393 | + console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) | ||
| 394 | + this.newsStatusOfUser = data[0]; | ||
| 395 | + } catch (exception) { | ||
| 396 | + // console.error(TAG, JSON.stringify(exception)) | ||
| 397 | + } | ||
| 398 | + } | ||
| 399 | + | ||
| 400 | + /** | ||
| 401 | + * 收藏、取消收藏 | ||
| 402 | + */ | ||
| 403 | + async toggleCollectStatus() { | ||
| 404 | + // 未登录,跳转登录 | ||
| 405 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 406 | + console.log(TAG, '收藏点击,登录', user_id) | ||
| 407 | + if (!user_id) { | ||
| 408 | + console.log(TAG, '收藏点击,用户未登录') | ||
| 409 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 410 | + return | ||
| 411 | + } | ||
| 412 | + const params: postExecuteCollectRecordParams = { | ||
| 413 | + status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1', | ||
| 414 | + contentList: [{ | ||
| 415 | + contentId: this.contentDetailData?.newsId + '', | ||
| 416 | + contentType: this.contentDetailData?.newsType + '', | ||
| 417 | + relType: this.contentDetailData?.reLInfo?.relType || '' + '', | ||
| 418 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 419 | + }], | ||
| 420 | + | ||
| 421 | + } | ||
| 422 | + console.log(TAG, '收藏点击', JSON.stringify(params)) | ||
| 423 | + PageRepository.postExecuteCollectRecord(params).then(res => { | ||
| 424 | + if (this.newsStatusOfUser) { | ||
| 425 | + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | ||
| 426 | + if (this.newsStatusOfUser.collectStatus === 1) { | ||
| 427 | + promptAction.showToast({ message: '收藏成功' }) | ||
| 428 | + TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) | ||
| 429 | + } else { | ||
| 430 | + TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) | ||
| 431 | + } | ||
| 432 | + this.queryContentInteractCount() | ||
| 433 | + } | ||
| 434 | + console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | ||
| 435 | + }) | ||
| 436 | + | ||
| 437 | + } | ||
| 438 | + | ||
| 439 | + /** | ||
| 440 | + * 查询点赞、收藏数量 | ||
| 441 | + */ | ||
| 442 | + queryContentInteractCount() { | ||
| 443 | + // console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) | ||
| 444 | + const params: contentListParams = { | ||
| 445 | + contentList: [{ | ||
| 446 | + contentId: this.contentDetailData?.newsId + '', | ||
| 447 | + contentType: this.contentDetailData?.newsType, | ||
| 448 | + }] | ||
| 449 | + } | ||
| 450 | + console.log(TAG, '查询点赞、收藏数量', JSON.stringify(params)) | ||
| 451 | + PageRepository.getContentInteract(params).then(res => { | ||
| 452 | + console.log(TAG, '查询点赞、收藏数量 res', JSON.stringify(res)) | ||
| 453 | + if (res.data) { | ||
| 454 | + this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) | ||
| 455 | + this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | ||
| 456 | + this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | ||
| 457 | + } | ||
| 458 | + // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | ||
| 459 | + console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData)) | ||
| 460 | + }) | ||
| 461 | + } | ||
| 462 | + | ||
| 463 | + async checkCanInputComment() { | ||
| 464 | + // 允许评论,且大家聊没隐藏 | ||
| 465 | + let canComment = (this.contentDetailData.liveInfo.openComment == 1 && this.contentDetailData.liveInfo.liveStyle != 2) | ||
| 466 | + this.showCommentInput = canComment | ||
| 467 | + | ||
| 468 | + let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string | ||
| 469 | + if (!HttpUtils.isLogin() || mLiveId == undefined) { | ||
| 470 | + return | ||
| 471 | + } | ||
| 472 | + | ||
| 473 | + // 查询是否被禁言 | ||
| 474 | + PageRepository.fetchLiveBarrageBan(mLiveId).then(res => { | ||
| 475 | + this.banComment = res.data as boolean | ||
| 476 | + this.showCommentInput = !this.banComment && canComment | ||
| 477 | + }) | ||
| 478 | + } | ||
| 479 | +} |
| @@ -14,14 +14,6 @@ export struct DateCustomComponent { | @@ -14,14 +14,6 @@ export struct DateCustomComponent { | ||
| 14 | .onDateChange((value) => { | 14 | .onDateChange((value) => { |
| 15 | this.selectDate = value as Date | 15 | this.selectDate = value as Date |
| 16 | }) | 16 | }) |
| 17 | - // .onDateChange:(value:DatePickerResult) => { | ||
| 18 | - // let mon = value.month as number + 1 | ||
| 19 | - // let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 20 | - // let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 21 | - // this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 22 | - // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 23 | - // this.updateEditModel() | ||
| 24 | - // } | ||
| 25 | }.justifyContent(FlexAlign.Center) | 17 | }.justifyContent(FlexAlign.Center) |
| 26 | }.height('100%') | 18 | }.height('100%') |
| 27 | } | 19 | } |
| 1 | +@CustomDialog | ||
| 2 | + | ||
| 3 | +export struct EditUserSexCustomDialog { | ||
| 4 | + controller: CustomDialogController | ||
| 5 | + confirmCallback: (selectIndex:number) => void = () => { | ||
| 6 | + } | ||
| 7 | + build() { | ||
| 8 | + Column(){ | ||
| 9 | + Button('男',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 10 | + .onClick(()=>{ | ||
| 11 | + this.confirmCallback(1) | ||
| 12 | + this.controller.close() | ||
| 13 | + }) | ||
| 14 | + Divider() | ||
| 15 | + .color('#f5f5f5') | ||
| 16 | + .width('100%') | ||
| 17 | + .strokeWidth(1) | ||
| 18 | + Button('女',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 19 | + .onClick(()=>{ | ||
| 20 | + this.confirmCallback(0) | ||
| 21 | + this.controller.close() | ||
| 22 | + }) | ||
| 23 | + Divider() | ||
| 24 | + .color('#f5f5f5') | ||
| 25 | + .width('100%') | ||
| 26 | + .strokeWidth(5) | ||
| 27 | + Button('取消',{type:ButtonType.Normal}).height(80).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 28 | + .onClick(()=>{ | ||
| 29 | + this.controller.close() | ||
| 30 | + }) | ||
| 31 | + }.height(176).width('100%').backgroundColor(Color.White) | ||
| 32 | + } | ||
| 33 | +} |
| @@ -3,7 +3,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | @@ -3,7 +3,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 3 | import { WDRouterRule } from 'wdRouter/Index' | 3 | import { WDRouterRule } from 'wdRouter/Index' |
| 4 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' | 4 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' |
| 5 | import { Logger } from 'wdKit'; | 5 | import { Logger } from 'wdKit'; |
| 6 | -import { window } from '@kit.ArkUI'; | 6 | +import { font, window } from '@kit.ArkUI'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * 读报纸半屏弹窗 | 9 | * 读报纸半屏弹窗 |
| @@ -56,6 +56,11 @@ export struct ENewspaperListDialog { | @@ -56,6 +56,11 @@ export struct ENewspaperListDialog { | ||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | async aboutToAppear() { | 58 | async aboutToAppear() { |
| 59 | + //注册字体 | ||
| 60 | + font.registerFont({ | ||
| 61 | + familyName: 'BebasNeueBold', | ||
| 62 | + familySrc: $rawfile('font/BebasNeueBold.otf') | ||
| 63 | + }) | ||
| 59 | // 屏幕高度 - 滑动高度计算 | 64 | // 屏幕高度 - 滑动高度计算 |
| 60 | let windowClass: window.Window = await window.getLastWindow(getContext(this)); | 65 | let windowClass: window.Window = await window.getLastWindow(getContext(this)); |
| 61 | let changeHeight = 85 + 44 + px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | 66 | let changeHeight = 85 + 44 + px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) |
| @@ -151,7 +156,7 @@ export struct ENewspaperListDialog { | @@ -151,7 +156,7 @@ export struct ENewspaperListDialog { | ||
| 151 | Column() { | 156 | Column() { |
| 152 | if (itemIndex == 0) { | 157 | if (itemIndex == 0) { |
| 153 | Text(item.pageNum + '版:' + item.pageName) | 158 | Text(item.pageNum + '版:' + item.pageName) |
| 154 | - .fontSize($r('app.float.font_size_14')) | 159 | + .fontSize($r('app.float.font_size_13')) |
| 155 | .fontColor($r('app.color.color_ED2800')) | 160 | .fontColor($r('app.color.color_ED2800')) |
| 156 | .fontWeight(600) | 161 | .fontWeight(600) |
| 157 | .width('100%') | 162 | .width('100%') |
| @@ -165,7 +170,7 @@ export struct ENewspaperListDialog { | @@ -165,7 +170,7 @@ export struct ENewspaperListDialog { | ||
| 165 | Column() { | 170 | Column() { |
| 166 | if (positionItem.shortTitle) { | 171 | if (positionItem.shortTitle) { |
| 167 | Text(positionItem.shortTitle) | 172 | Text(positionItem.shortTitle) |
| 168 | - .fontSize($r('app.float.font_size_14')) | 173 | + .fontSize($r('app.float.font_size_13')) |
| 169 | .fontColor($r('app.color.color_222222')) | 174 | .fontColor($r('app.color.color_222222')) |
| 170 | .fontWeight(600) | 175 | .fontWeight(600) |
| 171 | // .maxLines(2) | 176 | // .maxLines(2) |
| @@ -176,7 +181,7 @@ export struct ENewspaperListDialog { | @@ -176,7 +181,7 @@ export struct ENewspaperListDialog { | ||
| 176 | 181 | ||
| 177 | if (positionItem.title) { | 182 | if (positionItem.title) { |
| 178 | Text(positionItem.title) | 183 | Text(positionItem.title) |
| 179 | - .fontSize($r('app.float.font_size_17')) | 184 | + .fontSize($r('app.float.font_size_16')) |
| 180 | .fontColor($r('app.color.color_222222')) | 185 | .fontColor($r('app.color.color_222222')) |
| 181 | .fontWeight(600) | 186 | .fontWeight(600) |
| 182 | .margin({ | 187 | .margin({ |
| @@ -187,7 +192,7 @@ export struct ENewspaperListDialog { | @@ -187,7 +192,7 @@ export struct ENewspaperListDialog { | ||
| 187 | 192 | ||
| 188 | if (positionItem.downTitle) { | 193 | if (positionItem.downTitle) { |
| 189 | Text(positionItem.downTitle) | 194 | Text(positionItem.downTitle) |
| 190 | - .fontSize($r('app.float.font_size_14')) | 195 | + .fontSize($r('app.float.font_size_13')) |
| 191 | .fontColor($r('app.color.color_222222')) | 196 | .fontColor($r('app.color.color_222222')) |
| 192 | .fontWeight(600) | 197 | .fontWeight(600) |
| 193 | .margin({ | 198 | .margin({ |
| @@ -197,7 +202,7 @@ export struct ENewspaperListDialog { | @@ -197,7 +202,7 @@ export struct ENewspaperListDialog { | ||
| 197 | } | 202 | } |
| 198 | if (positionItem.newsTxt) { | 203 | if (positionItem.newsTxt) { |
| 199 | Text(positionItem.newsTxt) | 204 | Text(positionItem.newsTxt) |
| 200 | - .fontSize($r('app.float.font_size_14')) | 205 | + .fontSize($r('app.float.font_size_13')) |
| 201 | .fontColor($r('app.color.color_999999')) | 206 | .fontColor($r('app.color.color_999999')) |
| 202 | .lineHeight(25) | 207 | .lineHeight(25) |
| 203 | .margin({ | 208 | .margin({ |
| @@ -73,9 +73,9 @@ class MinePageDatasModel{ | @@ -73,9 +73,9 @@ class MinePageDatasModel{ | ||
| 73 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) | 73 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 74 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 74 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 75 | // this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | 75 | // this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 76 | - this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 77 | // this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) | 76 | // this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) |
| 78 | this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) | 77 | this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) |
| 78 | + this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 79 | return this.personalData | 79 | return this.personalData |
| 80 | } | 80 | } |
| 81 | 81 |
| @@ -480,4 +480,11 @@ export class PageRepository { | @@ -480,4 +480,11 @@ export class PageRepository { | ||
| 480 | url = url + "?liveIdList=" + ids; | 480 | url = url + "?liveIdList=" + ids; |
| 481 | return WDHttp.get<ResponseDTO<LiveRoomDataBean[]>>(url) | 481 | return WDHttp.get<ResponseDTO<LiveRoomDataBean[]>>(url) |
| 482 | }; | 482 | }; |
| 483 | + | ||
| 484 | + static fetchLiveBarrageBan(mLiveId: string) { | ||
| 485 | + let url = HttpUrlUtils.getLiveBarrageHasBanUrl() | ||
| 486 | + url = url + "?mliveId=" + mLiveId | ||
| 487 | + return WDHttp.get<ResponseDTO<boolean>>(url) | ||
| 488 | + } | ||
| 489 | + | ||
| 483 | } | 490 | } |
| 1 | import { NetworkUtil, SPHelper } from 'wdKit'; | 1 | import { NetworkUtil, SPHelper } from 'wdKit'; |
| 2 | import { SpConstants } from 'wdConstant'; | 2 | import { SpConstants } from 'wdConstant'; |
| 3 | 3 | ||
| 4 | -async function onlyWifiLoadImg() : Promise<boolean> { | 4 | +async function onlyWifiLoadImg(): Promise<boolean> { |
| 5 | let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_IMAGE_SWITCH, '') || false; | 5 | let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_IMAGE_SWITCH, '') || false; |
| 6 | - let isNetConnected = NetworkUtil.isNetConnected(); | 6 | + if (!loadImageOnlyWifiSwitch) { |
| 7 | + // 开关没开,直接让加载图片 | ||
| 8 | + return true | ||
| 9 | + } | ||
| 7 | let netWorkStatus = NetworkUtil.getNetworkType(); | 10 | let netWorkStatus = NetworkUtil.getNetworkType(); |
| 8 | - | ||
| 9 | - if (isNetConnected) { | 11 | + // 开关打开,wifi下才加载图片 |
| 10 | if (netWorkStatus === NetworkUtil.TYPE_WIFI) { | 12 | if (netWorkStatus === NetworkUtil.TYPE_WIFI) { |
| 11 | - return true; | ||
| 12 | - } else { | ||
| 13 | - if (loadImageOnlyWifiSwitch) { | ||
| 14 | - return false | ||
| 15 | - } else { | ||
| 16 | - return true; | ||
| 17 | - } | ||
| 18 | - } | ||
| 19 | - } else { | ||
| 20 | - return false; | 13 | + return true |
| 21 | } | 14 | } |
| 15 | + return false | ||
| 22 | } | 16 | } |
| 23 | 17 | ||
| 24 | export { onlyWifiLoadImg } | 18 | export { onlyWifiLoadImg } |
| 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; |
| 4 | -import { LiveDetailsBean, ReserveBean, ReserveItemBean, joinPeopleNum } from 'wdBean/Index'; | 4 | +import { LiveDetailsBean, ReserveBean, ReserveItemBean, joinPeopleNum, LiveRoomDataBean, ValueType } from 'wdBean/Index'; |
| 5 | 5 | ||
| 6 | const TAG = 'LiveModel' | 6 | const TAG = 'LiveModel' |
| 7 | 7 | ||
| @@ -73,6 +73,89 @@ export class LiveModel { | @@ -73,6 +73,89 @@ export class LiveModel { | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | + * 获取直播数据 | ||
| 77 | + * @param liveId | ||
| 78 | + * @returns | ||
| 79 | + */ | ||
| 80 | + getLiveRoomData(liveId: string) { | ||
| 81 | + return new Promise<LiveRoomDataBean>((success, fail) => { | ||
| 82 | + HttpRequest.get<ResponseDTO<LiveRoomDataBean>>( | ||
| 83 | + HttpUrlUtils.getLiveRoomDataUrl() + `?liveId=${liveId}`, | ||
| 84 | + ).then((data: ResponseDTO<LiveRoomDataBean>) => { | ||
| 85 | + if (!data || !data.data) { | ||
| 86 | + fail("数据为空") | ||
| 87 | + return | ||
| 88 | + } | ||
| 89 | + if (data.code != 0) { | ||
| 90 | + fail(data.message) | ||
| 91 | + return | ||
| 92 | + } | ||
| 93 | + success(data.data) | ||
| 94 | + }, (error: Error) => { | ||
| 95 | + fail(error.message) | ||
| 96 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 97 | + }) | ||
| 98 | + }) | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 直播详情-C端点赞接口 | ||
| 103 | + * @param liveId | ||
| 104 | + * @param number | ||
| 105 | + * @param deviceId | ||
| 106 | + * @returns | ||
| 107 | + */ | ||
| 108 | + getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) { | ||
| 109 | + return new Promise<number>((success, fail) => { | ||
| 110 | + HttpRequest.get<ResponseDTO<number>>( | ||
| 111 | + HttpUrlUtils.getLiveRoomNumberLikeUrl() + `?liveId=${liveId}&number=${number}&deviceId=${deviceId}`, | ||
| 112 | + ).then((data: ResponseDTO<number>) => { | ||
| 113 | + if (!data || !data.data) { | ||
| 114 | + fail("数据为空") | ||
| 115 | + return | ||
| 116 | + } | ||
| 117 | + if (data.code != 0) { | ||
| 118 | + fail(data.message) | ||
| 119 | + return | ||
| 120 | + } | ||
| 121 | + console.log('LiveLikeComponent data.data', data.data) | ||
| 122 | + success(data.data) | ||
| 123 | + }, (error: Error) => { | ||
| 124 | + fail(error.message) | ||
| 125 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 126 | + }) | ||
| 127 | + }) | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * 直播详情-查询是否点赞接口 | ||
| 132 | + * @param liveId | ||
| 133 | + * @param userId | ||
| 134 | + * @param deviceId | ||
| 135 | + * @returns | ||
| 136 | + */ | ||
| 137 | + getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) { | ||
| 138 | + return new Promise<boolean>((success, fail) => { | ||
| 139 | + HttpRequest.get<ResponseDTO<boolean>>( | ||
| 140 | + HttpUrlUtils.getLiveLikeUrl() + `?liveId=${liveId}&userId=${userId}&deviceId=${deviceId}`, | ||
| 141 | + ).then((data: ResponseDTO<boolean>) => { | ||
| 142 | + if (!data || !data.data) { | ||
| 143 | + fail("数据为空") | ||
| 144 | + return | ||
| 145 | + } | ||
| 146 | + if (data.code != 0) { | ||
| 147 | + fail(data.message) | ||
| 148 | + return | ||
| 149 | + } | ||
| 150 | + success(data.data) | ||
| 151 | + }, (error: Error) => { | ||
| 152 | + fail(error.message) | ||
| 153 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 154 | + }) | ||
| 155 | + }) | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + /** | ||
| 76 | * 查询预约状态 | 159 | * 查询预约状态 |
| 77 | * | 160 | * |
| 78 | [{"relationId":"500002824823","liveId":"20000120522"},{"relationId":"500002845517","liveId":"20000120782"}] | 161 | [{"relationId":"500002824823","liveId":"20000120522"},{"relationId":"500002845517","liveId":"20000120782"}] |
| @@ -112,6 +112,23 @@ export struct DetailPlayLiveCommon { | @@ -112,6 +112,23 @@ export struct DetailPlayLiveCommon { | ||
| 112 | }) | 112 | }) |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | + // /** | ||
| 116 | + // * | ||
| 117 | + // * @returns true : 沉浸式;false : 非沉浸式 | ||
| 118 | + // */ | ||
| 119 | + // isImmersionLive(): boolean { | ||
| 120 | + // | ||
| 121 | + // let flag = false | ||
| 122 | + // | ||
| 123 | + // if (this.liveState === 'wait' || this.liveLandscape === 'news') { | ||
| 124 | + // flag = false | ||
| 125 | + // } else if (this.liveLandscape === 'general') { | ||
| 126 | + // flag = true | ||
| 127 | + // } | ||
| 128 | + // | ||
| 129 | + // return flag | ||
| 130 | + // } | ||
| 131 | + | ||
| 115 | onPageShow() { | 132 | onPageShow() { |
| 116 | this.pageShow = Math.random() | 133 | this.pageShow = Math.random() |
| 117 | Logger.info(TAG, 'onPageShow') | 134 | Logger.info(TAG, 'onPageShow') |
| @@ -7,7 +7,7 @@ import mediaquery from '@ohos.mediaquery'; | @@ -7,7 +7,7 @@ import mediaquery from '@ohos.mediaquery'; | ||
| 7 | import { Logger, WindowModel } from 'wdKit/Index'; | 7 | import { Logger, WindowModel } from 'wdKit/Index'; |
| 8 | import { router, window } from '@kit.ArkUI'; | 8 | import { router, window } from '@kit.ArkUI'; |
| 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; | 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 10 | -import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | 10 | +import { LiveOperRowListView } from 'wdComponent'; |
| 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 12 | 12 | ||
| 13 | let TAG: string = 'DetailPlayLivePage'; | 13 | let TAG: string = 'DetailPlayLivePage'; |
| @@ -69,16 +69,18 @@ export struct DetailPlayLivePage { | @@ -69,16 +69,18 @@ export struct DetailPlayLivePage { | ||
| 69 | .layoutWeight(1) | 69 | .layoutWeight(1) |
| 70 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 70 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 71 | 71 | ||
| 72 | - OperRowListView({ | ||
| 73 | - componentType: 4, | 72 | + LiveOperRowListView({ |
| 74 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 73 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 75 | styleType: 1, | 74 | styleType: 1, |
| 76 | contentDetailData: this.contentDetailData, | 75 | contentDetailData: this.contentDetailData, |
| 77 | - publishCommentModel: this.publishCommentModel, | ||
| 78 | - showCommentIcon: false, | ||
| 79 | - onCommentFocus: () => { | 76 | + onCommentInputFocus: () => { |
| 80 | // 切换到大家聊 | 77 | // 切换到大家聊 |
| 81 | this.changeToTab = Math.random() | 78 | this.changeToTab = Math.random() |
| 79 | + }, | ||
| 80 | + onCommentInputed: (content) => { | ||
| 81 | + if (content.comment) { | ||
| 82 | + this.liveViewModel.sendComment(content.comment) | ||
| 83 | + } | ||
| 82 | } | 84 | } |
| 83 | }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 85 | }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 84 | 86 | ||
| @@ -119,8 +121,8 @@ export struct DetailPlayLivePage { | @@ -119,8 +121,8 @@ export struct DetailPlayLivePage { | ||
| 119 | 121 | ||
| 120 | getLiveDetails() { | 122 | getLiveDetails() { |
| 121 | const data = this.contentDetailData | 123 | const data = this.contentDetailData |
| 122 | - console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState) | ||
| 123 | - console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle) | 124 | + // console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState) |
| 125 | + // console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle) | ||
| 124 | if (data.liveInfo?.liveState == 'wait') { | 126 | if (data.liveInfo?.liveState == 'wait') { |
| 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 | 127 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 |
| 126 | if (data.liveInfo?.liveStyle == 1) { | 128 | if (data.liveInfo?.liveStyle == 1) { |
| 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; |
| 4 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean } from 'wdBean/Index'; | 4 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean, ValueType } from 'wdBean/Index'; |
| 5 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; | 5 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; |
| 6 | 6 | ||
| 7 | const TAG = 'LiveModel' | 7 | const TAG = 'LiveModel' |
| @@ -151,6 +151,62 @@ export class LiveModel { | @@ -151,6 +151,62 @@ export class LiveModel { | ||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | /** | 153 | /** |
| 154 | + * 直播详情-C端点赞接口 | ||
| 155 | + * @param liveId | ||
| 156 | + * @param number | ||
| 157 | + * @param deviceId | ||
| 158 | + * @returns | ||
| 159 | + */ | ||
| 160 | + getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) { | ||
| 161 | + return new Promise<number>((success, fail) => { | ||
| 162 | + HttpRequest.get<ResponseDTO<number>>( | ||
| 163 | + HttpUrlUtils.getLiveRoomNumberLikeUrl() + `?liveId=${liveId}&number=${number}&deviceId=${deviceId}`, | ||
| 164 | + ).then((data: ResponseDTO<number>) => { | ||
| 165 | + if (!data || !data.data) { | ||
| 166 | + fail("数据为空") | ||
| 167 | + return | ||
| 168 | + } | ||
| 169 | + if (data.code != 0) { | ||
| 170 | + fail(data.message) | ||
| 171 | + return | ||
| 172 | + } | ||
| 173 | + success(data.data) | ||
| 174 | + }, (error: Error) => { | ||
| 175 | + fail(error.message) | ||
| 176 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 177 | + }) | ||
| 178 | + }) | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + /** | ||
| 182 | + * 直播详情-查询是否点赞接口 | ||
| 183 | + * @param liveId | ||
| 184 | + * @param userId | ||
| 185 | + * @param deviceId | ||
| 186 | + * @returns | ||
| 187 | + */ | ||
| 188 | + getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) { | ||
| 189 | + return new Promise<boolean>((success, fail) => { | ||
| 190 | + HttpRequest.get<ResponseDTO<boolean>>( | ||
| 191 | + HttpUrlUtils.getLiveLikeUrl() + `?liveId=${liveId}&userId=${userId}&deviceId=${deviceId}`, | ||
| 192 | + ).then((data: ResponseDTO<boolean>) => { | ||
| 193 | + if (!data || !data.data) { | ||
| 194 | + fail("数据为空") | ||
| 195 | + return | ||
| 196 | + } | ||
| 197 | + if (data.code != 0) { | ||
| 198 | + fail(data.message) | ||
| 199 | + return | ||
| 200 | + } | ||
| 201 | + success(data.data) | ||
| 202 | + }, (error: Error) => { | ||
| 203 | + fail(error.message) | ||
| 204 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 205 | + }) | ||
| 206 | + }) | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + /** | ||
| 154 | * 获取直播预约状态 | 210 | * 获取直播预约状态 |
| 155 | * @param relationId | 211 | * @param relationId |
| 156 | * @param liveId | 212 | * @param liveId |
| 1 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | import { ResponseDTO } from 'wdNetwork/Index' | 3 | import { ResponseDTO } from 'wdNetwork/Index' |
| 4 | import { LiveModel } from './LiveModel' | 4 | import { LiveModel } from './LiveModel' |
| @@ -68,6 +68,26 @@ export class LiveViewModel { | @@ -68,6 +68,26 @@ export class LiveViewModel { | ||
| 68 | }) | 68 | }) |
| 69 | }) | 69 | }) |
| 70 | } | 70 | } |
| 71 | + // 直播详情-C端点赞接口 | ||
| 72 | + getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) { | ||
| 73 | + return new Promise<number>((success, fail) => { | ||
| 74 | + this.liveModel.getLiveRoomNumberLike(liveId, number, deviceId).then((data) => { | ||
| 75 | + success(data) | ||
| 76 | + }).catch((message: string) => { | ||
| 77 | + fail(message) | ||
| 78 | + }) | ||
| 79 | + }) | ||
| 80 | + } | ||
| 81 | + // 直播详情-查询是否点赞接口 | ||
| 82 | + getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) { | ||
| 83 | + return new Promise<boolean>((success, fail) => { | ||
| 84 | + this.liveModel.getLiveLike(liveId, userId, deviceId).then((data) => { | ||
| 85 | + success(data) | ||
| 86 | + }).catch((message: string) => { | ||
| 87 | + fail(message) | ||
| 88 | + }) | ||
| 89 | + }) | ||
| 90 | + } | ||
| 71 | 91 | ||
| 72 | //直播预约状态查询 | 92 | //直播预约状态查询 |
| 73 | getLiveAppointmentStatus(relationId: string, liveId: string) { | 93 | getLiveAppointmentStatus(relationId: string, liveId: string) { |
| @@ -90,4 +110,8 @@ export class LiveViewModel { | @@ -90,4 +110,8 @@ export class LiveViewModel { | ||
| 90 | }) | 110 | }) |
| 91 | }) | 111 | }) |
| 92 | } | 112 | } |
| 113 | + | ||
| 114 | + sendComment(comment: string) { | ||
| 115 | + | ||
| 116 | + } | ||
| 93 | } | 117 | } |
| 1 | -import { window } from '@kit.ArkUI' | 1 | +import { window } from '@kit.ArkUI'; |
| 2 | import lottie from '@ohos/lottie'; | 2 | import lottie from '@ohos/lottie'; |
| 3 | 3 | ||
| 4 | -import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' | ||
| 5 | -import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' | ||
| 6 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | ||
| 7 | -import { DisplayDirection } from 'wdConstant/Index' | ||
| 8 | -import { LiveFollowComponent, LottieView } from 'wdComponent/Index' | 4 | +import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index'; |
| 5 | +import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer/Index'; | ||
| 6 | +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | ||
| 7 | +import { DisplayDirection } from 'wdConstant/Index'; | ||
| 8 | +import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; | ||
| 9 | 9 | ||
| 10 | @Component | 10 | @Component |
| 11 | export struct PlayUIComponent { | 11 | export struct PlayUIComponent { |
| 12 | playerController?: WDAliPlayerController; | 12 | playerController?: WDAliPlayerController; |
| 13 | //菜单键是否可见 | 13 | //菜单键是否可见 |
| 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true | 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true |
| 15 | -// @Consume liveDetailsBean: LiveDetailsBean | ||
| 16 | @Consume contentDetailData: ContentDetailDTO | 15 | @Consume contentDetailData: ContentDetailDTO |
| 17 | @Consume liveRoomDataBean: LiveRoomDataBean | 16 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 18 | @State currentTime: string = '' | 17 | @State currentTime: string = '' |
| @@ -21,8 +20,11 @@ export struct PlayUIComponent { | @@ -21,8 +20,11 @@ export struct PlayUIComponent { | ||
| 21 | //是否处于播放状态中 | 20 | //是否处于播放状态中 |
| 22 | @State isPlayStatus: boolean = true | 21 | @State isPlayStatus: boolean = true |
| 23 | @Consume displayDirection: DisplayDirection | 22 | @Consume displayDirection: DisplayDirection |
| 24 | - | ||
| 25 | @Prop isShowBottom: boolean | 23 | @Prop isShowBottom: boolean |
| 24 | + // 播放地址 (视频或者 直播地址) | ||
| 25 | + @Prop liveUrl: string | ||
| 26 | + // 当前播放资源的状态 | ||
| 27 | + @Consume playSourceState: number | ||
| 26 | 28 | ||
| 27 | onChangeMenuVisible() { | 29 | onChangeMenuVisible() { |
| 28 | if (!this.contentDetailData || !this.contentDetailData.liveInfo || | 30 | if (!this.contentDetailData || !this.contentDetailData.liveInfo || |
| @@ -41,6 +43,21 @@ export struct PlayUIComponent { | @@ -41,6 +43,21 @@ export struct PlayUIComponent { | ||
| 41 | 43 | ||
| 42 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 43 | this.onChangeMenuVisible() | 45 | this.onChangeMenuVisible() |
| 46 | + | ||
| 47 | + this.initPlayerSet() | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + aboutToDisappear(): void { | ||
| 51 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { | ||
| 52 | + lottie.destroy('live_status_wait') | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /* | ||
| 57 | + 初始话播放器设置 | ||
| 58 | + */ | ||
| 59 | + initPlayerSet(){ | ||
| 60 | + | ||
| 44 | //播放进度监听 | 61 | //播放进度监听 |
| 45 | if (this.playerController) { | 62 | if (this.playerController) { |
| 46 | this.playerController.onTimeUpdate = (position: number, duration: number) => { | 63 | this.playerController.onTimeUpdate = (position: number, duration: number) => { |
| @@ -49,12 +66,7 @@ export struct PlayUIComponent { | @@ -49,12 +66,7 @@ export struct PlayUIComponent { | ||
| 49 | this.progressVal = Math.floor(position * 100 / duration); | 66 | this.progressVal = Math.floor(position * 100 / duration); |
| 50 | } | 67 | } |
| 51 | } | 68 | } |
| 52 | - } | ||
| 53 | 69 | ||
| 54 | - aboutToDisappear(): void { | ||
| 55 | - if (this.contentDetailData.liveInfo?.liveState == 'running') { | ||
| 56 | - lottie.destroy('live_status_wait') | ||
| 57 | - } | ||
| 58 | } | 70 | } |
| 59 | 71 | ||
| 60 | build() { | 72 | build() { |
| @@ -62,7 +74,7 @@ export struct PlayUIComponent { | @@ -62,7 +74,7 @@ export struct PlayUIComponent { | ||
| 62 | if (this.contentDetailData && this.contentDetailData.liveInfo) { | 74 | if (this.contentDetailData && this.contentDetailData.liveInfo) { |
| 63 | this.getTopUIComponent() | 75 | this.getTopUIComponent() |
| 64 | this.getMiddleUIComponent() | 76 | this.getMiddleUIComponent() |
| 65 | - if(this.isShowBottom){ | 77 | + if (this.isShowBottom) { |
| 66 | this.getBottomUIComponent() | 78 | this.getBottomUIComponent() |
| 67 | } | 79 | } |
| 68 | 80 | ||
| @@ -251,16 +263,13 @@ export struct PlayUIComponent { | @@ -251,16 +263,13 @@ export struct PlayUIComponent { | ||
| 251 | @Builder | 263 | @Builder |
| 252 | getBottomUIComponent() { | 264 | getBottomUIComponent() { |
| 253 | Row() { | 265 | Row() { |
| 254 | - if (this.contentDetailData?.liveInfo?.liveState == 'wait') { | ||
| 255 | - Blank() | ||
| 256 | - } else if (this.contentDetailData?.liveInfo?.liveState == 'running') { | ||
| 257 | - this.playOrPauseBtn() | ||
| 258 | - Blank() | ||
| 259 | - } else if (this.contentDetailData?.liveInfo?.liveState == 'end') { | ||
| 260 | - if (StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)) { | ||
| 261 | - Blank() | ||
| 262 | - } else { | 266 | + |
| 267 | + // 视频资源 | ||
| 268 | + if (!StringUtils.isEmpty(this.liveUrl)) { | ||
| 269 | + // 暂定和播放按钮 | ||
| 263 | this.playOrPauseBtn() | 270 | this.playOrPauseBtn() |
| 271 | + // 开始时间 | ||
| 272 | + if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | ||
| 264 | Text(this.currentTime) | 273 | Text(this.currentTime) |
| 265 | .fontColor(Color.White) | 274 | .fontColor(Color.White) |
| 266 | .fontWeight(600) | 275 | .fontWeight(600) |
| @@ -268,7 +277,12 @@ export struct PlayUIComponent { | @@ -268,7 +277,12 @@ export struct PlayUIComponent { | ||
| 268 | .margin({ | 277 | .margin({ |
| 269 | left: 16 | 278 | left: 16 |
| 270 | }) | 279 | }) |
| 280 | + } | ||
| 281 | + | ||
| 282 | + // 进度条 | ||
| 271 | this.playProgressView() | 283 | this.playProgressView() |
| 284 | + // 总的播放时间 | ||
| 285 | + if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | ||
| 272 | Text(this.totalTime) | 286 | Text(this.totalTime) |
| 273 | .fontColor(Color.White) | 287 | .fontColor(Color.White) |
| 274 | .fontWeight(600) | 288 | .fontWeight(600) |
| @@ -277,11 +291,13 @@ export struct PlayUIComponent { | @@ -277,11 +291,13 @@ export struct PlayUIComponent { | ||
| 277 | right: 16 | 291 | right: 16 |
| 278 | }) | 292 | }) |
| 279 | } | 293 | } |
| 294 | + | ||
| 295 | + } else { | ||
| 296 | + Blank() | ||
| 280 | } | 297 | } |
| 281 | - if (this.contentDetailData?.liveInfo?.liveState == 'running' | ||
| 282 | - || (this.contentDetailData?.liveInfo?.liveState == 'end' && | ||
| 283 | - StringUtils.isNotEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)) | ||
| 284 | - ) { | 298 | + |
| 299 | + // 全屏按钮 | ||
| 300 | + if (!StringUtils.isEmpty(this.liveUrl)) { | ||
| 285 | Image($r('app.media.icon_live_player_full_screen')) | 301 | Image($r('app.media.icon_live_player_full_screen')) |
| 286 | .width(24) | 302 | .width(24) |
| 287 | .height(24) | 303 | .height(24) |
| @@ -298,6 +314,7 @@ export struct PlayUIComponent { | @@ -298,6 +314,7 @@ export struct PlayUIComponent { | ||
| 298 | }) | 314 | }) |
| 299 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 315 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 300 | } | 316 | } |
| 317 | + | ||
| 301 | } | 318 | } |
| 302 | .alignItems(VerticalAlign.Center) | 319 | .alignItems(VerticalAlign.Center) |
| 303 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 320 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| @@ -313,6 +330,19 @@ export struct PlayUIComponent { | @@ -313,6 +330,19 @@ export struct PlayUIComponent { | ||
| 313 | 330 | ||
| 314 | @Builder | 331 | @Builder |
| 315 | playOrPauseBtn() { | 332 | playOrPauseBtn() { |
| 333 | + | ||
| 334 | + if (this.playSourceState === PlayerConstants.STATUS_COMPLETION) { | ||
| 335 | + //资源播放完成 | ||
| 336 | + Image($r('app.media.player_play_ic')) | ||
| 337 | + .width(24) | ||
| 338 | + .height(24) | ||
| 339 | + .onClick(() => { | ||
| 340 | + this.isPlayStatus = true | ||
| 341 | + this.initPlayerSet() | ||
| 342 | + this.playerController?.firstPlay(this.liveUrl) | ||
| 343 | + this.playerController?.play() | ||
| 344 | + }) | ||
| 345 | + } else { | ||
| 316 | //暂停、播放 | 346 | //暂停、播放 |
| 317 | Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic')) | 347 | Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic')) |
| 318 | .width(24) | 348 | .width(24) |
| @@ -328,6 +358,8 @@ export struct PlayUIComponent { | @@ -328,6 +358,8 @@ export struct PlayUIComponent { | ||
| 328 | }) | 358 | }) |
| 329 | } | 359 | } |
| 330 | 360 | ||
| 361 | + } | ||
| 362 | + | ||
| 331 | @Builder | 363 | @Builder |
| 332 | playProgressView() { | 364 | playProgressView() { |
| 333 | Slider({ | 365 | Slider({ |
| @@ -13,7 +13,9 @@ const TAG: string = 'TopPlayComponent' | @@ -13,7 +13,9 @@ const TAG: string = 'TopPlayComponent' | ||
| 13 | export struct TopPlayComponent { | 13 | export struct TopPlayComponent { |
| 14 | @Consume @Watch('updateData') contentDetailData: ContentDetailDTO | 14 | @Consume @Watch('updateData') contentDetailData: ContentDetailDTO |
| 15 | playerController?: WDAliPlayerController | 15 | playerController?: WDAliPlayerController |
| 16 | - @State imgUrl: string = '' | 16 | + // 预告片图片/视频url |
| 17 | + @State previewUrl: string = '' | ||
| 18 | + @State isVideoSource: boolean = false | ||
| 17 | //未开始 | 19 | //未开始 |
| 18 | @State isWait: boolean = false | 20 | @State isWait: boolean = false |
| 19 | //已结束直播 | 21 | //已结束直播 |
| @@ -24,14 +26,15 @@ export struct TopPlayComponent { | @@ -24,14 +26,15 @@ export struct TopPlayComponent { | ||
| 24 | @State isLoading: boolean = false | 26 | @State isLoading: boolean = false |
| 25 | // 获取播放资源能播放了 | 27 | // 获取播放资源能播放了 |
| 26 | @State isCanPlay: boolean = false | 28 | @State isCanPlay: boolean = false |
| 27 | - | 29 | + // 当前播放资源的状态 |
| 30 | + @Provide playSourceState: number = 0 | ||
| 28 | private playUrl: string = "" | 31 | private playUrl: string = "" |
| 29 | private xComponentIsLoaded: boolean = false | 32 | private xComponentIsLoaded: boolean = false |
| 30 | 33 | ||
| 31 | aboutToAppear(): void { | 34 | aboutToAppear(): void { |
| 32 | if (this.playerController) { | 35 | if (this.playerController) { |
| 33 | this.playerController.onCanplay = () => { | 36 | this.playerController.onCanplay = () => { |
| 34 | - | 37 | + Logger.debug(TAG, 'onCanplay==>') |
| 35 | this.isCanPlay = true | 38 | this.isCanPlay = true |
| 36 | this.isLoading = true | 39 | this.isLoading = true |
| 37 | this.playerController?.play() | 40 | this.playerController?.play() |
| @@ -40,35 +43,56 @@ export struct TopPlayComponent { | @@ -40,35 +43,56 @@ export struct TopPlayComponent { | ||
| 40 | 43 | ||
| 41 | this.playerController.onStatusChange = (status: number) => { | 44 | this.playerController.onStatusChange = (status: number) => { |
| 42 | 45 | ||
| 46 | + this.playSourceState = status | ||
| 47 | + Logger.debug(TAG, 'status==>' + status) | ||
| 43 | if (status === PlayerConstants.STATUS_ERROR) { | 48 | if (status === PlayerConstants.STATUS_ERROR) { |
| 44 | this.isError = true | 49 | this.isError = true |
| 45 | this.isLoading = true | 50 | this.isLoading = true |
| 46 | - | ||
| 47 | this.isCanPlay = false | 51 | this.isCanPlay = false |
| 52 | + } else if (status === PlayerConstants.STATUS_COMPLETION) { | ||
| 53 | + // 播放完成 | ||
| 54 | + | ||
| 55 | + | ||
| 48 | } else { | 56 | } else { |
| 49 | this.isError = false | 57 | this.isError = false |
| 50 | } | 58 | } |
| 51 | 59 | ||
| 52 | - | ||
| 53 | } | 60 | } |
| 54 | } | 61 | } |
| 55 | this.updateData() | 62 | this.updateData() |
| 56 | } | 63 | } |
| 57 | 64 | ||
| 58 | updateData() { | 65 | updateData() { |
| 66 | + | ||
| 67 | + // 检测等待中的直播预告是否视频资源 | ||
| 68 | + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 | ||
| 69 | + && this.contentDetailData.liveInfo.previewUrl && | ||
| 70 | + this.contentDetailData.liveInfo.previewUrl.length > 0) { | ||
| 71 | + // 预告资源是视频 | ||
| 72 | + this.isVideoSource = true | ||
| 73 | + this.contentDetailData.showTime = true | ||
| 74 | + } | ||
| 59 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 75 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 60 | if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl && | 76 | if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl && |
| 61 | this.contentDetailData.liveInfo.previewUrl.length > 0) { | 77 | this.contentDetailData.liveInfo.previewUrl.length > 0) { |
| 62 | - this.imgUrl = this.contentDetailData.liveInfo.previewUrl | ||
| 63 | - Logger.debug(TAG, 'ok+' + `${this.imgUrl}`) | 78 | + this.previewUrl = this.contentDetailData.liveInfo.previewUrl |
| 79 | + | ||
| 64 | } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { | 80 | } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { |
| 65 | - this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url | ||
| 66 | - Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) | 81 | + this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url |
| 67 | } | 82 | } |
| 83 | + | ||
| 84 | + Logger.debug(TAG, 'ok+' + `${this.previewUrl}`) | ||
| 85 | + | ||
| 86 | + if (this.isVideoSource) { | ||
| 87 | + this.isWait = false | ||
| 88 | + this.isLoading = false | ||
| 89 | + } else { | ||
| 68 | this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' | 90 | this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' |
| 69 | - if(this.isWait ){ | 91 | + if (this.isWait) { |
| 70 | this.isLoading = true | 92 | this.isLoading = true |
| 71 | } | 93 | } |
| 94 | + } | ||
| 95 | + | ||
| 72 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && | 96 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && |
| 73 | StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) | 97 | StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) |
| 74 | if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { | 98 | if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { |
| @@ -78,13 +102,19 @@ export struct TopPlayComponent { | @@ -78,13 +102,19 @@ export struct TopPlayComponent { | ||
| 78 | } else if (this.contentDetailData.liveInfo.liveState == 'end') { | 102 | } else if (this.contentDetailData.liveInfo.liveState == 'end') { |
| 79 | playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri | 103 | playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri |
| 80 | } | 104 | } |
| 81 | - // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); | 105 | + |
| 106 | + if (this.isVideoSource) { | ||
| 107 | + this.playUrl = this.previewUrl | ||
| 108 | + this.tryToPlay() | ||
| 109 | + } else { | ||
| 82 | if (StringUtils.isNotEmpty(playUrl)) { | 110 | if (StringUtils.isNotEmpty(playUrl)) { |
| 83 | Logger.debug(TAG, `${playUrl}`) | 111 | Logger.debug(TAG, `${playUrl}`) |
| 84 | this.playUrl = playUrl | 112 | this.playUrl = playUrl |
| 85 | this.tryToPlay() | 113 | this.tryToPlay() |
| 86 | } | 114 | } |
| 87 | } | 115 | } |
| 116 | + | ||
| 117 | + } | ||
| 88 | } | 118 | } |
| 89 | 119 | ||
| 90 | tryToPlay() { | 120 | tryToPlay() { |
| @@ -115,18 +145,22 @@ export struct TopPlayComponent { | @@ -115,18 +145,22 @@ export struct TopPlayComponent { | ||
| 115 | .width('100%') | 145 | .width('100%') |
| 116 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) | 146 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) |
| 117 | 147 | ||
| 148 | + if (this.isVideoSource) { | ||
| 149 | + | ||
| 150 | + } else { | ||
| 118 | // 直播房间图 | 151 | // 直播房间图 |
| 119 | - Image(this.imgUrl) | 152 | + Image(this.previewUrl) |
| 120 | .objectFit(ImageFit.Cover) | 153 | .objectFit(ImageFit.Cover) |
| 121 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) | 154 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) |
| 122 | .contrast(this.isEnd ? 0.2 : 1) | 155 | .contrast(this.isEnd ? 0.2 : 1) |
| 123 | .width('100%') | 156 | .width('100%') |
| 157 | + } | ||
| 124 | 158 | ||
| 125 | // loading | 159 | // loading |
| 126 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 160 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 127 | 161 | ||
| 128 | // 视频播放器上的控制面板和信息 | 162 | // 视频播放器上的控制面板和信息 |
| 129 | - PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay }) | 163 | + PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl }) |
| 130 | 164 | ||
| 131 | // 直播结束 | 165 | // 直播结束 |
| 132 | Text('直播已结束') | 166 | Text('直播已结束') |
| 1 | import { Action, ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | import { Action, ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { LiveCommentComponent } from 'wdComponent/Index' | 2 | import { LiveCommentComponent } from 'wdComponent/Index' |
| 3 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | 3 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel' |
| 4 | -import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView' | 4 | +import { LiveOperRowListView } from 'wdComponent' |
| 5 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | 5 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' |
| 6 | import { DisplayDirection, SpConstants, ViewType } from 'wdConstant/Index' | 6 | import { DisplayDirection, SpConstants, ViewType } from 'wdConstant/Index' |
| 7 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 7 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| @@ -112,14 +112,19 @@ export struct PlayerCommentComponent { | @@ -112,14 +112,19 @@ export struct PlayerCommentComponent { | ||
| 112 | .margin({ bottom: 20 }) | 112 | .margin({ bottom: 20 }) |
| 113 | 113 | ||
| 114 | // 收藏、分享、点赞是否需要根据字段显隐 | 114 | // 收藏、分享、点赞是否需要根据字段显隐 |
| 115 | - OperRowListView({ | 115 | + LiveOperRowListView({ |
| 116 | styleType: 3, | 116 | styleType: 3, |
| 117 | - componentType: 4, | ||
| 118 | pageComponentType: 2, // 竖屏直播页 | 117 | pageComponentType: 2, // 竖屏直播页 |
| 119 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 118 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 120 | contentDetailData: this.contentDetailData, | 119 | contentDetailData: this.contentDetailData, |
| 121 | - publishCommentModel: this.publishCommentModel, | ||
| 122 | - showCommentIcon: false, | 120 | + onCommentInputFocus: () => { |
| 121 | + | ||
| 122 | + }, | ||
| 123 | + onCommentInputed: (content) => { | ||
| 124 | + if (content.comment) { | ||
| 125 | + this.liveViewModel.sendComment(content.comment) | ||
| 126 | + } | ||
| 127 | + }, | ||
| 123 | onBack: () => { | 128 | onBack: () => { |
| 124 | WindowModel.shared.setWindowLayoutFullScreen(false) | 129 | WindowModel.shared.setWindowLayoutFullScreen(false) |
| 125 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 130 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| @@ -16,6 +16,7 @@ import { CommentDialogView } from '../view/CommentDialogView'; | @@ -16,6 +16,7 @@ import { CommentDialogView } from '../view/CommentDialogView'; | ||
| 16 | import { window } from '@kit.ArkUI'; | 16 | import { window } from '@kit.ArkUI'; |
| 17 | import { PlayerFullScreenView } from '../view/PlayerFullScreenView'; | 17 | import { PlayerFullScreenView } from '../view/PlayerFullScreenView'; |
| 18 | import { OperRowListView, publishCommentModel } from 'wdComponent/Index'; | 18 | import { OperRowListView, publishCommentModel } from 'wdComponent/Index'; |
| 19 | +import { ParamType, TrackConstants } from 'wdTracking/Index'; | ||
| 19 | 20 | ||
| 20 | const TAG = 'DetailPlayShortVideoPage'; | 21 | const TAG = 'DetailPlayShortVideoPage'; |
| 21 | 22 | ||
| @@ -49,6 +50,10 @@ export struct DetailPlayShortVideoPage { | @@ -49,6 +50,10 @@ export struct DetailPlayShortVideoPage { | ||
| 49 | @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false | 50 | @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false |
| 50 | @State imageVisible: boolean = true | 51 | @State imageVisible: boolean = true |
| 51 | @State ratio: number = 16 / 9 | 52 | @State ratio: number = 16 / 9 |
| 53 | + @State playerWidth: number | string = px2vp(this.windowWidth) | ||
| 54 | + @State playerHeight: number | string = px2vp(this.windowHeight) | ||
| 55 | + pageParam: ParamType = {} | ||
| 56 | + PageName: string = '' | ||
| 52 | 57 | ||
| 53 | /** | 58 | /** |
| 54 | * 页面显示重查用户关注、点赞等信息 | 59 | * 页面显示重查用户关注、点赞等信息 |
| @@ -91,7 +96,8 @@ export struct DetailPlayShortVideoPage { | @@ -91,7 +96,8 @@ export struct DetailPlayShortVideoPage { | ||
| 91 | } else { | 96 | } else { |
| 92 | this.queryNewsInfoOfUser() | 97 | this.queryNewsInfoOfUser() |
| 93 | if (!this.playerController.getPlayer()) { | 98 | if (!this.playerController.getPlayer()) { |
| 94 | - this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || ''); | 99 | + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '', this.PageName, |
| 100 | + this.PageName, this.pageParam); | ||
| 95 | } else { | 101 | } else { |
| 96 | await this.playerController.play() | 102 | await this.playerController.play() |
| 97 | this.imageVisible = false | 103 | this.imageVisible = false |
| @@ -165,7 +171,30 @@ export struct DetailPlayShortVideoPage { | @@ -165,7 +171,30 @@ export struct DetailPlayShortVideoPage { | ||
| 165 | } | 171 | } |
| 166 | this.queryNewsInfoOfUser() | 172 | this.queryNewsInfoOfUser() |
| 167 | 173 | ||
| 174 | + this.contentTrackingDict() | ||
| 175 | + } | ||
| 168 | 176 | ||
| 177 | + contentTrackingDict() { | ||
| 178 | + this.pageParam = { | ||
| 179 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 180 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 181 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 182 | + } | ||
| 183 | + if (this.contentDetailData.newsType == 1) { | ||
| 184 | + this.PageName = TrackConstants.PageName.VideoDetail // 点播 | ||
| 185 | + } else if (this.contentDetailData.newsType == 2) { | ||
| 186 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 187 | + } else if (this.contentDetailData.newsType == 5) { | ||
| 188 | + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页 | ||
| 189 | + } else if (this.contentDetailData.newsType == 8) { | ||
| 190 | + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页 | ||
| 191 | + } else if (this.contentDetailData.newsType == 9) { | ||
| 192 | + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页 | ||
| 193 | + } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | ||
| 194 | + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | ||
| 195 | + } | ||
| 196 | + console.log('视频详情页', JSON.stringify(this.pageParam)) | ||
| 197 | + console.log('视频详情页2', JSON.stringify(this.PageName)) | ||
| 169 | } | 198 | } |
| 170 | 199 | ||
| 171 | async aboutToDisappear(): Promise<void> { | 200 | async aboutToDisappear(): Promise<void> { |
| @@ -174,6 +203,32 @@ export struct DetailPlayShortVideoPage { | @@ -174,6 +203,32 @@ export struct DetailPlayShortVideoPage { | ||
| 174 | await this.playerController?.release(); | 203 | await this.playerController?.release(); |
| 175 | } | 204 | } |
| 176 | 205 | ||
| 206 | + /** | ||
| 207 | + * 屏幕变化动态计算播放器宽高 | ||
| 208 | + */ | ||
| 209 | + calculatePlayerRect() { | ||
| 210 | + let width = this.windowWidth | ||
| 211 | + let height = this.windowHeight | ||
| 212 | + if (this.displayDirection === DisplayDirection.VERTICAL) { | ||
| 213 | + width = this.windowWidth | ||
| 214 | + height = this.windowHeight | ||
| 215 | + } else { | ||
| 216 | + width = this.windowHeight | ||
| 217 | + height = this.windowWidth | ||
| 218 | + } | ||
| 219 | + // 视频宽高比屏幕大,则宽度撑满 | ||
| 220 | + if (this.ratio > width / height) { | ||
| 221 | + this.playerWidth = '100%' | ||
| 222 | + this.playerHeight = px2vp(width / this.ratio) | ||
| 223 | + } else { | ||
| 224 | + // 否则高度撑满 | ||
| 225 | + this.playerHeight = '100%' | ||
| 226 | + this.playerWidth = px2vp(height * this.ratio) | ||
| 227 | + } | ||
| 228 | + console.log('calculatePlayerRect=====', this.windowWidth, this.windowHeight) | ||
| 229 | + | ||
| 230 | + } | ||
| 231 | + | ||
| 177 | build() { | 232 | build() { |
| 178 | Stack({ alignContent: Alignment.Top }) { | 233 | Stack({ alignContent: Alignment.Top }) { |
| 179 | Column() { | 234 | Column() { |
| @@ -182,7 +237,8 @@ export struct DetailPlayShortVideoPage { | @@ -182,7 +237,8 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | index: $index, | 237 | index: $index, |
| 183 | currentIndex: $currentIndex, | 238 | currentIndex: $currentIndex, |
| 184 | showCommentList: $showCommentList, | 239 | showCommentList: $showCommentList, |
| 185 | - publishCommentModel: $publishCommentModel | 240 | + publishCommentModel: $publishCommentModel, |
| 241 | + interactData: $interactData, | ||
| 186 | }) | 242 | }) |
| 187 | this.playerViewBuilder() | 243 | this.playerViewBuilder() |
| 188 | 244 | ||
| @@ -224,6 +280,7 @@ export struct DetailPlayShortVideoPage { | @@ -224,6 +280,7 @@ export struct DetailPlayShortVideoPage { | ||
| 224 | } | 280 | } |
| 225 | .height('100%') | 281 | .height('100%') |
| 226 | .width('100%') | 282 | .width('100%') |
| 283 | + .onAreaChange(() => this.calculatePlayerRect()) | ||
| 227 | 284 | ||
| 228 | } | 285 | } |
| 229 | 286 | ||
| @@ -237,9 +294,9 @@ export struct DetailPlayShortVideoPage { | @@ -237,9 +294,9 @@ export struct DetailPlayShortVideoPage { | ||
| 237 | Image(this.contentDetailData?.firstFrameImageUri) | 294 | Image(this.contentDetailData?.firstFrameImageUri) |
| 238 | .width('100%') | 295 | .width('100%') |
| 239 | .height(this.windowWidth / this.ratio + 'px') | 296 | .height(this.windowWidth / this.ratio + 'px') |
| 240 | - .opacity(this.imageVisible ? 1 : 0) | 297 | + .opacity(this.imageVisible ? 0.8 : 0) |
| 241 | .animation({ | 298 | .animation({ |
| 242 | - duration: 500, curve: Curve.EaseInOut | 299 | + duration: 350, curve: Curve.EaseInOut |
| 243 | }) | 300 | }) |
| 244 | } | 301 | } |
| 245 | 302 | ||
| @@ -250,12 +307,13 @@ export struct DetailPlayShortVideoPage { | @@ -250,12 +307,13 @@ export struct DetailPlayShortVideoPage { | ||
| 250 | playerController: this.playerController, | 307 | playerController: this.playerController, |
| 251 | onLoad: async () => { | 308 | onLoad: async () => { |
| 252 | if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) { | 309 | if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) { |
| 253 | - this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl); | 310 | + this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl, this.PageName, this.PageName, |
| 311 | + this.pageParam); | ||
| 254 | } | 312 | } |
| 255 | } | 313 | } |
| 256 | }) | 314 | }) |
| 257 | - .width(this.displayDirection === DisplayDirection.VERTICAL ? '100%' : this.windowWidth * 16 / 9 + 'px') | ||
| 258 | - .height(this.displayDirection === DisplayDirection.VERTICAL ? this.windowWidth / this.ratio + 'px' : '100%') | 315 | + .width(this.playerWidth) |
| 316 | + .height(this.playerHeight) | ||
| 259 | 317 | ||
| 260 | this.playerCoverBuilder() | 318 | this.playerCoverBuilder() |
| 261 | 319 |
| @@ -15,7 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | @@ -15,7 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | ||
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; | 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; |
| 17 | import { DateTimeUtils } from 'wdKit/Index'; | 17 | import { DateTimeUtils } from 'wdKit/Index'; |
| 18 | -import {TrackConstants,TrackingPageBrowse } from 'wdTracking/Index'; | 18 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 19 | 19 | ||
| 20 | interface loadMoreData { | 20 | interface loadMoreData { |
| 21 | pageNum: number; | 21 | pageNum: number; |
| @@ -61,17 +61,17 @@ export struct VideoChannelDetail { | @@ -61,17 +61,17 @@ export struct VideoChannelDetail { | ||
| 61 | @State totalCount: number = 0 | 61 | @State totalCount: number = 0 |
| 62 | @State isMouted: boolean = false | 62 | @State isMouted: boolean = false |
| 63 | @State isRequestError: boolean = false | 63 | @State isRequestError: boolean = false |
| 64 | - pageShowTime:number = 0; | ||
| 65 | - pageHideTime:number = 0; | 64 | + @State isRequesting: boolean = false |
| 65 | + pageShowTime: number = 0; | ||
| 66 | + pageHideTime: number = 0; | ||
| 66 | 67 | ||
| 67 | autoRefreshChange() { | 68 | autoRefreshChange() { |
| 68 | - if (this.topNavIndex === 0) { | 69 | + if (this.topNavIndex === 0 && !this.isRequesting) { |
| 69 | this.data = [] | 70 | this.data = [] |
| 70 | this.interactDataList = [] | 71 | this.interactDataList = [] |
| 71 | this.totalCount = 0 | 72 | this.totalCount = 0 |
| 72 | this.isMouted = false | 73 | this.isMouted = false |
| 73 | this.getRecCompInfo() | 74 | this.getRecCompInfo() |
| 74 | - this.getRecCompInfo() | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | } | 77 | } |
| @@ -95,8 +95,9 @@ export struct VideoChannelDetail { | @@ -95,8 +95,9 @@ export struct VideoChannelDetail { | ||
| 95 | console.log(TAG, '一级视频隐藏') | 95 | console.log(TAG, '一级视频隐藏') |
| 96 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 96 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 97 | let duration = 0 | 97 | let duration = 0 |
| 98 | - duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 99 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | 98 | + duration = Math.floor((this.pageHideTime - this.pageShowTime) / 1000) |
| 99 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal, | ||
| 100 | + TrackConstants.PageName.Customer_Personal, duration) | ||
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | /** | 103 | /** |
| @@ -187,7 +188,7 @@ export struct VideoChannelDetail { | @@ -187,7 +188,7 @@ export struct VideoChannelDetail { | ||
| 187 | AlertDialog.show({ message: '没有更多视频了~' }) | 188 | AlertDialog.show({ message: '没有更多视频了~' }) |
| 188 | return | 189 | return |
| 189 | } | 190 | } |
| 190 | - | 191 | + this.isRequesting = true |
| 191 | const params: getRecCompInfoParams = { | 192 | const params: getRecCompInfoParams = { |
| 192 | groupId: this.groupId, | 193 | groupId: this.groupId, |
| 193 | pageId: this.pageId, | 194 | pageId: this.pageId, |
| @@ -237,6 +238,7 @@ export struct VideoChannelDetail { | @@ -237,6 +238,7 @@ export struct VideoChannelDetail { | ||
| 237 | }).catch(() => { | 238 | }).catch(() => { |
| 238 | // 获取内容失败请重试 | 239 | // 获取内容失败请重试 |
| 239 | this.isRequestError = true | 240 | this.isRequestError = true |
| 241 | + this.isRequesting = false | ||
| 240 | }) | 242 | }) |
| 241 | } | 243 | } |
| 242 | 244 | ||
| @@ -251,7 +253,14 @@ export struct VideoChannelDetail { | @@ -251,7 +253,14 @@ export struct VideoChannelDetail { | ||
| 251 | this.data = this.data.concat(res.data) | 253 | this.data = this.data.concat(res.data) |
| 252 | } | 254 | } |
| 253 | console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) | 255 | console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) |
| 256 | + }).finally(() => { | ||
| 257 | + setTimeout(() => { | ||
| 258 | + this.isRequesting = false | ||
| 259 | + }, 2000) | ||
| 260 | + | ||
| 254 | }) | 261 | }) |
| 262 | + } else { | ||
| 263 | + this.isRequesting = false | ||
| 255 | } | 264 | } |
| 256 | } | 265 | } |
| 257 | 266 | ||
| @@ -268,6 +277,7 @@ export struct VideoChannelDetail { | @@ -268,6 +277,7 @@ export struct VideoChannelDetail { | ||
| 268 | }) | 277 | }) |
| 269 | } | 278 | } |
| 270 | } | 279 | } |
| 280 | + | ||
| 271 | build() { | 281 | build() { |
| 272 | Column() { | 282 | Column() { |
| 273 | if (this.isRequestError) { | 283 | if (this.isRequestError) { |
| 1 | -import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' | 3 | import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' |
| 4 | 4 | ||
| @@ -9,6 +9,7 @@ export struct CommentDialogView { | @@ -9,6 +9,7 @@ export struct CommentDialogView { | ||
| 9 | @Link currentIndex: number | 9 | @Link currentIndex: number |
| 10 | @Link publishCommentModel: publishCommentModel | 10 | @Link publishCommentModel: publishCommentModel |
| 11 | @Consume contentDetailData: ContentDetailDTO | 11 | @Consume contentDetailData: ContentDetailDTO |
| 12 | + @Link interactData: InteractDataDTO | ||
| 12 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 13 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| 14 | 15 | ||
| @@ -34,6 +35,9 @@ export struct CommentDialogView { | @@ -34,6 +35,9 @@ export struct CommentDialogView { | ||
| 34 | pageInfo: this.fakePageInfo, | 35 | pageInfo: this.fakePageInfo, |
| 35 | onClose: () => { | 36 | onClose: () => { |
| 36 | this.showCommentList = false | 37 | this.showCommentList = false |
| 38 | + if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { | ||
| 39 | + this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) | ||
| 40 | + } | ||
| 37 | } | 41 | } |
| 38 | }) | 42 | }) |
| 39 | } | 43 | } |
| @@ -38,9 +38,8 @@ export struct PlayerRightView { | @@ -38,9 +38,8 @@ export struct PlayerRightView { | ||
| 38 | @Consume showCommentList: boolean | 38 | @Consume showCommentList: boolean |
| 39 | @Consume displayDirection: DisplayDirection | 39 | @Consume displayDirection: DisplayDirection |
| 40 | @Consume publishCommentModel: publishCommentModel | 40 | @Consume publishCommentModel: publishCommentModel |
| 41 | - // @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 41 | + @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 42 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | 42 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 |
| 43 | - @State likesStyle: number | string = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | ||
| 44 | pageParam: ParamType = {} | 43 | pageParam: ParamType = {} |
| 45 | PageName: string = '' | 44 | PageName: string = '' |
| 46 | followUserId: string = '' | 45 | followUserId: string = '' |
| @@ -387,7 +386,7 @@ export struct PlayerRightView { | @@ -387,7 +386,7 @@ export struct PlayerRightView { | ||
| 387 | .width(32) | 386 | .width(32) |
| 388 | .aspectRatio(1) | 387 | .aspectRatio(1) |
| 389 | 388 | ||
| 390 | - Text(this.transNum2String('commentNum') || '抢首评') | 389 | + Text(this.interactData.commentNum > 0 ? this.transNum2String('commentNum') : '抢首评') |
| 391 | .width('100%') | 390 | .width('100%') |
| 392 | .fontWeight(500) | 391 | .fontWeight(500) |
| 393 | .textAlign(TextAlign.Center) | 392 | .textAlign(TextAlign.Center) |
| @@ -8,6 +8,8 @@ | @@ -8,6 +8,8 @@ | ||
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | "wdKit": "file:../../commons/wdKit", | 10 | "wdKit": "file:../../commons/wdKit", |
| 11 | - "premierlibrary": "file:./libs/premierlibrary.har" | 11 | + "premierlibrary": "file:./libs/premierlibrary.har", |
| 12 | + "wdTracking": "file:../wdTracking", | ||
| 13 | + "wdBean": "file:../../features/wdBean" | ||
| 12 | } | 14 | } |
| 13 | } | 15 | } |
| @@ -3,6 +3,9 @@ import prompt from '@ohos.promptAction'; | @@ -3,6 +3,9 @@ import prompt from '@ohos.promptAction'; | ||
| 3 | import { Logger } from '../utils/Logger'; | 3 | import { Logger } from '../utils/Logger'; |
| 4 | import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; | 4 | import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; |
| 5 | import { BusinessError } from '@ohos.base'; | 5 | import { BusinessError } from '@ohos.base'; |
| 6 | +import { TrackingPlay } from 'wdTracking/Index'; | ||
| 7 | +import { ParamType } from 'wdTracking/Index'; | ||
| 8 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 6 | 9 | ||
| 7 | @Observed | 10 | @Observed |
| 8 | export class WDPlayerController { | 11 | export class WDPlayerController { |
| @@ -17,6 +20,12 @@ export class WDPlayerController { | @@ -17,6 +20,12 @@ export class WDPlayerController { | ||
| 17 | private seekTime: number = 0; | 20 | private seekTime: number = 0; |
| 18 | private positionY: number = 0; | 21 | private positionY: number = 0; |
| 19 | private startTime: number = 0; | 22 | private startTime: number = 0; |
| 23 | + private pageParam: ParamType = {} | ||
| 24 | + private pageName: string = '' | ||
| 25 | + private creatStartTime:number = 0;//开始加载时间 | ||
| 26 | + private creatEndTime:number = 0;//加载完成时间 | ||
| 27 | + private prepareTime:number = 0; //加载时间 | ||
| 28 | + private currentPlayTime:number = 0; //当前播放时间 | ||
| 20 | public onVideoSizeChange?: (width: number, height: number) => void; | 29 | public onVideoSizeChange?: (width: number, height: number) => void; |
| 21 | public onTimeUpdate?: (position: number, duration: number) => void; | 30 | public onTimeUpdate?: (position: number, duration: number) => void; |
| 22 | public onVolumeUpdate?: (volume: number) => void; | 31 | public onVolumeUpdate?: (volume: number) => void; |
| @@ -28,6 +37,9 @@ export class WDPlayerController { | @@ -28,6 +37,9 @@ export class WDPlayerController { | ||
| 28 | public videoWidth: number = 0 | 37 | public videoWidth: number = 0 |
| 29 | public videoHeight: number = 0 | 38 | public videoHeight: number = 0 |
| 30 | 39 | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 31 | constructor() { | 43 | constructor() { |
| 32 | Logger.error("初始化") | 44 | Logger.error("初始化") |
| 33 | this.initPromise = this.createAVPlayer(); | 45 | this.initPromise = this.createAVPlayer(); |
| @@ -123,6 +135,8 @@ export class WDPlayerController { | @@ -123,6 +135,8 @@ export class WDPlayerController { | ||
| 123 | }); | 135 | }); |
| 124 | this.avPlayer?.on(Events.ERROR, (error) => { | 136 | this.avPlayer?.on(Events.ERROR, (error) => { |
| 125 | this.playError(error.message); | 137 | this.playError(error.message); |
| 138 | + console.log('播放错误',JSON.stringify(error)) | ||
| 139 | + TrackingPlay.videoPlayError(error.message, this.pageName, this.pageName, this.pageParam) | ||
| 126 | }) | 140 | }) |
| 127 | this.avPlayer?.on('seekDone', (time: number) => { | 141 | this.avPlayer?.on('seekDone', (time: number) => { |
| 128 | this.initProgress(time); | 142 | this.initProgress(time); |
| @@ -148,8 +162,18 @@ export class WDPlayerController { | @@ -148,8 +162,18 @@ export class WDPlayerController { | ||
| 148 | this.surfaceId = surfaceId | 162 | this.surfaceId = surfaceId |
| 149 | } | 163 | } |
| 150 | 164 | ||
| 151 | - async firstPlay(url: string) { | 165 | + async firstPlay(url: string,pageId?: string, pageName?: string, pageParam?: ParamType) { |
| 152 | this.url = url; | 166 | this.url = url; |
| 167 | + //加载时长prepareTime | ||
| 168 | + this.creatStartTime = DateTimeUtils.getTimeStamp() | ||
| 169 | + console.log('开始创建',JSON.stringify(this.creatStartTime)) | ||
| 170 | + this.prepareTime = 0 | ||
| 171 | + if(pageName){ | ||
| 172 | + this.pageName = pageName | ||
| 173 | + } | ||
| 174 | + if(pageParam){ | ||
| 175 | + this.pageParam = pageParam | ||
| 176 | + } | ||
| 153 | if (this.avPlayer == null) { | 177 | if (this.avPlayer == null) { |
| 154 | Logger.error("等待") | 178 | Logger.error("等待") |
| 155 | await this.initPromise; | 179 | await this.initPromise; |
| @@ -166,6 +190,11 @@ export class WDPlayerController { | @@ -166,6 +190,11 @@ export class WDPlayerController { | ||
| 166 | } | 190 | } |
| 167 | Logger.error("开始播放", this.url) | 191 | Logger.error("开始播放", this.url) |
| 168 | this.avPlayer.url = this.url; | 192 | this.avPlayer.url = this.url; |
| 193 | + //加载时长prepareTime | ||
| 194 | + this.creatEndTime = DateTimeUtils.getTimeStamp() | ||
| 195 | + this.prepareTime = 0 | ||
| 196 | + this.prepareTime = Math.floor((this.creatEndTime - this.creatStartTime)/1000) | ||
| 197 | + console.log('开始播放2',JSON.stringify(this.prepareTime)) | ||
| 169 | } | 198 | } |
| 170 | 199 | ||
| 171 | async release() { | 200 | async release() { |
| @@ -271,6 +300,7 @@ export class WDPlayerController { | @@ -271,6 +300,7 @@ export class WDPlayerController { | ||
| 271 | } | 300 | } |
| 272 | if (mode === SliderChangeMode.End) { | 301 | if (mode === SliderChangeMode.End) { |
| 273 | this.seekTime = Math.floor(value * this.duration / 100); | 302 | this.seekTime = Math.floor(value * this.duration / 100); |
| 303 | + this.currentPlayTime = this.seekTime | ||
| 274 | this.avPlayer?.seek(this.seekTime); | 304 | this.avPlayer?.seek(this.seekTime); |
| 275 | } | 305 | } |
| 276 | } | 306 | } |
| @@ -288,6 +318,7 @@ export class WDPlayerController { | @@ -288,6 +318,7 @@ export class WDPlayerController { | ||
| 288 | } | 318 | } |
| 289 | 319 | ||
| 290 | initProgress(time: number) { | 320 | initProgress(time: number) { |
| 321 | + this.currentPlayTime=Math.floor(time / 1000); | ||
| 291 | let nowSeconds = Math.floor(time / 1000); | 322 | let nowSeconds = Math.floor(time / 1000); |
| 292 | let totalSeconds = Math.floor(this.duration / 1000); | 323 | let totalSeconds = Math.floor(this.duration / 1000); |
| 293 | if (this.onTimeUpdate) { | 324 | if (this.onTimeUpdate) { |
| @@ -357,6 +388,24 @@ export class WDPlayerController { | @@ -357,6 +388,24 @@ export class WDPlayerController { | ||
| 357 | 388 | ||
| 358 | watchStatus() { | 389 | watchStatus() { |
| 359 | console.log('watchStatus', this.status) | 390 | console.log('watchStatus', this.status) |
| 391 | + if(this.status == 1){ | ||
| 392 | + console.log('播放视频') | ||
| 393 | + console.log('播放视频prepareTime',JSON.stringify(this.prepareTime)) | ||
| 394 | + console.log('播放视频pageName',JSON.stringify(this.pageName)) | ||
| 395 | + console.log('播放视频pageParam',JSON.stringify(this.pageParam)) | ||
| 396 | + // 播放埋点 | ||
| 397 | + TrackingPlay.videoPositivePlay(Number(this.prepareTime),this.pageName, this.pageName, this.pageParam) | ||
| 398 | + } | ||
| 399 | + if(this.status == 2){ | ||
| 400 | + let initDuration = Math.floor(Number(this.duration)/1000) | ||
| 401 | + console.log('播放结束') | ||
| 402 | + console.log('播放结束currentPlayTime',JSON.stringify(this.currentPlayTime)) | ||
| 403 | + console.log('播放结束initDuration',JSON.stringify(initDuration)) | ||
| 404 | + console.log('播放结束pageName',JSON.stringify(this.pageName)) | ||
| 405 | + console.log('播放结束pageParam',JSON.stringify(this.pageParam)) | ||
| 406 | + // 播放结束埋点 | ||
| 407 | + TrackingPlay.videoPlayEnd(this.currentPlayTime, initDuration, this.currentPlayTime, this.pageName, this.pageName, this.pageParam) | ||
| 408 | + } | ||
| 360 | if (this.onStatusChange) { | 409 | if (this.onStatusChange) { |
| 361 | this.onStatusChange(this.status) | 410 | this.onStatusChange(this.status) |
| 362 | } | 411 | } |
| @@ -50,8 +50,6 @@ export struct WDPlayerRenderLiveView { | @@ -50,8 +50,6 @@ export struct WDPlayerRenderLiveView { | ||
| 50 | 50 | ||
| 51 | aboutToAppear() { | 51 | aboutToAppear() { |
| 52 | MGPlayRenderViewIns.add(); | 52 | MGPlayRenderViewIns.add(); |
| 53 | - | ||
| 54 | - console.log('playerController', this.playerController) | ||
| 55 | insIndex++; | 53 | insIndex++; |
| 56 | if (!this.playerController) { | 54 | if (!this.playerController) { |
| 57 | return | 55 | return |
| @@ -59,7 +57,6 @@ export struct WDPlayerRenderLiveView { | @@ -59,7 +57,6 @@ export struct WDPlayerRenderLiveView { | ||
| 59 | 57 | ||
| 60 | this.playerController.onVideoSizeChange = (width: number, height: number) => { | 58 | this.playerController.onVideoSizeChange = (width: number, height: number) => { |
| 61 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | 59 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) |
| 62 | - Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`) | ||
| 63 | this.videoWidth = width; | 60 | this.videoWidth = width; |
| 64 | this.videoHeight = height; | 61 | this.videoHeight = height; |
| 65 | this.updateLayout() | 62 | this.updateLayout() |
| @@ -83,8 +80,6 @@ export struct WDPlayerRenderLiveView { | @@ -83,8 +80,6 @@ export struct WDPlayerRenderLiveView { | ||
| 83 | .onLoad(async (event) => { | 80 | .onLoad(async (event) => { |
| 84 | Logger.info(TAG, 'onLoad') | 81 | Logger.info(TAG, 'onLoad') |
| 85 | let surfaceId = this.xComponentController.getXComponentSurfaceId() | 82 | let surfaceId = this.xComponentController.getXComponentSurfaceId() |
| 86 | - console.log('surfaceId===', surfaceId) | ||
| 87 | - console.log('insId===', this.insId) | ||
| 88 | this.xComponentController.setXComponentSurfaceSize({ | 83 | this.xComponentController.setXComponentSurfaceSize({ |
| 89 | surfaceWidth: 1920, | 84 | surfaceWidth: 1920, |
| 90 | surfaceHeight: 720 | 85 | surfaceHeight: 720 |
| @@ -25,7 +25,7 @@ export class TrackingPlay { | @@ -25,7 +25,7 @@ export class TrackingPlay { | ||
| 25 | Tracking.event("video_positive_pybk", params) | 25 | Tracking.event("video_positive_pybk", params) |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | - // 视频 播放结束 | 28 | + // 视频 播放结束 currentPlayTime:当前时长,totalTime:总时长 ,browseTime:浏览时长, |
| 29 | static videoPlayEnd(currentPlayTime: number, totalTime: number, browseTime: number, pageId: string, pageName: string, extParams: ParamType) { | 29 | static videoPlayEnd(currentPlayTime: number, totalTime: number, browseTime: number, pageId: string, pageName: string, extParams: ParamType) { |
| 30 | let params = TrackingUtils.generateParams(extParams) | 30 | let params = TrackingUtils.generateParams(extParams) |
| 31 | if (pageId.length) { | 31 | if (pageId.length) { |
| @@ -13,7 +13,8 @@ | @@ -13,7 +13,8 @@ | ||
| 13 | "@ohos/pulltorefresh": "^2.0.5", | 13 | "@ohos/pulltorefresh": "^2.0.5", |
| 14 | "@mpaas/udid": "0.0.2", | 14 | "@mpaas/udid": "0.0.2", |
| 15 | "@mpaas/upgrade": "0.0.2", | 15 | "@mpaas/upgrade": "0.0.2", |
| 16 | - "@mpaas/framework": "0.0.2" | 16 | + "@mpaas/framework": "0.0.2", |
| 17 | + "@ohos/imageknife": "^2.1.2" | ||
| 17 | }, | 18 | }, |
| 18 | "dynamicDependencies": {} | 19 | "dynamicDependencies": {} |
| 19 | } | 20 | } |
| @@ -7,8 +7,12 @@ import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/Mine | @@ -7,8 +7,12 @@ import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/Mine | ||
| 7 | import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; | 7 | import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; |
| 8 | import { VideoChannelPage } from './VideoChannelPage'; | 8 | import { VideoChannelPage } from './VideoChannelPage'; |
| 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; | 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; |
| 10 | +import { ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'BottomNavigationComponent'; | 12 | const TAG = 'BottomNavigationComponent'; |
| 13 | +PersistentStorage.persistProp('channelIds', ''); | ||
| 14 | +PersistentStorage.persistProp('indexSettingChannelId', 2002); | ||
| 15 | + | ||
| 12 | let storage = LocalStorage.getShared(); | 16 | let storage = LocalStorage.getShared(); |
| 13 | 17 | ||
| 14 | /** | 18 | /** |
| @@ -131,16 +135,26 @@ export struct BottomNavigationComponent { | @@ -131,16 +135,26 @@ export struct BottomNavigationComponent { | ||
| 131 | @Builder | 135 | @Builder |
| 132 | tabBarBuilder(navItem: BottomNavDTO, index: number) { | 136 | tabBarBuilder(navItem: BottomNavDTO, index: number) { |
| 133 | Stack({ alignContent: Alignment.Bottom }) { | 137 | Stack({ alignContent: Alignment.Bottom }) { |
| 134 | - Image(this.getBottomIcon(navItem, this.currentNavIndex === index)) | ||
| 135 | - .height(CommonConstants.FULL_PARENT) | 138 | + // Image(this.getBottomIcon(navItem, this.currentNavIndex === index)) |
| 139 | + // .height(CommonConstants.FULL_PARENT) | ||
| 140 | + // .padding({ | ||
| 141 | + // bottom: 15, | ||
| 142 | + // left: 10, | ||
| 143 | + // right: 10, | ||
| 144 | + // top: 2 | ||
| 145 | + // }) | ||
| 146 | + // .aspectRatio(this.ASPECT_RATIO_1_1) | ||
| 147 | + // .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) | ||
| 148 | + ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) | ||
| 136 | .padding({ | 149 | .padding({ |
| 137 | bottom: 15, | 150 | bottom: 15, |
| 138 | left: 10, | 151 | left: 10, |
| 139 | right: 10, | 152 | right: 10, |
| 140 | top: 2 | 153 | top: 2 |
| 141 | }) | 154 | }) |
| 142 | - .aspectRatio(this.ASPECT_RATIO_1_1) | ||
| 143 | - .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) | 155 | + .width('100%') |
| 156 | + .height('100%') | ||
| 157 | + .enabled(false) | ||
| 144 | 158 | ||
| 145 | Text(navItem.name) | 159 | Text(navItem.name) |
| 146 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 160 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) |
| @@ -154,6 +168,7 @@ export struct BottomNavigationComponent { | @@ -154,6 +168,7 @@ export struct BottomNavigationComponent { | ||
| 154 | .height($r('app.float.bottom_navigation_barHeight')) | 168 | .height($r('app.float.bottom_navigation_barHeight')) |
| 155 | .hoverEffect(HoverEffect.Highlight) | 169 | .hoverEffect(HoverEffect.Highlight) |
| 156 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 170 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 171 | + // .hitTestBehavior(HitTestMode.Block) | ||
| 157 | .onClick(() => { | 172 | .onClick(() => { |
| 158 | Logger.info(TAG, `onChange, index: ${index}`); | 173 | Logger.info(TAG, `onChange, index: ${index}`); |
| 159 | this.onBottomNavigationIndexChange(navItem, index) | 174 | this.onBottomNavigationIndexChange(navItem, index) |
| @@ -161,6 +176,24 @@ export struct BottomNavigationComponent { | @@ -161,6 +176,24 @@ export struct BottomNavigationComponent { | ||
| 161 | 176 | ||
| 162 | } | 177 | } |
| 163 | 178 | ||
| 179 | + getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption { | ||
| 180 | + let defaultIcon = this.getBottomLocalIcon(navItem, isSelect) | ||
| 181 | + let url = this.getBottomIcon(navItem, isSelect) | ||
| 182 | + | ||
| 183 | + let imageKnifeOption: ImageKnifeOption = { | ||
| 184 | + loadSrc: url, | ||
| 185 | + // 占位图使用本地资源 | ||
| 186 | + placeholderSrc: defaultIcon, | ||
| 187 | + // 失败占位图使用本地资源 | ||
| 188 | + errorholderSrc: defaultIcon, | ||
| 189 | + // 是否开启一级内存缓存 | ||
| 190 | + isCacheable: true, | ||
| 191 | + // 磁盘缓存none | ||
| 192 | + strategy: new NONE() | ||
| 193 | + }; | ||
| 194 | + return imageKnifeOption | ||
| 195 | + } | ||
| 196 | + | ||
| 164 | private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string | Resource { | 197 | private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string | Resource { |
| 165 | if (!navItem) { | 198 | if (!navItem) { |
| 166 | return '' | 199 | return '' |
| @@ -173,10 +206,10 @@ export struct BottomNavigationComponent { | @@ -173,10 +206,10 @@ export struct BottomNavigationComponent { | ||
| 173 | // 获取常规icon | 206 | // 获取常规icon |
| 174 | icon = isSelect ? navItem.iconC : navItem.icon | 207 | icon = isSelect ? navItem.iconC : navItem.icon |
| 175 | } | 208 | } |
| 176 | - if (StringUtils.isEmpty(icon) || icon.includes('.pag')) { | ||
| 177 | - // 兜底,获取预置的本地icon | ||
| 178 | - return this.getBottomLocalIcon(navItem, isSelect) | ||
| 179 | - } | 209 | + // if (StringUtils.isEmpty(icon) || icon.includes('.pag')) { |
| 210 | + // // 兜底,获取预置的本地icon | ||
| 211 | + // return this.getBottomLocalIcon(navItem, isSelect) | ||
| 212 | + // } | ||
| 180 | return icon | 213 | return icon |
| 181 | } | 214 | } |
| 182 | 215 |
| @@ -6,7 +6,8 @@ import { | @@ -6,7 +6,8 @@ import { | ||
| 6 | postInteractBrowsOperateParams, | 6 | postInteractBrowsOperateParams, |
| 7 | postBatchAttentionStatusParams, | 7 | postBatchAttentionStatusParams, |
| 8 | postInteractAccentionOperateParams, | 8 | postInteractAccentionOperateParams, |
| 9 | - Params | 9 | + Params, |
| 10 | + InteractDataDTO | ||
| 10 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 11 | import display from '@ohos.display'; | 12 | import display from '@ohos.display'; |
| 12 | import { DateTimeUtils } from 'wdKit/Index'; | 13 | import { DateTimeUtils } from 'wdKit/Index'; |
| @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent { | @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 59 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 60 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 60 | @State currentOffset: number = 0 | 61 | @State currentOffset: number = 0 |
| 61 | @State duration: number = 0 | 62 | @State duration: number = 0 |
| 63 | + @Provide interactData: InteractDataDTO = {} as InteractDataDTO | ||
| 62 | pageParam: ParamType = {} | 64 | pageParam: ParamType = {} |
| 63 | followUserId: string = '' | 65 | followUserId: string = '' |
| 64 | followUserName: string = '' | 66 | followUserName: string = '' |
| @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent { | @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 116 | index: $index, | 118 | index: $index, |
| 117 | currentIndex: $currentIndex, | 119 | currentIndex: $currentIndex, |
| 118 | showCommentList: $showCommentList, | 120 | showCommentList: $showCommentList, |
| 119 | - publishCommentModel: $publishCommentModel | 121 | + publishCommentModel: $publishCommentModel, |
| 122 | + interactData:$interactData | ||
| 120 | }) | 123 | }) |
| 121 | 124 | ||
| 122 | } | 125 | } |
| @@ -17,6 +17,7 @@ import { TrackingModule } from 'wdTracking/Index' | @@ -17,6 +17,7 @@ import { TrackingModule } from 'wdTracking/Index' | ||
| 17 | import { JSON } from '@kit.ArkTS' | 17 | import { JSON } from '@kit.ArkTS' |
| 18 | import app from '@system.app' | 18 | import app from '@system.app' |
| 19 | import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index' | 19 | import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index' |
| 20 | +import { ImageKnife, ImageKnifeGlobal } from '@ohos/imageknife' | ||
| 20 | 21 | ||
| 21 | const TAG = "[StartupManager]" | 22 | const TAG = "[StartupManager]" |
| 22 | 23 | ||
| @@ -58,6 +59,14 @@ export class StartupManager { | @@ -58,6 +59,14 @@ export class StartupManager { | ||
| 58 | HostManager.changeHost(spHostUrl as HostEnum) | 59 | HostManager.changeHost(spHostUrl as HostEnum) |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 62 | + // 初始化全局ImageKnife | ||
| 63 | + ImageKnife.with(this.context); | ||
| 64 | + let imageKnife: ImageKnife | undefined = ImageKnifeGlobal.getInstance().getImageKnife() | ||
| 65 | + if (imageKnife != undefined) { | ||
| 66 | + //设置全局内存缓存大小张数 | ||
| 67 | + imageKnife.setLruCacheSize(100, 100 * 1204 * 1024) | ||
| 68 | + } | ||
| 69 | + | ||
| 61 | // 友盟预初始化 | 70 | // 友盟预初始化 |
| 62 | this.preInitUmentStat() | 71 | this.preInitUmentStat() |
| 63 | 72 |
-
Please register or login to post a comment