智能照明系统APP-本地串口
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.
LightingSystemApp-serial/.svn/pristine/1a/1aaeb1e65e222cacf3b69c7ea69...

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
})
}
})
}