BMS.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view style="padding-bottom: 30rpx;">
  3. <!-- tab -->
  4. <view class="tab-box ddflex">
  5. <view class="fflex ddflex">
  6. <view :class="'tab-item fflex '+(queryType==1?'tab-item-active':'')" @click="queryTypeChange(1)">
  7. <view>实时状态</view>
  8. <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
  9. </view>
  10. <view :class="'tab-item fflex '+(queryType==2?'tab-item-active':'')" @click="queryTypeChange(2)">
  11. <view>BMS控制</view>
  12. <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="height: 110rpx;"></view>
  17. <block v-if="queryType==1">
  18. <view class="option-box">
  19. <view class="option-time ddflex">
  20. <view>更新时间: 2023-04-03 11:09:08</view>
  21. <view class="refresh ddflex">
  22. <image src="../../static/pages/images/refresh.png"></image>
  23. <text>刷新</text>
  24. </view>
  25. </view>
  26. <view style="position: relative;">
  27. <view style="height: 130rpx;"></view>
  28. <view style="margin-top: 40rpx;justify-content: center;position: absolute;left: 50%;transform: translateX(-50%);top: -50%;" class="ddflex">
  29. <cell :width="99" :height="197" :soc="6*10" :showsoc="true" :rotate="90"></cell>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bms-info">
  34. <view class="bms-row ddflex">
  35. <view class="fflex ddflex">
  36. <text>电池数量:</text>
  37. <text class="bms-row-data">17 串</text>
  38. </view>
  39. <view class="fflex ddflex bms-row-right">
  40. <text>剩余容量:</text>
  41. <text class="bms-row-data">31.6 AH</text>
  42. </view>
  43. </view>
  44. <view class="bms-row ddflex">
  45. <view class="fflex ddflex">
  46. <text>总电压:</text>
  47. <text class="bms-row-data">66.99V</text>
  48. </view>
  49. <view class="fflex ddflex bms-row-right">
  50. <text>电流数据:</text>
  51. <text class="bms-row-data">0A</text>
  52. </view>
  53. </view>
  54. <view class="bms-row ddflex">
  55. <view class="fflex ddflex">
  56. <text>最低电压:</text>
  57. <text class="bms-row-data">3.934 V</text>
  58. </view>
  59. <view class="fflex ddflex bms-row-right">
  60. <text>最高电压:</text>
  61. <text class="bms-row-data">3.946V</text>
  62. </view>
  63. </view>
  64. <view class="bms-row ddflex">
  65. <view class="fflex ddflex">
  66. <text>相差电压:</text>
  67. <text class="bms-row-data">0.012V</text>
  68. </view>
  69. <view class="fflex ddflex bms-row-right">
  70. <text>平均电压:</text>
  71. <text class="bms-row-data">3.94V</text>
  72. </view>
  73. </view>
  74. <view class="bms-row ddflex">
  75. <view class="fflex ddflex">
  76. <text>温度数量:</text>
  77. <text class="bms-row-data">2个</text>
  78. </view>
  79. <view class="fflex ddflex bms-row-right">
  80. <text>校准容量:</text>
  81. <text class="bms-row-data">36.1AH</text>
  82. </view>
  83. </view>
  84. <view class="bms-row ddflex">
  85. <view class="fflex ddflex">
  86. <text>温度:</text>
  87. <text class="bms-row-data"> [20°C][20°C]</text>
  88. </view>
  89. <view class="fflex ddflex bms-row-right">
  90. <text>功率:</text>
  91. <text class="bms-row-data">0KW</text>
  92. </view>
  93. </view>
  94. <view class="bms-row ddflex">
  95. <view class="fflex ddflex">
  96. <text>充电状态:</text>
  97. <text class="bms-row-data">静止</text>
  98. </view>
  99. <view class="fflex ddflex bms-row-right">
  100. <text>均衡开闭:</text>
  101. <text class="bms-row-data">关闭</text>
  102. </view>
  103. </view>
  104. <view class="bms-row ddflex">
  105. <view class="fflex ddflex">
  106. <text>循环摞碍次数:</text>
  107. <text class="bms-row-data">216次</text>
  108. </view>
  109. <view class="fflex ddflex bms-row-right">
  110. <text>固件版本:</text>
  111. <text class="bms-row-data">0KW</text>
  112. </view>
  113. </view>
  114. <view class="bms-row ddflex">
  115. <view class="fflex ddflex">
  116. <text>连接状态:</text>
  117. <text class="bms-row-data">已连接</text>
  118. </view>
  119. <view class="fflex ddflex bms-row-right">
  120. <text>设备编码:</text>
  121. <text class="bms-row-data">613880983244</text>
  122. </view>
  123. </view>
  124. </view>
  125. </block>
  126. <block v-if="queryType==2">
  127. <view class="option-box">
  128. <view class="option-time ddflex">
  129. <view>更新时间: 2023-04-03 11:09:08</view>
  130. <view class="refresh ddflex">
  131. <image src="../../static/pages/images/refresh.png"></image>
  132. <text>刷新</text>
  133. </view>
  134. </view>
  135. <view class="ddflex state">
  136. <view class="ddflex">
  137. <view>充电开关:</view>
  138. <view style="color: #A8A5A5;">开启</view>
  139. </view>
  140. <switch style="transform: scale(0.6);" color="#FF753A"></switch>
  141. </view>
  142. <view class="ddflex state">
  143. <view class="ddflex">
  144. <view>放电开关:</view>
  145. <view style="color: #A8A5A5;">关闭</view>
  146. </view>
  147. <switch style="transform: scale(0.6);" color="#FF753A"></switch>
  148. </view>
  149. </view>
  150. </block>
  151. </view>
  152. </template>
  153. <script>
  154. const app = getApp();
  155. const req = require("../../utils/request.js");
  156. import cell from "../../components/cell/index";
  157. export default {
  158. components: {
  159. cell
  160. },
  161. props: {},
  162. data() {
  163. return {
  164. systems: {},
  165. isTop:0,
  166. queryType: 1,
  167. }
  168. },
  169. onLoad(options) {
  170. },
  171. onShow() {
  172. },
  173. methods: {
  174. jumpUrl(url) {
  175. if (req.isLogins(true)) {
  176. uni.navigateTo({
  177. url: url
  178. })
  179. }
  180. },
  181. queryTypeChange(val) {
  182. if (this.queryType == val) return false
  183. this.queryType = val
  184. },
  185. },
  186. mounted() {
  187. const systemInfo = uni.getSystemInfoSync();
  188. // px转换到rpx的比例
  189. let pxToRpxScale = 750 / systemInfo.windowWidth;
  190. let systems = {
  191. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  192. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  193. };
  194. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  195. this.systems = systems;
  196. },
  197. onPageScroll: function(e) {
  198. if (e.scrollTop > this.systems.barHeight) {
  199. this.isTop = 1;
  200. } else {
  201. this.isTop = 0;
  202. }
  203. }
  204. }
  205. </script>
  206. <style>
  207. @import "./BMS.css";
  208. </style>