Showing
4 changed files
with
10 additions
and
4 deletions
| @@ -58,6 +58,7 @@ export struct DetailPlayShortVideoPage { | @@ -58,6 +58,7 @@ export struct DetailPlayShortVideoPage { | ||
| 58 | PageName: string = '' | 58 | PageName: string = '' |
| 59 | @State toastText: ResourceStr = "正在使用非WI-FI网络,播放将产生流量费用" | 59 | @State toastText: ResourceStr = "正在使用非WI-FI网络,播放将产生流量费用" |
| 60 | @Consume onlyWifiLoadVideo: boolean | 60 | @Consume onlyWifiLoadVideo: boolean |
| 61 | + @Consume toastTextVisible: boolean | ||
| 61 | 62 | ||
| 62 | /** | 63 | /** |
| 63 | * 页面显示重查用户关注、点赞等信息 | 64 | * 页面显示重查用户关注、点赞等信息 |
| @@ -169,9 +170,12 @@ export struct DetailPlayShortVideoPage { | @@ -169,9 +170,12 @@ export struct DetailPlayShortVideoPage { | ||
| 169 | } | 170 | } |
| 170 | 171 | ||
| 171 | async aboutToAppear() { | 172 | async aboutToAppear() { |
| 172 | - if(await onlyWifiLoadVideo()){ | ||
| 173 | - this.onlyWifiLoadVideo = true | 173 | + if (!this.onlyWifiLoadVideo) { |
| 174 | + this.onlyWifiLoadVideo = await onlyWifiLoadVideo() | ||
| 175 | + this.toastTextVisible = this.onlyWifiLoadVideo ? false : true | ||
| 176 | + console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo) | ||
| 174 | } | 177 | } |
| 178 | + | ||
| 175 | this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape | 179 | this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape |
| 176 | this.ratio = (this.contentDetailData.videoInfo[0]?.resolutionWidth || 16) / | 180 | this.ratio = (this.contentDetailData.videoInfo[0]?.resolutionWidth || 16) / |
| 177 | (this.contentDetailData.videoInfo[0]?.resolutionHeight || 9) | 181 | (this.contentDetailData.videoInfo[0]?.resolutionHeight || 9) |
| @@ -280,7 +284,7 @@ export struct DetailPlayShortVideoPage { | @@ -280,7 +284,7 @@ export struct DetailPlayShortVideoPage { | ||
| 280 | playerController: this.playerController | 284 | playerController: this.playerController |
| 281 | }) | 285 | }) |
| 282 | 286 | ||
| 283 | - if (!this.onlyWifiLoadVideo) { | 287 | + if (this.toastTextVisible) { |
| 284 | this.buildContent() | 288 | this.buildContent() |
| 285 | } | 289 | } |
| 286 | 290 | ||
| @@ -357,6 +361,7 @@ export struct DetailPlayShortVideoPage { | @@ -357,6 +361,7 @@ export struct DetailPlayShortVideoPage { | ||
| 357 | }) | 361 | }) |
| 358 | .onClick(() => { | 362 | .onClick(() => { |
| 359 | this.onlyWifiLoadVideo = true | 363 | this.onlyWifiLoadVideo = true |
| 364 | + this.toastTextVisible = false | ||
| 360 | this.playerController?.play() | 365 | this.playerController?.play() |
| 361 | this.imageVisible = false | 366 | this.imageVisible = false |
| 362 | }) | 367 | }) |
| @@ -40,6 +40,7 @@ export struct DetailVideoListPage { | @@ -40,6 +40,7 @@ export struct DetailVideoListPage { | ||
| 40 | pageShowTime:number = 0; | 40 | pageShowTime:number = 0; |
| 41 | pageHideTime:number = 0; | 41 | pageHideTime:number = 0; |
| 42 | @Provide onlyWifiLoadVideo: boolean = false | 42 | @Provide onlyWifiLoadVideo: boolean = false |
| 43 | + @Provide toastTextVisible: boolean = false | ||
| 43 | 44 | ||
| 44 | async aboutToAppear(): Promise<void> { | 45 | async aboutToAppear(): Promise<void> { |
| 45 | // 注册监听网络连接 | 46 | // 注册监听网络连接 |
| @@ -65,6 +65,7 @@ export struct VideoChannelDetail { | @@ -65,6 +65,7 @@ export struct VideoChannelDetail { | ||
| 65 | pageShowTime: number = 0; | 65 | pageShowTime: number = 0; |
| 66 | pageHideTime: number = 0; | 66 | pageHideTime: number = 0; |
| 67 | @Provide onlyWifiLoadVideo: boolean = false | 67 | @Provide onlyWifiLoadVideo: boolean = false |
| 68 | + @Provide toastTextVisible: boolean = false | ||
| 68 | 69 | ||
| 69 | autoRefreshChange() { | 70 | autoRefreshChange() { |
| 70 | if (this.topNavIndex === 0 && !this.isRequesting) { | 71 | if (this.topNavIndex === 0 && !this.isRequesting) { |
| @@ -13,7 +13,6 @@ export struct PlayerBottomView { | @@ -13,7 +13,6 @@ export struct PlayerBottomView { | ||
| 13 | @Consume isDragging?: boolean | 13 | @Consume isDragging?: boolean |
| 14 | @Consume contentDetailData: ContentDetailDTO | 14 | @Consume contentDetailData: ContentDetailDTO |
| 15 | @Consume displayDirection: DisplayDirection | 15 | @Consume displayDirection: DisplayDirection |
| 16 | - @Consume onlyWifiLoadVideo: boolean | ||
| 17 | 16 | ||
| 18 | aboutToAppear(): void { | 17 | aboutToAppear(): void { |
| 19 | 18 |
-
Please register or login to post a comment