Commit d17a8c7b by zhangxw

无线设备显示电量

1 parent 023860e7
.icon {display: inline-block;background-image: url(sprite.png);background-size: 192px 188px;} .icon {display: inline-block;background-image: url(sprite.png);background-size: 192px 188px;}
.icon-battery-empty { width: 24px; height: 16px; background-position: -144px -124px; }
.icon-battery-enough { width: 24px; height: 16px; background-position: -168px -124px; }
.icon-begin { width: 26px; height: 36px; background-position: -140px -52px; } .icon-begin { width: 26px; height: 36px; background-position: -140px -52px; }
.icon-copy { width: 28px; height: 28px; background-position: -144px -96px; } .icon-copy { width: 28px; height: 28px; background-position: -144px -96px; }
.icon-device { width: 14px; height: 14px; background-position: -118px -68px; } .icon-device { width: 14px; height: 14px; background-position: -118px -68px; }
...@@ -19,5 +21,5 @@ ...@@ -19,5 +21,5 @@
.icon-search { width: 16px; height: 16px; background-position: -118px -52px; } .icon-search { width: 16px; height: 16px; background-position: -118px -52px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -76px -160px; } .icon-setting-btn { width: 24px; height: 24px; background-position: -76px -160px; }
.icon-share { width: 88px; height: 96px; background-position: 0px 0px; } .icon-share { width: 88px; height: 96px; background-position: 0px 0px; }
.icon-typeList { width: 14px; height: 14px; background-position: -144px -124px; } .icon-typeList { width: 14px; height: 14px; background-position: -64px -144px; }
.icon-warning { width: 16px; height: 16px; background-position: -172px -96px; } .icon-warning { width: 16px; height: 16px; background-position: -172px -96px; }
\ No newline at end of file \ No newline at end of file

35.6 KB | W: | H:

37 KB | W: | H:

src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -450,7 +450,17 @@ export default defineComponent({ ...@@ -450,7 +450,17 @@ export default defineComponent({
carInfoWindowTpl += `<div class="info-list">`; carInfoWindowTpl += `<div class="info-list">`;
carInfoWindowTpl += `<p class="device-info"><i class="icon icon-device"></i><span class="label">${ carInfoWindowTpl += `<p class="device-info"><i class="icon icon-device"></i><span class="label">${
item.source == 1 ? "有线设备" : "无线设备" item.source == 1 ? "有线设备" : "无线设备"
}</span><span>${item.sn}</span></p>`; }</span><span>${item.sn}</span>`;
if (item.source == 0 && item.battery >= 0) {
carInfoWindowTpl += `<span class="battery">`;
if (item.battery <= 20) {
carInfoWindowTpl += `<span class="all-fill"><span style="width: ${item.battery}%;" class="fill empty"></span></span><span class="icon icon-battery-empty"></span><span class="battery-text empty">${item.battery}%</span>`;
} else {
carInfoWindowTpl += `<span class="all-fill"><span style="width: ${item.battery}%;" class="fill enough"></span></span><span class="icon icon-battery-enough"></span><span class="battery-text enough">${item.battery}%</span>`;
}
carInfoWindowTpl += `</span>`;
}
carInfoWindowTpl += `</p>`;
if (item.status && item.status == 2) { if (item.status && item.status == 2) {
carInfoWindowTpl += `<p class="offline-info"><i class="icon icon-offline-time"></i><span class="label">离线时长</span><span>${ carInfoWindowTpl += `<p class="offline-info"><i class="icon icon-offline-time"></i><span class="label">离线时长</span><span>${
item.statusTime || "--" item.statusTime || "--"
...@@ -1015,6 +1025,48 @@ export default defineComponent({ ...@@ -1015,6 +1025,48 @@ export default defineComponent({
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.battery {
margin-left: 8px;
position: relative;
height: 16px;
display: flex;
align-items: center;
.all-fill {
display: inline-block;
position: absolute;
top: 4px;
left: 3px;
width: 16px;
height: 8px;
background: #fff;
.fill {
position: absolute;
top: 0;
left: 0;
display: inline-block;
height: 100%;
border-radius: 2px;
}
.fill.enough {
background: #00cd9e;
}
.fill.empty {
background: #ff7340;
}
}
.battery-text {
font-size: 20px;
transform: scale(0.5) translate(-50%);
margin-left: 1px;
display: inline-block;
}
.battery-text.empty {
color: #ff7340;
}
.battery-text.enough {
color: #00cd9e;
}
}
} }
.list-info { .list-info {
align-items: center; align-items: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!