|
|
@@ -280,6 +280,7 @@ import { setTourist } from '@/pages/common'
|
|
|
import { verifyId, verifyPhone, verifyId_HUZHAO, verifyId_GANGAO, verifyId_TAIBAO } from '@/utils/validate'
|
|
|
import { getIdInfo } from '@/api/ZTKReaderApi'
|
|
|
import { getReadCert } from '@/api/JinlunReaderApi'
|
|
|
+import HuashiReaderWsApi from '@/api/HuashiReaderWsApi'
|
|
|
import donsee from '@/api/donsee'
|
|
|
import { IDENTIFY_TYPES } from '@/const'
|
|
|
import GetFace from '@/components/GetFace'
|
|
|
@@ -389,7 +390,8 @@ export default {
|
|
|
},
|
|
|
papersOption: IDENTIFY_TYPES,
|
|
|
uploadUrl: '',
|
|
|
- showUpload: true
|
|
|
+ showUpload: true,
|
|
|
+ hsWsApi: null
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -404,6 +406,8 @@ export default {
|
|
|
this.startReadCard()
|
|
|
this.getAge()
|
|
|
})
|
|
|
+
|
|
|
+ this.hsWsApi = new HuashiReaderWsApi()
|
|
|
},
|
|
|
|
|
|
// 获取社保卡信息
|
|
|
@@ -448,7 +452,7 @@ export default {
|
|
|
case 'tecsun':
|
|
|
data = await getTecsun(this)
|
|
|
if (data) {
|
|
|
- setTourist(this.touristData, 1, { Name: data.name, IDNumber: data.idNum })
|
|
|
+ setTourist(this.touristData, 1, { guestName: data.name, IDNumber: data.idNum })
|
|
|
}
|
|
|
break
|
|
|
case 'zk':
|
|
|
@@ -465,7 +469,7 @@ export default {
|
|
|
if (res.data.resultFlag === 0) {
|
|
|
readcard().then(res => {
|
|
|
if (res.data.resultFlag === 0) {
|
|
|
- setTourist(this.touristData, 1, { Name: res.data.partyName, IDNumber: res.data.certNumber })
|
|
|
+ setTourist(this.touristData, 1, { guestName: res.data.partyName, IDNumber: res.data.certNumber })
|
|
|
|
|
|
closeDevice()
|
|
|
}
|
|
|
@@ -476,6 +480,40 @@ export default {
|
|
|
}).catch(e => {
|
|
|
this.message = '身份证读卡器暂时无法使用,请检查;关闭弹窗后重试'
|
|
|
})
|
|
|
+ break
|
|
|
+ case 'hs-ws':
|
|
|
+ if (!this.hsWsApi) return
|
|
|
+ if (this.hsWsApi.isConnected) {
|
|
|
+ this.hsWsApi.addMessageListener((res) => {
|
|
|
+ console.log(res, '11212')
|
|
|
+ if (res.data === 'failed to obtain ID card information') {
|
|
|
+ this.message = '读取失败,请重试'
|
|
|
+ this.getIdInfo()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const alldata = res.data.split('|')
|
|
|
+ console.log(alldata)
|
|
|
+
|
|
|
+ if (alldata.length >= 17) {
|
|
|
+ setTourist(this.touristData, 1, { Name: alldata[3], IDNumber: alldata[8] })
|
|
|
+ this.hsWsApi.closeConnect()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.hsWsApi.readIDCard(1500)
|
|
|
+ } else {
|
|
|
+ this.hsWsApi.closeConnect()
|
|
|
+ this.hsWsApi.connect((isConnected) => {
|
|
|
+ if (isConnected) {
|
|
|
+ this.message = '身份证读卡器已连接'
|
|
|
+ // this.timer && clearTimeout(this.timer)
|
|
|
+ } else {
|
|
|
+ this.message = '身份证读卡器暂时无法使用,请检查;关闭弹窗后重试'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
break
|
|
|
case 'xzx':
|
|
|
readcard_xzx().then(res => {
|
|
|
@@ -541,6 +579,8 @@ export default {
|
|
|
if (this.deviceName === 'donsee-100R') {
|
|
|
this.$store.dispatch('stopAutoReadIDCard')
|
|
|
}
|
|
|
+
|
|
|
+ this.hsWsApi && this.hsWsApi.closeConnect()
|
|
|
},
|
|
|
validateTourist () {
|
|
|
// 验证游客信息
|