monthlyCardList.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <view >
  3. <ujp-navbar title="适用站点"></ujp-navbar>
  4. <view class="carNone" v-if="list.length == 0">
  5. <img src="@/assets/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. var data={
  104. monthlyRentCardId:this.monthlyRentCardId,
  105. online:0
  106. }
  107. if (this.carhelp.getPersonInfo()) {
  108. data.openId=this.carhelp.getOpenId()
  109. }
  110. API.getChargingStationData(data).then((response) => {
  111. console.log(response)
  112. this.list = [
  113. ...this.list,
  114. ...response.data.data
  115. ];
  116. this.recordsTotal = response.data.recordsTotal;
  117. //this.detail=response.data.monthlyRentCard
  118. uni.hideLoading()
  119. }).catch(error => {
  120. uni.showToast({
  121. title: error
  122. })
  123. })
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .carNone{
  130. display: flex;
  131. flex-direction: column;
  132. justify-content: center;
  133. align-items: center;
  134. img{
  135. width: 100%;
  136. height: 100%;
  137. }
  138. p{
  139. margin-top: -60px;
  140. }
  141. }
  142. .top-box {
  143. width: 100%;
  144. height: 88px;
  145. position: fixed;
  146. top: 0;
  147. left: 0;
  148. z-index: 999;
  149. }
  150. .top {
  151. display: flex;
  152. justify-content: space-between;
  153. width: 100%;
  154. height: 44px;
  155. color: #666666;
  156. background-color: rgba(255, 255, 255, 100);
  157. padding: 12px 16px;
  158. .u-search[data-v-1a326067] {
  159. flex: 0.9;
  160. }
  161. .list {
  162. margin-left: 2px;
  163. }
  164. }
  165. .condition {
  166. width: 100%;
  167. height: 44px;
  168. line-height: 20px;
  169. padding: 12px 16px;
  170. display: flex;
  171. background-color: #fff;
  172. .condition-type {
  173. margin-left: 36px;
  174. }
  175. .condition-screen {
  176. margin-left: 159px;
  177. }
  178. }
  179. .charing-slow {
  180. background-color: #fff;
  181. margin: 0 12px;
  182. border-radius: 8px;
  183. padding: 10px 12px 0px;
  184. margin-top: 12px;
  185. .trickle-charge {
  186. display: inline-block;
  187. width: 44px;
  188. height: 20px;
  189. line-height: 20px;
  190. border-radius: 50px;
  191. background-color: rgba(0, 185, 98, 100);
  192. color: rgba(255, 255, 255, 100);
  193. font-size: 12px;
  194. text-align: center;
  195. }
  196. .fast-charge {
  197. display: inline-block;
  198. width: 44px;
  199. height: 20px;
  200. line-height: 20px;
  201. border-radius: 50px;
  202. background-color: #9d9fff;
  203. color: rgba(255, 255, 255, 100);
  204. font-size: 12px;
  205. text-align: center;
  206. }
  207. .fast-slow{
  208. display: inline-block;
  209. width: 44px;
  210. height: 20px;
  211. line-height: 20px;
  212. border-radius: 50px;
  213. background-color: #00bac8;
  214. color: rgba(255, 255, 255, 100);
  215. font-size: 12px;
  216. text-align: center;
  217. }
  218. .station-items {
  219. display: inline-block;
  220. height: 16px;
  221. line-height: 16px;
  222. font-size: 16px;
  223. margin-left: 4px;
  224. color: #101010;
  225. }
  226. .address {
  227. margin-top: 8px;
  228. line-height: 16px;
  229. font-size: 11px;
  230. color: rgba(119, 119, 119, 100);
  231. }
  232. .price {
  233. display: flex;
  234. height: 20px;
  235. margin-top: 8px;
  236. .num {
  237. height: 20px;
  238. color: rgba(255, 98, 0, 100);
  239. font-size: 20px;
  240. text-align: left;
  241. font-family: Roboto-medium;
  242. }
  243. .unit {
  244. height: 14px;
  245. line-height: 14px;
  246. color: rgba(102, 102, 102, 100);
  247. font-size: 14px;
  248. text-align: left;
  249. font-family: AlibabaPuHui-regular;
  250. margin-top: 6px;
  251. margin-left: 4px;
  252. }
  253. }
  254. .park {
  255. margin-top: 10px;
  256. display: flex;
  257. .park-p {
  258. display: inline-block;
  259. width: 20px;
  260. height: 18px;
  261. line-height: 12px;
  262. text-align: center;
  263. background-color: rgba(125, 177, 255, 100);
  264. color: #fff;
  265. }
  266. .park-text {
  267. display: inline-block;
  268. width: 300px;
  269. height: 17px;
  270. color: rgba(102, 102, 102, 100);
  271. font-size: 12px;
  272. text-align: left;
  273. margin-left: 4px;
  274. margin-top: 2px;
  275. }
  276. }
  277. .free {
  278. display: flex;
  279. justify-content: space-between;
  280. height: 52px;
  281. border-top: 1px solid rgba(238, 242, 240, 100);
  282. margin-top: 10px;
  283. .free-num {
  284. line-height: 52px;
  285. font-size: 14px
  286. }
  287. .distance {
  288. width: 130px;
  289. height: 28px;
  290. line-height: 28px;
  291. color: rgba(255, 255, 255, 100);
  292. font-size: 14px;
  293. background-color: #00b962;
  294. border-radius: 50px;
  295. margin: 12px;
  296. text-align: center;
  297. .distance-font {
  298. font-size: 16px
  299. }
  300. }
  301. }
  302. }
  303. </style>