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
liujian1_wd
2024-02-01 17:36:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d71d77403747bd1c502ffe12053c88db28da709d
d71d7740
1 parent
14f26591
图文详情页面
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
10 deletions
sight_harmony/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
sight_harmony/wdWebComponent/Index.ets
sight_harmony/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
sight_harmony/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
sight_harmony/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
View file @
d71d774
...
...
@@ -7,7 +7,7 @@ import {
ResponseBean
} from 'wdBean';
import { Logger } from 'wdKit';
import { WdWebComponent } from 'wdWebComponent';
import { WdWebComponent
, WdWebLocalComponent
} from 'wdWebComponent';
import { BridgeWebViewControl } from '../../../../../wdWebComponent/oh_modules/wdJsBridge/Index';
@Component
...
...
@@ -74,12 +74,10 @@ export struct ImageAndTextWebComponent {
build() {
Column() {
WdWebComponent({
type: 0,
WdWebLocalComponent({
webviewControl: this.webviewControl,
webResource: $rawfile('apph5/index.html'),
backVisibility: false,
reload: this.reload
})
}
}
...
...
sight_harmony/wdWebComponent/Index.ets
View file @
d71d774
export { WdWebComponent } from './src/main/ets/pages/WdWebComponent'
export { WdWebLocalComponent } from './src/main/ets/pages/WdWebLocalComponent'
\ No newline at end of file
...
...
sight_harmony/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
View file @
d71d774
...
...
@@ -13,11 +13,6 @@ export struct WdWebComponent {
private webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
//TODO 默认网页
webUrl: string = ConfigConstants.DETAIL_URL
// 0网页, 1本地html
type: number = 0
webResource: Resource = {} as Resource
/**
* 对外暴露webview的回调,能力
*/
...
...
@@ -68,7 +63,7 @@ export struct WdWebComponent {
.height(44)
.visibility(this.backVisibility ? Visibility.Visible : Visibility.None)
Web({ src: this.
type == 0 ? this.webUrl : this.webResource
, controller: this.webviewControl })
Web({ src: this.
webUrl
, controller: this.webviewControl })
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
...
...
sight_harmony/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
0 → 100644
View file @
d71d774
import router from '@ohos.router';
import { BridgeWebViewControl } from 'wdJsBridge';
const TAG = 'WdWebLocalComponent';
@Component
export struct WdWebLocalComponent {
private webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
backVisibility: boolean = false
webResource: Resource = {} as Resource
build() {
Column() {
Row() {
Image($r("app.media.ic_back"))
.width(44)
.padding(13)
.aspectRatio(1)
.onClick(() => {
router.back();
})
}.backgroundColor(Color.Black)
.width('100%')
.height(44)
.visibility(this.backVisibility ? Visibility.Visible : Visibility.None)
Web({ src: this.webResource, controller: this.webviewControl })
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
.backgroundColor(Color.Yellow)
}
}
}
...
...
Please
register
or
login
to post a comment