<!-- echarts -->
<view class="container">
  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
  <!--空白来占位状态栏-->
  <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
  <!--自定义导航栏 -->
  <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
    <picker bindchange="bindPickerChange" range="{{objectArray}}" range-key="name" value="{{stationindex}}">
    <view class="title_1" bindtap="rotateImage">{{stationName}}<image class="title_image" src="https://esos-iot.bjdexn.cn/wx_images/switch.png" mode="" animation="{{animationData}}"/></view>
    </picker>
  </view>
</view>
<view style="{{'height: ' + navStatusBarHeight +'px'}}"></view>
<!-- <view class="title_2">电站额定容量：{{characteristic.ratedCap}}kWh</view> -->

	<view class="canvasArea">
		<ec-canvas type="2d" id="dispace_charts" canvas-id="dispace_charts" ec="{{ ec_dispace_charts }}"></ec-canvas>
    <view class="data_box" style="background-image: url({{img_path}});background-size: 100% 100%; background-repeat: no-repeat;">
     <view class="titledata">
      <view>功率</view>
     </view>
      
     <view class="realtime1">
      <view class="realtime_left1">
        <view><text class="realtime_text">{{converter.formattoFixed(characteristic.power,1)}}</text><text class="realtime_unit">kW</text></view>  
     <view class="realtime_title">当前功率</view>  
      </view>
      <view class="realtime_right1">
        <view><text class="realtime_text">{{ectricdata.length}}/{{comStateunm}}</text>
        <!-- <text class="realtime_unit">h</text> -->
        </view>  
     <view class="realtime_title">总设备数/在线数</view>  
      </view>
     </view>
    </view>
	</view>
  <view class="canvasArea1">
     <view class="realtime2">
      <view class="realtime_left2">
     <view class="realtime_title">昨日收益</view>  
        <view><text class="realtime_text">{{converter.formatAmount(characteristic.moneyDaily)}}</text><text class="realtime_unit">{{converter.formatAmounts(characteristic.moneyDaily)}}</text></view>  
      </view>
      <view class="realtime_right2">
     <view class="realtime_title">累计收益</view>  
        <view><text class="realtime_text">{{converter.formatAmount(characteristic.money)}} </text><text class="realtime_unit">{{converter.formatAmounts(characteristic.money)}}</text></view>  
      </view>
    </view>
	</view>
    <view class="equipment">
    <view>电站总览 <text class="equipmenttext"> (今日：{{currentDate}})</text></view>
    <view class="details">
    <!-- <t-icon name="chevron-right-s" size="24" color="#999999" data-name="chevron-right-s" bind:tap="ondetails"/> -->
    </view>

    </view>
    <view class="electric">
    <view class="electric1" bind:tap="onIconTap">
    <view class="electric_rong">
    <view class="electric4">电量</view>
    <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
    </view>
    <view class="pic_pic">
    <ec-canvas id="mychart_line" canvas-id="mychart_line" ec="{{ ec }}"></ec-canvas>
    
    </view>
    </view>
    <view class="electric2">
    <view class="electric21" bind:tap="onIconTap">
      <view class="electric_rong">
    <view class="electric4">充电状态</view>
    <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"  />
    </view>
    <!-- <view>{{between.list[0].chargetime}} <text class="electric3">h</text></view> -->
    <!-- 功率>0 放电 -->
    <!-- 功率<0 充电/ -->
    <!-- 功率==0 空闲 -->
    <view class="tag_type1" wx:if="{{characteristic.power>0}}">放电</view>
    <view class="tag_type2" wx:if="{{characteristic.power<0}}">充电</view>
    <view class="tag_type3" wx:if="{{characteristic.power==0}}">空闲</view>
    <view class="batteryccc">当前充放电状态</view>
    </view>
    <!-- <view class="electric22" bind:tap="onhealthy"> -->
    <view class="electric22">
      <!-- <view class="electric_rong">
    <view class="electric4">系统效率</view>
    <view class="battery">{{characteristic.efficiency}} <text class="batteryccc">%</text> </view>
    </view> -->
 <!-- <view class="battery_bottom"></view> -->
 <view ></view>
    <view class="batteryccc">累计充电 <text class="battery">{{converter.formattoFixed(characteristic.chargeEnergy,2)}} </text> <text>kWh</text> </view>
    <view class="batteryccc">累计放电 <text class="battery">{{converter.formattoFixed(characteristic.disChargeEnergy,2)}} </text> <text>kWh</text> </view>
    </view>
    </view>
    </view>
</view>
<wxs module="converter">
 var formattoFixed = function(amount,unm) {
     return amount.toFixed(unm*1);
    }
   var formatAmount = function(amount) {
    if (amount==undefined) {
        return '1000';
      }
      if (amount < 10000) {
        return amount.toFixed(2);
      } else {
        return (amount / 10000).toFixed(2);
      }
    }
    var formatAmounts = function(amount) {
    if (amount==undefined) {
        return '元';
      }
      if (amount < 10000) {
        return'元';
      } else {
        return'万元';
      }
    }
    module.exports = {
      formatAmount: formatAmount,
      formatAmounts: formatAmounts,
      formattoFixed:formattoFixed
    }
</wxs>
<!--  -->