Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuzhilin
2024-04-18 11:21:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
350c972b569796d2c334b151327642db57ae8c44
350c972b
1 parent
1930e96a
H5稿件详情 图片加载
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
4 deletions
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/h5/H5ReceiveDataExtraBean.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
sight_harmony/products/phone/src/main/ets/pages/web/DefaultWebPage.ets
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
View file @
350c972
import { Action } from './Action';
interface dataObject {
operateType?: string
webViewHeight?: string
dataJson?: string
}
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
View file @
350c972
...
...
@@ -41,6 +41,7 @@ export function performJSCallNative(data: Message, call: Callback) {
class AppInfo {
plat: string = ''
system: string = ''
networkStatus: number = 1
// TODO 完善
}
...
...
@@ -52,6 +53,7 @@ function getAppPublicInfo(): string {
info.plat = 'Phone'
// 直接用Android,后续适配再新增鸿蒙
info.system = 'Android'
info.networkStatus = 1
let result = JSON.stringify(info)
return result;
}
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
View file @
350c972
...
...
@@ -83,7 +83,7 @@ export struct WdWebLocalComponent {
//webview 高度设置
private setCurrentPageOperate: (data: Message) => void = (data) => {
console.log("setCurrentPageOperate", JSON.stringify(data))
if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) {
if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate
&& data?.data?.operateType === '8'
) {
if (typeof this.webHeight === 'number') {
if (Number(data?.data?.webViewHeight) > this.webHeight) {
this.webHeight = Number(data?.data?.webViewHeight)
...
...
sight_harmony/features/wdBean/src/main/ets/bean/h5/H5ReceiveDataExtraBean.ets
View file @
350c972
export interface H5ReceiveDataExtraBean {
creatorId: string;
isLogin: string;
networkStatus: number;
loadImageOnlyWifiSwitch: string
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
View file @
350c972
...
...
@@ -55,7 +55,13 @@ export struct ImageAndTextWebComponent {
}
// TODO 对接user信息、登录情况
let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = { creatorId: '', isLogin: '0' } as H5ReceiveDataExtraBean
let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = {
creatorId: '',
isLogin: '0',
networkStatus: 1,
loadImageOnlyWifiSwitch: '2',
} as H5ReceiveDataExtraBean
let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = {
contentId: contentId,
contentType: contentType
...
...
@@ -86,7 +92,7 @@ export struct ImageAndTextWebComponent {
webResource: $rawfile('apph5/index.html'),
backVisibility: false,
onWebPrepared: this.onWebPrepared.bind(this),
isPageEnd:$isPageEnd
isPageEnd:
$isPageEnd
})
}
...
...
sight_harmony/products/phone/src/main/ets/pages/web/DefaultWebPage.ets
View file @
350c972
...
...
@@ -33,7 +33,7 @@ struct DefaultWebPage {
webUrl: this.url,
backVisibility: false,
reload: this.reload,
isPageEnd:
this.
isPageEnd
isPageEnd:
$
isPageEnd
})
}
}
...
...
Please
register
or
login
to post a comment