zhangbo1_wd

修改编译错

... ... @@ -5,7 +5,9 @@ import { BridgeUtil } from '../utils/BridgeUtil';
import { Message } from '../bean/Message';
import { CallBackMessage } from '../bean/CallBackMessage';
import { StringUtils } from '../utils/StringUtils';
import { hilog } from '@kit.PerformanceAnalysisKit';
import hilog from '@ohos.hilog';
// import { hilog } from '@kit.PerformanceAnalysisKit';
const TAG = 'BridgeWebViewControl';
... ...
... ... @@ -8,7 +8,7 @@ export class NumberFormatterUtils {
*/
static formatNumberWithWan(inputNumber: number | String): string {
const num = typeof inputNumber === 'number' ? inputNumber : Number(inputNumber);
if (isNaN(num) || num < 10000) {
if (Number.isNaN(num) || num < 10000) {
return num.toString();
} else {
const wanUnit = num / 10000;
... ...
... ... @@ -10,7 +10,7 @@ export class H5CallNativeType {
static jsCall_callAppService = 'jsCall_callAppService'
// TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
static {
static init() {
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_currentPageOperate)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppPublicInfo)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getArticleDetailBussinessData)
... ...
... ... @@ -89,7 +89,7 @@ export struct WdWebComponent {
// },500)
// })
// this.onPageBegin(event?.url)
this.webviewControl?.setCustomUserAgent('Mozilla/5.0 (Linux; Android 12; HarmonyOS; OXF-AN00; HMSCore 6.13.0.302) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 HuaweiBrowser/14.0.6.300 Mobile Safari/537.36')
// this.webviewControl?.setCustomUserAgent('Mozilla/5.0 (Linux; Android 12; HarmonyOS; OXF-AN00; HMSCore 6.13.0.302) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 HuaweiBrowser/14.0.6.300 Mobile Safari/537.36')
})
.onLoadIntercept((event) => {
let url: string = event.data.getRequestUrl().toString()
... ...
... ... @@ -75,6 +75,8 @@ export struct WdWebLocalComponent {
}
private registerHandlers(): void {
// TODO 待优化
H5CallNativeType.init();
// 注册h5调用js相关
for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) {
let handleName = H5CallNativeType.JsCallTypeList[i];
... ...