dcCharging.vue 34 KB

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