dcCharging.vue 33 KB

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