You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
821 B
47 lines
821 B
|
3 years ago
|
const {
|
||
|
|
emit,
|
||
|
|
invokeCallbackHandler: invoke
|
||
|
|
} = UniServiceJSBridge
|
||
|
|
|
||
|
|
export function showModal (args, callbackId) {
|
||
|
|
emit('onShowModal', args, function (type) {
|
||
|
|
invoke(callbackId, {
|
||
|
|
[type]: true
|
||
|
|
})
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
export function showToast (args) {
|
||
|
|
emit('onShowToast', args)
|
||
|
|
return {}
|
||
|
|
}
|
||
|
|
|
||
|
|
export function hideToast () {
|
||
|
|
emit('onHideToast')
|
||
|
|
return {}
|
||
|
|
}
|
||
|
|
|
||
|
|
export function showLoading (args) {
|
||
|
|
emit('onShowLoading', args)
|
||
|
|
return {}
|
||
|
|
}
|
||
|
|
|
||
|
|
export function hideLoading () {
|
||
|
|
emit('onHideLoading')
|
||
|
|
return {}
|
||
|
|
}
|
||
|
|
|
||
|
|
export function showActionSheet (args, callbackId) {
|
||
|
|
emit('onShowActionSheet', args, function (tapIndex) {
|
||
|
|
if (tapIndex === -1) {
|
||
|
|
invoke(callbackId, {
|
||
|
|
errMsg: 'showActionSheet:fail cancel'
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
invoke(callbackId, {
|
||
|
|
tapIndex
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|