提交 0f03f28a 编写于 作者: fxy060608's avatar fxy060608

Merge branch 'v3' of https://github.com/dcloudio/uni-app into v3

import {
newSetStatusBarStyle
} from '../../bridge'
export function restoreGlobal (
newWeex,
newPlus,
......@@ -15,7 +19,8 @@ export function restoreGlobal (
console.log(`[restoreGlobal][${Date.now()}]`)
}
weex = newWeex
plus = newPlus
plus = newPlus
plus.navigator.setStatusBarStyle = newSetStatusBarStyle
/* eslint-disable no-global-assign */
setTimeout = newSetTimeout
clearTimeout = newClearTimeout
......
......@@ -21,14 +21,16 @@ export function publish (name, ...args) {
return UniServiceJSBridge.emit('api.' + name, ...args)
}
let lastStatusBarStyle
export let lastStatusBarStyle
const oldSetStatusBarStyle = plus.navigator.setStatusBarStyle
plus.navigator.setStatusBarStyle = function (style) {
export function newSetStatusBarStyle(style) {
lastStatusBarStyle = style
oldSetStatusBarStyle(style)
}
}
plus.navigator.setStatusBarStyle = newSetStatusBarStyle
export function setStatusBarStyle (statusBarStyle) {
if (!statusBarStyle) {
......
import {
import {
lastStatusBarStyle,
setStatusBarStyle
} from '../../bridge'
export function onWebviewPopGesture (webview) {
export function onWebviewPopGesture (webview) {
let popStartStatusBarStyle
webview.addEventListener('popGesture', e => {
if (e.type === 'start') {
// 设置下一个页面的 statusBarStyle
const pages = getCurrentPages()
const page = pages[pages.length - 2]
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.
先完成此消息的编辑!
想要评论请 注册