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

fix showToast returnValue

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