提交 502a8e0b 编写于 作者: 雪洛's avatar 雪洛

fix(v3): 修复ios侧滑取消时不重置状态栏颜色的Bug

上级 0370e8c2
......@@ -21,7 +21,7 @@ export function publish (name, ...args) {
return UniServiceJSBridge.emit('api.' + name, ...args)
}
let lastStatusBarStyle
export let lastStatusBarStyle
const oldSetStatusBarStyle = plus.navigator.setStatusBarStyle
......
import {
lastStatusBarStyle,
setStatusBarStyle
} from '../../bridge'
export function onWebviewPopGesture (webview) {
let popStartStatusBarStyle
webview.addEventListener('popGesture', e => {
if (e.type === 'start') {
// 设置下一个页面的 statusBarStyle
const pages = getCurrentPages()
const page = pages[pages.length - 2]
popStartStatusBarStyle = lastStatusBarStyle
const statusBarStyle = page && page.$page.meta.statusBarStyle
statusBarStyle && setStatusBarStyle(statusBarStyle)
} else if (e.type === 'end' && !e.result) {
// 拖拽未完成,设置为当前状态栏前景色
setStatusBarStyle()
setStatusBarStyle(popStartStatusBarStyle)
} else if (e.type === 'end' && e.result) {
const pages = getCurrentPages()
const page = pages[pages.length - 1]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册