1. 修复名称过长显示bug

2. 添加首页列表远程开锁显示
3. 添加密码钥匙空列表判断
This commit is contained in:
范鹏 2024-09-04 11:02:08 +08:00
parent ede3acd285
commit 367001f127
6 changed files with 45 additions and 6 deletions

View File

@ -3,7 +3,7 @@
<view class="name">
<view class="name-text">{{ title }}</view>
<input :value="value" class="name-input" :placeholder="placeholder" placeholder-class="placeholder-class"
maxlength="16" @input="changeInput"></input>
maxlength="50" @input="changeInput"></input>
</view>
</view>
</template>

View File

@ -34,10 +34,15 @@
</view>
</view>
<view class="lock-name">{{lock.lockAlias}}</view>
<view v-if="lock.keyStatus === 110412" class="lock-status">已过期</view>
<view v-if="lock.days" class="lock-status" style="background-color: #63b8af">{{lock.days}}</view>
<view v-if="lock.keyStatus === 110403" class="lock-status" style="background-color: #63b8af">未生效</view>
<view v-if="lock.keyStatus === 110405" class="lock-status">已冻结</view>
<view style="display: flex;align-items: center">
<view v-if="lock.keyStatus === 110412" class="lock-status">已过期</view>
<view v-if="lock.days" class="lock-status" style="background-color: #63b8af">{{lock.days}}</view>
<view v-if="lock.keyStatus === 110403" class="lock-status" style="background-color: #63b8af">未生效</view>
<view v-if="lock.keyStatus === 110405" class="lock-status">已冻结</view>
<view v-if="lock.lockSetting.remoteUnlock === 1" class="lock-status" style="background-color:
#63b8af">远程开锁
</view>
</view>
<view class="lock-time"
:style="{padding: lock.keyStatus === 110401 && !lock.days ? '12rpx 24rpx 0 24rpx'
:'6rpx 24rpx 0 24rpx'}">

View File

@ -1,7 +1,7 @@
<template>
<view>
<view class="item">
<view class="item-title">名称</view>
<view class="item-title" style="width: 350rpx">名称</view>
<view class="item-content">{{ currentKeyInfo.keyName }}</view>
</view>
<view class="item" style="margin-top: 2rpx">

View File

@ -191,6 +191,13 @@ export default {
},
async resetKey() {
const that = this
if(that.keyList.length === 0) {
uni.showToast({
title: '暂无钥匙,无需重置',
icon: 'none'
})
return
}
uni.showModal({
title: '提示',
content: '确定要重置钥匙,该锁的所有钥匙都将被删除',

View File

@ -1,5 +1,6 @@
<template>
<view>
<view class="days" v-if="currentLockInfo.days">钥匙将在{{ currentLockInfo.days }}天后失效</view>
<view class="lock-name">{{ currentLockInfo.lockAlias }}</view>
<view class="top">
<image class="top-background" src="/static/images/background_main.jpg" mode="aspectFill"></image>
@ -187,6 +188,16 @@ export default {
</script>
<style lang="scss" scoped>
.days {
line-height: 60rpx;
background: #faecc9;
color: #bc9839;
text-align: center;
font-size: 32rpx;
width: 750rpx;
height: 60rpx;
}
.lock-name {
text-align: center;
font-size: 32rpx;

View File

@ -159,11 +159,22 @@ export default {
},
async resetPassword() {
const that = this
if(this.passwordList.length === 0) {
uni.showToast({
title: '暂无密码,无需重置',
icon: 'none'
})
return
}
uni.showModal({
title: '提示',
content: '确定要重置密码,该锁的所有密码都将被删除',
async success(res) {
if(res.confirm) {
uni.showLoading({
title: '重置中',
mask: true
})
const { code } = await that.resetLockPassword({
uid: that.userInfo.uid.toString(),
keyId: that.currentLockInfo.keyId.toString()
@ -175,6 +186,7 @@ export default {
})
console.log('重置密码返回', requestCode, message)
if(requestCode === 0) {
uni.hideLoading()
uni.showToast({
title: '重置密码成功',
icon: 'none'
@ -185,16 +197,20 @@ export default {
})
that.getPasswordList(that.passwordSearch)
} else {
uni.hideLoading()
uni.showToast({
title: message,
icon: 'none'
})
}
} else if(code === -1) {
uni.hideLoading()
uni.showToast({
title: '重置密码失败,请保持在锁附近',
icon: 'none'
})
} else {
uni.hideLoading()
}
}
}