提交 1cb152bd 编写于 作者: fxy060608's avatar fxy060608

fix showToast returnValue

上级 54053874
......@@ -2597,7 +2597,7 @@ function unpack (args) {
}
function invoke (...args) {
return UniServiceJSBridge.invoke(...args)
return UniServiceJSBridge.invokeCallbackHandler(...args)
}
function publish (...args) {
......@@ -6142,6 +6142,14 @@ let waitingTimeout;
let toast = false;
let toastTimeout;
function showLoading$1 (args) {
return showToast$1(args).replace('showToast', 'showLoading')
}
function hideLoading () {
return hideToast().replace('hideToast', 'hideLoading')
}
function showToast$1 ({
title = '',
icon = 'success',
......@@ -6169,7 +6177,9 @@ function showToast$1 ({
toastTimeout = setTimeout(() => {
hideToast();
}, 2000);
return
return {
errMsg: 'showToast:ok'
}
}
console.warn('uni.showToast 传入的 "position" 值 "' + position + '" 无效');
}
......@@ -6454,6 +6464,8 @@ var appApi = /*#__PURE__*/Object.freeze({
startBeaconDiscovery: startBeaconDiscovery,
stopBeaconDiscovery: stopBeaconDiscovery,
makePhoneCall: makePhoneCall$1,
SCAN_ID: SCAN_ID,
SCAN_PATH: SCAN_PATH,
scanCode: scanCode,
getSystemInfo: getSystemInfo,
vibrateLong: vibrateLong,
......@@ -6509,6 +6521,8 @@ var appApi = /*#__PURE__*/Object.freeze({
showNavigationBarLoading: showNavigationBarLoading,
hideNavigationBarLoading: hideNavigationBarLoading,
setNavigationBarColor: setNavigationBarColor$1,
showLoading: showLoading$1,
hideLoading: hideLoading,
showToast: showToast$1,
hideToast: hideToast,
showModal: showModal$1,
......
......@@ -7,15 +7,15 @@ let waitingTimeout
let toast = false
let toastTimeout
export function showLoading(args) {
export function showLoading (args) {
return showToast(args).replace('showToast', 'showLoading')
}
export function hideLoading() {
export function hideLoading () {
return hideToast().replace('hideToast', 'hideLoading')
}
export function showToast({
export function showToast ({
title = '',
icon = 'success',
image = '',
......@@ -42,7 +42,9 @@ export function showToast({
toastTimeout = setTimeout(() => {
hideToast()
}, 2000)
return
return {
errMsg: 'showToast:ok'
}
}
console.warn('uni.showToast 传入的 "position" 值 "' + position + '" 无效')
}
......@@ -104,7 +106,7 @@ export function showToast({
}
}
export function hideToast() {
export function hideToast () {
if (toast) {
toastTimeout && clearTimeout(toastTimeout)
plus.nativeUI.closeToast()
......@@ -120,7 +122,7 @@ export function hideToast() {
errMsg: 'hideToast:ok'
}
}
export function showModal({
export function showModal ({
title = '',
content = '',
showCancel = true,
......@@ -145,7 +147,7 @@ export function showModal({
}
}, title, showCancel ? [cancelText, confirmText] : [confirmText])
}
export function showActionSheet({
export function showActionSheet ({
itemList = [],
itemColor = '#000000',
title = ''
......
......@@ -7,7 +7,7 @@ export function unpack (args) {
}
export function invoke (...args) {
return UniServiceJSBridge.invoke(...args)
return UniServiceJSBridge.invokeCallbackHandler(...args)
}
export function publish (...args) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册