Browse Source

版本3.7 2023-11-23 ljd

1、小程序增加了人脸所得录入删除修改功能,还未进行测试
2、修复了小程序q系列锁施工页面绑定锁之后进到房间详情页开不了锁和无法录入凭证的问题
master
xiaohei 1 year ago
parent
commit
63513c8dd8
6 changed files with 132 additions and 29 deletions
  1. +23
    -6
      pages/addperson/addperson.js
  2. +5
    -7
      pages/personManger/personManger.js
  3. +15
    -0
      pages/roomDetail/roomDetail.js
  4. +47
    -11
      pagesA/faceinfo/faceinfo.js
  5. +1
    -1
      pagesA/faceinfo/faceinfo.wxml
  6. +41
    -4
      pagesA/facepeople/facepeople.js

+ 23
- 6
pages/addperson/addperson.js View File

@ -261,6 +261,21 @@ Page({
app.watch(this.getcartcount, 'backdata') app.watch(this.getcartcount, 'backdata')
app.watch(this.fingerprintFun, 'fingerprintId') app.watch(this.fingerprintFun, 'fingerprintId')
} }
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");
}
}, },
// 指纹选择 // 指纹选择
radioChange(e) { radioChange(e) {
@ -908,7 +923,7 @@ Page({
var _this = this var _this = this
this.getNFCIndexLwj(index, function (data) { this.getNFCIndexLwj(index, function (data) {
if (data.length > 0) { if (data.length > 0) {
let passwordIndex = JSON.parse(data[0].content).index || ''
let passwordIndex = info.index
var dataPasswod = { var dataPasswod = {
code: "lwj/cardOperate", code: "lwj/cardOperate",
data: { data: {
@ -1083,6 +1098,7 @@ Page({
var info = JSON.parse(personLi.content) var info = JSON.parse(personLi.content)
var person = this.data.personLi var person = this.data.personLi
var _this = this var _this = this
console.log(personLi, "personLi");
this.getFpIndex(index, function (data) { this.getFpIndex(index, function (data) {
if (data.length > 0) { if (data.length > 0) {
var FPindex = data[0].face var FPindex = data[0].face
@ -1090,19 +1106,17 @@ Page({
var dataFP = { var dataFP = {
code: "", code: "",
data: { data: {
fpIndex: info.index,
lockerId: deviceinfo.deviceNum, lockerId: deviceinfo.deviceNum,
imei: deviceinfo.imei, imei: deviceinfo.imei,
lockerUserId: info.userPassword, lockerUserId: info.userPassword,
keyId: info.userPassword, keyId: info.userPassword,
fingerType: 0,
order: 6216,
fingerId: '',
operateMode: 18,
order: 6218,
roomName: deviceinfo.roomName, roomName: deviceinfo.roomName,
cardName: cardName, cardName: cardName,
startTime: passwordStartTime, startTime: passwordStartTime,
endTime: passwordEndTime, endTime: passwordEndTime,
file: '',
type: 1,
action: 2 action: 2
} }
} }
@ -2159,6 +2173,7 @@ Page({
cardName: cardName, cardName: cardName,
} }
} }
console.log(dataPasswod);
WXAPI.sendCommand(dataPasswod).then(res => { WXAPI.sendCommand(dataPasswod).then(res => {
console.log(res, '获取索引') console.log(res, '获取索引')
if (res.success) { if (res.success) {
@ -4193,7 +4208,9 @@ Page({
type: 1 type: 1
} }
} }
console.log(dataPasswod);
WXAPI.sendCommand(dataPasswod).then(res => { WXAPI.sendCommand(dataPasswod).then(res => {
console.log(res);
if (res.success) { if (res.success) {
fingerprintIndex = res.data.index fingerprintIndex = res.data.index
serialNumber = res.data.serialNumber serialNumber = res.data.serialNumber


+ 5
- 7
pages/personManger/personManger.js View File

@ -565,18 +565,16 @@ Page({
} }
WXAPI.getSiteTenant(data2).then(res1 => { WXAPI.getSiteTenant(data2).then(res1 => {
if (res1.data.list.length > 0) { if (res1.data.list.length > 0) {
let minDate = res1.data.list[0].startTime
let minDate1 = res1.data.list[0].endTime
let starttime = moment(minDate).format('YYYY-MM-DD HH:mm:ss')
let endtime = moment(minDate1).format('YYYY-MM-DD HH:mm:ss')
wx.setStorageSync('minDate',starttime)
wx.setStorageSync('minDate1',endtime)
let starttime = moment().format('YYYY-MM-DD HH:mm:ss')
let endtime = moment().add(30,'days').format('YYYY-MM-DD HH:mm:ss')
// wx.setStorageSync('minDate',starttime)
// wx.setStorageSync('minDate1',endtime)
this.setData({ this.setData({
personList: res1.data.list, personList: res1.data.list,
roomId: roomId, roomId: roomId,
starttime, starttime,
endtime, endtime,
minDate,minDate1
// minDate,minDate1
}) })
} else { } else {
this.setData({ this.setData({


+ 15
- 0
pages/roomDetail/roomDetail.js View File

@ -174,6 +174,21 @@ Page({
app.globalData.deviceNum = deviceinfo.deviceNum app.globalData.deviceNum = deviceinfo.deviceNum
var userInfo1 = wx.getStorageSync('userInfo') var userInfo1 = wx.getStorageSync('userInfo')
let deviceinfoData = JSON.parse(JSON.stringify(deviceinfo)) let deviceinfoData = JSON.parse(JSON.stringify(deviceinfo))
console.log(deviceinfoData);
if(deviceinfoData.bluetoothMac){
let superAdmin = []
var superAdminIdlist = deviceinfoData.bluetoothMac.slice(deviceinfoData.bluetoothMac.length - 11, deviceinfoData.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
}
if (deviceinfo.manufactureId == 201 || deviceinfo.manufactureId == 221) { if (deviceinfo.manufactureId == 201 || deviceinfo.manufactureId == 221) {
var data3 = { var data3 = {
code: "zg/bleRegisterInfo", code: "zg/bleRegisterInfo",


+ 47
- 11
pagesA/faceinfo/faceinfo.js View File

@ -78,18 +78,54 @@ Page({
console.log(this.data.facemessage) console.log(this.data.facemessage)
var face = this.data.facemessage var face = this.data.facemessage
var content = JSON.parse(face.content) var content = JSON.parse(face.content)
var passwordStartTime = moment(this.data.startdate).format('YYYYMMDDHHmmss')
var passwordEndTime = moment(this.data.enddate).format('YYYYMMDDHHmmss')
content.pzname = this.data.facemessage.pzname
content.passwordStartTime = passwordStartTime
content.passwordEndTime = passwordEndTime
var updatedata = {
id: this.data.facemessage.id,
content: JSON.stringify(content),
startTime: moment(this.data.startdate).format('x') / 1000,
endTime: moment(this.data.enddate).format('x') / 1000
var startTime = moment(this.data.startdate).format('x') / 1000
var endTime = moment(this.data.enddate).format('x') / 1000
var dataface = {
code: "lwj/faceOperate",
data: {
faceIndex: content.index,
action: 3,
endTime: endTime,
faceData: lt.contentJSON.faceData,
lockerId: deviceinfo.deviceNum,
lockerUserId: lt.contentJSON.userPassword,
startTime: startTime,
operateMode: 21,
order: 6221
}
} }
WXAPI.sendCommand(dataface).then(res => {
console.log(res);
if(res.success){
content.index = res.data.index
content.operateMode = 21
content.order = 6221
content.passwordStartTime = startTime
content.passwordEndTime = endTime
let data1 = {
id: face.id,
content: JSON.stringify(content),
startTime: startTime,
endTime: endTime
}
WXAPI.sendCommand(data1).then(res1 => {
console.log(res1);
if(res1.success){
wx.showToast({
title: '修改凭证成功',
icon: 'none',
duration: 2000
})
}else{
wx.showToast({
title: '修改凭证失败',
icon: "none",
duration: 2000
})
}
})
}
})
}, },
onChange(e) { onChange(e) {
this.data.facemessage.pzname = e.detail this.data.facemessage.pzname = e.detail


+ 1
- 1
pagesA/faceinfo/faceinfo.wxml View File

@ -29,7 +29,7 @@
<view class="picmessage"> <view class="picmessage">
<!-- <view class="picmessage-title">图像名称</view> <!-- <view class="picmessage-title">图像名称</view>
<view class="picmessage-value">{{facemessage.pzname}}</view> --> <view class="picmessage-value">{{facemessage.pzname}}</view> -->
<van-field value="{{ facemessage.pzname }}" placeholder="请输入凭证名称" label="图像名称" border="{{ false }}" bind:change="onChange" input-align="right" />
<van-field value="{{ facemessage.pzname }}" placeholder="凭证名称" label="图像名称" border="{{ false }}" bind:change="onChange" input-align="right" disabled/>
</view> </view>
<view class="btn" bindtap="sendface">确定</view> <view class="btn" bindtap="sendface">确定</view>
</view> </view>


+ 41
- 4
pagesA/facepeople/facepeople.js View File

@ -281,6 +281,7 @@ Page({
var _this = this var _this = this
var deviceinfo = this.data.deviceinfo var deviceinfo = this.data.deviceinfo
var info = JSON.parse(this.data.personLi.info) var info = JSON.parse(this.data.personLi.info)
console.log(deviceinfo, info, this.data.personLi);
if (deviceinfo.manufactureId == 1241) { if (deviceinfo.manufactureId == 1241) {
var time1 = new Date(_this.data.datetimerange[0].replace(/-/g, '/')) var time1 = new Date(_this.data.datetimerange[0].replace(/-/g, '/'))
var time2 = new Date(_this.data.datetimerange[1].replace(/-/g, '/')) var time2 = new Date(_this.data.datetimerange[1].replace(/-/g, '/'))
@ -303,6 +304,8 @@ Page({
lockerId: deviceinfo.deviceNum, lockerId: deviceinfo.deviceNum,
lockerUserId: info.userPassword, lockerUserId: info.userPassword,
startTime: passwordStartTime, startTime: passwordStartTime,
operateMode: 20,
order: 6220
} }
} }
var str = { var str = {
@ -312,18 +315,21 @@ Page({
password: '', password: '',
faceData: _this.data.avatarPath, faceData: _this.data.avatarPath,
userTelephone: JSON.parse(_this.data.personLi.info).userTelephone, userTelephone: JSON.parse(_this.data.personLi.info).userTelephone,
operateMode: '',
operateMode: 20,
order: 6220,
userPassword: JSON.parse(_this.data.personLi.info).userPassword, userPassword: JSON.parse(_this.data.personLi.info).userPassword,
passwordStartTime: passwordStartTime, passwordStartTime: passwordStartTime,
passwordEndTime: passwordEndTime, passwordEndTime: passwordEndTime,
is: false, is: false,
pass: true
pass: true,
cardName: this.data.personLi.name + '-' + pzname,
roomName: deviceinfo.roomName
} }
console.log(_this.data.avatarPath, dataface); console.log(_this.data.avatarPath, dataface);
WXAPI.sendCommand(dataface).then(res => { WXAPI.sendCommand(dataface).then(res => {
console.log(res); console.log(res);
if (res.success) { if (res.success) {
faceaddIndex = res.data.index
str.faceaddIndex = res.data.index
serialNumber = res.data.serialNumber serialNumber = res.data.serialNumber
var datalist = { var datalist = {
cardId: _this.data.personLi.cardId, cardId: _this.data.personLi.cardId,
@ -344,6 +350,8 @@ Page({
serial: serialNumber, serial: serialNumber,
startTime: passwordStartTime, startTime: passwordStartTime,
endTime: passwordEndTime, endTime: passwordEndTime,
order: 6220,
operateMode: 20
} }
WXAPI.addCertificates(data1).then(res2 => { WXAPI.addCertificates(data1).then(res2 => {
console.log("res2", res2); console.log("res2", res2);
@ -391,16 +399,45 @@ Page({
let dataface = { let dataface = {
code: "lwj/faceOperate", code: "lwj/faceOperate",
data: { data: {
faceIndex: content.index,
action: 2, action: 2,
endTime: content.passwordEndTime, endTime: content.passwordEndTime,
faceData: content.faceData, faceData: content.faceData,
lockerId: facemessage.deviceNum, lockerId: facemessage.deviceNum,
lockerUserId: content.userPassword, lockerUserId: content.userPassword,
startTime: content.passwordStartTime
startTime: content.passwordStartTime,
operateMode: 22,
order: 6222
} }
} }
WXAPI.sendCommand(dataface).then(res => { WXAPI.sendCommand(dataface).then(res => {
console.log(res); console.log(res);
content.operateMode = 22
content.order = 6222
if(res.success){
let updatedata = {
id: facemessage.id,
status: 0,
serial: res.data.serialNumber,
content: JSON.stringify(content)
}
WXAPI.updateCertificates(updatedata).then(res1 => {
console.log(res1);
if(res1.success){
wx.showToast({
title: '删除人脸成功',
icon: 'none',
duration: 2000
})
}else{
wx.showToast({
title: '删除人脸失败',
icon: "none",
duration: 2000
})
}
})
}
}) })
}else if(res.cancel) { }else if(res.cancel) {
wx.showToast({ wx.showToast({


Loading…
Cancel
Save