chargingDetails.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view>
  3. <u-navbar title="充电价格详情"></u-navbar>
  4. <!-- 主体 -->
  5. <!-- 充电桩信息 -->
  6. <view class="main">
  7. <!-- 收费标准 -->
  8. <view class="rates" v-if="prices&&prices.length">
  9. <view class="rates-title">
  10. <view class="title-left">
  11. 收费标准
  12. </view>
  13. <view class="title-right">
  14. 充电功率计费
  15. </view>
  16. </view>
  17. <!-- 时段分类 -->
  18. <view class="time-rates">
  19. <view class="time-part" v-for="(item,index) in prices" :key="index">
  20. <view class="part-top">
  21. <view class="time">
  22. {{item.minPower}}W-{{item.maxPower}}W
  23. </view>
  24. <view class="price">
  25. <text class="price-number">{{item.price}}</text>
  26. <text class="price-unit">元每小时</text>
  27. </view>
  28. </view>
  29. <!-- <view class="part-bottom">
  30. <view class="unitPrice-servicePrice">
  31. 充电单价:¥{{item.costPrice}} | 服务费:¥{{item.servicePrice}}
  32. </view>
  33. </view> -->
  34. </view>
  35. <view style="
  36. text-align: center;
  37. color: #999999;
  38. ">*充电费用仅供参考,请以充电桩上的费用为准。</view>
  39. </view>
  40. </view>
  41. <!-- 收费标准 -->
  42. <view class="rates" v-if="carPrices&&carPrices.length">
  43. <view class="rates-title">
  44. <view class="title-left">
  45. 收费标准
  46. </view>
  47. <view class="title-right">
  48. 峰谷平电价计费
  49. </view>
  50. </view>
  51. <!-- 时段分类 -->
  52. <view class="time-rates">
  53. <view class="time-part" v-for="(item,index) in carPrices" :key="index">
  54. <view class="part-top">
  55. <view class="time">
  56. {{item.startTime}}-{{item.endTime}}
  57. </view>
  58. <view class="price">
  59. <text class="price-number">{{item.electricityPrice}}</text>
  60. <text class="price-unit">元/度</text>
  61. </view>
  62. </view>
  63. <view class="part-bottom">
  64. <view class="unitPrice-servicePrice">
  65. 充电单价:¥{{item.costPrice}} | 服务费:¥{{item.servicePrice}}
  66. </view>
  67. </view>
  68. </view>
  69. <view style="
  70. text-align: center;
  71. color: #999999;
  72. ">*充电费用仅供参考,请以充电桩上的费用为准。</view>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 底部按钮 -->
  77. </view>
  78. </template>
  79. <script>
  80. import * as API from '@/apis/finance.js'
  81. export default {
  82. data() {
  83. return {
  84. id:'',
  85. carPrices: [],
  86. device: [],
  87. prices: null,
  88. description: '温馨提示:充电前请确保您的车辆已与充电桩连接!并关闭车内电源。'
  89. }
  90. },
  91. onLoad(op) {
  92. if(op){
  93. this.id=op.id
  94. this.getInfo()
  95. }
  96. },
  97. onReady() {
  98. },
  99. methods: {
  100. getInfo(){
  101. uni.showLoading({
  102. title: "加载中",
  103. mask: true,
  104. })
  105. API.priceList({
  106. deviceNo:this.id
  107. }).then((res) => {
  108. this.carPrices=res.data.carPrices
  109. this.device=res.data.device
  110. this.prices=res.data.prices
  111. uni.hideLoading()
  112. }).catch(error => {
  113. uni.showToast({
  114. title: error
  115. })
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. // 头部
  123. .title {
  124. width: 100%;
  125. line-height: 44px;
  126. background-color: rgba(255, 255, 255, 100);
  127. text-align: center;
  128. border: 1px solid rgba(242, 242, 242, 100);
  129. position: fixed;
  130. top: 0;
  131. }
  132. .title-left,.title-right{
  133. font-size: 18px;
  134. }
  135. // 主体
  136. .main {
  137. width: 100%;
  138. //margin-top: 44px;
  139. // margin-bottom: 64px;
  140. //padding-bottom: 234px;
  141. .main-detail {
  142. display: flex;
  143. justify-content: space-between;
  144. padding: 14px 16px 0 0;
  145. height: 48px;
  146. line-height: 48px;
  147. background-color: #fff;
  148. border-bottom: 1px solid rgba(242, 242, 242, 100);
  149. .detail-name {
  150. margin-left: 16px;
  151. height: 20px;
  152. line-height: 23px;
  153. color: rgba(102, 102, 102, 100);
  154. font-size: 14px;
  155. }
  156. .detail-content {
  157. height: 23px;
  158. line-height: 23px;
  159. color: rgba(51, 51, 51, 100);
  160. font-size: 14px;
  161. }
  162. }
  163. // 收费标准
  164. .rates {
  165. width: 100%;
  166. background-color: #fff;
  167. margin-top: 12px;
  168. .rates-title {
  169. display: flex;
  170. justify-content: space-between;
  171. height: 48px;
  172. line-height: 48px;
  173. padding: 0px 16px 0;
  174. border-bottom: 1px solid rgba(242, 242, 242, 100);
  175. }
  176. .time-part {
  177. width: 100%;
  178. .part-top {
  179. display: flex;
  180. justify-content: space-between;
  181. padding: 16px;
  182. .time {
  183. font-weight: bold;
  184. color: rgba(16, 16, 16, 100);
  185. font-size: 18px;
  186. }
  187. .price {
  188. .price-number {
  189. color: rgba(255, 61, 0, 100);
  190. font-size: 24px;
  191. text-align: right;
  192. font-family: Roboto-regular;
  193. display: inline-block;
  194. height: 20px;
  195. font-weight: 600;
  196. }
  197. .price-unit {
  198. color: rgba(102, 102, 102, 100);
  199. font-size: 16px;
  200. text-align: right;
  201. margin-left: 4px;
  202. display: inline-block;
  203. height: 20px;
  204. }
  205. }
  206. }
  207. .part-bottom {
  208. .unitPrice-servicePrice {
  209. eight: 18px;
  210. color: rgba(136, 136, 136, 100);
  211. font-size: 18px;
  212. text-align: right;
  213. padding-right: 16px;
  214. padding-bottom: 18px;
  215. }
  216. }
  217. }
  218. }
  219. .tips {
  220. font-size: 12px;
  221. margin-top: 24px;
  222. /deep/.u-alert-desc[data-v-4d234687] {
  223. font-size: 12px
  224. }
  225. }
  226. }
  227. // 尾部
  228. .bottom {
  229. background-color: #fff;
  230. width: 100%;
  231. height: 64px;
  232. line-height: 64px;
  233. position: fixed;
  234. bottom: 0;
  235. left: 0;
  236. z-index: 999;
  237. padding: 12px 16px;
  238. .botton {
  239. width: 343px;
  240. height: 40px;
  241. line-height: 40px;
  242. border-radius: 50px;
  243. background-color: rgba(0, 185, 98, 100);
  244. color: rgba(255, 255, 255, 100);
  245. font-size: 16px;
  246. text-align: center;
  247. margin: 0 auto;
  248. }
  249. }
  250. </style>