dcCharging.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471
  1. <template>
  2. <view>
  3. <view v-if="chargingRecord.status==2" style="background-color: #fff; " >
  4. <ujp-navbar title="充电结束">
  5. </ujp-navbar>
  6. <view class="progress-bar2">
  7. <u-circle-progress width="300" active-color="green" duration='20' :percent="100" border-width="20">
  8. <view class="u-progress-content">
  9. <text class='u-progress-info' v-if="chargingGun.gunType==1">
  10. <p style="text-align: center;">{{chargingRecord.endSoc}}%</p>
  11. <p class="progress-text">当前电量</p>
  12. </text>
  13. <text class='u-progress-info' v-if="chargingGun.gunType==2">
  14. <p style="text-align: center;">{{chargingRecord.electricQuantity/10000}}</p>
  15. <p class="progress-text">已充电量(度)</p>
  16. </text>
  17. </view>
  18. </u-circle-progress>
  19. </view>
  20. <!-- 充电信息 -->
  21. <!-- <view class="charge-infos">
  22. <view class="item">
  23. <view class="title">
  24. 充电金额
  25. </view>
  26. <view class="content">
  27. 50.00
  28. </view>
  29. </view>
  30. <view class="item">
  31. <view class="title">
  32. 充电时长
  33. </view>
  34. <view class="content">
  35. 00.00.00
  36. </view>
  37. </view>
  38. <view class="item">
  39. <view class="title">
  40. 优惠金额
  41. </view>
  42. <view class="content discounts">
  43. -6.00元
  44. </view>
  45. </view>
  46. <view class="item">
  47. <view class="title">
  48. 会员活动
  49. </view>
  50. <view class="content">
  51. 充电服务费包月卡
  52. </view>
  53. </view>
  54. </view> -->
  55. <view class="info" >
  56. <view class="info-name">
  57. 充电时长
  58. </view>
  59. <view class="info-text">
  60. {{getPercent2()}}
  61. </view>
  62. </view>
  63. <view class="info" >
  64. <view class="info-name">
  65. 充电金额
  66. </view>
  67. <view class="info-text">
  68. {{chargingRecord.actualFee}}元
  69. </view>
  70. </view>
  71. <view class="info" v-if="chargingRecord.discountAmount">
  72. <view class="info-name">
  73. 优惠金额
  74. </view>
  75. <view class="info-text" style="color:red">
  76. {{chargingRecord.discountAmount}}元
  77. </view>
  78. </view>
  79. <view class="info" v-if="chargingRecord.remark">
  80. <view class="info-name">
  81. 结束原因
  82. </view>
  83. <view class="info-text" style="color: red;" >
  84. {{chargingRecord.remark}}
  85. </view>
  86. </view>
  87. <!--
  88. <view
  89. style="
  90. margin-top: 20px;
  91. text-align: center;
  92. padding: 0 45px;
  93. padding-bottom: 40px;
  94. color:#9e9e9e;
  95. ">
  96. <span style="color: red;">*</span>实际充电金额与所选金额会略有出入,最终结算金额将以实际充入电量为准。
  97. </view> -->
  98. <view class="bottom">
  99. <u-button size="default" style="background-color:#53b56b"
  100. shape="circle" @click="gotoMain(0)" >返回首页</u-button>
  101. <u-button style="background-color:#53b56b"
  102. size="default" shape="circle" @click="gotoMain(1)">查看订单详情</u-button>
  103. </view>
  104. <u-line color="#E6E6E6 100%" length="81%" margin="auto"/>
  105. <!-- 反馈 -->
  106. <view class="feedback">
  107. <view class="title-1">
  108. 您对本次充电服务还满意吗?
  109. </view>
  110. <view class="title-2">
  111. 请在下方描述您所遇到的问题,或填写您的反馈意见。我们将对优质内容的反馈者发放奖励!
  112. </view>
  113. <textarea value="" v-model="message" placeholder="请填写反馈内容" />
  114. <u-button class="submit" type="success" @click="submitMessage()">提交</u-button>
  115. </view>
  116. <u-line color="#E6E6E6 100%" length="81%" margin="auto"/>
  117. <view class="info" >
  118. <view class="info-name">
  119. 优惠券
  120. </view>
  121. <view class="info-text" style="color:red">
  122. {{couponObj&&couponObj.status=='1'?couponObj.text:'未使用'}}
  123. </view>
  124. </view>
  125. <view class="info" v-if="userCardBool" >
  126. <view class="info-name">
  127. 会员活动
  128. </view>
  129. <view class="info-text">
  130. 充电服务费包月卡
  131. </view>
  132. </view>
  133. <u-divider color="#B6BDC3" style="margin-bottom:20px;" bg-color="#ffffff">已经到底了</u-divider>
  134. <view>
  135. <u-toast ref="uToast" />
  136. </view>
  137. </view>
  138. <view style="background-color: #fff; padding-bottom: 0px;"
  139. class="progress-bar-main" v-else>
  140. <view>
  141. <ujp-navbar title="充电中">
  142. <view class="to-recharge" @click="gotoUrl('pages/user/finance/recharge')">
  143. 去充值
  144. </view>
  145. </ujp-navbar>
  146. <!-- 充电状态 -->
  147. <view class="charge-state">
  148. <view class="progress-bar">
  149. <u-circle-progress width="440" active-color="#53b56b" :percent="percent?percent:percentValue" border-width="35">
  150. <view class="u-progress-content" v-if="chargingRecord.status==4">
  151. <text class='u-progress-info' v-if="waitNum==1">排队中</text>
  152. <text class='u-progress-info' v-else >前方等待{{waitNum-1}}位</text>
  153. </view>
  154. <view class="u-progress-content" v-else>
  155. <text class='u-progress-info' >
  156. <view v-if="chargingGun.gunType==1" style="
  157. font-size: 40px;
  158. font-weight: bold;
  159. color: #009B52 ;
  160. " >{{percent}}<span style="font-size: 16px;">%</span></view>
  161. <view v-if="chargingGun.gunType==2"
  162. style="
  163. font-size: 30px;
  164. font-weight: bold;
  165. color: #009B52 ;
  166. "
  167. >{{chargingRecord.statusText}}</view>
  168. <view style="
  169. font-size: 16px;
  170. font-weight: bold;
  171. " >已充费用{{chargingRecord.dueFee?chargingRecord.dueFee:0}}元</view>
  172. </text>
  173. </view>
  174. <view class="bot"></view>
  175. </u-circle-progress>
  176. </view>
  177. <!-- <view class="img">
  178. <img src="../../../assets/img/Group (2).png" alt="">
  179. </view>
  180. <view class="state-infos">
  181. <view class="state">
  182. <text><img src="../../../assets/img/if-flash.svg" alt=""></text>充电中...
  183. </view>
  184. <view class="electric-quantity">
  185. <p>当前电量</p>
  186. <view class="percent">
  187. 60<text>%</text>
  188. </view>
  189. </view>
  190. <view class="charge-time">
  191. <p>充电时长</p>
  192. <view class="time">
  193. 00:24:01
  194. </view>
  195. </view>
  196. </view> -->
  197. </view>
  198. <!-- 充电信息 -->
  199. <view class="charge-info">
  200. <view class="info-item">
  201. <view class="content">
  202. {{timer}}
  203. </view>
  204. <view class="name">
  205. 充电时长
  206. </view>
  207. </view>
  208. <view class="info-item">
  209. <view class="content">
  210. {{chargingGun.kwh}}
  211. </view>
  212. <view class="name">
  213. 已充电量(度)
  214. </view>
  215. </view>
  216. <view class="info-item">
  217. <view class="content">
  218. {{detail.balance>0&&chargingRecord.dueFee?(detail.balance*1000-chargingRecord.dueFee*1000)/1000:detail.balance}}
  219. </view>
  220. <view class="name">
  221. 账户余额(元)
  222. </view>
  223. </view>
  224. </view>
  225. <!-- 其他信息 -->
  226. <view class="else-infos">
  227. <view class="item">
  228. <view class="title">
  229. 充电车辆
  230. </view>
  231. <view class="detail">
  232. {{chargingRecord.carNumber}}
  233. </view>
  234. </view>
  235. <view class="item">
  236. <view class="title">
  237. <p class="price">当前价格</p>
  238. <p class="time">{{price.startTime}}-{{price.endTime}}</p>
  239. </view>
  240. <view class="detail">
  241. <p class="electrovalence"><text class="num">{{chargingRecord.userCardId?price.electricityPrice:price.costPrice}}</text> 元/度</p>
  242. <p class="electrovalence-monthlyCard">电价:{{price.electricityPrice}} | 服务费:{{chargingRecord.userCardId?0+'(包月卡)':price.servicePrice}}</p>
  243. </view>
  244. </view>
  245. <view class="item">
  246. <view class="title">
  247. {{chargingRecord.chargeStrategy==0?'充电模式':''}}
  248. {{chargingRecord.chargeStrategy==2?'充电金额':''}}
  249. </view>
  250. <view class="detail">
  251. {{chargingRecord.chargeStrategy==0?'充满自停':''}}
  252. {{chargingRecord.chargeStrategy==2?chargingRecord.estimateFee+'元':''}}
  253. </view>
  254. </view>
  255. <view class="item">
  256. <view class="title">
  257. 优惠券
  258. </view>
  259. <view class="detail">
  260. {{couponObj&&couponObj.useText?couponObj.useText:'未使用优惠券'}}
  261. </view>
  262. </view>
  263. <view class="item" v-if="userCardBool" >
  264. <view class="title">
  265. 会员活动
  266. </view>
  267. <view class="detail">
  268. 充电免服务费包月卡
  269. </view>
  270. </view>
  271. <view class="item">
  272. <view class="title">
  273. 站点
  274. </view>
  275. <view class="detail">
  276. {{chargingRecord.stationName}}
  277. <br/>{{chargingRecord.deviceName}}
  278. </view>
  279. </view>
  280. <view class="item" v-if="false">
  281. <view class="title">
  282. 占位费说明
  283. </view>
  284. <view class="detail">
  285. 停止充电后30分钟即开始收取占位费用,1元/分钟
  286. </view>
  287. </view>
  288. </view>
  289. <view class="bottom">
  290. <view class="img-box" @click="show = true">
  291. <img src="../../../assets/img/customer-service-2-line.svg" alt="">
  292. </view>
  293. <button
  294. :style="(chargingRecord.status=='0'||chargingRecord.status=='1'||chargingRecord.status=='4')?'':'background-color: #b3abab;'"
  295. style="width: 80%;"
  296. @click="submit" >结束充电</button>
  297. <view class="img-box" v-if="false">
  298. <img src="../../../assets/img/tools-fill.svg" alt="">
  299. </view>
  300. </view>
  301. <u-modal v-model="show" @confirm="confirmPhone"
  302. :confirm-text="confirmText" confirm-color="#606266"
  303. :show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="consumerPhone">
  304. </u-modal>
  305. <u-modal v-model="show2" @confirm="gotoGz"
  306. cancel-text="暂不关注" @cancel="cancelGz"
  307. confirm-text="前往关注"
  308. confirm-color="#53b56b"
  309. :show-cancel-button="true"
  310. ref="uModal2" :asyncClose="true"
  311. >
  312. <view style="padding: 15px;"
  313. >请关注<span style=" color: #53b56b;">{{projectName}}</span>公众号,以便第一时间收到充电结束消息提醒</view>
  314. </u-modal>
  315. </view>
  316. <view v-if="false">
  317. <ujp-navbar title="充电详情">
  318. </ujp-navbar>
  319. <view class="iconfont tittle-font" @click="show = true">
  320. &#xe616;
  321. </view>
  322. <view class="progress-bar">
  323. <u-circle-progress width="440" active-color="green" :percent="percent?percent:percentValue" border-width="50">
  324. <view class="u-progress-content" v-if="chargingRecord.status==4">
  325. <text class='u-progress-info' v-if="waitNum==1">排队中</text>
  326. <text class='u-progress-info' v-else >前方等待{{waitNum-1}}位</text>
  327. </view>
  328. <view class="u-progress-content" v-else-if="chargingGun.gunType==1">
  329. <text class='u-progress-info'>{{percent}}%</text>
  330. </view>
  331. <view class="u-progress-content" v-else-if="chargingGun.gunType==2">
  332. <text class='u-progress-info'>{{chargingRecord.statusText}}...</text>
  333. </view>
  334. <view class="bot"></view>
  335. </u-circle-progress>
  336. </view>
  337. <view class="starting" v-if="chargingGun.gunType==1">
  338. <span v-if="chargingRecord.status==4">
  339. 可用功率不足,您可以换桩或继续排队等待...
  340. </span>
  341. <span v-else>
  342. {{chargingRecord.statusText}}...
  343. </span>
  344. </view>
  345. <view class="timer">
  346. {{timer}}
  347. </view>
  348. <view class="charged">
  349. 已充电{{chargingGun.kwh}}度
  350. </view>
  351. <view class="cost">
  352. <view class="">
  353. <view class="cost-top">
  354. {{chargingRecord.dueFee?chargingRecord.dueFee:0}}元
  355. </view>
  356. <view class="cost-bottom " >
  357. 实时费用
  358. </view>
  359. </view>
  360. <view class="line"></view>
  361. <view class="">
  362. <view class="cost-top">
  363. {{detail.balance>0?detail.balance:0}}元
  364. <view class="iconfont cost-font" @click="gotoUrl('pages/user/finance/recharge')" >&#xe633;</view>
  365. </view>
  366. <view class="cost-bottom">
  367. 账户余额
  368. </view>
  369. </view>
  370. </view>
  371. <view class="power">
  372. <view>
  373. <view class="power-num">
  374. {{chargingRecord.chargeVoltage?chargingRecord.chargeVoltage:0}}v
  375. </view>
  376. <view class="power-text">
  377. 电压
  378. </view>
  379. </view>
  380. <view class="line"></view>
  381. <view>
  382. <view class="power-num">
  383. {{chargingRecord.chargingPower?chargingRecord.chargingPower/1000:0}}kW
  384. </view>
  385. <view class="power-text">
  386. 功率
  387. </view>
  388. </view>
  389. <view class="line"></view>
  390. <view>
  391. <view class="power-num">
  392. {{chargingRecord.chargeAmpere?chargingRecord.chargeAmpere:0}}A
  393. </view>
  394. <view class="power-text">
  395. 电流
  396. </view>
  397. </view>
  398. </view>
  399. <view class="info" >
  400. <view class="info-name">
  401. {{chargingRecord.chargeStrategy==0?'充电模式':''}}
  402. {{chargingRecord.chargeStrategy==2?'充电金额':''}}
  403. </view>
  404. <view class="info-text" >
  405. {{chargingRecord.chargeStrategy==0?'充满自停':''}}
  406. {{chargingRecord.chargeStrategy==2?chargingRecord.estimateFee+'元':''}}
  407. </view>
  408. </view>
  409. <view class="info" >
  410. <view class="info-name">
  411. 优惠券
  412. </view>
  413. <view class="info-text" style="color:red">
  414. {{couponObj&&couponObj.useText?couponObj.useText:'未使用'}}
  415. </view>
  416. </view>
  417. <view class="info" v-if="chargingRecord.carNumber">
  418. <view class="info-name">
  419. 充电车辆
  420. </view>
  421. <view class="info-text">
  422. {{chargingRecord.carNumber}}
  423. </view>
  424. </view>
  425. <view class="info">
  426. <view class="info-name">
  427. 站点
  428. </view>
  429. <view class="info-text">
  430. {{chargingRecord.stationName}}
  431. </view>
  432. </view>
  433. <view class="info">
  434. <view class="info-name">
  435. 充电桩
  436. </view>
  437. <view class="info-text">
  438. {{chargingRecord.deviceName}}枪{{chargingRecord.channelNo}}
  439. </view>
  440. </view>
  441. <view class="info" v-if="price" style="line-height: 23px;">
  442. <view class="info-text" style="text-align: left;" >
  443. <view style="font-weight: bold;font-size: 20px;">当前价格</view>
  444. <view class="info-name2" >
  445. {{price.startTime}}-{{price.endTime}}
  446. </view>
  447. </view>
  448. <view class="info-text" style="line-height: 23px;">
  449. <view><span style="color: #FF3D00;font-size: 20px;"><b>{{price.costPrice}}</b></span>元/度</view>
  450. <view class="info-name2">
  451. 电价:{{price.electricityPrice}}元 | 服务费:{{price.servicePrice}}元
  452. </view>
  453. </view>
  454. </view>
  455. <view class="bottom2" >
  456. <u-button type="primary" @click="submit"
  457. :style="(chargingRecord.status==0||chargingRecord.status==1||chargingRecord.status==4)?'background-color: #00b962':'background-color: #9be6c2;'"
  458. shape="circle" >结束充电</u-button>
  459. </view>
  460. <u-modal v-model="show" @confirm="confirmPhone"
  461. :confirm-text="confirmText" confirm-color="#606266"
  462. :show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="consumerPhone">
  463. </u-modal>
  464. <u-modal v-model="show2" @confirm="gotoGz"
  465. cancel-text="暂不关注" @cancel="cancelGz"
  466. confirm-text="前往关注"
  467. confirm-color="#53b56b"
  468. :show-cancel-button="true"
  469. ref="uModal2" :asyncClose="true"
  470. >
  471. <view style="padding: 15px;"
  472. >请关注<span style=" color: #53b56b;">{{projectName}}</span>公众号,以便第一时间收到充电结束消息提醒</view>
  473. </u-modal>
  474. </view>
  475. </view>
  476. </view>
  477. </template>
  478. <script>
  479. var formatNum=function(num) {
  480. let res = Number(num);
  481. return res < 10 ? '0' + res : res;
  482. };
  483. import * as api from "@/apis/site.js"
  484. import * as API from '@/apis/chargeProcess.js'
  485. import * as API_weixin from '@/apis/weixin.js'
  486. import * as userAPI from '@/apis/user.js'
  487. import {
  488. newDate,
  489. secondsDistance,
  490. hourDistanceArr
  491. } from '@/utils'
  492. export default {
  493. data() {
  494. return {
  495. message: '',
  496. elderMode:false,
  497. timer:'',
  498. title: '联系客服',
  499. content: '0716-8123456',
  500. confirmText: '拨打电话',
  501. detail:{},
  502. percent: 0,
  503. percentValue: 0,
  504. show3:false,
  505. consumerPhone: "",
  506. id: "",
  507. chargingGun: {},
  508. chargingRecord: {},
  509. couponObj:{},
  510. show: false,
  511. show2: false,
  512. isReady:true,
  513. waitNum:'',
  514. projectName:"",
  515. userCard:null,
  516. price:null,
  517. prices:[],
  518. }
  519. },
  520. onLoad(op) {
  521. this.projectName=process.car.ProjectName;
  522. var plus=this.carhelp.getPersonInfoPlus()
  523. if(plus){
  524. this.userCard=plus.userCard;
  525. }
  526. if (op.id) {
  527. this.id = op.id;
  528. this.init()
  529. this.getInfo()
  530. }
  531. var consumerPhone = this.carhelp.getConfig().consumerPhone
  532. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  533. if (consumerPhone) {
  534. this.consumerPhone = consumerPhone
  535. }
  536. },
  537. onShow() {
  538. if(!this.isReady){
  539. this.isReady=true;
  540. this.addpercent();
  541. this.getInfo()
  542. }
  543. },
  544. onHide() {
  545. this.isReady=false;
  546. console.log("onHide")
  547. },
  548. onUnload() {
  549. console.log("onUnload")
  550. this.isReady=false;
  551. },
  552. onReady() {
  553. this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
  554. if(this.elderMode)
  555. this.theme('elder')
  556. else
  557. this.theme('standard')
  558. this.addpercent()
  559. },
  560. computed:{
  561. userCardBool(){
  562. if(this.chargingRecord&&this.chargingRecord.userCardId){
  563. return true;
  564. }
  565. return false
  566. }
  567. },
  568. methods: {
  569. forPrice(){
  570. if(this.prices&&this.prices.length){
  571. let date = new Date();
  572. let hours = date.getHours();
  573. let minutes = date.getMinutes();
  574. let seconds = date.getSeconds();
  575. let date_str = formatNum(hours)+ ':'+ formatNum(minutes);//+ ' ' +formatWeek;
  576. for(var i in this.prices[0].priceList){
  577. var item=this.prices[0].priceList[i];
  578. if(date_str>=item.startTime && date_str<= item.endTime)
  579. {
  580. this.price= item
  581. }
  582. }
  583. }
  584. },
  585. getChargingStationPrice(id){
  586. if(this.prices&&this.prices.length){
  587. this.forPrice()
  588. return
  589. }
  590. if(!id||id==undefined){
  591. return
  592. }
  593. //id='e012f9fe-90a8-4a47-bb64-26ea139c3c05'
  594. api.getChargingStationPrice({
  595. stationId:id
  596. }).then((res)=>{
  597. this.prices=res.data.prices
  598. this.forPrice()
  599. }).catch(error => {
  600. uni.showToast({
  601. title: error
  602. })
  603. })
  604. },
  605. showToast() {
  606. this.$refs.uToast.show({
  607. title: '提交成功',
  608. type: 'success'
  609. })
  610. },
  611. submitMessage() {
  612. if(!this.message) {
  613. uni.showToast({
  614. title: "请填写反馈内容",
  615. icon: "none"
  616. })
  617. return
  618. }
  619. uni.showLoading({
  620. title: "加载中",
  621. mask: true,
  622. })
  623. userAPI.feedback({content: this.message}).then(response => {
  624. uni.hideLoading()
  625. this.message = '';
  626. this.showToast();
  627. }).catch(error => {
  628. uni.showToast({
  629. title: error
  630. })
  631. })
  632. },
  633. theme(type) {
  634. if(type == 'elder')
  635. {
  636. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  637. }
  638. else
  639. {
  640. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  641. }
  642. },
  643. cancelGz(){
  644. this.carhelp.setGzDate()
  645. },
  646. gotoGz(){
  647. this.carhelp.setGzDate()
  648. var url="https://mp.weixin.qq.com/s/mCHz1nNvg0xAICiBeIyKRQ";
  649. window.location.href=url
  650. },
  651. gotoMain(i){
  652. if(i==0){
  653. uni.reLaunch({
  654. url:"/pages/index/index"
  655. })
  656. }
  657. if(i==1){
  658. uni.navigateTo({
  659. url:"/pages/record/details?id="+this.id
  660. })
  661. }
  662. },
  663. addpercent(){
  664. this.timer=this.getPercent()
  665. if(this.isReady){
  666. setTimeout(()=>{
  667. this.percentValue++;
  668. if(this.percentValue>=100){
  669. this.percentValue=0;
  670. }
  671. this.addpercent()
  672. },100)
  673. }
  674. },
  675. getPercent2() {
  676. var ms=this.chargingRecord.chargingMinute*60;
  677. var Hour = parseInt(Math.floor(ms / (60 * 60)));
  678. var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
  679. var S = parseInt(Math.floor(ms % (60) ));
  680. var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen+ ":" + (S > 9 ? "" : "0") + S
  681. return obj;
  682. },
  683. getPercent() {
  684. if(!this.chargingRecord.startTime){
  685. return '00:00:00'
  686. }
  687. var Hour=0;
  688. var Fen=0;
  689. var S=0;
  690. if (this.chargingRecord.status == 1) {
  691. var second = secondsDistance(newDate(this.chargingRecord.startTime));
  692. var ms=second;
  693. Hour = parseInt(Math.floor(ms / (60 * 60)));
  694. Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
  695. S = parseInt(Math.floor(ms % (60) ));
  696. }
  697. var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen+ ":" + (S > 9 ? "" : "0") + S
  698. return obj;
  699. },
  700. init() {
  701. API.personalCenter().then((res) => {
  702. this.detail = res.data
  703. }).catch(error => {
  704. uni.showToast({
  705. title: error
  706. })
  707. })
  708. },
  709. checkSubscribe(){
  710. API_weixin.checkSubscribe({
  711. openId: this.carhelp.getOpenId()
  712. }).then((res) => {
  713. if(res.data=="0"){
  714. this.show2=true;
  715. }else{
  716. this.carhelp.setGzDate()
  717. }
  718. //setGzDate
  719. }).catch(error => {
  720. uni.showToast({
  721. title: error
  722. })
  723. })
  724. },
  725. confirmPhone() {
  726. this.show = false;
  727. uni.makePhoneCall({
  728. phoneNumber: this.consumerPhone //仅为示例
  729. });
  730. },
  731. getInfo() {
  732. // uni.showLoading({
  733. // title: "加载中",
  734. // mask: true,
  735. // })
  736. API.chargingDetail({
  737. id: this.id
  738. }).then((res) => {
  739. this.chargingRecord = res.data.chargingRecord
  740. //(this.chargingRecord)
  741. this.couponObj= res.data.coupon
  742. this.chargingGun = res.data.chargingGun
  743. this.waitNum=res.data.chargingRecord.waitNum;
  744. this.getChargingStationPrice(this.chargingGun.stationId )
  745. //this.isReady = true;
  746. //直流
  747. if(this.chargingGun.gunType==1){
  748. if (this.chargingRecord.status == 1) {
  749. this.percent=this.chargingGun.soc
  750. }
  751. }else if(this.chargingGun.gunType==2){
  752. //交流
  753. }
  754. if (this.chargingRecord.status == 1) {
  755. if(this.carhelp.getGzDate()&&!this.show2){
  756. this.checkSubscribe()
  757. }
  758. }
  759. if(this.isReady&&this.chargingRecord.status!=2){
  760. var time=500;
  761. if(this.chargingRecord.status==0){
  762. }else{
  763. time=3000;
  764. this.init();
  765. }
  766. setTimeout(()=>{
  767. this.getInfo();
  768. },time)
  769. }
  770. uni.hideLoading()
  771. }).catch(error => {
  772. uni.showToast({
  773. title: error
  774. })
  775. })
  776. },
  777. submit() {
  778. if(this.chargingRecord.status==0||this.chargingRecord.status==1||this.chargingRecord.status==4){
  779. }else{
  780. return
  781. }
  782. uni.showModal({
  783. title: '提示',
  784. content: '确认结束充电?',
  785. success: res => {
  786. if (res.confirm) {
  787. //付钱 改为组件
  788. this.confirm()
  789. } else if (res.cancel) {
  790. //('用户点击取消');
  791. }
  792. }
  793. });
  794. },
  795. confirm() {
  796. ////(JSON.stringify(this.submitForm))
  797. uni.showLoading({
  798. title: "加载中",
  799. mask: true,
  800. })
  801. //this.submitForm.deviceNo = this.detail.deviceNo;
  802. API.stopCarCharging({
  803. chargingRecordId:this.chargingRecord.id
  804. }).then((res) => {
  805. this.getInfo()
  806. }).catch(error => {
  807. uni.showToast({
  808. title: error
  809. })
  810. })
  811. },
  812. }
  813. }
  814. </script>
  815. <style>
  816. page {
  817. background: #fff;
  818. padding-bottom: 50px;
  819. }
  820. </style>
  821. <style lang="scss" scoped>
  822. .progress-bar-main{
  823. .info-name2{
  824. color: #777777 ;
  825. font-size:14px;
  826. }
  827. .info-name{
  828. font-weight:bold;
  829. font-size: 20px;
  830. }
  831. }
  832. @import "@/_theme.scss";
  833. .tittle-font {
  834. @include themeify{
  835. font-size: themed('font-size7');
  836. }
  837. /* font-size: 24px;*/
  838. position: fixed;
  839. top: 12px;
  840. right: 16px;
  841. z-index: 99999;
  842. }
  843. .bot {
  844. width:100%;
  845. height:0;
  846. padding-top: 100%;
  847. border: 2px #00b962 dotted;
  848. border-radius:100%;
  849. box-sizing: border-box;
  850. position: absolute;
  851. top: 0px;
  852. left: 0px;
  853. right: 0px;
  854. margin: auto;
  855. }
  856. .progress-bar {
  857. text-align: center;
  858. margin-top: 20px;
  859. /deep/.u-circle-progress {
  860. position: relative;
  861. // min-width:220px;
  862. // min-height: 220px;
  863. }
  864. .u-progress-content {
  865. display: flex;
  866. align-items: center;
  867. justify-content: center;
  868. }
  869. .u-progress-dot {
  870. width: 16rpx;
  871. height: 16rpx;
  872. border-radius: 50%;
  873. background-color: #fb9126;
  874. }
  875. .u-progress-info {
  876. @include themeify{
  877. font-size: themed('font-size6');
  878. }
  879. /* font-size: 22px;*/
  880. padding-left: 16rpx;
  881. letter-spacing: 2rpx;
  882. color: rgba(51, 51, 51, 100);
  883. }
  884. /deep/.u-progress-dot[data-v-05b104e0] {
  885. display: none;
  886. }
  887. /deep/.u-circle-progress[data-v-cab6fc66] {
  888. margin: 30px;
  889. }
  890. }
  891. .starting {
  892. /* height: 22px;*/
  893. color: rgba(0, 185, 98, 100);
  894. @include themeify{
  895. font-size: themed('font-size3');
  896. height:themed('font-size6');
  897. }
  898. /* font-size: 16px;*/
  899. text-align: center;
  900. margin-top: 10px;
  901. }
  902. .timer {
  903. height: 43px;
  904. color: rgba(51, 51, 51, 100);
  905. @include themeify{
  906. font-size: themed('font-size13');
  907. }
  908. /* font-size: 36px;*/
  909. text-align: center;
  910. margin-top: 40px;
  911. }
  912. .charged {
  913. /* height: 20px;*/
  914. color: rgba(153, 153, 153, 100);
  915. @include themeify{
  916. font-size: themed('font-size2');
  917. height:themed('font-size5')
  918. }
  919. /* font-size: 14px;*/
  920. text-align: center;
  921. margin-top: 4px;
  922. }
  923. .cost {
  924. // width: 50%;
  925. padding: 0 50px;
  926. margin-top: 16px;
  927. margin: auto;
  928. width: 280px;
  929. display: flex;
  930. justify-content: space-between;
  931. .cost-top {
  932. line-height: 33px;
  933. text-align: center;
  934. @include themeify{
  935. font-size: themed('font-size7');
  936. }
  937. /* font-size: 24px;*/
  938. position: relative;
  939. .cost-font {
  940. position: absolute;
  941. top: 0;
  942. right: -25px;
  943. color: #ff6200;
  944. @include themeify{
  945. font-size: themed('font-size7');
  946. }
  947. /* font-size: 24px*/
  948. }
  949. }
  950. .cost-bottom {
  951. @include themeify{
  952. line-height: themed('font-size5');
  953. }
  954. /* line-height: 20px;*/
  955. color: #999999;
  956. text-align: center;
  957. }
  958. }
  959. .line {
  960. width: 0;
  961. height: 36px;
  962. border: 1px solid rgba(237, 237, 237, 100);
  963. margin-top: 10px;
  964. background-color: #ededed;
  965. }
  966. .power {
  967. display: flex;
  968. justify-content: space-around;
  969. padding: 0 55px;
  970. margin-top: 40px;
  971. .power-num {
  972. /* height: 27px;*/
  973. color: rgba(51, 51, 51, 100);
  974. @include themeify{
  975. font-size: themed('font-size5');
  976. height: themed('font-size9');
  977. }
  978. /* font-size: 20px;*/
  979. text-align: center;
  980. }
  981. .power-text {
  982. /* height: 20px;*/
  983. color: rgba(153, 153, 153, 100);
  984. @include themeify{
  985. font-size: themed('font-size2');
  986. height: themed('font-size5');
  987. }
  988. /* font-size: 14px;*/
  989. text-align: center;
  990. }
  991. }
  992. .info {
  993. display: flex;
  994. justify-content: space-between;
  995. margin: 0 40px;
  996. // height: 48px;
  997. line-height: 48px;
  998. background-color: rgba(255, 255, 255, 100);
  999. color: rgba(16, 16, 16, 100);
  1000. border-bottom: 1px solid #ededed;
  1001. .info-text {
  1002. @include themeify{
  1003. line-height: themed('font-size7');
  1004. }
  1005. /* line-height: 23px;*/
  1006. padding: 13px 0 12px;
  1007. //width: 200px;
  1008. text-align: right;
  1009. }
  1010. }
  1011. .charge-infos{
  1012. padding: 20px 36px;
  1013. margin: 0 auto;
  1014. .item{
  1015. display: flex;
  1016. justify-content: space-between;
  1017. color: rgba(102, 102, 102, 100);
  1018. font-size: 18px;
  1019. margin-bottom: 12px;
  1020. .discounts{
  1021. color:red
  1022. }
  1023. }
  1024. }
  1025. .bottom2 {
  1026. padding: 12px 20px;
  1027. background-color: #fff;
  1028. position: fixed;
  1029. bottom: 0;
  1030. left: 0;
  1031. right: 0;
  1032. margin: auto;
  1033. }
  1034. .progress-bar2 {
  1035. text-align: center;
  1036. margin-top: 20px;
  1037. /deep/.u-circle-progress {
  1038. // margin-left: 23.3% !important;
  1039. position: relative;
  1040. }
  1041. .u-progress-content {
  1042. display: flex;
  1043. align-items: center;
  1044. justify-content: center;
  1045. }
  1046. .u-progress-dot {
  1047. width: 16rpx;
  1048. height: 16rpx;
  1049. border-radius: 50%;
  1050. background-color: #fb9126;
  1051. }
  1052. .u-progress-info {
  1053. display: block;
  1054. @include themeify{
  1055. font-size: themed('font-size11');
  1056. }
  1057. /* font-size: 32px;*/
  1058. padding-left: 16rpx;
  1059. letter-spacing: 2rpx;
  1060. color: rgba(51, 51, 51, 100);
  1061. .progress-text {
  1062. @include themeify{
  1063. font-size: themed('font-size2');
  1064. }
  1065. /* font-size: 14px;*/
  1066. text-align: center;
  1067. color: #666666;
  1068. }
  1069. }
  1070. /deep/.u-progress-dot[data-v-05b104e0] {
  1071. display: none;
  1072. }
  1073. /deep/.u-circle-progress[data-v-cab6fc66] {
  1074. margin: 30px;
  1075. }
  1076. }
  1077. .time-price {
  1078. display: flex;
  1079. justify-content: space-between;
  1080. padding: 0 65px;
  1081. .item-num {
  1082. /* height: 33px;*/
  1083. color: rgba(51, 51, 51, 100);
  1084. @include themeify{
  1085. font-size: themed('font-size7');
  1086. height:themed('font-size12')
  1087. }
  1088. /* font-size: 24px;*/
  1089. text-align: center;
  1090. }
  1091. .item-text {
  1092. eight: 20px;
  1093. color: rgba(153, 153, 153, 100);
  1094. @include themeify{
  1095. font-size: themed('font-size2');
  1096. }
  1097. /* font-size: 14px;*/
  1098. text-align: center;
  1099. }
  1100. }
  1101. // .bottom {
  1102. // background-color: #fff;
  1103. // display: flex;
  1104. // width: 91.4%;
  1105. // padding: 0 16px;
  1106. // margin:0 auto 40px;
  1107. // .u-size-default {
  1108. // border: 1px solid rgba(0, 185, 98, 100);
  1109. // color: #00b962;
  1110. // width: 44%;
  1111. // }
  1112. // }
  1113. // 反馈
  1114. .feedback{
  1115. padding: 20px 36px ;
  1116. .title-1{
  1117. color: rgba(16, 16, 16, 100);
  1118. font-size: 18px;
  1119. }
  1120. .title-2{
  1121. color: rgba(102, 102, 102, 100);
  1122. margin-top: 8px;
  1123. line-height: 20px;
  1124. }
  1125. textarea{
  1126. margin-top: 16px;
  1127. width: 93.5%;
  1128. height: 100px;
  1129. background-color: rgba(228, 228, 228, 100);
  1130. color: rgba(153, 153, 153, 100);
  1131. font-size: 16px;
  1132. border-radius: 12px;
  1133. padding: 12px;
  1134. line-height: 23px;
  1135. }
  1136. .submit{
  1137. height: 44px;
  1138. line-height: 26px;
  1139. border-radius: 50px;
  1140. background-color: rgba(0, 185, 98, 100);
  1141. color: rgba(255, 255, 255, 100);
  1142. font-size: 18px;
  1143. margin-top: 16px;
  1144. }
  1145. }
  1146. </style>
  1147. <style lang="scss" scoped>
  1148. page {
  1149. background-color: #f6f8f8;
  1150. padding-bottom: 60px;
  1151. }
  1152. .to-recharge{
  1153. position: absolute;
  1154. right: 22px;
  1155. color: #333333
  1156. }
  1157. // 充电状态
  1158. .charge-state {
  1159. width: 100%;
  1160. }
  1161. // 充电信息
  1162. .charge-info {
  1163. background-color: #ffffff;
  1164. width: 88.2%;
  1165. padding: 20px 10px 4px 7px;
  1166. margin: 24px auto 0;
  1167. box-shadow: 0px 2px 8px 0px #1A095A34;
  1168. border-radius: 12px;
  1169. display: flex;
  1170. flex-wrap: wrap;
  1171. justify-content: space-between;
  1172. .info-item {
  1173. width: 33%;
  1174. text-align: center;
  1175. margin-bottom: 14px;
  1176. .content {
  1177. line-height: 33px;
  1178. color: rgba(51, 51, 51, 100);
  1179. font-size: 24px;
  1180. font-weight: 550;
  1181. }
  1182. .name {
  1183. line-height: 22px;
  1184. color: rgba(119, 119, 119, 100);
  1185. font-size: 16px;
  1186. }
  1187. }
  1188. }
  1189. //其他信息
  1190. .else-infos {
  1191. padding: 0 12px;
  1192. background-color: #ffffff;
  1193. width: 88.2%;
  1194. margin: 16px auto 0;
  1195. border-radius: 12px;
  1196. .item{
  1197. display: flex;
  1198. justify-content: space-between;
  1199. line-height: 23px;
  1200. padding: 10px 0 10px 0;
  1201. border-bottom: 1px solid #E9EBEE;
  1202. .title{
  1203. // width: 100px;
  1204. width: 26.6vw;
  1205. color: rgba(16, 16, 16, 100);
  1206. font-size: 18px;
  1207. font-weight: 550;
  1208. .time{
  1209. font-size: 13px;
  1210. color: #666666 100%;
  1211. font-weight: normal;
  1212. }
  1213. }
  1214. .detail{
  1215. // width: 197px;
  1216. width: 52.5vw;
  1217. color: rgba(16, 16, 16, 100);
  1218. font-size: 16px;
  1219. text-align: right;
  1220. .electrovalence{
  1221. .num{
  1222. color: rgba(255, 61, 0, 100);
  1223. margin-right: 4px;
  1224. }
  1225. }
  1226. .electrovalence-monthlyCard{
  1227. font-size: 28rpx;
  1228. color: #959595;
  1229. }
  1230. }
  1231. }
  1232. }
  1233. // 底部按钮
  1234. .bottom{
  1235. background:white ;
  1236. position: fixed;
  1237. bottom: 0;
  1238. left: 0;
  1239. right: 0;
  1240. display: flex;
  1241. padding: 12px 24px;
  1242. padding-bottom: 12px;
  1243. z-index: 999;
  1244. .img-box{
  1245. width: 48px;
  1246. height: 48px;
  1247. padding: 12px 0;
  1248. background-color: rgba(210, 215, 213, 100);
  1249. text-align: center;
  1250. border-radius: 999px;
  1251. img{
  1252. }
  1253. }
  1254. button{
  1255. width: 60.8%;
  1256. background-color: black;
  1257. color: #fff;
  1258. height: 48px;
  1259. border-radius: 50px;
  1260. font-size: 18px;
  1261. }
  1262. }
  1263. </style>