Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
16 changed files
with
212 additions
and
79 deletions
| @@ -38,7 +38,11 @@ export struct CommentListDialogView { | @@ -38,7 +38,11 @@ export struct CommentListDialogView { | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | closeAction() { | 40 | closeAction() { |
| 41 | - this.showCommentList = false | 41 | + if (this.onClose) { |
| 42 | + this.onClose() | ||
| 43 | + } else { | ||
| 44 | + this.showCommentList = false | ||
| 45 | + } | ||
| 42 | } | 46 | } |
| 43 | 47 | ||
| 44 | build() { | 48 | build() { |
| @@ -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 | }) |
| @@ -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}`); |
| @@ -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 |
| 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) { | ||
| 10 | - 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; | 11 | + // 开关打开,wifi下才加载图片 |
| 12 | + if (netWorkStatus === NetworkUtil.TYPE_WIFI) { | ||
| 13 | + return true | ||
| 21 | } | 14 | } |
| 15 | + return false | ||
| 22 | } | 16 | } |
| 23 | 17 | ||
| 24 | export { onlyWifiLoadImg } | 18 | export { onlyWifiLoadImg } |
| 1 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { TabComponent } from '../widgets/details/TabComponent'; | 3 | import { TabComponent } from '../widgets/details/TabComponent'; |
| 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; |
| @@ -6,12 +6,9 @@ import { DisplayDirection } from 'wdConstant/Index'; | @@ -6,12 +6,9 @@ import { DisplayDirection } from 'wdConstant/Index'; | ||
| 6 | import mediaquery from '@ohos.mediaquery'; | 6 | 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 { devicePLSensorManager } from 'wdDetailPlayApi/Index'; | ||
| 10 | -import { LiveCommentComponent } from 'wdComponent/Index'; | ||
| 11 | -import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; | ||
| 12 | -import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | 9 | +import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 10 | +import { LiveOperRowListView } from 'wdComponent'; | ||
| 13 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 14 | -import { ResponseDTO } from 'wdNetwork/Index'; | ||
| 15 | 12 | ||
| 16 | let TAG: string = 'DetailPlayLivePage'; | 13 | let TAG: string = 'DetailPlayLivePage'; |
| 17 | 14 | ||
| @@ -37,7 +34,6 @@ export struct DetailPlayLivePage { | @@ -37,7 +34,6 @@ export struct DetailPlayLivePage { | ||
| 37 | @Consume @Watch('onBackPressCus') pageBackPress: number | 34 | @Consume @Watch('onBackPressCus') pageBackPress: number |
| 38 | @Consume contentDetailData: ContentDetailDTO | 35 | @Consume contentDetailData: ContentDetailDTO |
| 39 | @Consume publishCommentModel: publishCommentModel | 36 | @Consume publishCommentModel: publishCommentModel |
| 40 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 41 | 37 | ||
| 42 | aboutToAppear(): void { | 38 | aboutToAppear(): void { |
| 43 | Logger.info(TAG, `wyj-aboutToAppear`) | 39 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -65,13 +61,15 @@ export struct DetailPlayLivePage { | @@ -65,13 +61,15 @@ export struct DetailPlayLivePage { | ||
| 65 | 61 | ||
| 66 | build() { | 62 | build() { |
| 67 | Column() { | 63 | Column() { |
| 64 | + | ||
| 68 | TopPlayComponent({ playerController: this.playerController }) | 65 | TopPlayComponent({ playerController: this.playerController }) |
| 69 | - .height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%') | 66 | + .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 67 | + | ||
| 70 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 68 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) |
| 71 | .layoutWeight(1) | 69 | .layoutWeight(1) |
| 72 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 70 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 73 | - OperRowListView({ | ||
| 74 | - componentType: 4, | 71 | + |
| 72 | + LiveOperRowListView({ | ||
| 75 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 73 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 76 | styleType: 1, | 74 | styleType: 1, |
| 77 | contentDetailData: this.contentDetailData, | 75 | contentDetailData: this.contentDetailData, |
| @@ -81,8 +79,7 @@ export struct DetailPlayLivePage { | @@ -81,8 +79,7 @@ export struct DetailPlayLivePage { | ||
| 81 | // 切换到大家聊 | 79 | // 切换到大家聊 |
| 82 | this.changeToTab = Math.random() | 80 | this.changeToTab = Math.random() |
| 83 | } | 81 | } |
| 84 | - }) | ||
| 85 | - .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 82 | + }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 86 | 83 | ||
| 87 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 84 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) |
| 88 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 85 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| @@ -120,7 +117,9 @@ export struct DetailPlayLivePage { | @@ -120,7 +117,9 @@ export struct DetailPlayLivePage { | ||
| 120 | } | 117 | } |
| 121 | 118 | ||
| 122 | getLiveDetails() { | 119 | getLiveDetails() { |
| 123 | - const data = this.liveDetailsBean | 120 | + const data = this.contentDetailData |
| 121 | + // console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState) | ||
| 122 | + // console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle) | ||
| 124 | if (data.liveInfo?.liveState == 'wait') { | 123 | if (data.liveInfo?.liveState == 'wait') { |
| 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 | 124 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 |
| 126 | if (data.liveInfo?.liveStyle == 1) { | 125 | if (data.liveInfo?.liveStyle == 1) { |
| @@ -131,7 +130,13 @@ export struct DetailPlayLivePage { | @@ -131,7 +130,13 @@ export struct DetailPlayLivePage { | ||
| 131 | this.tabs = ['简介', '直播间', '大家聊'] | 130 | this.tabs = ['简介', '直播间', '大家聊'] |
| 132 | } | 131 | } |
| 133 | } else { | 132 | } else { |
| 134 | - this.tabs = ['直播间', '大家聊'] | 133 | + if (data.liveInfo?.liveStyle == 1) { |
| 134 | + this.tabs = ['大家聊'] | ||
| 135 | + } else if (data.liveInfo?.liveStyle == 2) { | ||
| 136 | + this.tabs = ['直播间',] | ||
| 137 | + } else { | ||
| 138 | + this.tabs = ['直播间', '大家聊'] | ||
| 139 | + } | ||
| 135 | } | 140 | } |
| 136 | 141 | ||
| 137 | } | 142 | } |
| @@ -16,7 +16,7 @@ import { CommentDialogView } from '../view/CommentDialogView'; | @@ -16,7 +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 | - | 19 | +import {ParamType,TrackConstants } from 'wdTracking/Index'; |
| 20 | const TAG = 'DetailPlayShortVideoPage'; | 20 | const TAG = 'DetailPlayShortVideoPage'; |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| @@ -49,6 +49,8 @@ export struct DetailPlayShortVideoPage { | @@ -49,6 +49,8 @@ export struct DetailPlayShortVideoPage { | ||
| 49 | @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false | 49 | @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false |
| 50 | @State imageVisible: boolean = true | 50 | @State imageVisible: boolean = true |
| 51 | @State ratio: number = 16 / 9 | 51 | @State ratio: number = 16 / 9 |
| 52 | + pageParam: ParamType = {} | ||
| 53 | + PageName: string = '' | ||
| 52 | 54 | ||
| 53 | /** | 55 | /** |
| 54 | * 页面显示重查用户关注、点赞等信息 | 56 | * 页面显示重查用户关注、点赞等信息 |
| @@ -91,7 +93,7 @@ export struct DetailPlayShortVideoPage { | @@ -91,7 +93,7 @@ export struct DetailPlayShortVideoPage { | ||
| 91 | } else { | 93 | } else { |
| 92 | this.queryNewsInfoOfUser() | 94 | this.queryNewsInfoOfUser() |
| 93 | if (!this.playerController.getPlayer()) { | 95 | if (!this.playerController.getPlayer()) { |
| 94 | - this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || ''); | 96 | + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '',this.PageName,this.PageName,this.pageParam); |
| 95 | } else { | 97 | } else { |
| 96 | await this.playerController.play() | 98 | await this.playerController.play() |
| 97 | this.imageVisible = false | 99 | this.imageVisible = false |
| @@ -165,9 +167,30 @@ export struct DetailPlayShortVideoPage { | @@ -165,9 +167,30 @@ export struct DetailPlayShortVideoPage { | ||
| 165 | } | 167 | } |
| 166 | this.queryNewsInfoOfUser() | 168 | this.queryNewsInfoOfUser() |
| 167 | 169 | ||
| 168 | - | 170 | + this.contentTrackingDict() |
| 171 | + } | ||
| 172 | + contentTrackingDict(){ | ||
| 173 | + this.pageParam = { | ||
| 174 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 175 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 176 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 177 | + } | ||
| 178 | + if(this.contentDetailData.newsType == 1) { | ||
| 179 | + this.PageName = TrackConstants.PageName.VideoDetail // 点播 | ||
| 180 | + } else if(this.contentDetailData.newsType == 2) { | ||
| 181 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 182 | + } else if(this.contentDetailData.newsType == 5) { | ||
| 183 | + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页 | ||
| 184 | + } else if(this.contentDetailData.newsType == 8) { | ||
| 185 | + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页 | ||
| 186 | + } else if(this.contentDetailData.newsType == 9) { | ||
| 187 | + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页 | ||
| 188 | + } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | ||
| 189 | + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | ||
| 190 | + } | ||
| 191 | + console.log('视频详情页',JSON.stringify(this.pageParam)) | ||
| 192 | + console.log('视频详情页2',JSON.stringify(this.PageName)) | ||
| 169 | } | 193 | } |
| 170 | - | ||
| 171 | async aboutToDisappear(): Promise<void> { | 194 | async aboutToDisappear(): Promise<void> { |
| 172 | console.log(TAG, 'aboutToDisappear', this.index) | 195 | console.log(TAG, 'aboutToDisappear', this.index) |
| 173 | await this.playerController?.pause() | 196 | await this.playerController?.pause() |
| @@ -182,7 +205,8 @@ export struct DetailPlayShortVideoPage { | @@ -182,7 +205,8 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | index: $index, | 205 | index: $index, |
| 183 | currentIndex: $currentIndex, | 206 | currentIndex: $currentIndex, |
| 184 | showCommentList: $showCommentList, | 207 | showCommentList: $showCommentList, |
| 185 | - publishCommentModel: $publishCommentModel | 208 | + publishCommentModel: $publishCommentModel, |
| 209 | + interactData: $interactData, | ||
| 186 | }) | 210 | }) |
| 187 | this.playerViewBuilder() | 211 | this.playerViewBuilder() |
| 188 | 212 | ||
| @@ -250,7 +274,7 @@ export struct DetailPlayShortVideoPage { | @@ -250,7 +274,7 @@ export struct DetailPlayShortVideoPage { | ||
| 250 | playerController: this.playerController, | 274 | playerController: this.playerController, |
| 251 | onLoad: async () => { | 275 | onLoad: async () => { |
| 252 | if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) { | 276 | if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) { |
| 253 | - this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl); | 277 | + this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl,this.PageName,this.PageName,this.pageParam); |
| 254 | } | 278 | } |
| 255 | } | 279 | } |
| 256 | }) | 280 | }) |
| 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 | } |
| @@ -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) { |
| @@ -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