diff --git a/pages/Bluetooth/Bluetooth.js b/pages/Bluetooth/Bluetooth.js index a2cc465..0a0f8d6 100644 --- a/pages/Bluetooth/Bluetooth.js +++ b/pages/Bluetooth/Bluetooth.js @@ -1963,6 +1963,9 @@ Page({ // }) var bytes = plugin.configureWifi(lockDevice.name, lockMac, that.data.WifiName, that.data.WifiPwd) that.sendBytes(bytes) + this.setData({ + show2: false + }) // }else{ // this.initBluetooth() // } diff --git a/pages/addperson/addperson.js b/pages/addperson/addperson.js index 38118c8..b239956 100644 --- a/pages/addperson/addperson.js +++ b/pages/addperson/addperson.js @@ -228,7 +228,8 @@ Page({ starttime:minDate, endtime:minDate1, deviceinfo: deviceinfo, - personLi: personLi + personLi: personLi, + isSearch: false }) this.getPassword() this.getNfc() @@ -2056,7 +2057,8 @@ Page({ }) } }) - }else if (deviceinfo.manufactureId == 1201){ + }else if (deviceinfo.manufactureId == 1201 || deviceinfo.manufactureId == 1241){ + console.log(this.data.isSearch); if(this.data.isSearch){ wx.hideLoading() this.addPincode() @@ -2066,7 +2068,7 @@ Page({ } }, onAddPincode: function () { - + console.log("2073123"); var that = this wx.showLoading({ title: '添加密码中', @@ -2119,6 +2121,7 @@ Page({ that.sendBytes(bytes) }, addPincode: function () { + console.log("2124"); var that = this taskId = 51 that.initBluetooth() @@ -2138,7 +2141,9 @@ Page({ }) console.log(isInitReady,'isConnected', isConnected) if (isConnected) { + console.log("2144"); if (isInitReady) { + console.log("2146"); that.doWork() } else { that.setupConnection() @@ -3192,6 +3197,7 @@ Page({ }, doWork: function () { var that = this + console.log(taskId); switch (taskId) { case 11: { that.onBindLock() @@ -3236,15 +3242,15 @@ Page({ } case 61: { // that.onAddRfCard() - if (lockModel > 70) { + // if (lockModel > 70) { that.sendAddRfcard() - } else { - wx.showModal({ - title: '提示', - content: '请刷卡!', - showCancel: false - }) - } + // } else { + // wx.showModal({ + // title: '提示', + // content: '请刷卡!', + // showCancel: false + // }) + // } break } case 62: { @@ -3675,7 +3681,7 @@ Page({ }) } }) - }else if (deviceinfo.manufactureId == 1201){ + }else if (deviceinfo.manufactureId == 1201 || deviceinfo.manufactureId == 1241){ if(this.data.isSearch){ wx.hideLoading() this.addRfCard() @@ -3685,6 +3691,7 @@ Page({ } }, addRfCard: function () { + console.log("3691NFC"); var that = this taskId = 61 that.initBluetooth() @@ -4082,7 +4089,7 @@ Page({ }) } }) - }else if(deviceinfo.manufactureId == 1201){ + }else if(deviceinfo.manufactureId == 1201 || deviceinfo.manufactureId == 1241){ if(this.data.isSearch){ // fingerprintIndex = 1 // serialNumber = 1686309639840 diff --git a/pages/addperson/addperson.wxml b/pages/addperson/addperson.wxml index b31c3aa..188f1b4 100644 --- a/pages/addperson/addperson.wxml +++ b/pages/addperson/addperson.wxml @@ -2,8 +2,8 @@ - - + + diff --git a/pages/roomDetail/roomDetail.js b/pages/roomDetail/roomDetail.js index f625794..af8766e 100644 --- a/pages/roomDetail/roomDetail.js +++ b/pages/roomDetail/roomDetail.js @@ -290,33 +290,48 @@ Page({ } }, // 配网 - changeshow2() { + changeshow2(e) { + var event = e.currentTarget.dataset.i + var that = this; this.setData({ - show2: true + event }) + var deviceinfo = this.data.deviceinfo + if (deviceinfo.manufactureId == '1241') { + if (event == '3') { + this.setData({ + show2: true + }) + } + }else{ + wx.showToast({ + title: '该类型锁不支持配网功能', + duration: 2000, + icon: 'none' + }) + } + }, + configurationWifi() { + let event = { + currentTarget: { + dataset: { + i: '3' + } + } + } + if(!this.data.isSearch){ + this.btntest1(event) + }else{ + this.configurewifj() + } }, onConfigurewifi() { var that = this - that.wifitimer = setTimeout(() => { - wx.closeBLEConnection({ - deviceId: lockDevice.deviceId, - success(res) { - - }, - fail: res => { - console.log("1", res); - } - }) - wx.showToast({ - title: '配网失败,请重试', - duration: 2000 - }) - }, 6000) - wx.showLoading({ - title: '配置网络中...', - }) var bytes = plugin.configureWifi(lockDevice.name, lockMac, that.data.wifiName, that.data.wifiPwd) that.sendBytes(bytes) + this.setData({ + show2: false + }) }, // 前往图像管理 goImageManagement() { @@ -782,7 +797,7 @@ Page({ mask: true }); this.setVolume1(volume) - } else if (this.data.deviceinfo.manufactureId == 1201) { + } else if (this.data.deviceinfo.manufactureId == 1201 || this.data.deviceinfo.manufactureId == 1241) { this.setData({ isMuted: isMuted }) @@ -808,7 +823,16 @@ Page({ this.data.fingerprintId = app.globalData.fingerprintId }, // 人员管理 - personManger() { + personManger(e) { + if(this.data.isSearch){ + wx.navigateTo({ + url: '/pages/personManger/personManger', + }) + }else{ + this.btntest1(e) + } + }, + gotoperson() { wx.navigateTo({ url: '/pages/personManger/personManger', }) @@ -1181,7 +1205,7 @@ Page({ } else { this.startconnect() } - } else if (deviceinfo.manufactureId == 1201) { + } else if (deviceinfo.manufactureId == 1201 || deviceinfo.manufactureId == 1241) { if (this.data.isSearch) { if (event == '0') { // let iotLwj = new LwJ(this.data.lockDevice,isConnected,connectedDeviceId,isInitReady,this.data.lockDevice.lockModel) @@ -1191,6 +1215,10 @@ Page({ this.setData({ show: true }) + }else if(event == '3') { + this.configurewifj() + }else if(event == '8') { + this.personnelmanagement() } } else { this.searchDevicesMethods() @@ -1272,6 +1300,10 @@ Page({ that.setData({ show: true }) + } else if (that.data.event == '3') { + that.configurewifj() + }else if(that.data.event == '8') { + that.personnelmanagement() } wx.hideLoading({ success: (res) => {}, @@ -1318,11 +1350,17 @@ Page({ taskId = 41 that.initBluetooth() }, - configurewifj(){ + configurewifj() { var that = this taskId = 121 that.initBluetooth() }, + // 人员管理 + personnelmanagement() { + var that = this + taskId = 9010 + that.initBluetooth() + }, LwjonOpenLock: function () { var that = this wx.showLoading({ @@ -1461,6 +1499,10 @@ Page({ case 121: { this.onConfigurewifi() } + // 人员管理 + case 9010: { + this.gotoperson() + } default: { } @@ -2199,6 +2241,10 @@ Page({ // that.onQueryBindState() if (taskId == 41 && that.data.event == '0') { that.doWork() + }else if(taskId == 121 && that.data.event == '3') { + that.doWork() + }else if(taskId == 9010 && that.data.event == '8') { + that.doWork() } }, 500) }, diff --git a/pages/roomDetail/roomDetail.wxml b/pages/roomDetail/roomDetail.wxml index 4e69cc6..e21cb1a 100644 --- a/pages/roomDetail/roomDetail.wxml +++ b/pages/roomDetail/roomDetail.wxml @@ -58,7 +58,7 @@ 图像管理 - + 配网 @@ -150,6 +150,6 @@ - 确定 + 确定 \ No newline at end of file diff --git a/pagesA/facepeople/facepeople.wxss b/pagesA/facepeople/facepeople.wxss index 42b3c67..a4ef6fb 100644 --- a/pagesA/facepeople/facepeople.wxss +++ b/pagesA/facepeople/facepeople.wxss @@ -108,11 +108,11 @@ .pic{ width: 100%; position: relative; - height: 40vw; + height: 48vw; } .picadd{ - width: 150px; - height: 150px; + width: 200px; + height: 200px; position: absolute; left: 50%; top: 50%; @@ -123,6 +123,6 @@ } .faceimg{ width: 120px; - height: 120px; + height: 160px; border-radius: 10px; } diff --git a/pagesA/selectFace/selectFace.js b/pagesA/selectFace/selectFace.js index cdeb461..92c98c0 100644 --- a/pagesA/selectFace/selectFace.js +++ b/pagesA/selectFace/selectFace.js @@ -77,14 +77,14 @@ Page({ _image.initialHeight = _src.height } // 控制图片在屏幕居中 - _image.initialX = (systemInfo.windowWidth - _image.initialWidth) >> 1 - _image.initialY = (systemInfo.windowHeight - _image.initialHeight) >> 1 + _image.initialX = 0//(systemInfo.windowWidth - _image.initialWidth) >> 1 + _image.initialY = 0//(systemInfo.windowHeight - _image.initialHeight) >> 1 console.log(JSON.stringify(_image)) // 定义方框的位置和尺寸 let _cropBorder = {} _cropBorder.size = systemInfo.windowWidth * 0.8 _cropBorder.x = (systemInfo.windowWidth - _cropBorder.size) >> 1 - _cropBorder.y = (systemInfo.windowHeight - _cropBorder.size * (4/3)) >> 1 + _cropBorder.y = (systemInfo.windowHeight - _cropBorder.size) >> 1 that.setData({ src: _src, image: _image, @@ -164,7 +164,7 @@ takePhoto() { // 画方框的外框 this.context.setStrokeStyle('white') // 往外画大一圈,这样在canvas上填充图片的时候框线就不会变细啦 - this.context.strokeRect(cropBorder.x - 1, cropBorder.y - 1, cropBorder.size + 2, cropBorder.size * (4/3) + 2) + this.context.strokeRect(cropBorder.x - 1, cropBorder.y - 1, cropBorder.size + 2, (cropBorder.size * (4/3)) + 2) this.context.draw() }, /** @@ -230,13 +230,13 @@ takePhoto() { let srcY = (cropBorder.y - image.curY - 120 / 750 * that.data.windowWidth) / curImageHeight * src.height // 方框区域映射到源图片中的尺寸 let srcWidth = cropBorder.size / curImageWidth * src.width - let srcHeight = cropBorder.size / curImageHeight * src.height + let srcHeight = (cropBorder.size * (4/3)) / curImageHeight * src.height console.log('srcX = ' + srcX + ', srcY = ' + srcY + ', srcWidth = ' + srcWidth + ', srcHeight = ' + srcHeight + ', cropX = ' + cropBorder.x + ', cropY = ' + cropBorder.y + ', cropSize = ' + cropBorder.size) // 绘制图片不要透明啦,不然会看到重影 this.context.setFillStyle('rgba(0,0,0,1)') // 鉴于尺寸的精确度,方框内图片的覆盖在y方向会有微微的偏移, // 但是一旦截图就返回上一页了,强迫症患者没有后悔的余地。 - this.context.drawImage(src.path, srcX, srcY, srcWidth, srcHeight, cropBorder.x, cropBorder.y, cropBorder.size, cropBorder.size * (4/3)) + this.context.drawImage(src.path, srcX, srcY, srcWidth, srcHeight, cropBorder.x, cropBorder.y, cropBorder.size, cropBorder.size) // 这里绘图一定要有回调,不然图片还没绘制完成就截图那就GG了 this.context.draw(true, function(res) { wx.canvasToTempFilePath({ diff --git a/project.config.json b/project.config.json index 8b43bdd..70821de 100644 --- a/project.config.json +++ b/project.config.json @@ -49,7 +49,7 @@ "compileType": "miniprogram", "libVersion": "2.23.4", "appid": "wx20de9fe5943934a1", - "projectname": "applte", + "projectname": "appltegy", "editorSetting": { "tabIndent": "insertSpaces", "tabSize": 4