wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 临时屏蔽
  fix |> 判断controller与web组件是否绑定
  ref |> 增加设备拉黑
  ref |> 点击查看评论按钮,页面顶部蒙层颜色过浅
  ref |> 增加调试设备profile
  fix |> 添加返回到稿件详情页刷新页面逻辑
  ref |> 竖屏直播横屏流全屏后,增加点击浮层消失功能
... ... @@ -49,5 +49,10 @@ export enum EmitterEventId {
// 全屏
FULL_SCREEN = 14,
// app页面显示
APP_PAGE_SHOW = 102,
// app页面隐藏
APP_PAGE_HIDDEN = 103,
}
... ...
export interface eventParams {
event: string;
}
export const enum NativeCallH5Event {
NativeCallH5EventPageWillAppear = '1',
NativeCallH5EventPageWillDisAppear = '2',
NativeCallH5EventAppWillEnterForeground = '3',
NativeCallH5EventAppEnterBackground = '4',
NativeCallH5EventAppPlayingAudio = '5',
NativeCallH5EventUpdateBrowseCount = '6',
NativeCallH5EventStartLoadingOnReuse = '7',
NativeCallH5EventNightModel = '9',
NativeCallH5EventFontSizesChange = '10',
NativeCallH5EventFollowEvent = '11',
NativeCallH5EventLikeEvent = '12'
}
/**
* native调用h5,事件id枚举
* app主动调用h5方法
*/
export const enum NativeCallH5Type {
jsCall_receiveAppData = 'jsCall_receiveAppData',
jsCall_appNotifyEvent = 'jsCall_appNotifyEvent',
// TODO 业务自行新增类型,自行调用,例:
// TODO this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,xxxx)
... ...
... ... @@ -4,8 +4,9 @@ import { Logger, WindowModel } from 'wdKit/Index';
import { performJSCallNative } from './JsBridgeBiz';
import { H5CallNativeType } from './H5CallNativeType';
import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
import { DateTimeUtils } from 'wdKit'
import { DateTimeUtils,EmitterUtils,EmitterEventId } from 'wdKit'
import { window } from '@kit.ArkUI';
import { NativeCallH5Type,NativeCallH5Event,eventParams } from './NativeCallH5Type';
const TAG = 'WdWebLocalComponent';
... ... @@ -32,6 +33,7 @@ export struct WdWebLocalComponent {
@State progressOpacity: number = 1
@State durationStringTime: string = '';
private progressTimerNumber: number = 0
private webIsLoaded:boolean = false
@State isPause: boolean = true;
controller: VideoController = new VideoController()
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
... ... @@ -183,6 +185,7 @@ export struct WdWebLocalComponent {
private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => {
performJSCallNative(data, f)
}
onPageBegin: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageBegin');
this.registerHandlers();
... ... @@ -195,6 +198,7 @@ export struct WdWebLocalComponent {
Logger.debug(TAG, 'onPageEnd');
this.onWebPrepared()
this.isPageEnd = true
this.webIsLoaded = true
}
onLoadIntercept: (url?: string) => boolean = () => {
Logger.debug(TAG, 'onLoadIntercept return false');
... ... @@ -228,6 +232,20 @@ export struct WdWebLocalComponent {
}
}
aboutToAppear(): void {
this.webIsLoaded = false
EmitterUtils.receiveEvent(EmitterEventId.APP_PAGE_SHOW, () => {
let params = {'event':NativeCallH5Event.NativeCallH5EventPageWillAppear} as eventParams;
let jsonString = JSON.stringify(params);
Logger.debug(TAG, 'APP_PAGE_SHOW'+this.webIsLoaded);
// if (this.webIsLoaded) {
// this.webviewControl.callHandle(NativeCallH5Type.jsCall_appNotifyEvent, jsonString, (data: string) => {
// Logger.debug(TAG, "from js data = " + data);
// })
// }
})
}
@Builder
videoComp(){
Video({
... ...
... ... @@ -98,7 +98,7 @@ export struct ImageAndTextPageComponent {
setTimeout(()=>{
this.pageScrollToCommonent()
},
900)
800)
}
}
... ...
... ... @@ -34,6 +34,7 @@ export struct CommentListDialogView {
height: this.maxHeight + 'px',
preferType: SheetType.BOTTOM,
showClose: false,
maskColor: "#50000000",
dragBar: false,
onDisappear: () => {
this.showCommentList = false
... ...
... ... @@ -68,6 +68,7 @@ export struct PlayerUIComponent {
Stack() {
// 标题
PlayerTitleComponent({ playerController: this.playerController })
.visibility(!this.isFullScreen ? Visibility.Visible : (this.isShowControl && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? Visibility.Visible : Visibility.Hidden))
PlayerCommentComponent()
.visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible)
... ...
... ... @@ -6,6 +6,7 @@ import { AccountManagerUtils, SPHelper } from 'wdKit/Index'
import { LoginViewModel } from './pages/login/LoginViewModel'
import { SpConstants } from 'wdConstant/Index'
import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo'
import { common } from '@kit.AbilityKit'
class LoginJumpHandler implements JumpInterceptorAction {
... ... @@ -42,12 +43,17 @@ export class LoginModule {
}
// 启动进入主页 和 每次登录成功调用
static reportDeviceInfo() {
static reportDeviceInfo(context?: common.UIAbilityContext) {
ReportDeviceInfo.reportDeviceInfo().then((res) => {
let nickName = res.touristNickName
if (res.touristNickName) {
SPHelper.default.save(SpConstants.TOURIST_NICK_NAME, res.touristNickName)
}
if (res.blockStatus == -2) {
// Exit the application.
context?.terminateSelf();
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -38,4 +38,5 @@ export class ReportDeviceInfo {
export class ReportDeviceInfoRes {
clean : number = 0
touristNickName : string = ""
blockStatus: number = 0 // 当等于-2时,表示拉黑
}
\ No newline at end of file
... ...
import { Action } from 'wdBean';
import { ImageAndTextPageComponent } from 'wdComponent'
import { Logger } from 'wdKit'
import { Logger,EmitterUtils,EmitterEventId } from 'wdKit'
import router from '@ohos.router';
import { TrackConstants } from 'wdTracking/Index';
... ... @@ -47,6 +47,7 @@ struct ImageAndTextDetailPage {
onPageShow() {
this.pageShow = Math.random()
EmitterUtils.sendEmptyEvent(EmitterEventId.APP_PAGE_SHOW)
Logger.info(TAG, 'onPageShow');
}
... ...
... ... @@ -137,7 +137,7 @@ export class StartupManager {
return new Promise((resolve) => {
Logger.debug(TAG, "App 初次进入首页,开始其他任务初始化")
LoginModule.reportDeviceInfo()
LoginModule.reportDeviceInfo(this.context)
GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => {
HWLocationUtils.startLocationService()
... ...