修改锁详情页开关门提示
This commit is contained in:
parent
f77303701e
commit
90525d9b0e
@ -24,10 +24,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<up-swipe-action>
|
<up-swipe-action>
|
||||||
<up-swipe-action-item class="lock" :ref="'swipeItem' + grounIndex" :options="options" v-for="(lock,
|
<up-swipe-action-item class="lock" :ref="'swipeItem' + grounIndex" :options="options" v-for="(lock,
|
||||||
lockIndex)
|
lockIndex) in group.lockList" :key="lock.lockId" :threshold="50" @click="deleteLock(lock,
|
||||||
in
|
grounIndex, lockIndex)">
|
||||||
group.lockList"
|
|
||||||
:key="lock.lockId" :threshold="50" @click="deleteLock(lock, grounIndex, lockIndex)">
|
|
||||||
<view class="lock" @click="toLockDeatil(lock)">
|
<view class="lock" @click="toLockDeatil(lock)">
|
||||||
<view class="lock-top">
|
<view class="lock-top">
|
||||||
<image class="lock-image-lock" src="/static/images/icon_lock.png"></image>
|
<image class="lock-image-lock" src="/static/images/icon_lock.png"></image>
|
||||||
@ -50,7 +48,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lock-time"
|
<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'}">
|
:'6rpx 24rpx 0 24rpx'}">
|
||||||
<view v-if="lock.keyType === 1 || lock.keyType === 3" style="font-size: 32rpx">{{
|
<view v-if="lock.keyType === 1 || lock.keyType === 3" style="font-size: 32rpx">{{
|
||||||
getTimeLimit(lock.keyType) }}</view>
|
getTimeLimit(lock.keyType) }}</view>
|
||||||
@ -613,6 +612,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lock-status {
|
.lock-status {
|
||||||
|
margin-top: 5rpx;
|
||||||
margin-left: 24rpx;
|
margin-left: 24rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
|
|||||||
@ -51,6 +51,17 @@
|
|||||||
<view class="setting-text">设置</view>
|
<view class="setting-text">设置</view>
|
||||||
<image class="setting-arrow" mode="aspectFill" src="/static/images/icon_arrow.png"></image>
|
<image class="setting-arrow" mode="aspectFill" src="/static/images/icon_arrow.png"></image>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -70,7 +81,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
time: 0,
|
time: 0,
|
||||||
onlineToken: '0',
|
onlineToken: '0',
|
||||||
pending: false
|
pending: false,
|
||||||
|
show: false,
|
||||||
|
type: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -85,9 +98,13 @@ export default {
|
|||||||
this.getServeTime()
|
this.getServeTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
timeFormat,
|
||||||
...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']),
|
...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']),
|
||||||
...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp', 'closeBluetoothConnection']),
|
...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp', 'closeBluetoothConnection']),
|
||||||
...mapActions(useBasicStore, ['routeJump', 'backAndToast']),
|
...mapActions(useBasicStore, ['routeJump', 'backAndToast']),
|
||||||
|
closePopup() {
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
powerTip() {
|
powerTip() {
|
||||||
const that = this
|
const that = this
|
||||||
const time = timeFormat(that.currentLockInfo.electricQuantityDate, 'yyyy-mm-dd h:M')
|
const time = timeFormat(that.currentLockInfo.electricQuantityDate, 'yyyy-mm-dd h:M')
|
||||||
@ -126,10 +143,12 @@ export default {
|
|||||||
uni.vibrateLong()
|
uni.vibrateLong()
|
||||||
this.pending = true
|
this.pending = true
|
||||||
this.$refs.loading.open()
|
this.$refs.loading.open()
|
||||||
uni.showToast({
|
if(type === 'close') {
|
||||||
title: `正在尝试${type === 'close' ? '闭' : '开'}锁……`,
|
uni.showToast({
|
||||||
icon: 'none'
|
title: `正在尝试闭锁……`,
|
||||||
})
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
if(this.currentLockInfo.lockSetting.appUnlockOnline) {
|
if(this.currentLockInfo.lockSetting.appUnlockOnline) {
|
||||||
const result = await this.getNetToken()
|
const result = await this.getNetToken()
|
||||||
if(!result) {
|
if(!result) {
|
||||||
@ -153,10 +172,11 @@ export default {
|
|||||||
})
|
})
|
||||||
if(code === 0) {
|
if(code === 0) {
|
||||||
this.closeBluetoothConnection()
|
this.closeBluetoothConnection()
|
||||||
uni.showToast({
|
this.show = true
|
||||||
title: `${type === 'close' ? '关' : '开'}锁成功`,
|
this.type = type
|
||||||
icon: 'none'
|
setTimeout(() => {
|
||||||
})
|
this.show = false
|
||||||
|
}, 3000)
|
||||||
if(this.currentLockInfo.keyType === 3) {
|
if(this.currentLockInfo.keyType === 3) {
|
||||||
const { code: deleteKeyCode } = await deleteKeyRequest({
|
const { code: deleteKeyCode } = await deleteKeyRequest({
|
||||||
keyId: this.keyId
|
keyId: this.keyId
|
||||||
@ -189,6 +209,45 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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 {
|
.days {
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
background: #faecc9;
|
background: #faecc9;
|
||||||
|
|||||||
BIN
static/images/background_close_door.png
Executable file
BIN
static/images/background_close_door.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
BIN
static/images/background_open_door.png
Normal file
BIN
static/images/background_open_door.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Loading…
x
Reference in New Issue
Block a user