dcCharging.vue 32 KB

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