dcCharging.vue 35 KB

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