修改锁详情页开关门提示

This commit is contained in:
范鹏 2024-09-05 15:46:49 +08:00
parent f77303701e
commit 90525d9b0e
4 changed files with 73 additions and 14 deletions

View File

@ -24,10 +24,8 @@
</view>
<up-swipe-action>
<up-swipe-action-item class="lock" :ref="'swipeItem' + grounIndex" :options="options" v-for="(lock,
lockIndex)
in
group.lockList"
:key="lock.lockId" :threshold="50" @click="deleteLock(lock, grounIndex, lockIndex)">
lockIndex) in group.lockList" :key="lock.lockId" :threshold="50" @click="deleteLock(lock,
grounIndex, lockIndex)">
<view class="lock" @click="toLockDeatil(lock)">
<view class="lock-top">
<image class="lock-image-lock" src="/static/images/icon_lock.png"></image>
@ -50,7 +48,8 @@
</view>
</view>
<view class="lock-time"
:style="{padding: lock.keyStatus === 110401 && !lock.days ? '12rpx 24rpx 0 24rpx'
:style="{padding: lock.keyStatus === 110401 && !lock.days &&
lock.lockSetting.remoteUnlock === 0 ? '12rpx 24rpx 0 24rpx'
:'6rpx 24rpx 0 24rpx'}">
<view v-if="lock.keyType === 1 || lock.keyType === 3" style="font-size: 32rpx">{{
getTimeLimit(lock.keyType) }}</view>
@ -613,6 +612,7 @@ page {
}
.lock-status {
margin-top: 5rpx;
margin-left: 24rpx;
color: #FFFFFF;
border-radius: 8rpx;

View File

@ -51,6 +51,17 @@
<view class="setting-text">设置</view>
<image class="setting-arrow" mode="aspectFill" src="/static/images/icon_arrow.png"></image>
</view>
<up-popup :show="show" @close="closePopup" mode="center" :closeOnClickOverlay="true" bgColor="transparent">
<view class="popup" @click="closePopup">
<image class="popup-background" :src="type === 'close' ? '/static/images/background_close_door.png' :
'/static/images/background_open_door.png'"
mode="aspectFill"></image>
<view>
<view class="popup-name">{{ currentLockInfo.lockAlias }}</view>
<view class="popup-time">{{ timeFormat('', 'mm/dd h:M') }}</view>
</view>
</view>
</up-popup>
</view>
</template>
@ -70,7 +81,9 @@ export default {
return {
time: 0,
onlineToken: '0',
pending: false
pending: false,
show: false,
type: ''
}
},
computed: {
@ -85,9 +98,13 @@ export default {
this.getServeTime()
},
methods: {
timeFormat,
...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']),
...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp', 'closeBluetoothConnection']),
...mapActions(useBasicStore, ['routeJump', 'backAndToast']),
closePopup() {
this.show = false
},
powerTip() {
const that = this
const time = timeFormat(that.currentLockInfo.electricQuantityDate, 'yyyy-mm-dd h:M')
@ -126,10 +143,12 @@ export default {
uni.vibrateLong()
this.pending = true
this.$refs.loading.open()
uni.showToast({
title: `正在尝试${type === 'close' ? '闭' : '开'}锁……`,
icon: 'none'
})
if(type === 'close') {
uni.showToast({
title: `正在尝试闭锁……`,
icon: 'none'
})
}
if(this.currentLockInfo.lockSetting.appUnlockOnline) {
const result = await this.getNetToken()
if(!result) {
@ -153,10 +172,11 @@ export default {
})
if(code === 0) {
this.closeBluetoothConnection()
uni.showToast({
title: `${type === 'close' ? '关' : '开'}锁成功`,
icon: 'none'
})
this.show = true
this.type = type
setTimeout(() => {
this.show = false
}, 3000)
if(this.currentLockInfo.keyType === 3) {
const { code: deleteKeyCode } = await deleteKeyRequest({
keyId: this.keyId
@ -189,6 +209,45 @@ export default {
</script>
<style lang="scss" scoped>
.popup {
display: flex;
position: relative;
width: 400rpx;
height: 389rpx;
text-align: center;
flex-wrap: wrap;
.popup-background {
z-index: -1;
width: 400rpx;
height: 389rpx;
position: absolute;
}
.popup-name {
margin-left: 30rpx;
z-index: 9;
margin-top: 180rpx;
color: #676b6d;
width: 340rpx;
max-height: 80rpx;
line-height: 40rpx;
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
}
.popup-time {
margin-top: 10rpx;
width: 400rpx;
}
}
.days {
line-height: 60rpx;
background: #faecc9;

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB