Browse Source

版本2.0 2023-11-24 ljd

1、修改了删除NFC卡凭证错误的问题,但是还是未能成功删除卡
2、增加了删除指纹凭证的功能
master
xiaohei 1 year ago
parent
commit
5a64878733
5 changed files with 133 additions and 17 deletions
  1. +94
    -13
      pages/addperson/addperson.js
  2. +1
    -0
      pages/indexUser/indexUser.js
  3. +1
    -0
      pages/login/login.js
  4. +21
    -3
      pages/userbluetoothUnlock/userbluetoothUnlock.js
  5. +16
    -1
      pagesA/facepeople/facepeople.js

+ 94
- 13
pages/addperson/addperson.js View File

@ -934,11 +934,11 @@ Page({
order: 6212,
operateMode: 12,
action: 2,
// cardNo: info.password,
passwordIndex: passwordIndex,
cardNo: info.password,
type: 12,
cardName: _this.data.personLi.name,
roomName: deviceinfo.roomName
roomName: deviceinfo.roomName,
cardIndex: info.index
}
}
console.log(dataPasswod, 'dataPasswod', info)
@ -1094,6 +1094,7 @@ Page({
})
var cgInfo = this.data.cgInfo
var personLi = this.data.FpList[index]
passwordLiAll = personLi
var deviceinfo = this.data.deviceinfo
var info = JSON.parse(personLi.content)
var person = this.data.personLi
@ -1101,25 +1102,42 @@ Page({
console.log(personLi, "personLi");
this.getFpIndex(index, function (data) {
if (data.length > 0) {
var FPindex = data[0].face
// 删除
var dataFP = {
code: "",
code: "lwj/fpOperate",
data: {
fpIndex: info.index,
lockerId: deviceinfo.deviceNum,
imei: deviceinfo.imei,
lockerUserId: info.userPassword,
keyId: info.userPassword,
operateMode: 18,
order: 6218,
roomName: deviceinfo.roomName,
cardName: cardName,
startTime: passwordStartTime,
endTime: passwordEndTime,
action: 2
startTime: personLi.startTime,
endTime: personLi.endTime,
action: 2,
cardName: personLi.name
}
}
console.log(dataFP);
WXAPI.sendCommand(dataFP).then(res => {
console.log(res, "获取索引");
if(res.success){
// fingerprintIndex = res.data.index
fingerprintIndex = JSON.parse(personLi.content).index
serialNumber = res.data.serialNumber
taskId = 72
_this.initBluetooth()
}else{
wx.hideLoading()
wx.showToast({
title: res.msg,
mask: true,
icon: 'none',
duration: 2000
})
}
})
} else {
wx.hideLoading()
wx.showToast({
@ -1543,6 +1561,15 @@ Page({
console.debug('bytes', bytes)
that.sendBytes(bytes)
},
onDelFingerprint: function() {
var that = this
wx.showLoading({
title: '删除指纹中',
})
var bytes = plugin.delFingerprint(lockDevice.name, basecode, fingerprintIndex)
console.debug('bytes', bytes);
that.sendBytes(bytes)
},
onDelPincode: function () {
var that = this
wx.showLoading({
@ -2892,7 +2919,7 @@ Page({
wx.hideLoading()
if (data.code != 200) {
var datacom = {
code: "lwj/c",
code: "lwj/cardOperate",
data: {
lockerId: that.data.deviceinfo.deviceNum,
serialNumber: serialNumber,
@ -2903,7 +2930,7 @@ Page({
}
}
WXAPI.sendCommand(datacom).then(res2 => {
console.log(res2, '失败')
console.log(res2, '失败2933')
})
wx.showModal({
title: '提示',
@ -2931,7 +2958,7 @@ Page({
})
}
var datacom = {
code: "lwj/c",
code: "lwj/cardOperate",
data: {
lockerId: that.data.deviceinfo.deviceNum,
serialNumber: serialNumber,
@ -2966,6 +2993,9 @@ Page({
})
}
})
that.setData({
isRfCardAdd: false
})
rfCardId = -1
rfCardIndex = -1
break
@ -3109,6 +3139,20 @@ Page({
case 'delFingerprint': {
wx.hideLoading()
if (data.code != 200) {
var datacom = {
code: "lwj/fpOperate",
data: {
lockerId: that.data.deviceinfo.deviceNum,
serialNumber: serialNumber,
index: fingerprintIndex,
action: 2,
type: 18,
result: 0
}
}
WXAPI.sendCommand(datacom).then(res2 => {
console.log(res2, '失败')
})
wx.showModal({
title: '提示',
content: '删除指纹失败!',
@ -3123,6 +3167,43 @@ Page({
content: `删除指纹成功,序号${fingerprintIndex}`,
showCancel: false,
})
var datacom = {
code: "lwj/fpOperate",
data: {
lockerId: that.data.deviceinfo.deviceNum,
serialNumber: serialNumber,
index: fingerprintIndex,
action: 2,
type: 18,
result: 1
}
}
WXAPI.sendCommand(datacom).then(res2 => {
if (res2.success) {}
})
var data = {
ids: [passwordLiAll.id]
}
WXAPI.deleteCertificates(data).then(res1 => {
if (res1.success) {
that.getFp()
wx.hideLoading()
wx.showToast({
title: '删除成功',
mask: true,
icon: 'none',
duration: 2000
})
} else {
wx.hideLoading()
wx.showToast({
title: '删除失败',
mask: true,
icon: 'none',
duration: 2000
})
}
})
that.setData({
isFingerprintAdd: false
})


+ 1
- 0
pages/indexUser/indexUser.js View File

@ -31,6 +31,7 @@ Page({
wx.getStorage({
key: "deviceinfoList",
success: (res) => {
console.log(res);
this.setData({
list:res.data,
deviceList:res.data


+ 1
- 0
pages/login/login.js View File

@ -223,6 +223,7 @@ Page({
number:this.data.usernameOne
}
WXAPI.atCardUser(data).then(res => {
console.log(res);
if(res.code==200){
let token={
access_token:signature


+ 21
- 3
pages/userbluetoothUnlock/userbluetoothUnlock.js View File

@ -12,6 +12,7 @@ var bleall = require('../../utils/bleall');
const emitter = app.globalData.emitter
import moment from "../../utils/moment"
const ADD_NFC_MODE=10
var basecode = ''
// ArrayBuffer转16进度字符串示例
function ab2hex(buffer) {
var hexArr = Array.prototype.map.call(
@ -96,6 +97,21 @@ Page({
app.globalData.zgBlueStatus = false
this.AddressPermissions()
let deviceinfo = wx.getStorageSync('deviceinfo')
// if(deviceinfo){
// let superAdmin = []
// var superAdminIdlist = deviceinfo.bluetoothMac.slice(deviceinfo.bluetoothMac.length - 11, deviceinfo.bluetoothMac.length).split(":").join("")
// for (let i = 0; i < superAdminIdlist.length; i++) {
// if (superAdminIdlist[i] >= 0 && superAdminIdlist[i] <= 9) {
// superAdmin.push(superAdminIdlist[i])
// } else {
// let adminid = superAdminIdlist.charCodeAt(i)
// superAdmin.push(adminid)
// }
// }
// let superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length)
// basecode = superAdminId
// console.log(basecode, "basecode");
// }
if(deviceinfo.manufactureId==201||deviceinfo.manufactureId == 221){
var data3 = {
code: "zg/bleRegisterInfo",
@ -121,9 +137,11 @@ Page({
this.getApartmentCardInfoMethods()
this.getPassWordMehods()
app.globalData.deviceNum = deviceinfo.deviceNum
app.watch(this.getcartcount, 'backdata')
app.watch(this.fingerprintFun, 'fingerprintId')
app.watch(this.openlockfun, 'openlock')
if(deviceinfo.manufactureId == 101){
app.watch(this.getcartcount, 'backdata')
app.watch(this.fingerprintFun, 'fingerprintId')
app.watch(this.openlockfun, 'openlock')
}
},
// 获取合同信息
getApartmentCardInfoMethods(){


+ 16
- 1
pagesA/facepeople/facepeople.js View File

@ -132,7 +132,22 @@ Page({
show2: true
})
}
this.getFace()
if(deviceinfo.bluetoothMac){
let superAdmin = []
var superAdminIdlist = deviceinfo.bluetoothMac.slice(deviceinfo.bluetoothMac.length - 11, deviceinfo.bluetoothMac.length).split(":").join("")
for (let i = 0; i < superAdminIdlist.length; i++) {
if (superAdminIdlist[i] >= 0 && superAdminIdlist[i] <= 9) {
superAdmin.push(superAdminIdlist[i])
} else {
let adminid = superAdminIdlist.charCodeAt(i)
superAdmin.push(adminid)
}
}
let superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length)
basecode = superAdminId
console.log(basecode, "basecode");
}
this.getFace();
},
// 获取已录入人脸数据
getFace() {


Loading…
Cancel
Save