dcCharging.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <view style="background-color: #fff; padding-bottom: 40px;">
  3. <u-navbar title="启动中">
  4. </u-navbar>
  5. <view class="iconfont tittle-font">
  6. &#xe616;
  7. </view>
  8. <view class="progress-bar">
  9. <u-circle-progress width="440" active-color="green" :percent="30" border-width="50">
  10. <view class="u-progress-content">
  11. <view class="u-progress-dot"></view>
  12. <text class='u-progress-info'>0.0%</text>
  13. </view>
  14. <view class="bot"></view>
  15. </u-circle-progress>
  16. </view>
  17. <view class="starting">
  18. 启动中...</view>
  19. <view class="timer">
  20. 00:00:00
  21. </view>
  22. <view class="charged">
  23. 已充电0度
  24. </view>
  25. <view class="cost">
  26. <view class="">
  27. <view class="cost-top">
  28. 0元
  29. </view>
  30. <view class="cost-bottom">
  31. 实时费用
  32. </view>
  33. </view>
  34. <view class="line"></view>
  35. <view class="">
  36. <view class="cost-top">
  37. 50.00元
  38. <view class="iconfont cost-font">&#xe633;</view>
  39. </view>
  40. <view class="cost-bottom">
  41. 账户余额
  42. </view>
  43. </view>
  44. </view>
  45. <view class="power">
  46. <view>
  47. <view class="power-num">
  48. 0.0v
  49. </view>
  50. <view class="power-text">
  51. 电压
  52. </view>
  53. </view>
  54. <view class="line"></view>
  55. <view>
  56. <view class="power-num">
  57. 0.00kW
  58. </view>
  59. <view class="power-text">
  60. 功率
  61. </view>
  62. </view>
  63. <view class="line"></view>
  64. <view>
  65. <view class="power-num">
  66. 0.0A
  67. </view>
  68. <view class="power-text">
  69. 电流
  70. </view>
  71. </view>
  72. </view>
  73. <view class="info">
  74. <view class="info-name">
  75. 充电车辆
  76. </view>
  77. <view class="info-text">
  78. 鄂D999999
  79. </view>
  80. </view>
  81. <view class="info">
  82. <view class="info-name">
  83. 站点
  84. </view>
  85. <view class="info-text">
  86. 荆鹏软件充电站 / A000152
  87. </view>
  88. </view>
  89. <view class="info">
  90. <view class="info-name">
  91. 占位费说明
  92. </view>
  93. <view class="info-text">
  94. 停止充电后30分钟即开始收取占位费用,1元/分钟
  95. </view>
  96. </view>
  97. <view class="bottom">
  98. <u-button type="primary" shape="circle">结束充电</u-button>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import * as API from '@/apis/chargeProcess.js'
  104. export default {
  105. data() {
  106. return {
  107. id:"",
  108. detail: {},
  109. }
  110. },
  111. onLoad(op) {
  112. if (op.id) {
  113. this.id = op.id;
  114. this.getInfo()
  115. }
  116. },
  117. onReady() {
  118. },
  119. methods: {
  120. getInfo() {
  121. uni.showLoading({
  122. title: "加载中",
  123. mask: true,
  124. })
  125. API.chargingDetail({
  126. id:this.id
  127. }).then((res) => {
  128. this.user = res.data
  129. this.isReady = true;
  130. uni.hideLoading()
  131. }).catch(error => {
  132. uni.showToast({
  133. title: error
  134. })
  135. })
  136. },
  137. submit() {
  138. if(this.moneyActiveClass==-1&&!this.otherNum){
  139. this.submitForm.chargeStrategy=0;
  140. this.submitForm.amount=0
  141. }else{
  142. this.submitForm.chargeStrategy=2;
  143. if(this.otherNum){
  144. this.submitForm.amount=this.otherNum
  145. }else{
  146. this.submitForm.amount=this.moneyActiveClass
  147. }
  148. }
  149. if (!this.submitForm.channelNo) {
  150. uni.showToast({
  151. title: '请先选择充电通道'
  152. })
  153. return
  154. }
  155. if (this.submitForm.chargeStrategy == 0 && this.user.balance < 5) {
  156. uni.showModal({
  157. title: '支付',
  158. content: '余额不足5元无法开启充满自停,是否充值?',
  159. success: res => {
  160. if (res.confirm) {
  161. //付钱 改为组件
  162. this.gotoUrl("pages/user/finance/recharge");
  163. } else if (res.cancel) {
  164. console.log('用户点击取消');
  165. }
  166. }
  167. });
  168. } else {
  169. this.confirm()
  170. }
  171. },
  172. }
  173. }
  174. </script>
  175. <style>
  176. page{
  177. background: #fff;
  178. }
  179. </style>
  180. <style lang="scss" scoped>
  181. .tittle-font {
  182. font-size: 24px;
  183. position: fixed;
  184. top: 12px;
  185. right: 16px;
  186. z-index: 99999;
  187. }
  188. .bot{
  189. width: 220px;
  190. height: 220px;
  191. border: 2px #00b962 dotted;
  192. border-radius: 999px;
  193. position: absolute;
  194. top: 0px;
  195. left: 0px;
  196. right: 0px;
  197. margin: auto;
  198. }
  199. .progress-bar{
  200. /deep/.u-circle-progress{
  201. margin-left: 23.3% !important;
  202. position: relative;
  203. }
  204. .u-progress-content {
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. }
  209. .u-progress-dot {
  210. width: 16rpx;
  211. height: 16rpx;
  212. border-radius: 50%;
  213. background-color: #fb9126;
  214. }
  215. .u-progress-info {
  216. font-size: 36px;
  217. padding-left: 16rpx;
  218. letter-spacing: 2rpx;
  219. color: rgba(51, 51, 51, 100);
  220. }
  221. /deep/.u-progress-dot[data-v-05b104e0]{
  222. display: none;
  223. }
  224. /deep/.u-circle-progress[data-v-cab6fc66]{
  225. margin: 30px ;
  226. }
  227. }
  228. .starting{
  229. height: 22px;
  230. color: rgba(0, 185, 98, 100);
  231. font-size: 16px;
  232. text-align: center;
  233. }
  234. .timer{
  235. height: 43px;
  236. color: rgba(51, 51, 51, 100);
  237. font-size: 36px;
  238. text-align: center;
  239. margin-top: 40px;
  240. }
  241. .charged{
  242. height: 20px;
  243. color: rgba(153, 153, 153, 100);
  244. font-size: 14px;
  245. text-align: center;
  246. margin-top: 4px;
  247. }
  248. .cost{
  249. // width: 50%;
  250. padding: 0 90px;
  251. margin-top: 16px;
  252. display: flex;
  253. justify-content: space-between;
  254. .cost-top{
  255. line-height: 33px;
  256. text-align: center;
  257. font-size: 24px;
  258. position: relative;
  259. .cost-font{
  260. position: absolute;
  261. top: 0;right: -25px;
  262. color: #ff6200;
  263. font-size: 24px
  264. }
  265. }
  266. .cost-bottom{
  267. line-height: 20px;
  268. color: #999999;text-align: center;
  269. }
  270. }
  271. .line{
  272. width: 0;
  273. height:36px;
  274. border: 1px solid rgba(237, 237, 237, 100);
  275. margin-top: 10px;
  276. background-color: #ededed;
  277. }
  278. .power{
  279. display: flex;
  280. justify-content: space-around;
  281. padding: 0 55px;
  282. margin-top: 40px;
  283. .power-num{
  284. height: 27px;
  285. color: rgba(51, 51, 51, 100);
  286. font-size: 20px;
  287. text-align: center;
  288. }
  289. .power-text{
  290. height: 20px;
  291. color: rgba(153, 153, 153, 100);
  292. font-size: 14px;
  293. text-align: center;
  294. }
  295. }
  296. .info{
  297. display: flex;
  298. justify-content: space-between;
  299. margin: 0 40px;
  300. // height: 48px;
  301. line-height: 48px;
  302. background-color: rgba(255, 255, 255, 100);
  303. color: rgba(16, 16, 16, 100);
  304. border-bottom: 1px solid #ededed;
  305. .info-text{
  306. line-height: 23px;
  307. padding: 13px 0 12px;
  308. width: 200px;
  309. text-align: right;
  310. }
  311. }
  312. .bottom{
  313. width: 343px;
  314. position: fixed;
  315. bottom: 0;
  316. left: 0;
  317. right: 0;
  318. margin: auto;
  319. .u-btn--primary[data-v-3bf2dba7]{
  320. background-color: #9be6c2;
  321. }
  322. }
  323. </style>