monthlyCardList.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <view >
  3. <ujp-navbar title="适用站点"></ujp-navbar>
  4. <view class="carNone" v-if="list.length == 0">
  5. <img src="static/img/暂无数据-缺省页.png" alt="">
  6. <p class="oldTextjp2" oldstyle="font-size: 18px;">加载中</p>
  7. </view>
  8. <view class="charing-slow" v-for="(item,index) in list"
  9. @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id='+item.id)"
  10. :key="item.id" >
  11. <text class="trickle-charge" v-if="item.type == '1'" :style="elderStatus ? 'font-size: 14px;background-color: #9D9FFF;' : 'background-color: #9D9FFF;'">快充</text>
  12. <text class="trickle-charge" v-if="item.type == '2'" :style="elderStatus ? 'font-size: 14px;background-color: #00B962;' : 'background-color: #00B962;'">慢充</text>
  13. <text class="trickle-charge" v-if="item.type == '1,2'" :style="elderStatus ? 'font-size: 14px;background-color: #00BAC8;' : 'background-color: #00BAC8;'">快/慢</text>
  14. <text class="station-items oldTextjp" oldstyle="font-size: 20px;">{{item.name}}</text>
  15. <view class="address oldTextjp2" oldstyle="font-size: 14px;">
  16. {{item.address}}
  17. </view>
  18. <view class="price">
  19. <view class="num">{{item.costPrice.toFixed(2)}}</view>
  20. <view class="unit oldTextjp2" oldstyle="font-size: 16px;">
  21. 元/度 起
  22. </view>
  23. </view>
  24. <!-- <view class="park">
  25. <text class="park-p">p</text>
  26. <text class="park-text">以实际费用为准</text>
  27. </view> -->
  28. <view class="free">
  29. <view class="free-num oldTextjp2" oldstyle="font-size: 18px;">
  30. <text style="color:#009143;">空闲{{item.availableNum}}</text>/总数{{item.totalNum}}
  31. </view>
  32. <!-- <view class="distance">
  33. <text class="iconfont distance-font">&#xe615;</text>
  34. </view> -->
  35. </view>
  36. </view>
  37. <u-divider v-if="list.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px;background-color: #F2F4F4;">已经到底了</u-divider>
  38. <!-- <u-divider margin-top="20" bg-color="#F2F4F4">已经到底了</u-divider>
  39. --> </view>
  40. </template>
  41. <script>
  42. import * as API from '@/apis/site.js';
  43. export default {
  44. data() {
  45. return {
  46. tabbarList: [{
  47. iconPath: "home-3-line",
  48. selectedIconPath: "home-3-fill",
  49. text: '主页 ',
  50. count: 0,
  51. isDot: true,
  52. customIcon: true,
  53. },
  54. {
  55. iconPath: "road-map-line",
  56. selectedIconPath: "road-map-fill",
  57. text: '找桩',
  58. midButton: true,
  59. customIcon: true,
  60. },
  61. {
  62. iconPath: "user-5-line",
  63. selectedIconPath: "user-5-fill",
  64. text: '我的',
  65. count: 0,
  66. isDot: false,
  67. customIcon: true,
  68. }
  69. ],
  70. current: 0,
  71. monthlyRentCardId:null,
  72. pageIndex: 1,
  73. recordsTotal: 0,
  74. list: [],
  75. elderStatus: false,
  76. }
  77. },onLoad(op){
  78. this.monthlyRentCardId=op.cardId
  79. this.getInfo()
  80. },
  81. onReachBottom() {
  82. if (this.chargeList.length < this.recordsTotal) {
  83. this.myLoadmore();
  84. }
  85. },
  86. onReady() {
  87. if(this.carhelp.get("getElderModeClass") == "长辈模式") {
  88. this.elderStatus = true;
  89. } else {
  90. this.elderStatus = false;
  91. }
  92. },
  93. methods: {
  94. myLoadmore() {
  95. this.pageIndex += 1;
  96. this.getInfo()
  97. },
  98. getInfo(){
  99. uni.showLoading({
  100. title: "加载中",
  101. mask: true,
  102. })
  103. API.getChargingStationData({
  104. monthlyRentCardId:this.monthlyRentCardId,
  105. online:0
  106. }).then((response) => {
  107. console.log(response)
  108. this.list = [
  109. ...this.list,
  110. ...response.data.data
  111. ];
  112. this.recordsTotal = response.data.recordsTotal;
  113. //this.detail=response.data.monthlyRentCard
  114. uni.hideLoading()
  115. }).catch(error => {
  116. uni.showToast({
  117. title: error
  118. })
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .carNone{
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: center;
  129. align-items: center;
  130. img{
  131. width: 100%;
  132. height: 100%;
  133. }
  134. p{
  135. margin-top: -60px;
  136. }
  137. }
  138. .top-box {
  139. width: 100%;
  140. height: 88px;
  141. position: fixed;
  142. top: 0;
  143. left: 0;
  144. z-index: 999;
  145. }
  146. .top {
  147. display: flex;
  148. justify-content: space-between;
  149. width: 100%;
  150. height: 44px;
  151. color: #666666;
  152. background-color: rgba(255, 255, 255, 100);
  153. padding: 12px 16px;
  154. .u-search[data-v-1a326067] {
  155. flex: 0.9;
  156. }
  157. .list {
  158. margin-left: 2px;
  159. }
  160. }
  161. .condition {
  162. width: 100%;
  163. height: 44px;
  164. line-height: 20px;
  165. padding: 12px 16px;
  166. display: flex;
  167. background-color: #fff;
  168. .condition-type {
  169. margin-left: 36px;
  170. }
  171. .condition-screen {
  172. margin-left: 159px;
  173. }
  174. }
  175. .charing-slow {
  176. background-color: #fff;
  177. margin: 0 12px;
  178. border-radius: 8px;
  179. padding: 10px 12px 0px;
  180. margin-top: 12px;
  181. .trickle-charge {
  182. display: inline-block;
  183. width: 44px;
  184. height: 20px;
  185. line-height: 20px;
  186. border-radius: 50px;
  187. background-color: rgba(0, 185, 98, 100);
  188. color: rgba(255, 255, 255, 100);
  189. font-size: 12px;
  190. text-align: center;
  191. }
  192. .fast-charge {
  193. display: inline-block;
  194. width: 44px;
  195. height: 20px;
  196. line-height: 20px;
  197. border-radius: 50px;
  198. background-color: #9d9fff;
  199. color: rgba(255, 255, 255, 100);
  200. font-size: 12px;
  201. text-align: center;
  202. }
  203. .fast-slow{
  204. display: inline-block;
  205. width: 44px;
  206. height: 20px;
  207. line-height: 20px;
  208. border-radius: 50px;
  209. background-color: #00bac8;
  210. color: rgba(255, 255, 255, 100);
  211. font-size: 12px;
  212. text-align: center;
  213. }
  214. .station-items {
  215. display: inline-block;
  216. height: 16px;
  217. line-height: 16px;
  218. font-size: 16px;
  219. margin-left: 4px;
  220. color: #101010;
  221. }
  222. .address {
  223. margin-top: 8px;
  224. line-height: 16px;
  225. font-size: 11px;
  226. color: rgba(119, 119, 119, 100);
  227. }
  228. .price {
  229. display: flex;
  230. height: 20px;
  231. margin-top: 8px;
  232. .num {
  233. height: 20px;
  234. color: rgba(255, 98, 0, 100);
  235. font-size: 20px;
  236. text-align: left;
  237. font-family: Roboto-medium;
  238. }
  239. .unit {
  240. height: 14px;
  241. line-height: 14px;
  242. color: rgba(102, 102, 102, 100);
  243. font-size: 14px;
  244. text-align: left;
  245. font-family: AlibabaPuHui-regular;
  246. margin-top: 6px;
  247. margin-left: 4px;
  248. }
  249. }
  250. .park {
  251. margin-top: 10px;
  252. display: flex;
  253. .park-p {
  254. display: inline-block;
  255. width: 20px;
  256. height: 18px;
  257. line-height: 12px;
  258. text-align: center;
  259. background-color: rgba(125, 177, 255, 100);
  260. color: #fff;
  261. }
  262. .park-text {
  263. display: inline-block;
  264. width: 300px;
  265. height: 17px;
  266. color: rgba(102, 102, 102, 100);
  267. font-size: 12px;
  268. text-align: left;
  269. margin-left: 4px;
  270. margin-top: 2px;
  271. }
  272. }
  273. .free {
  274. display: flex;
  275. justify-content: space-between;
  276. height: 52px;
  277. border-top: 1px solid rgba(238, 242, 240, 100);
  278. margin-top: 10px;
  279. .free-num {
  280. line-height: 52px;
  281. font-size: 14px
  282. }
  283. .distance {
  284. width: 130px;
  285. height: 28px;
  286. line-height: 28px;
  287. color: rgba(255, 255, 255, 100);
  288. font-size: 14px;
  289. background-color: #00b962;
  290. border-radius: 50px;
  291. margin: 12px;
  292. text-align: center;
  293. .distance-font {
  294. font-size: 16px
  295. }
  296. }
  297. }
  298. }
  299. </style>