cell.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view>
  3. <view class="top-box">
  4. <view class="top-title">
  5. <view class="ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;padding-top:' + systems.ktxStatusHeight + 'rpx;'+'line-height: '+ systems.navigationHeight + 'rpx;'">
  6. <view>白云科技门店</view>
  7. <image class="dow-ssicon" src="../../static/pages/images/dow-ssicon.png"></image>
  8. </view>
  9. </view>
  10. <view class="tab-box ddflex">
  11. <view class="fflex ddflex">
  12. <view :class="'tab-item fflex '+(queryType==1?'tab-item-active':'')" @click="queryTypeChange(1)">
  13. <view>全部</view>
  14. <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
  15. </view>
  16. <view :class="'tab-item fflex '+(queryType==2?'tab-item-active':'')" @click="queryTypeChange(2)">
  17. <view>未租</view>
  18. <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
  19. </view>
  20. <view :class="'tab-item fflex '+(queryType==3?'tab-item-active':'')" @click="queryTypeChange(3)">
  21. <view>已租</view>
  22. <image class="tab-active-icon" src="../../static/images/tab_cur.png"></image>
  23. </view>
  24. </view>
  25. <view class="ddflex">
  26. <image class="saoma" src="../../static/pages/images/saoma.png"></image>
  27. <image class="sousuo" src="../../static/pages/images/search.png" @click="jumpUrl('/machineAndCell/cellSearch/cellSearch')"></image>
  28. </view>
  29. </view>
  30. </view>
  31. <view :style="'height: '+ (systems.navigationHeight+systems.ktxStatusHeight+106) + 'rpx;'"></view>
  32. <view class="ddflex state-box">
  33. <view class="state-item">
  34. <view class="ddflex">
  35. <view class="icon"></view>
  36. <view class="state-label">租赁中</view>
  37. </view>
  38. <view class="ddflex state-data">
  39. <view>6</view>
  40. <view>16.66%</view>
  41. </view>
  42. </view>
  43. <view class="state-item">
  44. <view class="ddflex">
  45. <view class="icon" style="background: #0FCB27;"></view>
  46. <view class="state-label">空闲</view>
  47. </view>
  48. <view class="ddflex fflex state-data">
  49. <view>30</view>
  50. <view>83.33%</view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 电池 -->
  55. <view>
  56. <view class="cell-box" v-for="item,index in 10">
  57. <view class="ddflex">
  58. <view style="margin-right: 35rpx;">
  59. <cell :width="99" :height="197" :soc="index*10" :showsoc="true"></cell>
  60. </view>
  61. <view class="cell-info fflex">
  62. <view class="ddflex">
  63. <view class="cell-title">60V40AH</view>
  64. <view class="cell-state">已租</view>
  65. </view>
  66. <view class="cell-info ddflex">
  67. <view>机柜名称:</view>
  68. <view>CHZD04TTCC200329109</view>
  69. </view>
  70. <view class="cell-info ddflex">
  71. <view>电池ID:</view>
  72. <view>613880983244</view>
  73. </view>
  74. <view class="cell-info ddflex">
  75. <view>门店:</view>
  76. <view>白云科技门店</view>
  77. </view>
  78. <view class="cell-info ddflex">
  79. <view>剩余30天</view>
  80. </view>
  81. <view class="cell-info ddflex">
  82. <view>2023-04-03 11:07:46</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="cell-option ddflex">
  87. <view class="fflex" @click="jumpUrl('/machineAndCell/map/map')">定位</view>
  88. <view class="fflex" @click="jumpUrl('/machineAndCell/BMS/BMS')">BMS</view>
  89. <view class="fflex" @click="jumpUrl('/machineAndCell/cellDetail/cellDetail')">详情</view>
  90. </view>
  91. </view>
  92. </view>
  93. <foot channel="cell" :isUpdate="isUpdate"></foot>
  94. </view>
  95. </template>
  96. <script>
  97. const app = getApp();
  98. const req = require("../../utils/request.js");
  99. import cell from "../../components/cell/index";
  100. import foot from "../../components/nav-bar/index";
  101. export default {
  102. components: {
  103. cell,
  104. foot
  105. },
  106. props: {},
  107. data() {
  108. return {
  109. systems: {},
  110. isTop:0,
  111. queryType:1
  112. }
  113. },
  114. onLoad(options) {
  115. },
  116. onShow() {
  117. },
  118. methods: {
  119. jumpUrl(url){
  120. if(req.isLogins(true)){
  121. uni.navigateTo({
  122. url:url
  123. })
  124. }
  125. },
  126. queryTypeChange(val) {
  127. if (this.queryType == val) return false
  128. this.queryType = val
  129. },
  130. },
  131. mounted() {
  132. const systemInfo = uni.getSystemInfoSync();
  133. // px转换到rpx的比例
  134. let pxToRpxScale = 750 / systemInfo.windowWidth;
  135. let systems = {
  136. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  137. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  138. };
  139. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  140. this.systems = systems;
  141. },
  142. onPageScroll: function(e) {
  143. if (e.scrollTop > this.systems.barHeight) {
  144. this.isTop = 1;
  145. } else {
  146. this.isTop = 0;
  147. }
  148. }
  149. }
  150. </script>
  151. <style>
  152. @import "./cell.css";
  153. </style>