/** * 重复扫描语音 */ export function scanRepeat(){ try { // @ts-ignore window.android.scanRepeatVib() }catch (e){ } } /** * 扫码失败 */ export function scanErr(){ try { // @ts-ignore window.android.scanError() }catch (e){ } } /** * 重新登录 */ export function reLoginTip(){ try { // @ts-ignore window.android.reLoginTip() }catch (e){ } } /** * 获取版本号 - piece */ export function getVersionName() : string { try { // @ts-ignore return window.android.getVersionName() }catch (e){ return '版本号获取失败!' } } /** * 检查版本更新 - piece */ export function checkUpdate() : void { try { // @ts-ignore return window.android.checkUpdate() }catch (e){ } } /** * 保存userId - piece */ export function saveUserId(userId : string) : boolean { try { // @ts-ignore return window.android.saveUserId(userId) }catch (e){ return false } } /** * 保存userId - piece */ export function removeUserId() { try { // @ts-ignore return window.android.removeUserId() }catch (e){ } } /** * 读取userId - piece */ export function getUserId(): string { try { // @ts-ignore return window.android.getUserId() }catch (e){ return '' } } /** * 获取异常的数量 - piece */ export function getErrRecordsCount(): number { try { // @ts-ignore return window.android.getErrRecordsCount() }catch (e){ return 0 } } /** * 获取异常的数据 - piece */ export function listErrRecords(): string { try { // @ts-ignore return window.android.listErrRecords() }catch (e){ return '' } } /** * 更新状态为失败 - piece */ export function updateDeliveryPushFail(code : string): number { try { // @ts-ignore return window.android.updateDeliveryPushFail(code) }catch (e){ return -1 } } /** * 更新状态为成功 - piece */ export function markAsPushed(code : string): number { try { // @ts-ignore return window.android.markAsPushed(code) }catch (e){ return -1 } } /** * 校验是否存在 */ export function isDeliveryNoExists(deliveryNo : string) : boolean { try { // @ts-ignore return window.android.isDeliveryNoExists(deliveryNo) }catch (e){ return false } } /** * 保存mac地址 - piece */ export function saveMacAddress(mac : string) : boolean { try { // @ts-ignore return window.android.saveMacAddress(mac) }catch (e){ return false } } /** * 读取mac地址 - piece */ export function readMacAddress(): string { try { // @ts-ignore return window.android.readMacAddress() }catch (e){ return '' } } /** * 分页查询 - piece */ export function pageDelivery(page : number, size : number): any { try { // @ts-ignore const result = window.android.pageDelivery(page, size); return JSON.parse(result) }catch (e){ return '' } } /** * 插入数据 - piece * * @param macAddress mac地址 * @param deliveryNo 快递单号 * @param userId 用户id */ export function addDelivery(macAddress : string, deliveryNo : string, userId : string, userName : string): number { try { // @ts-ignore return window.android.addDelivery(macAddress, deliveryNo, userId, userName) }catch (e){ return -2 } }