适配不同电量icon
This commit is contained in:
parent
e9b1ea1d7d
commit
47643f55be
@ -33,8 +33,8 @@
|
|||||||
<image class="lock-image-lock" src="/static/images/icon_lock.png"></image>
|
<image class="lock-image-lock" src="/static/images/icon_lock.png"></image>
|
||||||
<view class="lock-top-right">
|
<view class="lock-top-right">
|
||||||
<view class="lock-top-right-power">
|
<view class="lock-top-right-power">
|
||||||
<image class="lock-top-right-power-image" src="/static/images/icon_power.png"></image>
|
<image class="lock-top-right-power-image" :src="getPowerIcon(lock.electricQuantity)"></image>
|
||||||
<view class="lock-top-right-power-text">{{lock.electricQuantity}}%</view>
|
<view class="lock-top-right-power-text">{{ lock.electricQuantity }}%</view>
|
||||||
</view>
|
</view>
|
||||||
<view>{{getRole(lock.userType, lock.keyRight)}}</view>
|
<view>{{getRole(lock.userType, lock.keyRight)}}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -147,7 +147,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
timeFormat,
|
timeFormat,
|
||||||
...mapActions(useUserStore, ['updateUserInfo', 'updateLoginStatus', 'phoneLogin', 'getUserInfo']),
|
...mapActions(useUserStore, ['updateUserInfo', 'updateLoginStatus', 'phoneLogin', 'getUserInfo']),
|
||||||
...mapActions(useLockStore, ['getLockList', 'getRole', 'getTimeLimit', 'updateLockSearch']),
|
...mapActions(useLockStore, ['getLockList', 'getRole', 'getTimeLimit', 'updateLockSearch', 'getPowerIcon']),
|
||||||
...mapActions(useBluetoothStore, ['getBluetoothStatus', 'initAndListenBluetooth', 'updateCurrentLockInfo',
|
...mapActions(useBluetoothStore, ['getBluetoothStatus', 'initAndListenBluetooth', 'updateCurrentLockInfo',
|
||||||
'checkSetting', 'updateKeyId', 'resetDevice']),
|
'checkSetting', 'updateKeyId', 'resetDevice']),
|
||||||
...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo']),
|
...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo']),
|
||||||
@ -548,7 +548,7 @@ page {
|
|||||||
|
|
||||||
.lock-top-right-power-image {
|
.lock-top-right-power-image {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 24rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<image class="top-background" src="/static/images/background_main.jpg" mode="aspectFill"></image>
|
<image class="top-background" src="/static/images/background_main.jpg" mode="aspectFill"></image>
|
||||||
<view style="width: 100%;height: 50rpx">
|
<view style="width: 100%;height: 50rpx">
|
||||||
<view class="power" @click="powerTip">
|
<view class="power" @click="powerTip">
|
||||||
<image class="power-icon" src="/static/images/icon_power.png" mode="aspectFill"></image>
|
<image class="power-icon" :src="getPowerIcon(currentLockInfo.electricQuantity)" mode="aspectFill"></image>
|
||||||
<view class="power-text">{{ currentLockInfo.electricQuantity }}%</view>
|
<view class="power-text">{{ currentLockInfo.electricQuantity }}%</view>
|
||||||
<image class="power-tips" src="/static/images/icon_tips.png" mode="aspectFill"></image>
|
<image class="power-tips" src="/static/images/icon_tips.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -85,7 +85,7 @@ export default {
|
|||||||
this.getServeTime()
|
this.getServeTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList']),
|
...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']),
|
||||||
...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp']),
|
...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp']),
|
||||||
...mapActions(useBasicStore, ['routeJump', 'backAndToast']),
|
...mapActions(useBasicStore, ['routeJump', 'backAndToast']),
|
||||||
powerTip() {
|
powerTip() {
|
||||||
@ -246,7 +246,7 @@ export default {
|
|||||||
.power-icon {
|
.power-icon {
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
height: 50rpx;
|
height: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.power-text {
|
.power-text {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
static/images/icon_power_1.png
Executable file
BIN
static/images/icon_power_1.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 859 B |
BIN
static/images/icon_power_2.png
Executable file
BIN
static/images/icon_power_2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 907 B |
BIN
static/images/icon_power_3.png
Executable file
BIN
static/images/icon_power_3.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 940 B |
BIN
static/images/icon_power_4.png
Executable file
BIN
static/images/icon_power_4.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 930 B |
BIN
static/images/icon_power_5.png
Executable file
BIN
static/images/icon_power_5.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 826 B |
@ -51,6 +51,21 @@ export const useLockStore = defineStore('lock', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
// 获取电量icon
|
||||||
|
getPowerIcon(power) {
|
||||||
|
if(power >= 80) {
|
||||||
|
return '/static/images/icon_power_5.png'
|
||||||
|
} else if(power >= 60) {
|
||||||
|
return '/static/images/icon_power_4.png'
|
||||||
|
} else if(power >= 40) {
|
||||||
|
return '/static/images/icon_power_3.png'
|
||||||
|
} else if(power >= 20) {
|
||||||
|
return '/static/images/icon_power_2.png'
|
||||||
|
} else {
|
||||||
|
return '/static/images/icon_power_1.png'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 将星期转换为中文字符串
|
||||||
convertWeekDaysToChineseString(weekDays) {
|
convertWeekDaysToChineseString(weekDays) {
|
||||||
const dayMap = {
|
const dayMap = {
|
||||||
1: '一',
|
1: '一',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user