cashier_app/pageDevice/face/index.vue

69 lines
2.0 KiB
Vue

<template>
<CommonPageByDevice
ref="commonPageByDeviceRef"
navTitle="刷脸设备管理"
searchTitle="搜索设备名称、设备号"
searchType="face"
searchStateField="state"
:bottomBtnTitle="ak.ent.has('ENT_MCH_QR_CODE_ADD') ? '绑定刷脸设备' : null"
@bottomBtnClickFunc="bottomBtnClickFunc"
:reqTableDataFunc="reqTableDataFunc"
>
</CommonPageByDevice>
<JSinglePopup ref="bindPopup" :list="codeBind" />
</template>
<script setup>
import { reactive, ref } from 'vue'
import { onReachBottom, onUnload } from '@dcloudio/uni-app'
import emit from '@/commons/utils/emit.js'
import CommonPageByDevice from '../commons/CommonPageByDevice.vue'
import { reqLoad, API_URL_SYS_DEVICE_LIST, $parseQrCodeUrl } from '@/http/apiManager.js'
import go from '@/commons/utils/go.js'
import DeviceCommonsRender from '@/pages/list/render/DeviceCommonsRender.vue'
import infoBox from '@/commons/utils/infoBox.js'
import ak from '@/commons/utils/ak.js'
const bindPopup = ref(null)
const reqTableDataFunc = (params) => {
params.deviceType = 6
return reqLoad.list(API_URL_SYS_DEVICE_LIST, params)
}
function bottomBtnClickFunc() {
bindPopup.value.open()
}
uni.$on(emit.ENAME_REF_QRC_LIST, (data) => {
commonPageByDeviceRef.value.refTable(true)
})
const commonPageByDeviceRef = ref(null)
// 点击绑定新码 事件
const codeBind = [
{
label: '扫码绑定',
value: 'scanCode',
fun: () => {
uni.scanCode({
success: ({ result }) => {
console.log('result', result)
let deviceNo = result.includes('=') ? result.split('=')[1] : result.split('ciot_helper/')[1]
go.to('PAGES_APP_FACE_EDIT', { deviceNo })
},
fail: (err) => {
// infoBox.showErrorToast('扫码失败')
},
})
},
},
{
label: '手动绑定',
value: 'handBind',
fun: () => {
go.to('PAGES_APP_FACE_EDIT')
},
},
]
onUnload(() => uni.$off(emit.ENAME_REF_QRC_LIST))
onReachBottom(() => {})
</script>
<style lang="scss" scoped></style>