feat(XWebview): 新增网页菜单功能并优化相关页面
- 新增 WebMenuView 组件,用于显示网页菜单 - 在 MiniAppManager 中集成 WebMenuView,并添加菜单控制器 - 修改 HomeView 中的文章详情跳转逻辑 - 在 XWebview 中实现 getUrl、refresh 和 getTitle 接口方法
这个提交包含在:
父节点
6779ed2e4f
当前提交
3752229689
@ -48,6 +48,17 @@ export struct XWebview {
|
||||
XWebManager.onClose(() => {
|
||||
router.back()
|
||||
})
|
||||
if (this.xController) {
|
||||
this.xController.getUrl = () => {
|
||||
return this.controller.getUrl()
|
||||
}
|
||||
this.xController.getTitle = () => {
|
||||
return this.controller.getTitle()
|
||||
}
|
||||
this.xController.refresh = () => {
|
||||
this.controller.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
SZYXLocalStorageHelper.storage.setOrCreate('refresh_web_base', -1)
|
||||
SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.XWebViewCLose, undefined)
|
||||
@ -141,7 +152,7 @@ export struct XWebview {
|
||||
}.width(65)
|
||||
.onClick(() => {
|
||||
if (this.clickMenu) {
|
||||
this.clickMenu.onClick()
|
||||
this.clickMenu?.onClick && this.clickMenu?.onClick()
|
||||
return
|
||||
}
|
||||
if (this.dialogController != null) {
|
||||
|
||||
@ -11,6 +11,9 @@ const XWebview = import('../pages/XWebview');
|
||||
|
||||
export interface XWebController {
|
||||
sendMessage: (message: string) => void
|
||||
getUrl: () => string
|
||||
refresh: () => void
|
||||
getTitle: () => string
|
||||
}
|
||||
|
||||
export interface XWebJsController {
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户