From 63513c8dd8fe149a40a3b7393362f6da499e7ad7 Mon Sep 17 00:00:00 2001
From: xiaohei <11674173+xiaohei102908@user.noreply.gitee.com>
Date: Thu, 23 Nov 2023 18:12:16 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC3.7=20=202023-11-23=20=20ljd?=
=?UTF-8?q?=201=E3=80=81=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E4=BA=86=E4=BA=BA=E8=84=B8=E6=89=80=E5=BE=97=E5=BD=95=E5=85=A5?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=EF=BC=8C?=
=?UTF-8?q?=E8=BF=98=E6=9C=AA=E8=BF=9B=E8=A1=8C=E6=B5=8B=E8=AF=95=202?=
=?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=B0=8F=E7=A8=8B=E5=BA=8F?=
=?UTF-8?q?q=E7=B3=BB=E5=88=97=E9=94=81=E6=96=BD=E5=B7=A5=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E7=BB=91=E5=AE=9A=E9=94=81=E4=B9=8B=E5=90=8E=E8=BF=9B?=
=?UTF-8?q?=E5=88=B0=E6=88=BF=E9=97=B4=E8=AF=A6=E6=83=85=E9=A1=B5=E5=BC=80?=
=?UTF-8?q?=E4=B8=8D=E4=BA=86=E9=94=81=E5=92=8C=E6=97=A0=E6=B3=95=E5=BD=95?=
=?UTF-8?q?=E5=85=A5=E5=87=AD=E8=AF=81=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/addperson/addperson.js | 29 +++++++++++++++----
pages/personManger/personManger.js | 12 ++++----
pages/roomDetail/roomDetail.js | 15 ++++++++++
pagesA/faceinfo/faceinfo.js | 58 ++++++++++++++++++++++++++++++--------
pagesA/faceinfo/faceinfo.wxml | 2 +-
pagesA/facepeople/facepeople.js | 45 ++++++++++++++++++++++++++---
6 files changed, 132 insertions(+), 29 deletions(-)
diff --git a/pages/addperson/addperson.js b/pages/addperson/addperson.js
index ade84f5..1ffbbed 100644
--- a/pages/addperson/addperson.js
+++ b/pages/addperson/addperson.js
@@ -261,6 +261,21 @@ Page({
app.watch(this.getcartcount, 'backdata')
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) {
@@ -908,7 +923,7 @@ Page({
var _this = this
this.getNFCIndexLwj(index, function (data) {
if (data.length > 0) {
- let passwordIndex = JSON.parse(data[0].content).index || ''
+ let passwordIndex = info.index
var dataPasswod = {
code: "lwj/cardOperate",
data: {
@@ -1083,6 +1098,7 @@ Page({
var info = JSON.parse(personLi.content)
var person = this.data.personLi
var _this = this
+ console.log(personLi, "personLi");
this.getFpIndex(index, function (data) {
if (data.length > 0) {
var FPindex = data[0].face
@@ -1090,19 +1106,17 @@ Page({
var dataFP = {
code: "",
data: {
+ fpIndex: info.index,
lockerId: deviceinfo.deviceNum,
imei: deviceinfo.imei,
lockerUserId: info.userPassword,
keyId: info.userPassword,
- fingerType: 0,
- order: 6216,
- fingerId: '',
+ operateMode: 18,
+ order: 6218,
roomName: deviceinfo.roomName,
cardName: cardName,
startTime: passwordStartTime,
endTime: passwordEndTime,
- file: '',
- type: 1,
action: 2
}
}
@@ -2159,6 +2173,7 @@ Page({
cardName: cardName,
}
}
+ console.log(dataPasswod);
WXAPI.sendCommand(dataPasswod).then(res => {
console.log(res, '获取索引')
if (res.success) {
@@ -4193,7 +4208,9 @@ Page({
type: 1
}
}
+ console.log(dataPasswod);
WXAPI.sendCommand(dataPasswod).then(res => {
+ console.log(res);
if (res.success) {
fingerprintIndex = res.data.index
serialNumber = res.data.serialNumber
diff --git a/pages/personManger/personManger.js b/pages/personManger/personManger.js
index 8106738..dd62bdb 100644
--- a/pages/personManger/personManger.js
+++ b/pages/personManger/personManger.js
@@ -565,18 +565,16 @@ Page({
}
WXAPI.getSiteTenant(data2).then(res1 => {
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({
personList: res1.data.list,
roomId: roomId,
starttime,
endtime,
- minDate,minDate1
+ // minDate,minDate1
})
} else {
this.setData({
diff --git a/pages/roomDetail/roomDetail.js b/pages/roomDetail/roomDetail.js
index c82c508..884827a 100644
--- a/pages/roomDetail/roomDetail.js
+++ b/pages/roomDetail/roomDetail.js
@@ -174,6 +174,21 @@ Page({
app.globalData.deviceNum = deviceinfo.deviceNum
var userInfo1 = wx.getStorageSync('userInfo')
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) {
var data3 = {
code: "zg/bleRegisterInfo",
diff --git a/pagesA/faceinfo/faceinfo.js b/pagesA/faceinfo/faceinfo.js
index a5326a7..4de6ec7 100644
--- a/pagesA/faceinfo/faceinfo.js
+++ b/pagesA/faceinfo/faceinfo.js
@@ -78,18 +78,54 @@ Page({
console.log(this.data.facemessage)
var face = this.data.facemessage
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) {
this.data.facemessage.pzname = e.detail
diff --git a/pagesA/faceinfo/faceinfo.wxml b/pagesA/faceinfo/faceinfo.wxml
index 1054eee..a00b4d5 100644
--- a/pagesA/faceinfo/faceinfo.wxml
+++ b/pagesA/faceinfo/faceinfo.wxml
@@ -29,7 +29,7 @@
-
+
确定
diff --git a/pagesA/facepeople/facepeople.js b/pagesA/facepeople/facepeople.js
index 26f4b85..1c256b1 100644
--- a/pagesA/facepeople/facepeople.js
+++ b/pagesA/facepeople/facepeople.js
@@ -281,6 +281,7 @@ Page({
var _this = this
var deviceinfo = this.data.deviceinfo
var info = JSON.parse(this.data.personLi.info)
+ console.log(deviceinfo, info, this.data.personLi);
if (deviceinfo.manufactureId == 1241) {
var time1 = new Date(_this.data.datetimerange[0].replace(/-/g, '/'))
var time2 = new Date(_this.data.datetimerange[1].replace(/-/g, '/'))
@@ -303,6 +304,8 @@ Page({
lockerId: deviceinfo.deviceNum,
lockerUserId: info.userPassword,
startTime: passwordStartTime,
+ operateMode: 20,
+ order: 6220
}
}
var str = {
@@ -312,18 +315,21 @@ Page({
password: '',
faceData: _this.data.avatarPath,
userTelephone: JSON.parse(_this.data.personLi.info).userTelephone,
- operateMode: '',
+ operateMode: 20,
+ order: 6220,
userPassword: JSON.parse(_this.data.personLi.info).userPassword,
passwordStartTime: passwordStartTime,
passwordEndTime: passwordEndTime,
is: false,
- pass: true
+ pass: true,
+ cardName: this.data.personLi.name + '-' + pzname,
+ roomName: deviceinfo.roomName
}
console.log(_this.data.avatarPath, dataface);
WXAPI.sendCommand(dataface).then(res => {
console.log(res);
if (res.success) {
- faceaddIndex = res.data.index
+ str.faceaddIndex = res.data.index
serialNumber = res.data.serialNumber
var datalist = {
cardId: _this.data.personLi.cardId,
@@ -344,6 +350,8 @@ Page({
serial: serialNumber,
startTime: passwordStartTime,
endTime: passwordEndTime,
+ order: 6220,
+ operateMode: 20
}
WXAPI.addCertificates(data1).then(res2 => {
console.log("res2", res2);
@@ -391,16 +399,45 @@ Page({
let dataface = {
code: "lwj/faceOperate",
data: {
+ faceIndex: content.index,
action: 2,
endTime: content.passwordEndTime,
faceData: content.faceData,
lockerId: facemessage.deviceNum,
lockerUserId: content.userPassword,
- startTime: content.passwordStartTime
+ startTime: content.passwordStartTime,
+ operateMode: 22,
+ order: 6222
}
}
WXAPI.sendCommand(dataface).then(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) {
wx.showToast({