diff --git a/api/face.js b/api/face.js new file mode 100644 index 0000000..7b9cf69 --- /dev/null +++ b/api/face.js @@ -0,0 +1,48 @@ +import request from '../utils/request' + +// face 人脸模块 + +// 获取人脸列表 +export function getFaceList(data) { + return request({ + url: '/face/list', + method: 'POST', + data + }) +} + +// 删除人脸 +export function deleteFaceRequest(data) { + return request({ + url: '/face/delete', + method: 'POST', + data + }) +} + +// 清空人脸 +export function clearFaceRequest(data) { + return request({ + url: '/face/clear', + method: 'POST', + data + }) +} + +// 检查人脸名称是否重复 +export function checkFaceNameRequest(data) { + return request({ + url: '/face/checkFaceName', + method: 'POST', + data + }) +} + +// 添加人脸 +export function addFaceRequest(data) { + return request({ + url: '/face/add', + method: 'POST', + data + }) +} diff --git a/api/palmVein.js b/api/palmVein.js new file mode 100644 index 0000000..83e1327 --- /dev/null +++ b/api/palmVein.js @@ -0,0 +1,48 @@ +import request from '../utils/request' + +// palmVein 掌纹模块 + +// 获取掌纹列表 +export function getPalmVeinList(data) { + return request({ + url: '/palmVein/list', + method: 'POST', + data + }) +} + +// 删除掌纹 +export function deletePalmVeinRequest(data) { + return request({ + url: '/palmVein/delete', + method: 'POST', + data + }) +} + +// 清空掌纹 +export function clearPalmVeinRequest(data) { + return request({ + url: '/palmVein/clear', + method: 'POST', + data + }) +} + +// 检查掌纹名称是否重复 +export function checkPalmVeinNameRequest(data) { + return request({ + url: '/palmVein/checkPalmVeinName', + method: 'POST', + data + }) +} + +// 添加掌纹 +export function addPalmVeinRequest(data) { + return request({ + url: '/palmVein/add', + method: 'POST', + data + }) +} diff --git a/api/remote.js b/api/remote.js new file mode 100644 index 0000000..fe2bc64 --- /dev/null +++ b/api/remote.js @@ -0,0 +1,48 @@ +import request from '../utils/request' + +// remote 远程模块 + +// 获取远程列表 +export function getRemoteList(data) { + return request({ + url: '/remote/list', + method: 'POST', + data + }) +} + +// 删除远程 +export function deleteRemoteRequest(data) { + return request({ + url: '/remote/delete', + method: 'POST', + data + }) +} + +// 清空远程 +export function clearRemoteRequest(data) { + return request({ + url: '/remote/clear', + method: 'POST', + data + }) +} + +// 检查远程名称是否重复 +export function checkRemoteNameRequest(data) { + return request({ + url: '/remote/checkRemoteName', + method: 'POST', + data + }) +} + +// 添加远程 +export function addRemoteRequest(data) { + return request({ + url: '/remote/add', + method: 'POST', + data + }) +} diff --git a/pages.json b/pages.json index d6d4f97..8e2543f 100644 --- a/pages.json +++ b/pages.json @@ -197,6 +197,90 @@ "navigationBarTitleText": "添加指纹", "disableScroll": true } + }, + { + "path": "pages/faceList/faceList", + "style": { + "navigationBarTitleText": "人脸", + "disableScroll": true + } + }, + { + "path": "pages/createFace/createFace", + "style": { + "navigationBarTitleText": "添加人脸", + "disableScroll": true + } + }, + { + "path": "pages/faceDetail/faceDetail", + "style": { + "navigationBarTitleText": "人脸详情", + "disableScroll": true + } + }, + { + "path": "pages/bindFace/bindFace", + "style": { + "navigationBarTitleText": "添加人脸", + "disableScroll": true + } + }, + { + "path": "pages/remoteList/remoteList", + "style": { + "navigationBarTitleText": "遥控", + "disableScroll": true + } + }, + { + "path": "pages/createRemote/createRemote", + "style": { + "navigationBarTitleText": "添加遥控", + "disableScroll": true + } + }, + { + "path": "pages/remoteDetail/remoteDetail", + "style": { + "navigationBarTitleText": "遥控详情", + "disableScroll": true + } + }, + { + "path": "pages/bindRemote/bindRemote", + "style": { + "navigationBarTitleText": "添加遥控", + "disableScroll": true + } + }, + { + "path": "pages/palmVeinList/palmVeinList", + "style": { + "navigationBarTitleText": "掌静脉", + "disableScroll": true + } + }, + { + "path": "pages/createPalmVein/createPalmVein", + "style": { + "navigationBarTitleText": "添加掌静脉", + "disableScroll": true + } + }, + { + "path": "pages/palmVeinDetail/palmVeinDetail", + "style": { + "navigationBarTitleText": "掌静脉详情", + "disableScroll": true + } + }, + { + "path": "pages/bindPalmVein/bindPalmVein", + "style": { + "navigationBarTitleText": "添加掌静脉", + "disableScroll": true + } } ], "globalStyle": { diff --git a/pages/bindCard/bindCard.vue b/pages/bindCard/bindCard.vue index a4435cd..9cf2331 100644 --- a/pages/bindCard/bindCard.vue +++ b/pages/bindCard/bindCard.vue @@ -67,6 +67,28 @@ } else { $basic.backAndToast(message) } + } else if (data.status === 0xff) { + $basic.backAndToast('添加失败,请重试') + } else if (data.status === 0xfe) { + uni.showToast({ + title: '管理员已满', + icon: 'none' + }) + } else if (data.status === 0xfd) { + uni.showToast({ + title: '用户已满', + icon: 'none' + }) + } else if (data.status === 0xfc) { + uni.showToast({ + title: '卡片已满', + icon: 'none' + }) + } else if (data.status === 0xfb) { + uni.showToast({ + title: '卡片已存在', + icon: 'none' + }) } }) } diff --git a/pages/bindFace/bindFace.vue b/pages/bindFace/bindFace.vue new file mode 100644 index 0000000..51837ab --- /dev/null +++ b/pages/bindFace/bindFace.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/pages/bindFingerprint/bindFingerprint.vue b/pages/bindFingerprint/bindFingerprint.vue index 5f4608f..4fd79bb 100644 --- a/pages/bindFingerprint/bindFingerprint.vue +++ b/pages/bindFingerprint/bindFingerprint.vue @@ -4,7 +4,7 @@ {{ text }} - ({{ process }}/5) + ({{ process }}/{{ maxProcess }}) { if (options.info) { const params = JSON.parse(options.info) - const { code } = await $bluetooth.registerAuthentication(params) + const { code, data } = await $bluetooth.registerAuthentication(params) if (code === 0) { text.value = '请将您的手指按下' + maxProcess.value = data.maxProcess showProcess.value = true } else { $basic.backAndToast('操作失败,请重试') @@ -73,6 +75,28 @@ uni.$on('registerFingerprintProcess', data => { if (data.status === 0) { process.value = data.process + } else if (data.status === 0xff) { + $basic.backAndToast('添加失败,请重试') + } else if (data.status === 0xfe) { + uni.showToast({ + title: '管理员已满', + icon: 'none' + }) + } else if (data.status === 0xfd) { + uni.showToast({ + title: '用户已满', + icon: 'none' + }) + } else if (data.status === 0xfc) { + uni.showToast({ + title: '指纹已满', + icon: 'none' + }) + } else if (data.status === 0xfb) { + uni.showToast({ + title: '指纹已存在', + icon: 'none' + }) } }) } diff --git a/pages/bindPalmVein/bindPalmVein.vue b/pages/bindPalmVein/bindPalmVein.vue new file mode 100644 index 0000000..96b0465 --- /dev/null +++ b/pages/bindPalmVein/bindPalmVein.vue @@ -0,0 +1,105 @@ + + + diff --git a/pages/bindRemote/bindRemote.vue b/pages/bindRemote/bindRemote.vue new file mode 100644 index 0000000..087e2fc --- /dev/null +++ b/pages/bindRemote/bindRemote.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/pages/createFace/createFace.vue b/pages/createFace/createFace.vue new file mode 100644 index 0000000..9c906c0 --- /dev/null +++ b/pages/createFace/createFace.vue @@ -0,0 +1,307 @@ + + + + + + + diff --git a/pages/createFingerprint/createFingerprint.vue b/pages/createFingerprint/createFingerprint.vue index 920fbb0..4287fd3 100644 --- a/pages/createFingerprint/createFingerprint.vue +++ b/pages/createFingerprint/createFingerprint.vue @@ -39,7 +39,7 @@ @@ -83,7 +83,7 @@ diff --git a/pages/createPalmVein/createPalmVein.vue b/pages/createPalmVein/createPalmVein.vue new file mode 100644 index 0000000..63c1d1e --- /dev/null +++ b/pages/createPalmVein/createPalmVein.vue @@ -0,0 +1,337 @@ + + + + + + + diff --git a/pages/createRemote/createRemote.vue b/pages/createRemote/createRemote.vue new file mode 100644 index 0000000..4e4121b --- /dev/null +++ b/pages/createRemote/createRemote.vue @@ -0,0 +1,281 @@ + + + + + + + diff --git a/pages/faceDetail/faceDetail.vue b/pages/faceDetail/faceDetail.vue new file mode 100644 index 0000000..7fdcf3d --- /dev/null +++ b/pages/faceDetail/faceDetail.vue @@ -0,0 +1,111 @@ + + + + + + + diff --git a/pages/faceList/faceList.vue b/pages/faceList/faceList.vue new file mode 100644 index 0000000..fa65ee1 --- /dev/null +++ b/pages/faceList/faceList.vue @@ -0,0 +1,464 @@ + + + + + + + diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 6464437..473aabc 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -84,6 +84,35 @@ 指纹 + + + 遥控 + + + + 人脸 + + + + 掌静脉 + 授权管理员 diff --git a/pages/palmVeinDetail/palmVeinDetail.vue b/pages/palmVeinDetail/palmVeinDetail.vue new file mode 100644 index 0000000..7ba2db4 --- /dev/null +++ b/pages/palmVeinDetail/palmVeinDetail.vue @@ -0,0 +1,111 @@ + + + + + + + diff --git a/pages/palmVeinList/palmVeinList.vue b/pages/palmVeinList/palmVeinList.vue new file mode 100644 index 0000000..9f409f0 --- /dev/null +++ b/pages/palmVeinList/palmVeinList.vue @@ -0,0 +1,468 @@ + + + + + + + diff --git a/pages/remoteDetail/remoteDetail.vue b/pages/remoteDetail/remoteDetail.vue new file mode 100644 index 0000000..3ae130f --- /dev/null +++ b/pages/remoteDetail/remoteDetail.vue @@ -0,0 +1,111 @@ + + + + + + + diff --git a/pages/remoteList/remoteList.vue b/pages/remoteList/remoteList.vue new file mode 100644 index 0000000..7470f29 --- /dev/null +++ b/pages/remoteList/remoteList.vue @@ -0,0 +1,466 @@ + + + + + + + diff --git a/static/images/background_close_door.png b/static/images/background_close_door.png index 04f5fa5..1b3d33e 100755 Binary files a/static/images/background_close_door.png and b/static/images/background_close_door.png differ diff --git a/static/images/background_empty_list.png b/static/images/background_empty_list.png index 80cdb63..339ed19 100644 Binary files a/static/images/background_empty_list.png and b/static/images/background_empty_list.png differ diff --git a/static/images/background_main.jpg b/static/images/background_main.jpg index 53c25b1..e51efc0 100644 Binary files a/static/images/background_main.jpg and b/static/images/background_main.jpg differ diff --git a/static/images/background_open_door.png b/static/images/background_open_door.png index e2a93f5..73313ab 100644 Binary files a/static/images/background_open_door.png and b/static/images/background_open_door.png differ diff --git a/static/images/icon_add.png b/static/images/icon_add.png index 937c30b..73524e6 100644 Binary files a/static/images/icon_add.png and b/static/images/icon_add.png differ diff --git a/static/images/icon_add_blue.png b/static/images/icon_add_blue.png index d08fc12..fd36391 100644 Binary files a/static/images/icon_add_blue.png and b/static/images/icon_add_blue.png differ diff --git a/static/images/icon_add_card.png b/static/images/icon_add_card.png index 0e25497..dd3a520 100755 Binary files a/static/images/icon_add_card.png and b/static/images/icon_add_card.png differ diff --git a/static/images/icon_add_face_1.png b/static/images/icon_add_face_1.png new file mode 100755 index 0000000..aeacd24 Binary files /dev/null and b/static/images/icon_add_face_1.png differ diff --git a/static/images/icon_add_face_2.png b/static/images/icon_add_face_2.png new file mode 100755 index 0000000..90e5f03 Binary files /dev/null and b/static/images/icon_add_face_2.png differ diff --git a/static/images/icon_add_palm_vein.png b/static/images/icon_add_palm_vein.png new file mode 100755 index 0000000..d491e67 Binary files /dev/null and b/static/images/icon_add_palm_vein.png differ diff --git a/static/images/icon_add_remote.png b/static/images/icon_add_remote.png new file mode 100644 index 0000000..b2e956f Binary files /dev/null and b/static/images/icon_add_remote.png differ diff --git a/static/images/icon_add_round.png b/static/images/icon_add_round.png index d0f9a4d..6f76848 100644 Binary files a/static/images/icon_add_round.png and b/static/images/icon_add_round.png differ diff --git a/static/images/icon_address.png b/static/images/icon_address.png index d2ddd5e..fd4022e 100644 Binary files a/static/images/icon_address.png and b/static/images/icon_address.png differ diff --git a/static/images/icon_admin.png b/static/images/icon_admin.png index d2a83cf..c389a77 100755 Binary files a/static/images/icon_admin.png and b/static/images/icon_admin.png differ diff --git a/static/images/icon_admin_black.png b/static/images/icon_admin_black.png index c431086..825bc88 100644 Binary files a/static/images/icon_admin_black.png and b/static/images/icon_admin_black.png differ diff --git a/static/images/icon_arrow.png b/static/images/icon_arrow.png index a0a91ec..f0d9d84 100644 Binary files a/static/images/icon_arrow.png and b/static/images/icon_arrow.png differ diff --git a/static/images/icon_card.png b/static/images/icon_card.png index b660629..1355daf 100644 Binary files a/static/images/icon_card.png and b/static/images/icon_card.png differ diff --git a/static/images/icon_card_white.png b/static/images/icon_card_white.png index 355b5c0..719ada5 100755 Binary files a/static/images/icon_card_white.png and b/static/images/icon_card_white.png differ diff --git a/static/images/icon_cloud.png b/static/images/icon_cloud.png index e93fd9c..aa41ec5 100644 Binary files a/static/images/icon_cloud.png and b/static/images/icon_cloud.png differ diff --git a/static/images/icon_cloud_active.png b/static/images/icon_cloud_active.png index 13f3d99..f15e39f 100644 Binary files a/static/images/icon_cloud_active.png and b/static/images/icon_cloud_active.png differ diff --git a/static/images/icon_delete.png b/static/images/icon_delete.png index 0c990ec..2559304 100644 Binary files a/static/images/icon_delete.png and b/static/images/icon_delete.png differ diff --git a/static/images/icon_door_lock.png b/static/images/icon_door_lock.png index 72dd4b9..5ee591d 100755 Binary files a/static/images/icon_door_lock.png and b/static/images/icon_door_lock.png differ diff --git a/static/images/icon_face.png b/static/images/icon_face.png new file mode 100644 index 0000000..ce6b9fd Binary files /dev/null and b/static/images/icon_face.png differ diff --git a/static/images/icon_face_white.png b/static/images/icon_face_white.png new file mode 100755 index 0000000..739bd42 Binary files /dev/null and b/static/images/icon_face_white.png differ diff --git a/static/images/icon_fingerprint.png b/static/images/icon_fingerprint.png index 19e66bd..6ec6147 100644 Binary files a/static/images/icon_fingerprint.png and b/static/images/icon_fingerprint.png differ diff --git a/static/images/icon_fingerprint_0.png b/static/images/icon_fingerprint_0.png index ffc2d97..5ef3c50 100755 Binary files a/static/images/icon_fingerprint_0.png and b/static/images/icon_fingerprint_0.png differ diff --git a/static/images/icon_fingerprint_1.png b/static/images/icon_fingerprint_1.png index ba603bf..cded470 100755 Binary files a/static/images/icon_fingerprint_1.png and b/static/images/icon_fingerprint_1.png differ diff --git a/static/images/icon_fingerprint_2.png b/static/images/icon_fingerprint_2.png index 89dea31..489de43 100755 Binary files a/static/images/icon_fingerprint_2.png and b/static/images/icon_fingerprint_2.png differ diff --git a/static/images/icon_fingerprint_3.png b/static/images/icon_fingerprint_3.png index a106ee5..b77d0fa 100755 Binary files a/static/images/icon_fingerprint_3.png and b/static/images/icon_fingerprint_3.png differ diff --git a/static/images/icon_fingerprint_4.png b/static/images/icon_fingerprint_4.png index 0c45326..ed7a18f 100755 Binary files a/static/images/icon_fingerprint_4.png and b/static/images/icon_fingerprint_4.png differ diff --git a/static/images/icon_fingerprint_5.png b/static/images/icon_fingerprint_5.png index a1e9b54..241b66f 100644 Binary files a/static/images/icon_fingerprint_5.png and b/static/images/icon_fingerprint_5.png differ diff --git a/static/images/icon_lock_touch_screen.png b/static/images/icon_lock_touch_screen.png index de3f363..c01adc9 100755 Binary files a/static/images/icon_lock_touch_screen.png and b/static/images/icon_lock_touch_screen.png differ diff --git a/static/images/icon_notification_read.png b/static/images/icon_notification_read.png index 95dc3cb..a9cb140 100755 Binary files a/static/images/icon_notification_read.png and b/static/images/icon_notification_read.png differ diff --git a/static/images/icon_notification_unread.png b/static/images/icon_notification_unread.png index be7a877..3a04613 100755 Binary files a/static/images/icon_notification_unread.png and b/static/images/icon_notification_unread.png differ diff --git a/static/images/icon_palm_vein.png b/static/images/icon_palm_vein.png new file mode 100644 index 0000000..018050b Binary files /dev/null and b/static/images/icon_palm_vein.png differ diff --git a/static/images/icon_palm_vein_white.png b/static/images/icon_palm_vein_white.png new file mode 100644 index 0000000..0b94f87 Binary files /dev/null and b/static/images/icon_palm_vein_white.png differ diff --git a/static/images/icon_remote.png b/static/images/icon_remote.png new file mode 100644 index 0000000..3bf9398 Binary files /dev/null and b/static/images/icon_remote.png differ diff --git a/static/images/icon_remote_white.png b/static/images/icon_remote_white.png new file mode 100644 index 0000000..8568eee Binary files /dev/null and b/static/images/icon_remote_white.png differ diff --git a/stores/basic.js b/stores/basic.js index 869ff81..8ccf1ae 100644 --- a/stores/basic.js +++ b/stores/basic.js @@ -151,6 +151,66 @@ const pages = [ name: 'bindFingerprint', path: '/pages/bindFingerprint/bindFingerprint', tabBar: false + }, + { + name: 'faceList', + path: '/pages/faceList/faceList', + tabBar: false + }, + { + name: 'createFace', + path: '/pages/createFace/createFace', + tabBar: false + }, + { + name: 'faceDetail', + path: '/pages/faceDetail/faceDetail', + tabBar: false + }, + { + name: 'bindFace', + path: '/pages/bindFace/bindFace', + tabBar: false + }, + { + name: 'remoteList', + path: '/pages/remoteList/remoteList', + tabBar: false + }, + { + name: 'createRemote', + path: '/pages/createRemote/createRemote', + tabBar: false + }, + { + name: 'remoteDetail', + path: '/pages/remoteDetail/remoteDetail', + tabBar: false + }, + { + name: 'bindRemote', + path: '/pages/bindRemote/bindRemote', + tabBar: false + }, + { + name: 'palmVeinList', + path: '/pages/palmVeinList/palmVeinList', + tabBar: false + }, + { + name: 'createPalmVein', + path: '/pages/createPalmVein/createPalmVein', + tabBar: false + }, + { + name: 'palmVeinDetail', + path: '/pages/palmVeinDetail/palmVeinDetail', + tabBar: false + }, + { + name: 'bindPalmVein', + path: '/pages/bindPalmVein/bindPalmVein', + tabBar: false } ] diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 7e7ecd7..b55e1ce 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -68,12 +68,20 @@ const subCmdIds = { registerFaceConfirm: 82, // 注册人脸取消 registerFaceCancel: 86, + // 注册人脸过程 + registerFaceProcess: 83, // 注册遥控 registerRemote: 26, // 注册遥控确认 registerRemoteConfirm: 27, // 注册遥控取消 - registerRemoteCancel: 28 + registerRemoteCancel: 28, + // 注册掌纹 + registerPalmVein: 42, + // 注册掌纹确认 + registerPalmVeinConfirm: 43, + // 注册掌纹取消 + registerPalmVeinCancel: 44 } export const useBluetoothStore = defineStore('ble', { @@ -397,9 +405,8 @@ export const useBluetoothStore = defineStore('ble', { }) break case subCmdIds.registerCard: - case subCmdIds.registerFingerprint: - case subCmdIds.registerFace: case subCmdIds.registerRemote: + case subCmdIds.registerPalmVein: that.updateCurrentLockInfo({ ...that.currentLockInfo, token: decrypted.slice(5, 9) @@ -407,8 +414,20 @@ export const useBluetoothStore = defineStore('ble', { characteristicValueCallback({ code: decrypted[2], data: { - status: decrypted[9], - no: decrypted[10] * 256 + decrypted[11] + status: decrypted[9] + } + }) + break + case subCmdIds.registerFingerprint: + case subCmdIds.registerFace: + that.updateCurrentLockInfo({ + ...that.currentLockInfo, + token: decrypted.slice(5, 9) + }) + characteristicValueCallback({ + code: decrypted[2], + data: { + maxProcess: decrypted[11] } }) break @@ -424,12 +443,36 @@ export const useBluetoothStore = defineStore('ble', { fingerprintNumber: decrypted[6] * 256 + decrypted[7] }) break + case subCmdIds.registerFaceConfirm: + uni.$emit('registerFaceConfirm', { + status: decrypted[5], + faceNumber: decrypted[6] * 256 + decrypted[7] + }) + break + case subCmdIds.registerRemoteConfirm: + uni.$emit('registerRemoteConfirm', { + status: decrypted[5], + remoteNumber: decrypted[6] * 256 + decrypted[7] + }) + break + case subCmdIds.registerPalmVeinConfirm: + uni.$emit('registerPalmVeinConfirm', { + status: decrypted[5], + palmVeinNumber: decrypted[6] * 256 + decrypted[7] + }) + break case subCmdIds.registerFingerprintProcess: uni.$emit('registerFingerprintProcess', { status: decrypted[5], process: decrypted[6] }) break + case subCmdIds.registerFaceProcess: + uni.$emit('registerFaceProcess', { + status: decrypted[5], + process: decrypted[6] + }) + break } break case cmdIds.openDoor: @@ -2292,8 +2335,10 @@ export const useBluetoothStore = defineStore('ble', { contentArray[2] = subCmdIds.registerFingerprint } else if (type === 'face') { contentArray[2] = subCmdIds.registerFace - } else { + } else if (type === 'remote') { contentArray[2] = subCmdIds.registerRemote + } else if (type === 'palmVein') { + contentArray[2] = subCmdIds.registerPalmVein } contentArray[3] = length - 3 @@ -2371,8 +2416,10 @@ export const useBluetoothStore = defineStore('ble', { contentArray[2] = subCmdIds.registerFingerprintCancel } else if (type === 'face') { contentArray[2] = subCmdIds.registerFaceCancel - } else { + } else if (type === 'remote') { contentArray[2] = subCmdIds.registerRemoteCancel + } else if (type === 'palmVein') { + contentArray[2] = subCmdIds.registerPalmVeinCancel } contentArray[3] = length - 3