123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <view>
- <!-- <view class="communication">
- <view><image class="cangwei" src="../../../static/equipment/cangwei.png" /><text class="storeCode_num">{{storeCode}}号仓位</text></view>
-
- </view> -->
- <view class="battery-number">
- <text>电池编号</text><text>{{sn ||'-'}}</text>
- </view>
- <view class="percent">
- <view><text>{{soc}}</text></view>
- <view>%</view>
- </view>
- <view class="line"><text></text><text></text></view>
- <view class="power">
- <view class="power-percent">
- <text v-for="item in 100" :key="item" :style="{'backgroundColor': soc >= item ? setcolor :''}"></text>
- </view>
- <view class="power-text">
- <text>电池电量</text>
- <text v-if="showCode ==0">预计 <em>{{chgEstimatedTime}}</em> 分钟后充满</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "BatteryStatus",
- props:['storeCode','comState','sn','chgEstimatedTime','soc','showCode'],
- computed:{
-
- setcolor(){
- if(this.soc<=30 && this.soc > 0){
- return '#ce4545'
- }else if(this.soc > 30 && this.soc <= 70){
- return '#f8dc4b'
- }else if(this.soc > 70){
- return '#44ab41'
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .communication {
- display: flex;
- justify-content: space-between;
- .cangwei{
- width: 20px;
- height: 20px;
- vertical-align: middle;
- margin-right: 5px;
- margin-top: -2px;
- }
- view {
- line-height: 32px;
- font-size: 16px;
- font-weight: 600;
- height: 32px;
- text-align: center;
- }
- view:first-child {
- background-color: #1b263a;
- border: #25334d solid 1px;
- color: white;
- line-height: 32px;
- text-align: left;
- padding: 0 10px 0 5px;
- // .image {
- // vertical-align: middle;
- // }
- }
-
- }
- .battery-number {
- margin-top: 10px;
- display: flex;
- color: #414A63;
- text:last-child {
- color: white;
- padding-right: 10px;
- font-size: 14px;
- font-weight: 600;
- margin-left: 10px;
- }
- }
- .percent {
- margin-top: 10px;
- display: flex;
- view:first-child {
- background-color: #181e2a;
- width: 90%;
- border-radius: 5px;
- height: 10px;
- text {
- color: white;
- font-weight: 600;
- font-size: 16px;
- position: relative;
- bottom: 5px;
- }
- }
- :last-child {
- position: relative;
- bottom: 4px;
- width: 30px;
- text-align: right;
- font-weight: 500;
- }
- }
- .line {
- display: flex;
- :first-child {
- width: 1%;
- background-color: white;
- height: 2px;
- }
- :last-child {
- height: 2px;
- width: 97%;
- background-color: #14172a;
- margin-left: 5px;
- }
- }
- .power {
- display: flex;
- flex-direction: column;
- margin-top: 10px;
- .power-percent {
- width: 100%;
- display: flex;
- text {
- background-color: #1e2535;
- height: 6px;
- width: 2px;
- margin-right: 1px;
- }
- }
- .power-text {
- display: flex;
- width: 100%;
- margin-top: 12px;
- justify-content: space-between;
- em {
- color: #87edab;
- font-weight: 500;
- font-style: normal;
- }
- }
- }
- </style>
|