subject-two/entry/src/main/ets/common/service/terminalService.ts
“wangzhongjie” 4c2515c1fb 22
2024-02-22 10:40:35 +08:00

40 lines
1.4 KiB
TypeScript

// @ts-nocheck
import { obtainCarExamInfo} from '../../api/index'
import { dateFormat} from '../utils/tools'
//获取设备信息
export async function getDeviceInfo() {
globalThis.deviceNo = 'J43405J003101'; //设备mac
globalThis.deviceNo = 'FE-FC-FE-7C-5C-77'; //设备mac
globalThis.diskId = '1231231231'; //硬盘号
globalThis.hasAuth = true;
//
// return null
// return new Promise((resolve, reject) => {
// getSyncData('DeviceInfoTable').then((result: Array<any>) => {
// if (result.length) {
// globalThis.deviceNo = result[0].deviceId
// this.deviceId = result[0].deviceId
// resolve(result[0].deviceId)
// } else {
// resolve('')
// }
// })
// })
}
//获取考车信息
export async function getCarInfo() {
let date = new Date();
let params = { time: dateFormat(date), deviceNo: globalThis.deviceNo };
let res:any = await obtainCarExamInfo(params)
if(!res.obtainCarExamInfoRsp.body){
this.errorMsg=decodeURI(res.examinerLoginRsp.head.resultMessage)
}else {
globalThis.carInfo=res.obtainCarExamInfoRsp.body
// globalThis.carInfo.carId=res.obtainCarExamInfoRsp.body.carId
globalThis.carInfo.plateNo = decodeURIComponent(globalThis.carInfo.plateNo)
}
return res
}