1. bug修复
2. 锁设置添加权限判断
This commit is contained in:
parent
3840971b9c
commit
2233dd2f68
@ -88,7 +88,7 @@
|
||||
<view>{{
|
||||
info.keyRight === 1
|
||||
? '取消授权会在用户APP连网后生效'
|
||||
: '授权用户拥有管理员的大部分权限,比如发送要是、发送密码'
|
||||
: '授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码'
|
||||
}}</view>
|
||||
</view>
|
||||
</up-modal>
|
||||
|
||||
@ -7,13 +7,13 @@
|
||||
:checked="check"
|
||||
class="transform-scale-90"
|
||||
:disabled="true"
|
||||
color="#002ce5"
|
||||
:color="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1 ? '#002ce5' : '#71acff'"
|
||||
/>
|
||||
</view>
|
||||
<view
|
||||
v-if="check"
|
||||
class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-1"
|
||||
@click="show = true"
|
||||
@click="open"
|
||||
>
|
||||
<view class="item-title">延迟时间</view>
|
||||
<view class="flex items-center">
|
||||
@ -35,6 +35,7 @@
|
||||
经过以上设定的时间,锁会自动关闭。开启或修改设置后,请先开一次锁,使时间生效。
|
||||
</view>
|
||||
<view
|
||||
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
|
||||
:class="[canUpdate ? 'bg-#63b8af' : 'bg-#a3a3a3']"
|
||||
class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold"
|
||||
@click="update"
|
||||
@ -109,6 +110,11 @@
|
||||
}
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
if ($bluetooth.currentLockSetting.lockBasicInfo.keyRight !== 1) return
|
||||
show.value = true
|
||||
}
|
||||
|
||||
const changeDuration = data => {
|
||||
if (custom.value) {
|
||||
value.value = Number(data)
|
||||
@ -176,6 +182,7 @@
|
||||
}
|
||||
|
||||
const changeCheck = () => {
|
||||
if ($bluetooth.currentLockSetting.lockBasicInfo.keyRight !== 1) return
|
||||
check.value = !check.value
|
||||
if (!check.value) {
|
||||
value.value = 0
|
||||
|
||||
@ -89,7 +89,10 @@
|
||||
placeholder="请输入姓名"
|
||||
@change-input="changeName('single', $event)"
|
||||
></LockInput>
|
||||
<view class="text mt-5 mb-50rpx">单次钥匙有效期为1小时,只能使用一次</view>
|
||||
<view class="text mt-5">单次钥匙有效期为1小时,只能使用一次</view>
|
||||
<view class="text" style="margin-bottom: 50rpx">
|
||||
小程序暂不支持邮箱登录,若接收者账号为邮箱可先使用星星锁APP登录,绑定手机号后可使用小程序登录
|
||||
</view>
|
||||
<view class="button" @click="createKey('single')">发送</view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
@ -108,7 +111,10 @@
|
||||
<view style="margin-top: 20rpx">
|
||||
<LockCycle @change="changeCycle"></LockCycle>
|
||||
</view>
|
||||
<view class="text mt-5 mb-50rpx">接收者可以在有效期内的固定时间段里,不限次数使用</view>
|
||||
<view class="text mt-5">接收者可以在有效期内的固定时间段里,不限次数使用</view>
|
||||
<view class="text" style="margin-bottom: 50rpx"
|
||||
>小程序暂不支持邮箱登录,若接收者账号为邮箱可先使用星星锁APP登录,绑定手机号后可使用小程序登录</view
|
||||
>
|
||||
<view class="button" @click="createKey('cycle')">发送</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
@ -123,11 +123,11 @@
|
||||
<script setup>
|
||||
import { getCurrentInstance, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { timeFormat } from 'uview-plus'
|
||||
import { useBasicStore } from '@/stores/basic'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useBluetoothStore } from '@/stores/bluetooth'
|
||||
import { checkPalmVeinNameRequest } from '@/api/palmVein'
|
||||
import { timeFormat } from 'uview-plus'
|
||||
|
||||
const instance = getCurrentInstance().proxy
|
||||
const eventChannel = instance.getOpenerEventChannel()
|
||||
|
||||
@ -251,6 +251,7 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!info.value.type) {
|
||||
const data = {
|
||||
startDate: updateTime(startDate.value, startTimeText.value),
|
||||
@ -263,6 +264,11 @@
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const netWork = await $basic.getNetworkType()
|
||||
if (!netWork) {
|
||||
return
|
||||
}
|
||||
|
||||
if (pending.value) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -91,11 +91,13 @@
|
||||
</view>
|
||||
<view class="m-4 flex items-center justify-between text-base">
|
||||
<view
|
||||
v-if="$lock.currentKeyInfo.keyType !== 3"
|
||||
:class="[$lock.currentKeyInfo.keyStatus === 110405 ? 'text-#63b8af' : 'text-red']"
|
||||
@click="freeze"
|
||||
>{{ $lock.currentKeyInfo.keyStatus === 110405 ? '解冻' : '冻结' }}</view
|
||||
>
|
||||
<view
|
||||
v-if="$lock.currentKeyInfo.keyType !== 3 && $lock.currentKeyInfo.keyType !== 4"
|
||||
:class="[$lock.currentKeyInfo.keyRight === 1 ? 'text-red' : 'text-#63b8af']"
|
||||
@click="authorize"
|
||||
>{{ $lock.currentKeyInfo.keyRight === 1 ? '取消授权管理员' : '授权管理员' }}</view
|
||||
@ -157,7 +159,7 @@
|
||||
<view>{{
|
||||
$lock.currentKeyInfo.keyRight === 1
|
||||
? '取消授权会在用户APP连网后生效'
|
||||
: '授权用户拥有管理员的大部分权限,比如发送要是、发送密码'
|
||||
: '授权用户拥有管理员的大部分权限,比如发送钥匙、发送密码'
|
||||
}}</view>
|
||||
</view>
|
||||
</up-modal>
|
||||
|
||||
@ -176,7 +176,7 @@
|
||||
mask: true
|
||||
})
|
||||
const that = this
|
||||
const { code } = await deleteKeyRequest({
|
||||
const { code, message } = await deleteKeyRequest({
|
||||
keyId: that.deleteKeyId,
|
||||
includeUnderlings: that.checked ? 1 : 0
|
||||
})
|
||||
@ -195,7 +195,7 @@
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: 'message',
|
||||
title: message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
<view>电子钥匙</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="currentLockInfo.lockFeature.password || currentLockInfo.keyRight === 1"
|
||||
v-if="currentLockInfo.lockFeature.password && currentLockInfo.keyRight === 1"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'passwordList' })"
|
||||
>
|
||||
@ -69,7 +69,7 @@
|
||||
<view>密码</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="currentLockInfo.lockFeature.icCard || currentLockInfo.keyRight === 1"
|
||||
v-if="currentLockInfo.lockFeature.icCard && currentLockInfo.keyRight === 1"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'cardList' })"
|
||||
>
|
||||
@ -77,7 +77,7 @@
|
||||
<view>卡</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="currentLockInfo.lockFeature.fingerprint || currentLockInfo.keyRight === 1"
|
||||
v-if="currentLockInfo.lockFeature.fingerprint && currentLockInfo.keyRight === 1"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'fingerprintList' })"
|
||||
>
|
||||
@ -86,7 +86,7 @@
|
||||
</view>
|
||||
<view
|
||||
v-if="
|
||||
currentLockInfo.lockFeature.bluetoothRemoteControl || currentLockInfo.keyRight === 1
|
||||
currentLockInfo.lockFeature.bluetoothRemoteControl && currentLockInfo.keyRight === 1
|
||||
"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'remoteList' })"
|
||||
@ -95,7 +95,7 @@
|
||||
<view>遥控</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="currentLockInfo.lockFeature.d3Face || currentLockInfo.keyRight === 1"
|
||||
v-if="currentLockInfo.lockFeature.d3Face && currentLockInfo.keyRight === 1"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'faceList' })"
|
||||
>
|
||||
@ -106,7 +106,7 @@
|
||||
<view>人脸</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="currentLockInfo.lockFeature.palmVein || currentLockInfo.keyRight === 1"
|
||||
v-if="currentLockInfo.lockFeature.palmVein && currentLockInfo.keyRight === 1"
|
||||
class="menu-main-view"
|
||||
@click="routeJump({ name: 'palmVeinList' })"
|
||||
>
|
||||
@ -324,7 +324,7 @@
|
||||
}
|
||||
} else if (code === 13) {
|
||||
uni.showToast({
|
||||
title: `只能在循环时间内操作门锁`,
|
||||
title: `钥匙当前不可用`,
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (code === -1) {
|
||||
|
||||
@ -68,8 +68,10 @@
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-2.5"></view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-2.5"
|
||||
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
@click="() => $refs.modalInput.open()"
|
||||
>
|
||||
<view>名称</view>
|
||||
@ -81,7 +83,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
@click="toJump('selectGroup')"
|
||||
>
|
||||
<view>锁分组</view>
|
||||
@ -93,7 +95,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
v-if="$bluetooth.currentLockSetting.lockBasicInfo.isLockOwner === 1"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
@click="() => $refs.modalPassword.open()"
|
||||
>
|
||||
<view>管理员开锁密码</view>
|
||||
@ -102,7 +105,7 @@
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx">
|
||||
<view class="py-3 px-4 bg-white flex items-center justify-between text-base">
|
||||
<view>位置信息</view>
|
||||
<view class="flex items-center max-w-400">
|
||||
<view>{{ $bluetooth.currentLockSetting.lockBasicInfo.address }}</view>
|
||||
|
||||
@ -52,7 +52,11 @@
|
||||
timeFormat($lock.currentPasswordInfo.sendDate, 'yyyy-mm-dd h:M')
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="item !py-2" style="margin-top: 20rpx">
|
||||
<view
|
||||
class="item !py-2"
|
||||
style="margin-top: 20rpx"
|
||||
v-if="$lock.currentPasswordInfo.isCustom === 1"
|
||||
>
|
||||
<view class="item-title">是否为管理员</view>
|
||||
<switch
|
||||
@click="disabled"
|
||||
@ -62,10 +66,18 @@
|
||||
color="#002ce5"
|
||||
/>
|
||||
</view>
|
||||
<view class="item" style="margin-top: 20rpx" @click="toRecordList">
|
||||
<view
|
||||
v-if="$lock.currentPasswordInfo.keyboardPwdType !== 4"
|
||||
class="item"
|
||||
style="margin-top: 20rpx"
|
||||
@click="toRecordList"
|
||||
>
|
||||
<view class="item-title">操作记录</view>
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
<view class="text-sm text-#262626 mt-3 mx-4" v-if="$lock.currentPasswordInfo.isCustom !== 1">
|
||||
密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。
|
||||
</view>
|
||||
<view class="button" @click="deletePassword">删除</view>
|
||||
<ModalInput
|
||||
ref="modalInput"
|
||||
@ -155,6 +167,12 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const netWork = await $basic.getNetworkType()
|
||||
if (!netWork) {
|
||||
return
|
||||
}
|
||||
|
||||
if (pending.value) return
|
||||
pending.value = true
|
||||
|
||||
|
||||
@ -7,8 +7,10 @@
|
||||
<view class="item-title">基本信息</view>
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<view class="mt-2.5"></view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-2.5"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
v-if="$bluetooth.currentLockSetting.lockFeature.autoLock === 1"
|
||||
@click="toJump('autoLock')"
|
||||
>
|
||||
<view class="item-title">自动闭锁</view>
|
||||
@ -24,7 +26,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockSettingInfo.lockSound === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
@click="toJump('lockSound')"
|
||||
>
|
||||
<view class="item-title">锁声音</view>
|
||||
@ -40,7 +46,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.antiPrySwitch === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base"
|
||||
@click="toUpdateSetting('antiPrySwitch')"
|
||||
>
|
||||
<view class="item-title">防撬报警</view>
|
||||
@ -53,8 +63,13 @@
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-2.5"></view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-2.5"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.remoteUnlock === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mb-4rpx"
|
||||
@click="toUpdateSetting('remoteUnlock')"
|
||||
>
|
||||
<view class="item-title">远程开锁</view>
|
||||
@ -68,7 +83,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.resetSwitch === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.isLockOwner === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base"
|
||||
@click="toUpdateSetting('resetSwitch')"
|
||||
>
|
||||
<view class="item-title">重置键</view>
|
||||
@ -81,21 +100,30 @@
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-2.5"></view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-2.5"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.d3Face === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base"
|
||||
@click="toJump('faceSetting')"
|
||||
>
|
||||
<view class="item-title">面容开锁</view>
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<!-- <view class="py-3 px-4 bg-white flex items-center justify-between text-base">-->
|
||||
<!-- <view class="item-title">消息提醒</view>-->
|
||||
<!-- <view><up-icon name="arrow-right"></up-icon></view>-->
|
||||
<!-- </view>-->
|
||||
<view class="mt-2.5"></view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
@click="toJump('lockInfo')"
|
||||
class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base"
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.unlockReminder === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.isLockOwner === 1
|
||||
"
|
||||
>
|
||||
<view class="item-title">消息提醒</view>
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<view class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-2.5">
|
||||
<view class="item-title">开锁提醒</view>
|
||||
<switch
|
||||
@click="changeSetting('unlockReminder')"
|
||||
@ -105,7 +133,13 @@
|
||||
color="#002ce5"
|
||||
/>
|
||||
</view>
|
||||
<view class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-4rpx">
|
||||
<view
|
||||
v-if="
|
||||
$bluetooth.currentLockSetting.lockFeature.appUnlockOnline === 1 &&
|
||||
$bluetooth.currentLockSetting.lockBasicInfo.isLockOwner === 1
|
||||
"
|
||||
class="py-3 px-4 bg-white !py-2 flex items-center justify-between text-base mt-4rpx"
|
||||
>
|
||||
<view class="item-title">开锁时是否需联网</view>
|
||||
<switch
|
||||
@click="changeSetting('appUnlockOnline')"
|
||||
@ -123,19 +157,17 @@
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<view
|
||||
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
@click="toJump('uploadLockData')"
|
||||
>
|
||||
<view class="item-title">上传数据</view>
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<view
|
||||
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
|
||||
@click="toJump('lockInfo')"
|
||||
>
|
||||
<view class="item-title">锁升级</view>
|
||||
<view><up-icon name="arrow-right"></up-icon></view>
|
||||
</view>
|
||||
<!-- <view class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx">-->
|
||||
<!-- <view class="item-title">锁升级</view>-->
|
||||
<!-- <view><up-icon name="arrow-right"></up-icon></view>-->
|
||||
<!-- </view>-->
|
||||
<view
|
||||
class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx bg-#ec433c text-white text-xl font-bold"
|
||||
@click="deleteLock"
|
||||
|
||||
@ -141,6 +141,11 @@
|
||||
return
|
||||
}
|
||||
|
||||
const netWork = await $basic.getNetworkType()
|
||||
if (!netWork) {
|
||||
return
|
||||
}
|
||||
|
||||
if (pending.value) {
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user