智能照明系统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/fc/fc95ef2cf220a448b687f5b19fe...

27 lines
782 B

import {
onMethod,
invokeMethod
} from '../../platform'
const longPressActionsCallbackId = 'longPressActionsCallback'
let longPressActions = {}
onMethod(longPressActionsCallbackId, function (res) {
const errMsg = res.errMsg || ''
if (new RegExp('\\:\\s*fail').test(errMsg)) {
longPressActions.fail && longPressActions.fail(res)
} else {
longPressActions.success && longPressActions.success(res)
}
longPressActions.complete && longPressActions.complete(res)
})
export function previewImage (args = {}) {
longPressActions = args.longPressActions || {}
if (longPressActions.success || longPressActions.fail || longPressActions.complete) {
longPressActions.callbackId = longPressActionsCallbackId
}
return invokeMethod('previewImagePlus', args)
}