提交 e7258b37 编写于 作者: Q qiang

build v3

上级 4867dd9d
...@@ -8486,7 +8486,9 @@ var serviceContext = (function () { ...@@ -8486,7 +8486,9 @@ var serviceContext = (function () {
return return
} }
uni.hideToast(); // 后退时,关闭 toast,loading // 后退时,关闭 toast,loading
uni.hideToast();
uni.hideLoading();
if (currentPage.$page.meta.isQuit) { if (currentPage.$page.meta.isQuit) {
quit(); quit();
...@@ -9322,17 +9324,16 @@ var serviceContext = (function () { ...@@ -9322,17 +9324,16 @@ var serviceContext = (function () {
} }
} }
let waiting; let toast;
let waitingTimeout; let toastType;
let toast = false; let timeout;
let toastTimeout;
function showLoading$1 (args) { function showLoading$1 (args) {
return callApiSync(showToast$1, args, 'showToast', 'showLoading') return callApiSync(showToast$1, Object.assign({}, args, { type: 'loading' }), 'showToast', 'showLoading')
} }
function hideLoading () { function hideLoading () {
return callApiSync(hideToast, Object.create(null), 'hideToast', 'hideLoading') return callApiSync(hide, 'loading', 'hide', 'hideLoading')
} }
function showToast$1 ({ function showToast$1 ({
...@@ -9341,41 +9342,18 @@ var serviceContext = (function () { ...@@ -9341,41 +9342,18 @@ var serviceContext = (function () {
image = '', image = '',
duration = 1500, duration = 1500,
mask = false, mask = false,
position = '' position = '',
type = 'toast'
} = {}) { } = {}) {
if (position) { hide(null);
if (toast) { toastType = type;
toastTimeout && clearTimeout(toastTimeout); if (['top', 'center', 'bottom'].includes(position)) {
plus.nativeUI.closeToast(); // 仅可以关闭 richtext 类型,但 iOS 部分情况换行显示有问题
}
if (waiting) {
waitingTimeout && clearTimeout(waitingTimeout);
waiting.close();
}
if (~['top', 'center', 'bottom'].indexOf(position)) {
plus.nativeUI.toast(title, { plus.nativeUI.toast(title, {
verticalAlign: position verticalAlign: position
}); });
toast = true; toast = true;
toastTimeout = setTimeout(() => { } else {
hideToast();
}, 2000);
return {
errMsg: 'showToast:ok'
}
}
console.warn('uni.showToast 传入的 "position" 值 "' + position + '" 无效');
}
if (duration) {
if (waiting) {
waitingTimeout && clearTimeout(waitingTimeout);
waiting.close();
}
if (toast) {
toastTimeout && clearTimeout(toastTimeout);
plus.nativeUI.closeToast();
}
if (icon && !~['success', 'loading', 'none'].indexOf(icon)) { if (icon && !~['success', 'loading', 'none'].indexOf(icon)) {
icon = 'success'; icon = 'success';
} }
...@@ -9409,35 +9387,42 @@ var serviceContext = (function () { ...@@ -9409,35 +9387,42 @@ var serviceContext = (function () {
height: '55px', height: '55px',
icon: '__uniappsuccess.png', icon: '__uniappsuccess.png',
interval: duration interval: duration
}; };
} }
} }
waiting = plus.nativeUI.showWaiting(title, waitingOptions); toast = plus.nativeUI.showWaiting(title, waitingOptions);
waitingTimeout = setTimeout(() => {
hideToast();
}, duration);
} }
timeout = setTimeout(() => {
hide(null);
}, duration);
return { return {
errMsg: 'showToast:ok' errMsg: 'showToast:ok'
} }
} }
function hideToast () { function hideToast () {
if (toast) { return callApiSync(hide, 'toast', 'hide', 'hideToast')
toastTimeout && clearTimeout(toastTimeout);
plus.nativeUI.closeToast();
toast = false;
} }
if (waiting) {
waitingTimeout && clearTimeout(waitingTimeout); function hide (type = 'toast') {
waiting.close(); if (type && type !== toastType) {
waiting = null; return
waitingTimeout = null; }
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
if (toast === true) {
plus.nativeUI.closeToast();
} else if (toast && toast.close) {
toast.close();
} }
toast = null;
toastType = null;
return { return {
errMsg: 'hideToast:ok' errMsg: 'hide:ok'
} }
} }
function showModal$1 ({ function showModal$1 ({
...@@ -9979,6 +9964,7 @@ var serviceContext = (function () { ...@@ -9979,6 +9964,7 @@ var serviceContext = (function () {
hideLoading: hideLoading, hideLoading: hideLoading,
showToast: showToast$1, showToast: showToast$1,
hideToast: hideToast, hideToast: hideToast,
hide: hide,
showModal: showModal$1, showModal: showModal$1,
showActionSheet: showActionSheet$1, showActionSheet: showActionSheet$1,
setTabBarBadge: setTabBarBadge$2, setTabBarBadge: setTabBarBadge$2,
...@@ -14016,6 +14002,7 @@ var serviceContext = (function () { ...@@ -14016,6 +14002,7 @@ var serviceContext = (function () {
'onShow', 'onShow',
'onHide', 'onHide',
'onUniNViewMessage', 'onUniNViewMessage',
'onPageNotFound',
'onError', 'onError',
// Page // Page
'onLoad', 'onLoad',
...@@ -14224,6 +14211,7 @@ var serviceContext = (function () { ...@@ -14224,6 +14211,7 @@ var serviceContext = (function () {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
console.log('[uni-app] launchApp'); console.log('[uni-app] launchApp');
} }
plus.updateConfigInfo && plus.updateConfigInfo();
registerApp(this); registerApp(this);
oldMount.call(this, el, hydrating); oldMount.call(this, el, hydrating);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册