dcCharging.vue 35 KB

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