储能智慧云小程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.wxml 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!--pages/station/index.wxml-->
  2. <view class="custom-tabs">
  3. <view class="custom_box" wx:for="{{baseInfo.list}}" wx:key="index">
  4. <view class="custom_title">
  5. <view class="custom_title_name">设备编号</view>
  6. <view class="custom_title_gl">{{item.name}} </view>
  7. </view>
  8. <view class="custom_div">
  9. <view class="batteryccc">实时功率</view>
  10. <view class="custom_title_gl">{{converter.formattoFixed(item.power*1,2)}}<text class="batteryccc"> kW</text> </view>
  11. </view>
  12. <view class="custom_div">
  13. <view class="batteryccc">在线状态</view>
  14. <!-- <view class="{{item.comState== '离线' ? 'tag_type2red':'tag_type2'}}">{{item.comState}}</view> -->
  15. <view wx:if="{{item.comState==0}}" class="tag_type2red">离线</view>
  16. <view wx:else class="tag_type2">在线</view>
  17. <!-- <view class="tag_type2">{{item.comState}}</view> -->
  18. </view>
  19. <view class="custom_div">
  20. <view class="batteryccc">故障状态</view>
  21. <!-- <view class="tag_type1">{{item.faultState}}</view> -->
  22. <!-- <view class="{{item.faultState== '正常' ? 'tag_type2':'tag_type2red'}}">{{item.faultState}}</view> -->
  23. <view wx:if="{{item.faultState == 0}}" class="tag_type2">正常</view>
  24. <view wx:else class="tag_type2red">故障</view>
  25. </view>
  26. <view class="custom_div">
  27. <view class="batteryccc">运行状态</view>
  28. <!-- <view class="tag_type3">{{item.runState}}</view> -->
  29. <!-- <view class="{{item.runState== '运行' ? 'tag_type2':'tag_type3'}}">{{item.runState}}</view> -->
  30. <view wx:if="{{item.runState== 1}}" class="tag_type2">运行</view>
  31. <view wx:else class="tag_type3">停机</view>
  32. </view>
  33. <view class="custom_div">
  34. <view class="batteryccc">投运时间</view>
  35. <view class="custom_div1">{{item.createTime}}</view>
  36. </view>
  37. </view>
  38. <view class="tag_typetext">没有更多数据...</view>
  39. </view>
  40. <!--
  41. createAt 投运时间
  42. comState 在线状态
  43. power 实时功率
  44. 故障状态 faultState
  45. 运行状态 runState
  46. name 名称
  47. -->
  48. <wxs module="converter">
  49. var formattoFixed = function(amount,unm) {
  50. return amount.toFixed(unm*1);
  51. }
  52. var formatAmount = function(amount) {
  53. if (amount==undefined) {
  54. return '1000';
  55. }
  56. if (amount < 10000) {
  57. return amount.toFixed(2);
  58. } else {
  59. return (amount / 10000).toFixed(2);
  60. }
  61. }
  62. var formatAmounts = function(amount) {
  63. if (amount==undefined) {
  64. return '元';
  65. }
  66. if (amount < 10000) {
  67. return'元';
  68. } else {
  69. return'万元';
  70. }
  71. }
  72. module.exports = {
  73. formatAmount: formatAmount,
  74. formatAmounts: formatAmounts,
  75. formattoFixed:formattoFixed
  76. }
  77. </wxs>