提交 44be1946 编写于 作者: M mehaotian

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

......@@ -2554,10 +2554,12 @@ var serviceContext = (function () {
const oldSetStatusBarStyle = plus.navigator.setStatusBarStyle;
plus.navigator.setStatusBarStyle = function (style) {
function newSetStatusBarStyle(style) {
lastStatusBarStyle = style;
oldSetStatusBarStyle(style);
};
}
plus.navigator.setStatusBarStyle = newSetStatusBarStyle;
function setStatusBarStyle (statusBarStyle) {
if (!statusBarStyle) {
......@@ -6829,7 +6831,8 @@ var serviceContext = (function () {
console.log(`[restoreGlobal][${Date.now()}]`);
}
weex = newWeex;
plus = newPlus;
plus = newPlus;
plus.navigator.setStatusBarStyle = newSetStatusBarStyle;
/* eslint-disable no-global-assign */
setTimeout = newSetTimeout;
clearTimeout = newClearTimeout;
......@@ -7423,17 +7426,19 @@ var serviceContext = (function () {
});
}
function onWebviewPopGesture (webview) {
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.
先完成此消息的编辑!
想要评论请 注册