v1.2.0.33

This commit is contained in:
范鹏 2025-02-27 11:29:53 +08:00
parent fafb06a8b5
commit 932654b706
14 changed files with 148 additions and 43 deletions

View File

@ -64,3 +64,12 @@ export function getPasswordRequest(data) {
data
})
}
// 检查密码是否存在
export function checkPasswordRequest(data) {
return request({
url: '/keyboardPwd/checkKeyboardPwd',
method: 'POST',
data
})
}

View File

@ -3,7 +3,7 @@
"appid" : "__UNI__933D519",
"description" : "",
"versionName" : "1.2.0",
"versionCode" : "32",
"versionCode" : "33",
"transformPx" : false,
/* */
"mp-weixin" : {

View File

@ -339,7 +339,7 @@
title: '删除中',
mask: true
})
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: info.value.keyId,
includeUnderlings: checked.value ? 1 : 0
})
@ -351,7 +351,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}

View File

@ -148,7 +148,7 @@
title: '删除中',
mask: true
})
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: deleteData.value.keyId,
includeUnderlings: checked.value ? 1 : 0
})
@ -166,7 +166,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}

View File

@ -31,7 +31,7 @@
@change-input="changeDuration"
></LockInput>
</view>
<view class="m-4 text-sm">
<view class="m-4 text-sm" v-if="check">
经过以上设定的时间锁会自动关闭开启或修改设置后请先开一次锁使时间生效
</view>
<view
@ -123,6 +123,10 @@
const update = async () => {
if (!canUpdate.value) return
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
if (pending.value) return
pending.value = true
uni.showLoading({

View File

@ -12,29 +12,35 @@
</view>
<view
class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-1"
@click="showDistance = true"
@click="distanceDialog"
v-if="distance !== null"
>
<view class="max-w-500">
<view>感应距离</view>
<view class="text-xs">{{ distanceColumns[0][distanceIndex].text }}</view>
<view class="text-xs mt-1 text-gray-500">{{ distanceColumns[0][distanceIndex].text }}</view>
</view>
<view class="flex items-center">
<view class="mr-2">{{ distanceColumns[0][distanceIndex].name }}</view>
<view class="mr-2" :class="[check ? '' : 'text-gray-500']">{{
distanceColumns[0][distanceIndex].name
}}</view>
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view
@click="showEnErrUnlock = true"
@click="enErrUnlockDialog"
class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-1"
v-if="enErrUnlock !== null"
>
<view class="max-w-500">
<view>防误开</view>
<view class="text-xs">{{ enErrUnlockColumns[0][enErrUnlock].text }}</view>
<view class="text-xs mt-1 text-gray-500">{{
enErrUnlockColumns[0][enErrUnlock].text
}}</view>
</view>
<view class="flex items-center">
<view class="mr-2">{{ enErrUnlockColumns[0][enErrUnlock].name }}</view>
<view class="mr-2" :class="[check && distance !== 0 ? '' : 'text-gray-500']">{{
enErrUnlockColumns[0][enErrUnlock].name
}}</view>
<up-icon name="arrow-right"></up-icon>
</view>
</view>
@ -42,10 +48,12 @@
class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] mx-3 py-5 px-3 bg-white text-sm rounded-md"
>
<view class="text-base font-bold mb-3">添加和使用面容开锁时</view>
<view>1请尽量保持单人在门前操作</view>
<view>2请站立在门锁正前方约0.50.8面向门锁</view>
<view>3请保持脸部无遮挡露出五官</view>
<view>4面容识别异常时可触摸数字键盘任意按键手动重启人脸识别</view>
<view class="text-gray-500">1请尽量保持单人在门前操作</view>
<view class="text-gray-500">2请站立在门锁正前方约0.50.8面向门锁</view>
<view class="text-gray-500">3请保持脸部无遮挡露出五官</view>
<view class="text-gray-500"
>4面容识别异常时可触摸数字键盘任意按键手动重启人脸识别</view
>
</view>
<up-picker
:show="showDistance"
@ -79,9 +87,11 @@
import { useBluetoothStore } from '@/stores/bluetooth'
import { updateLockSettingRequest } from '@/api/setting'
import { useUserStore } from '@/stores/user'
import { useBasicStore } from '@/stores/basic'
const $bluetooth = useBluetoothStore()
const $user = useUserStore()
const $basic = useBasicStore()
const showDistance = ref(false)
const showEnErrUnlock = ref(false)
@ -104,6 +114,16 @@
const enErrUnlockColumns = ref([])
const distanceDialog = () => {
if (!check.value) return
showDistance.value = true
}
const enErrUnlockDialog = () => {
if (!check.value || distance.value === 0) return
showEnErrUnlock.value = true
}
onMounted(() => {
const list = []
for (let i = 0; i <= 30; i++) {
@ -143,6 +163,10 @@
const change = async (type, value) => {
if (pending.value) return
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
pending.value = true
uni.showLoading({
title: '设置中'
@ -168,8 +192,9 @@
...$bluetooth.currentLockSetting,
lockSettingInfo: {
...$bluetooth.currentLockSetting.lockSettingInfo,
autoLock: check.value ? 1 : 0,
autoLockSecond: value.value
faceSwitch: check.value ? 1 : 0,
faceInductionDistance: distance.value,
faceEnErrUnlock: enErrUnlock.value
}
})
uni.showToast({
@ -182,6 +207,9 @@
icon: 'none'
})
}
} else if (code === -21) {
pending.value = false
uni.hideLoading()
} else {
pending.value = false
uni.hideLoading()

View File

@ -329,7 +329,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}
@ -341,7 +341,7 @@
})
}
} else {
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: that.keyId
})
if (code === 0) {
@ -358,7 +358,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}
@ -373,7 +373,7 @@
mask: true
})
const that = this
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: that.deleteLockInfo.keyId,
includeUnderlings: that.checked ? 1 : 0
})
@ -392,7 +392,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}

View File

@ -365,7 +365,7 @@
title: '删除中',
mask: true
})
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: $lock.currentKeyInfo.keyId,
includeUnderlings: checked.value ? 1 : 0
})
@ -381,7 +381,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}

View File

@ -141,6 +141,7 @@
import { updateAdminPasswordRequest, updateLockNameRequest } from '@/api/setting'
import { useBasicStore } from '@/stores/basic'
import { useUserStore } from '@/stores/user'
import { checkPasswordRequest } from '@/api/keyboardPwd'
const $bluetooth = useBluetoothStore()
const $lock = useLockStore()
@ -204,6 +205,24 @@
})
return
}
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
const { code: checkCode, message } = await checkPasswordRequest({
lockId: $bluetooth.currentLockInfo.lockId,
keyboardPwd: password
})
if (checkCode !== 0) {
uni.showToast({
title: message,
icon: 'none'
})
return
}
if (pending.value) return
pending.value = true
@ -248,6 +267,9 @@
icon: 'none'
})
}
} else if (code === -21) {
uni.hideLoading()
pending.value = false
} else {
uni.hideLoading()
pending.value = false

View File

@ -73,6 +73,10 @@
const update = async () => {
if (!canUpdate.value) return
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
if (pending.value) return
pending.value = true
uni.showLoading({
@ -111,6 +115,9 @@
icon: 'none'
})
}
} else if (code === -21) {
pending.value = false
uni.hideLoading()
} else {
pending.value = false
uni.hideLoading()

View File

@ -122,7 +122,7 @@
</view>
<view
v-if="
$bluetooth.currentLockSetting.lockFeature.isSupportCatEye !== 1 &&
$bluetooth.currentLockSetting.lockFeature.isSupportCatEye === 1 &&
$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1
"
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
@ -236,7 +236,11 @@
import { useLockStore } from '@/stores/lock'
import { deleteKeyRequest } from '@/api/key'
import { useBasicStore } from '@/stores/basic'
import { getLockSettingRequest, updateLockSettingRequest } from '@/api/setting'
import {
getLockSettingRequest,
lockDataUploadRequest,
updateLockSettingRequest
} from '@/api/setting'
const $user = useUserStore()
const $bluetooth = useBluetoothStore()
@ -268,8 +272,33 @@
icon: 'none'
})
}
await asyncSetting()
})
const asyncSetting = async () => {
const { code, data } = await $bluetooth.getLockDataList({
type: 'setting',
lockId: $bluetooth.currentLockInfo.lockName.toString(),
uid: $user.userInfo.uid.toString()
})
$bluetooth.closeBluetoothConnection()
if (code === 0) {
const { code: resultCode } = await lockDataUploadRequest({
lockId: $bluetooth.currentLockInfo.lockId,
uploadType: 1,
records: data.list
})
if (resultCode === 0) {
const { code, data } = await getLockSettingRequest({
lockId: $bluetooth.currentLockInfo.lockId
})
if (code === 0) {
$bluetooth.updateCurrentLockSetting(data)
}
}
}
}
const toUpdateSetting = key => {
$basic.routeJump({
name: 'updateSetting',
@ -285,6 +314,10 @@
}
const changeSetting = async key => {
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
if (pending.value) return
pending.value = true
uni.showLoading({
@ -370,7 +403,7 @@
title: '删除中',
mask: true
})
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: $lock.keyId,
includeUnderlings: checked.value ? 1 : 0
})
@ -386,7 +419,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}
@ -423,7 +456,7 @@
keyId: $bluetooth.keyId.toString()
})
if (resetDeviceCode === 0 || resetDeviceCode === -2) {
const { code } = await deleteLockRequest({
const { code, message } = await deleteLockRequest({
lockId: $bluetooth.currentLockInfo.lockId
})
if (code === 0) {
@ -437,7 +470,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}
@ -449,7 +482,7 @@
})
}
} else {
const { code } = await deleteKeyRequest({
const { code, message } = await deleteKeyRequest({
keyId: $bluetooth.keyId
})
if (code === 0) {
@ -463,7 +496,7 @@
} else {
uni.hideLoading()
uni.showToast({
title: 'message',
title: message,
icon: 'none'
})
}

View File

@ -18,7 +18,7 @@
import { ref } from 'vue'
import { useBluetoothStore } from '@/stores/bluetooth'
import { useUserStore } from '@/stores/user'
import { lockDataUploadRequest } from '@/api/setting'
import { getLockSettingRequest, lockDataUploadRequest } from '@/api/setting'
const $bluetooth = useBluetoothStore()
const $user = useUserStore()
@ -56,6 +56,12 @@
pending.value = false
$bluetooth.closeBluetoothConnection()
if (resultCode === 0) {
const { code, data } = await getLockSettingRequest({
lockId: $bluetooth.currentLockInfo.lockId
})
if (code === 0) {
$bluetooth.updateCurrentLockSetting(data)
}
uni.showToast({
title: '上传成功',
icon: 'none'
@ -71,10 +77,6 @@
list.value = list.value.concat(data.list)
if (data.size === 10) {
page.value++
} else if (data.size === 0) {
page.value = 0
list.value = []
progress.value++
} else {
const { code: resultCode } = await lockDataUploadRequest({
lockId: $bluetooth.currentLockInfo.lockId,
@ -92,7 +94,7 @@
})
return
}
page.value = 1
page.value = 0
list.value = []
progress.value++
}

View File

@ -2724,7 +2724,7 @@ export const useBluetoothStore = defineStore('ble', {
console.log('写入未执行', this.bluetoothStatus)
this.getBluetoothStatus()
return {
code: -1
code: -21
}
}
@ -2820,7 +2820,7 @@ export const useBluetoothStore = defineStore('ble', {
console.log('写入未执行', this.bluetoothStatus)
this.getBluetoothStatus()
return {
code: -1
code: -21
}
}

View File

@ -29,13 +29,13 @@ const request = config => {
const timestamp = new Date().getTime()
timer = setTimeout(() => {
resolve({ code: -1, message: '网络访问失败,请检查网络是否正常' })
}, 3200)
}, 7200)
uni.request({
url: URL,
method,
header,
data,
timeout: 3000,
timeout: 7000,
async success(res) {
const { statusCode, data } = res
if (timer) {