details.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247
  1. <template>
  2. <view class="time-head">
  3. <ujp-navbar title="充电详情">
  4. <view slot="right" style="margin-right: 10px;" @click="openModalBl=true">
  5. <view class="iconfont qr-code">
  6. &#xe60d;
  7. </view>
  8. </view>
  9. </ujp-navbar>
  10. <view class="slogan-4 " v-for="(item,i) in bannerListYXJ" :key="i" v-if="i==0">
  11. <u-icon name="close-circle-fill" color="#989898" @click="bannerListYXJ=[]"></u-icon>
  12. <img :src="item.picUrl" @click="gotoUrl2(item.linkUrl)" >
  13. </view>
  14. <u-modal v-model="openModalBl" @confirm="confirmPhoneBl" confirm-text="拨打电话" confirm-color="#606266"
  15. :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" :content="consumerPhone"
  16. :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
  17. <view class="details-time">
  18. <view class="time">
  19. <view class="time1">
  20. <view class="time13" v-if="chargeDetail.deviceType==1&&chargeDetail.endSoc">
  21. 启动: {{chargeDetail.startSoc}}%
  22. </view>
  23. <view class="time12">{{geth1(chargeDetail.startTime?chargeDetail.startTime:chargeDetail.createTime)}}
  24. </view>
  25. <view class="time11">
  26. {{getday(chargeDetail.startTime?chargeDetail.startTime:chargeDetail.createTime)}}</view>
  27. </view>
  28. <view class="time2">
  29. <view class="time21">
  30. {{ getPercent(chargeDetail)}}
  31. </view>
  32. <view class="time22"></view>
  33. <view class="time21" style="color: #fff;">-</view>
  34. </view>
  35. <view class="time1" style=" text-align: end;">
  36. <view class="time13" v-if="chargeDetail.deviceType==1&&chargeDetail.endSoc">
  37. 停止: {{chargeDetail.endSoc}}%
  38. </view>
  39. <view class="time12">{{geth1(chargeDetail.endTime)}}</view>
  40. <view class="time11">{{getday(chargeDetail.endTime)}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="details showCoupon" v-if="userParkingCoupon" @click="gotoUrl('pages/record/coupon?id='+id)" >
  45. <view class="showCoupon1 ">
  46. <view class="showCoupon11">
  47. <span class="showCoupon111" >免费停车优惠卷</span>
  48. </view>
  49. <view class="showCoupon12 padding1" >{{ minuteConversion(userParkingCoupon.freeMinute,true)}}</view>
  50. <view class="showCoupon13 padding1">充电时间 {{ getPercent(chargeDetail)}}</view>
  51. </view>
  52. <view class="showCoupon2 padding2">
  53. <u-icon name="coupon-fill" size="48" color="#FF3D00"></u-icon>
  54. <view class="showCoupon22">
  55. 出示
  56. </view>
  57. </view>
  58. </view>
  59. <view class="details" v-if="chargeDetail.updateBy=='cfyxz'">
  60. <view class="details-title">
  61. <h4 class="oldTextjp20px" oldstyle="font-size: 20px;">结束原因</h4>
  62. </view>
  63. <view class="oldTextjp18px" oldstyle="font-size: 18px;" @click="uMessageShow" >
  64. {{chargeDetail.remark}}<br/><span style="color: #00b962;">点击查看小优推荐</span>
  65. </view>
  66. </view>
  67. <view class="details">
  68. <view class="details-title">
  69. <h4 class="oldTextjp20px" oldstyle="font-size: 20px;">费用信息</h4>
  70. </view>
  71. <view class="oldTextjp18px" oldstyle="font-size: 18px;">
  72. <view class="details-row">
  73. <p>订单总额</p><span>{{chargeDetail.dueFee != null ? chargeDetail.dueFee.toFixed(2) : '0.00'}}元</span>
  74. </view>
  75. <view class="details-row">
  76. <p>电费</p>
  77. <span>{{chargeDetail.totalElecMoney != null ? chargeDetail.totalElecMoney.toFixed(2) : '0.00'}}元</span>
  78. </view>
  79. <view class="details-row">
  80. <p>服务费</p>
  81. <span>{{chargeDetail.totalServiceMoney != null ? chargeDetail.totalServiceMoney.toFixed(2) : '0.00'}}元</span>
  82. </view>
  83. <view class="details-row"
  84. v-if="chargeDetail.serviceDiscountRatio&&chargeDetail.serviceDiscountRatio!=100">
  85. <p>折前服务费</p>
  86. <span>{{(chargeDetail.dueServiceMoney?chargeDetail.dueServiceMoney:0).toFixed(2)}}元</span>
  87. </view>
  88. <view class="details-row"
  89. v-if="false&&chargeDetail.realityServiceDiscountRatio&&chargeDetail.realityServiceDiscountRatio!=100">
  90. <p>服务费折扣</p><span style="color:#ef7041">{{discountRatio10(chargeDetail.realityServiceDiscountRatio)}}折</span>
  91. </view>
  92. <view class="details-row"
  93. v-else-if="!(chargeDetail.quickChargeReduce)&&chargeDetail.serviceDiscountRatio&&chargeDetail.serviceDiscountRatio!=100">
  94. <p>服务费折扣</p><span style="color:#ef7041">{{discountRatio10(chargeDetail.serviceDiscountRatio)}}折</span>
  95. </view>
  96. <view class="details-row">
  97. <p>优惠券抵扣</p><span style="color:#ef7041">
  98. {{userCouponObj&&userCouponObj.useText?(userCouponObj.useText=='服务费0折'?'免服务费':userCouponObj.useText):'未使用'}}
  99. </span>
  100. </view>
  101. <view class="details-row" v-if="chargeDetail.userCardId">
  102. <p>会员活动</p><span style="color:#ef7041">折扣卡</span>
  103. </view>
  104. <view class="details-row" v-if="chargeDetail.discountAmount">
  105. <p>实际减免(优惠券)</p><span style="color:#ef7041">-{{chargeDetail.discountAmount.toFixed(2)}}元</span>
  106. </view>
  107. <view class="details-row" v-if="chargeDetail.dueServiceMoney&&chargeDetail.totalServiceMoney&&chargeDetail.dueServiceMoney!=chargeDetail.totalServiceMoney">
  108. <p>优惠金额</p><span style="color:#ef7041">{{(chargeDetail.dueServiceMoney-chargeDetail.totalServiceMoney).toFixed(2)}}元</span>
  109. </view>
  110. <p style="color: rgba(119, 119, 119, 1);font-size: 24rpx; text-align: end;"
  111. v-if="chargeDetail.quickChargeReduce">快充订单满{{chargeDetail.quickChargeDegree}}度服务费
  112. <span v-if="chargeDetail.serviceDiscountRatio==0">免单</span>
  113. <span v-else >{{discountRatio10(chargeDetail.serviceDiscountRatio)}}折</span>
  114. </p>
  115. <view class="details-row">
  116. <p>实付款</p>
  117. <span style="color:#ef7041;font-size: 20px;" ><b>{{chargeDetail.actualFee != null ? chargeDetail.actualFee.toFixed(2) : '0.00'}}元</b></span>
  118. </view>
  119. <view class="details-row">
  120. <p>支付方式</p>
  121. <span ><b>{{chargeDetail.payTypeText}}</b></span>
  122. </view>
  123. <view class="details-row" v-if="chargeDetail.payType==1">
  124. <p>预付款</p>
  125. <span ><b>{{chargeDetail.estimateFee != null ? chargeDetail. estimateFee.toFixed(2) : '0.00'}}元</b></span>
  126. </view>
  127. <view class="details-row" v-if="chargeDetail.payType==1">
  128. <p>预付款自动退款</p>
  129. <span ><b>{{chargeDetail.estimateFee != null ? (chargeDetail.estimateFee -chargeDetail. actualFee).toFixed(2) : '0.00'}}元</b></span>
  130. </view>
  131. <view class="details-row" v-if="chargeDetail.payType==2||chargeDetail.payType==3">
  132. <p>余额</p>
  133. <span ><b>{{chargeDetail. balance != null ? chargeDetail. balance.toFixed(2) : '0.00'}}元</b></span>
  134. </view>
  135. </view>
  136. </view>
  137. <!-- 优惠券2 -->
  138. <view v-if="0&&chargeDetail.carNumber" class="details" >
  139. <view class="details-title">
  140. <h4 class="oldTextjp20px" oldstyle="font-size: 20px;">充电免费停车优惠券</h4>
  141. </view>
  142. <view class="oldTextjp18px" oldstyle="font-size: 18px;">
  143. <view class="details-row">
  144. <view>1.优惠券时长为:充电时间+30分钟
  145. <view style="margin-top: 8rpx;">2.充电时填写车牌号生效</view>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. <view class="piccBanner"
  151. v-for="(itemJNT,index ) in bannerListJNT" v-show="index==0"
  152. @click="gotoUrl2(itemJNT.linkUrl)" :key="index"
  153. style="
  154. text-align: center;
  155. padding: 0px 16px;">
  156. <image :src="itemJNT.picUrl" style="height: 204rpx;width: 100%;border-radius: 10px;" ></image>
  157. </view>
  158. <!-- 常见问题 -->
  159. <view class="details common-problem " style="padding: 20rpx;">
  160. <view class="details-title" style=" margin-bottom: 0px;">
  161. <h4 class="oldTextjp20px" >常见问题
  162. <!-- <span style="float: right;">@click="remarkBl=!remarkBl"
  163. <u-icon name="arrow-up" v-show="remarkBl" ></u-icon>
  164. <u-icon name="arrow-down" v-show="!remarkBl" ></u-icon>
  165. </span> -->
  166. </h4>
  167. </view>
  168. <view class="tabs">
  169. <u-tabs active-color="#333333" inactive-color="#999999" :list="tabList" :is-scroll="false"
  170. :current="current" @change="change"></u-tabs>
  171. </view>
  172. <view class="collapse" v-for="(itemList,i) in newsList" :key="i" v-show="current==i">
  173. <!-- -->
  174. <u-collapse v-if="itemList.length">
  175. <u-collapse-item v-for="(item, index) in itemList" :title="(index+1)+'.'+item.title"
  176. :key="index">
  177. <!-- <textarea maxlength="-1" :auto-height="true" v-model="item.content" readonly ></textarea>
  178. -->
  179. <view v-html="item.content"></view>
  180. </u-collapse-item>
  181. </u-collapse>
  182. </view>
  183. </view>
  184. <view class="details" :style="(!electricRecordListBl?'margin-bottom: 60px;':'')+(!remarkBl?'padding: 32rpx 32rpx 0 32rpx;':'')">
  185. <view class="details-title">
  186. <h4 class="oldTextjp20px" @click="remarkBl=!remarkBl" >充电信息
  187. <span style="float: right;">
  188. <u-icon name="arrow-up" v-show="remarkBl" ></u-icon>
  189. <u-icon name="arrow-down" v-show="!remarkBl" ></u-icon>
  190. </span>
  191. </h4>
  192. </view>
  193. <view class="oldTextjp18px" v-show="remarkBl">
  194. <view class="details-row" v-if="chargeDetail.updateBy!='cfyxz'">
  195. <p>结束原因</p><span>{{chargeDetail.remark}}</span>
  196. </view>
  197. <view class="details-row">
  198. <p>订单状态</p><span>{{chargeDetail.statusText}}</span>
  199. </view>
  200. <view class="details-row" v-if="false">
  201. <p>更新时间</p><span>{{chargeDetail.updateTime}}</span>
  202. </view>
  203. <view class="details-row">
  204. <p>充电站点</p><span>{{chargeDetail.stationName}}</span>
  205. </view>
  206. <view class="details-row">
  207. <p>充电桩编号</p><span>{{chargeDetail.deviceName}}</span>
  208. </view>
  209. <view class="details-row">
  210. <p>充电车辆</p><span>{{chargeDetail.carNumber}}</span>
  211. </view>
  212. </view>
  213. <view v-show="remarkBl" style=" border-top: dashed 1px #777; margin-top: 10px;">
  214. <view class="details-row"><p>开始时间</p><span style="color:#777777">{{chargeDetail.startTime}}</span></view>
  215. <view class="details-row"><p>结束时间</p><span style="color:#777777">{{chargeDetail.endTime}}</span></view>
  216. </view>
  217. <view class="chargeDetailsClass" v-show="remarkBl" style=" border-top: dashed 1px #777; margin-top: 10px;" v-if="chargeDetails.length">
  218. <view v-for="(item,i) in chargeDetails" :key="i" >
  219. <view class="details-row" style=" margin-top: 18px;" >
  220. <p>区间充电量({{item.startTime}}-{{item.endTime}})</p>
  221. <span v-if="item.fixKwh&&item.kwh" >{{(item.kwh+item.fixKwh).toFixed(2) }}度</span>
  222. <span v-else >{{item.kwh }}度</span>
  223. </view>
  224. <view class="details-row" style="display: block;" >
  225. <p>
  226. <span style=" color: #37393c;">区间定价</span>
  227. <span style="float: right; color: #333;font-weight: normal;" v-if="item.discountServicePrice||item.discountServicePrice==0" >{{((item.electricityPrice*100+item.discountServicePrice*100)/100).toFixed(2)}}元/度 <span style="text-decoration:line-through;margin-left: 3px;">{{((item.electricityPrice*100+item.servicePrice*100)/100).toFixed(2)}}元/度</span></span>
  228. <span style="float: right; color: #333;font-weight: normal;" v-else >{{((item.electricityPrice*100+item.servicePrice*100)/100).toFixed(2)}}元/度</span>
  229. </p>
  230. <view class="details-row-grey">
  231. <view class="details-row-grey-row">
  232. <span>电费</span>
  233. <span class="details-row-grey-span" >{{item.electricityPrice.toFixed(2)}}元/度</span>
  234. </view>
  235. <template v-if="item.discountServicePrice||item.discountServicePrice==0" >
  236. <view class="details-row-grey-row">
  237. <span>充电服务费</span>
  238. <span class="details-row-grey-span" >{{item.discountServicePrice.toFixed(2)}}元/度</span>
  239. </view>
  240. <view class="details-row-grey-row">
  241. <span>折前服务费</span>
  242. <span class="details-row-grey-span details-row-grey-span2" >{{item.servicePrice.toFixed(2)}}元/度</span>
  243. </view>
  244. </template>
  245. <template v-else >
  246. <view class="details-row-grey-row">
  247. <span>充电服务费</span>
  248. <span class="details-row-grey-span" >{{item.servicePrice.toFixed(2)}}元/度</span>
  249. </view>
  250. </template>
  251. </view>
  252. <!-- <span class="details-row-sum" style="float:none" v-if="item.discountServicePrice||item.discountServicePrice==0" >电费{{item.electricityPrice.toFixed(2)}}元/度|服务费{{item.discountServicePrice.toFixed(2)}}元/度(折前{{item.servicePrice.toFixed(2)}}元/度) </span>
  253. <span class="details-row-sum" v-else >{{item.electricityPrice.toFixed(2)}}元/度(电费)+{{item.servicePrice.toFixed(2)}}元/度(服务费) </span>
  254. -->
  255. <view class="details-row-sum" >注:充电量包含充电设备和充电线路的损耗电量</view>
  256. </view>
  257. </view>
  258. </view>
  259. </view>
  260. <view class="details" style="padding: 20rpx;margin-bottom: 60px;" v-show="electricRecordListBl">
  261. <view id="pieEcharts" style="min-height:180px;">
  262. </view>
  263. <view class="details-row-sum">注:充电时间每5分钟获取一次数据</view>
  264. </view>
  265. <view class="buttonClass" >
  266. <u-button size="medium" class="detailsBtn-btn " :customStyle="customStyle" type="info" shape="circle"
  267. @click="openModalBl=true">
  268. <view class="iconfont ">
  269. &#xe60d;
  270. </view>
  271. 联系客服</u-button>
  272. <u-button class="detailsBtn-btn " size="medium" type="success" shape="circle"
  273. @click="gotoUrl('pages/user/message')">填写反馈意见</u-button>
  274. </view>
  275. <u-modal v-model="showTop" v-if="getBannerInfoTopBl" class="showOss" :show-title="false"
  276. :show-confirm-button="false">
  277. <view class="slot-content">
  278. <swiper class="swiper" circular :indicator-dots="bannerListTop.length!=1" :autoplay="true" :interval="2500"
  279. :duration="500">
  280. <swiper-item class="swiperitem" v-for="(item,i) in bannerListTop" :key="i">
  281. <u-image width="500" height="500" bgColor="#ff000000"
  282. style="margin: auto;min-height: 250px;" mode="widthFix" @click="clickBannerTopI(i)"
  283. :src="item.picUrl">
  284. <view slot="loading" style="height: 200px;">
  285. <u-loading mode="flower" size="186">
  286. </u-loading>
  287. </view>
  288. </u-image>
  289. </swiper-item>
  290. </swiper>
  291. <u-image width="36px" style="margin: auto; margin-top: 10px;" mode="widthFix" @click="showTop=false"
  292. src="../../assets/img/if-close-line-circled.png"></u-image>
  293. </view>
  294. </u-modal>
  295. <uMessage ref="uMessage" :stationId="stationId" :deviceNo="chargeDetail.deviceNo" :channelNo="chargeDetail.channelNo" ></uMessage>
  296. </view>
  297. </template>
  298. <script>
  299. import * as API from '@/apis/index.js'
  300. import * as echarts from "echarts";
  301. import * as newsApi from '@/apis/news.js'
  302. import uMessage from '@/components/UMessage.vue'
  303. import {
  304. newDate,
  305. currentTimeStamp,
  306. parseUnixTime,
  307. secondsDistance,minuteConversion
  308. } from '@/utils'
  309. export default {
  310. components: {
  311. uMessage
  312. },
  313. data() {
  314. return {
  315. id: '',
  316. useFreeCoupon:false,
  317. useFreeMinute: 0,
  318. remarkBl:false,
  319. myChart: null,
  320. electricRecordList: [],
  321. chargeDetail: {},
  322. chargeDetails:[],
  323. bannerListJNT:[],
  324. bannerListYXJ:[],
  325. userParkingCoupon:null,
  326. userCouponObj: {},
  327. electricRecordListBl: true,
  328. elderStatus: false,
  329. consumerPhone: "",
  330. openModalBl: false,
  331. customStyle:{
  332. color: '#00B962'
  333. },
  334. payList: [{},
  335. {
  336. name: "先付后退",
  337. tips: "游客不享受平台优惠活动",
  338. value: "1",
  339. select: false,
  340. }, {
  341. name: "个人账户支付",
  342. tips: "可使用折扣卡、优惠券、折扣卷等",
  343. value: "2",
  344. select: false,
  345. }, {
  346. name: "单位账户支付",
  347. tips: "账户余额:99999元",
  348. value: "3",
  349. select: false,
  350. }, {
  351. name: "充电金",
  352. tips: "账户余额:99999元",
  353. value: "4",
  354. select: false,
  355. }, {
  356. name: "充电金",
  357. tips: "账户余额:99999元",
  358. value: "4",
  359. select: false,
  360. }],
  361. getBannerInfoTopBl: true,
  362. showTop: false,
  363. showTopImg: '',
  364. showTopIndex: 0,
  365. bannerListTop: [],
  366. stationId:"",
  367. tabList: [
  368. {
  369. name: '软件使用',
  370. type: 'CJWT-RJSY'
  371. },{
  372. name: '故障',
  373. type: 'CJWT-GZ'
  374. },
  375. {
  376. name: '活动优惠',
  377. type: 'CJWT-YHHD'
  378. },
  379. ],
  380. current: 0,
  381. newsList: [
  382. [],
  383. [],
  384. []
  385. ],
  386. newsType: 'CJWT-RJSY',
  387. }
  388. },
  389. onLoad(op) {
  390. if (op.id) {
  391. this.id = op.id;
  392. this.getchargingDetail();
  393. }
  394. if (this.carhelp.get("getElderModeClass") == "长辈模式") {
  395. this.elderStatus = true;
  396. } else {
  397. this.elderStatus = false;
  398. }
  399. var consumerPhone = "400-8899-619"
  400. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  401. if (consumerPhone) {
  402. this.consumerPhone = consumerPhone
  403. }
  404. this.getBannerInfo("JNT-list-end","bannerListJNT");
  405. this.getBannerInfo("YXJ-list-end","bannerListYXJ");
  406. this.getBannerInfoTop("record-end-top");
  407. this.getNewsList()
  408. },
  409. methods: {
  410. uMessageShow(){
  411. this.$refs.uMessage.bShow()
  412. },
  413. change(index) {
  414. this.current = index;
  415. this.newsType = this.tabList[index].type;
  416. if (this.newsList[this.current].length == 0) {
  417. this.getNewsList(true)
  418. }
  419. },
  420. getNewsList(bl) {
  421. if(bl){
  422. uni.showLoading({
  423. title: "加载中",
  424. mask: true,
  425. })
  426. }
  427. newsApi.newsInfoContentList({
  428. pageIndex: 1,
  429. pageSize: 100,
  430. shortName: this.newsType
  431. }).then((res) => {
  432. var newsList = res.data.data;
  433. this.newsList[this.current] = newsList.reverse()
  434. if(bl){
  435. uni.hideLoading();
  436. this.$forceUpdate()
  437. }
  438. //this.recordsTotal = res.data.recordsTotal
  439. }).catch(error => {
  440. uni.showToast({
  441. title: error,
  442. icon: "none"
  443. })
  444. })
  445. },
  446. minuteConversion(a,b){
  447. return minuteConversion(a,b)
  448. },
  449. getBannerInfoTop(code) {
  450. // var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  451. // var time = this.carhelp.get("bannerListTop");
  452. // if ((time && nowtime == time)) {
  453. // this.getBannerInfoTopBl = false;
  454. // }
  455. // uni.showLoading({
  456. // title: "加载中",
  457. // mask: true,
  458. // })
  459. newsApi.getBannerInfo(code).then((res) => {
  460. this.bannerListTop = res.data;
  461. if (this.bannerListTop.length) {
  462. this.showTop = true;
  463. this.showTopImg = this.bannerListTop[0].picUrl;
  464. this.showTopIndex = 0;
  465. }
  466. //uni.hideLoading()
  467. //document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
  468. }).catch(error => {
  469. uni.showToast({
  470. title: error,
  471. icon: "none"
  472. })
  473. })
  474. },
  475. clickBannerTopI(i) {
  476. var mod = this.bannerListTop[i];
  477. //this.showTop = false;
  478. this.clickBanner(0, true, mod)
  479. },
  480. clickBanner(index, bl, modout) {
  481. var uurl = "";
  482. var mod = {}
  483. if (modout) {
  484. mod = modout;
  485. }else{
  486. mod =this.bannerList[index]
  487. }
  488. mod.clickUrl = mod.linkUrl
  489. if (mod.linkPicUrl && !bl) {
  490. this.showOss = true;
  491. this.showOssImg = mod.linkPicUrl;
  492. this.showOssIndex = index;
  493. } else if (mod.clickUrl == null) {
  494. } else if (mod.clickUrl.indexOf('http') == 0) {
  495. window.location = mod.clickUrl + uurl;
  496. } else if (mod.clickUrl.slice(-5) == 'login' && this.userId) {
  497. } else if (mod.clickUrl.indexOf('#/') == 0) {
  498. if (mod.clickUrl.indexOf("?") == -1) {
  499. mod.clickUrl += '?';
  500. }
  501. var url = mod.clickUrl.split("#")[1]
  502. //window.location = mod.clickUrl;
  503. uni.navigateTo({
  504. url: url + uurl
  505. })
  506. } else if (mod.clickUrl == '#' || mod.clickUrl == '') {
  507. } else {
  508. uni.navigateTo({
  509. url: mod.clickUrl + uurl
  510. })
  511. }
  512. },
  513. getBannerInfo(code,list) {
  514. newsApi.getBannerInfo(code).then((res) => {
  515. if(list){
  516. this[list] = res.data;
  517. }else{
  518. this.bannerList = res.data;
  519. }
  520. //uni.hideLoading()
  521. //document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
  522. }).catch(error => {
  523. uni.showToast({
  524. title: error,
  525. icon: "none"
  526. })
  527. })
  528. },
  529. confirmPhoneBl() {
  530. this.openModalBl = false;
  531. uni.makePhoneCall({
  532. phoneNumber: this.consumerPhone //仅为示例
  533. });
  534. },
  535. getday(time) {
  536. if(time){
  537. return time.substring(0, 10);
  538. }else {
  539. return ''
  540. }
  541. },
  542. geth1(time) {
  543. if (time) {
  544. return time.substring(11)
  545. } else
  546. return ''
  547. },
  548. geth(time) {
  549. if (time) {
  550. return time.substring(11, 16)
  551. } else
  552. return ''
  553. },
  554. getPercent(chargingRecord,time,str) {
  555. if (!chargingRecord.startTime) {
  556. return '00:00:00'
  557. }
  558. var Hour = 0;
  559. var Fen = 0;
  560. var S = 0;
  561. var now = newDate(chargingRecord.startTime).getTime();
  562. var date = newDate(chargingRecord.endTime).getTime();
  563. if(time){
  564. date=date+time*1000*60
  565. }
  566. var seconds = parseInt(( date-now ) / 1000);
  567. var ms = seconds;
  568. Hour = parseInt(Math.floor(ms / (60 * 60)));
  569. Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
  570. S = parseInt(Math.floor(ms % (60)));
  571. if(str){
  572. var obj = "";
  573. if(Hour){
  574. obj+=Hour+"小时"
  575. }
  576. if(Fen){
  577. obj+=Fen+"分"
  578. }
  579. if(S){
  580. obj+=S+"秒"
  581. }
  582. return obj;
  583. }else{
  584. var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen + ":" + (S > 9 ? "" : "0") + S
  585. return obj;
  586. }
  587. },
  588. toHome() {
  589. uni.navigateTo({
  590. url: '/pages/index/index'
  591. })
  592. },
  593. getPie(data) {
  594. if (!this.myChart) {
  595. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  596. // this.myChart.on("dataZoom", (res) => {
  597. // showkey = "";
  598. // this.headitemby = "";
  599. // });
  600. }
  601. var timeList = []
  602. var seriesList1 = []
  603. var seriesList2 = []
  604. var seriesList3 = []
  605. //var sz2 = ['soc', 'power', 'ampere', 'voltage','temperature'];
  606. console.log(data)
  607. var dataInterval = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
  608. for (var i in data) {
  609. var item = data[i]
  610. timeList.push(this.geth(item.recordTime));
  611. seriesList1.push(item.soc ? item.soc : '')
  612. seriesList2.push(item.power ? (item.power / 1000).toFixed(1) : '')
  613. //seriesList3.push(item.temperature?item.temperature:0)
  614. seriesList3.push(item.temperature ? item.temperature : '')
  615. }
  616. var spaceNum = 5
  617. let maxA = Math.max(...seriesList2); // 最大值A
  618. let maxint = Math.ceil(maxA / spaceNum); //最大平均值(向上取整)= 最大值A / 间隔数
  619. let maxB = maxint * spaceNum; // 最大值B = 最大平均值 * 间隔数 (注:最大值B>最大值A)
  620. var max = Math.max(maxB, 10); // 为了防止maxB数据为0时,Y轴不显示,给个默认最大值10
  621. var interval = max / spaceNum;
  622. const colors = ['#ea9832', '#429fc8', '#b13331'];
  623. var option = {
  624. color: colors,
  625. tooltip: {
  626. formatter: (value) => {
  627. console.log(value)
  628. var name = value[0].axisValue;
  629. var style = "float: right;margin-left: 3px;"
  630. var text1 = ""
  631. var ulist = ['%', 'kW', '℃', '', '', '']
  632. for (var i in value) {
  633. var u = ulist[i];
  634. if (value[i].data == '') {
  635. continue
  636. }
  637. text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
  638. '">' + value[i].data + u + '</span></p>';
  639. }
  640. return `<p>${name}</p>` + text1
  641. },
  642. trigger: 'axis',
  643. },
  644. grid: {
  645. top:'24%',
  646. left: '8%',
  647. right: '10%',
  648. bottom: '10%',
  649. // containLabel: true
  650. },
  651. legend: {
  652. data: ['SOC', '功率', '温度']
  653. },
  654. xAxis: [{
  655. type: 'category',
  656. axisTick: {
  657. alignWithLabel: true
  658. },
  659. splitNumber: 2,
  660. // prettier-ignore
  661. data: timeList
  662. }],
  663. yAxis: [{
  664. type: 'value',
  665. name: '℃/SOC',
  666. //data: [0,10,20,30,40,50,60,70,80,90,100],
  667. max: 100,
  668. min: 0,
  669. minInterval: 10,
  670. position: 'right',
  671. alignTicks: true,
  672. axisLine: {
  673. show: true,
  674. lineStyle: {
  675. color: colors[0]
  676. }
  677. },
  678. axisLabel: {
  679. formatter: '{value}'
  680. }
  681. },
  682. {
  683. type: 'value',
  684. name: 'kW',
  685. position: 'left',
  686. alignTicks: true,
  687. interval: interval,
  688. max: max,
  689. min: 0,
  690. axisLine: {
  691. show: true,
  692. lineStyle: {
  693. color: colors[1]
  694. }
  695. },
  696. axisLabel: {
  697. formatter: '{value}'
  698. }
  699. }
  700. ],
  701. series: [{
  702. name: 'SOC',
  703. type: 'line',
  704. symbolSize: 3,
  705. data: seriesList1
  706. },
  707. {
  708. name: '功率',
  709. type: 'line',
  710. symbolSize: 3,
  711. yAxisIndex: 1,
  712. data: seriesList2
  713. },
  714. {
  715. name: '温度',
  716. type: 'line',
  717. symbolSize: 3,
  718. yAxisIndex: 0,
  719. data: seriesList3
  720. }
  721. ]
  722. };
  723. console.log(option)
  724. this.myChart.setOption(option);
  725. },
  726. getchargingDetail() {
  727. uni.showLoading({
  728. title: "加载中",
  729. mask: true,
  730. })
  731. API.chargingDetail(this.id).then((res) => {
  732. uni.hideLoading();
  733. this.stationId= res.data.station.id
  734. this.chargeDetail = res.data.chargingRecord;
  735. if(this.chargeDetail.chargeDetails){
  736. this.chargeDetails=JSON.parse(this.chargeDetail.chargeDetails)
  737. }
  738. // this.useFreeCoupon=res.data.useFreeCoupon;
  739. // this.useFreeMinute=res.data.useFreeMinute;
  740. this.userParkingCoupon=res.data.userParkingCoupon
  741. this.userCouponObj = res.data.userCoupon;
  742. this.electricRecordList = res.data.electricRecordList
  743. if (res.data.electricRecordList && res.data.electricRecordList.length) {
  744. this.getPie(res.data.electricRecordList);
  745. } else {
  746. this.electricRecordListBl = false
  747. }
  748. }).catch(error => {
  749. uni.showToast({
  750. title: error,
  751. icon: "none"
  752. })
  753. })
  754. }
  755. }
  756. }
  757. </script>
  758. <style>
  759. page {
  760. background-color: #F7F7F7;
  761. }
  762. </style>
  763. <style lang="scss" scoped>
  764. .details-row-grey{
  765. background-color: rgba(245, 245, 245, 1);
  766. border-radius: 8px;
  767. padding: 20rpx 36rpx;
  768. margin-top:16rpx ;
  769. .details-row-grey-row{
  770. margin-top:4rpx ;
  771. .details-row-grey-span{
  772. float: right;
  773. }
  774. .details-row-grey-span2{
  775. text-decoration: line-through;
  776. }
  777. }
  778. }
  779. .slogan-4 {
  780. margin-top: 10px;
  781. display: flex;
  782. /* text-decoration: underline; */
  783. z-index: 999;
  784. text-align: center;
  785. position: fixed;
  786. /* top: 40px; */
  787. bottom: 180px;
  788. right: 20px;
  789. line-height: 20px;
  790. font-size: 16px;
  791. //background: linear-gradient(95deg, #FF9800, #FF5722);
  792. //box-shadow: 0 4rpx 24rpx 0 #FF5722;
  793. //padding-top: 8px;
  794. color: #fff;
  795. border-radius: 25px;
  796. flex-direction: column;
  797. align-items: flex-end;
  798. img{
  799. //height: 160rpx;
  800. width: 144rpx;
  801. }
  802. }
  803. .time-head {
  804. background: linear-gradient(180deg, rgba(0, 185, 98, 1) 0%, rgba(246, 248, 248, 1) 240px);
  805. padding-bottom: 20px;
  806. }
  807. .details-time {
  808. background: linear-gradient(180deg, #b7ebcf 0%, rgba(255, 255, 255, 1) 33%);
  809. .time {
  810. display: flex;
  811. justify-content: space-between;
  812. //border-bottom: 1px solid #E8E8E8;
  813. white-space: pre;
  814. .time1 {
  815. .time13 {
  816. font-size: 28rpx;
  817. font-weight: bold;
  818. }
  819. .time11 {
  820. font-size: 24rpx;
  821. }
  822. .time12 {
  823. font-size: 36rpx;
  824. color: rgba(0, 185, 98, 1);
  825. margin: 4rpx 0;
  826. font-weight: bold;
  827. text-align: center;
  828. }
  829. }
  830. .time2 {
  831. color: #B8B8B8;
  832. width: 90%;
  833. // align-items: center;
  834. // display: flex;
  835. // justify-content: space-between;
  836. display: flex;
  837. flex-direction: column;
  838. justify-content: center;
  839. align-items: center;
  840. .time21 {
  841. //border: 1px solid #B8B8B8;
  842. //border-radius: 100rpx;
  843. // line-height: 46rpx;
  844. // height: 48rpx;
  845. // width: 48rpx;
  846. color: rgba(51, 51, 51, 1);
  847. font-size: 28rpx;
  848. text-align: center;
  849. }
  850. .time22 {
  851. width: 80%;
  852. border-top: 1px solid #CFCFCF;
  853. }
  854. }
  855. }
  856. }
  857. .oldTextClassF {
  858. .oldTextjp18px {
  859. font-size: 36rpx !important;
  860. }
  861. .oldTextjp20px {
  862. font-size: 40rpx !important;
  863. }
  864. }
  865. .detailsBtn {
  866. margin: 16px;
  867. .detailsBtn-btn {
  868. border-color: #00B962 !important;
  869. border-radius: 8px !important;
  870. background: none !important;
  871. color: #00B962 !important;
  872. }
  873. }
  874. .details-title {
  875. margin-bottom: 16px;
  876. h4 {
  877. font-weight: bold;
  878. font-size: 16px;
  879. position: relative;
  880. padding-left: 10px;
  881. &::after {
  882. content: '';
  883. position: absolute;
  884. height: 12px;
  885. width: 4px;
  886. background-color: #27B148;
  887. left: 0;
  888. top: 5px;
  889. }
  890. }
  891. }
  892. .details-row {
  893. display: flex;
  894. justify-content: space-between;
  895. align-items: center;
  896. margin-top: 10px;
  897. p {
  898. color: #333;
  899. //width: 180rpx;
  900. min-width: 80px;
  901. }
  902. span {
  903. color: #101010;
  904. font-weight: bold;
  905. }
  906. }
  907. .chargeDetailsClass{
  908. span {
  909. color: rgb(51, 51, 51);
  910. font-weight: normal;
  911. }
  912. }
  913. .details-row-sum{
  914. font-size: 24rpx;
  915. color: rgb(158, 158, 158);
  916. margin-top: 4px;
  917. }
  918. .details,
  919. .details-time {
  920. margin: 32rpx;
  921. padding: 32rpx;
  922. background-color: #fff;
  923. border-radius: 8px;
  924. box-shadow: 0px 2px 6px 0px #00b96226;
  925. border: 1px solid rgba(255, 255, 255, 1);
  926. .details-head {
  927. display: flex;
  928. align-items: center;
  929. justify-content: center;
  930. h4 {
  931. font-size: 18px;
  932. font-weight: normal;
  933. margin-left: 4px;
  934. }
  935. }
  936. .details-price {
  937. margin-top: 28px;
  938. display: flex;
  939. align-items: flex-end;
  940. justify-content: center;
  941. h3 {
  942. font-size: 36px;
  943. color: #FF6200;
  944. line-height: 36px;
  945. margin: 0 4px;
  946. font-weight: normal;
  947. }
  948. span {
  949. font-size: 20px;
  950. color: #FF6200;
  951. }
  952. }
  953. .details-main {
  954. text-align: center;
  955. margin-bottom: 20px;
  956. p {
  957. color: #777;
  958. margin-top: 4px;
  959. }
  960. }
  961. }
  962. .qr-code {
  963. font-size: 24px;
  964. color: #666666;
  965. // position: absolute;
  966. right: 16px;
  967. }
  968. .buttonClass{
  969. display: flex;
  970. text-align: center;
  971. position: fixed;
  972. bottom: 0px;
  973. width: 100%;
  974. background: #fff;
  975. padding: 10px 0;
  976. .detailsBtn-btn{
  977. // margin:0 32rpx;
  978. }
  979. }
  980. .showCoupon{
  981. display: flex;
  982. justify-content: space-between;
  983. align-items: center;
  984. padding: 0 ;
  985. .padding1{
  986. padding-left: 32rpx;
  987. }
  988. .padding2{
  989. padding-right: 32rpx;
  990. }
  991. .showCoupon1{
  992. .showCoupon111{
  993. padding: 2rpx 24rpx;
  994. border-radius: 8px 0px 8px 0px;
  995. background-color: rgba(255, 61, 0, 1);
  996. color: rgba(255, 255, 255, 1);
  997. }
  998. .showCoupon13{
  999. padding-bottom: 32rpx;
  1000. font-weight: bold;
  1001. }
  1002. .showCoupon12{
  1003. color: red;
  1004. font-size: 48rpx;
  1005. font-weight: bold;
  1006. margin: 16rpx 0 4rpx 0;
  1007. }
  1008. }
  1009. .showCoupon2{
  1010. border-left: 1px solid #CFCFCF;
  1011. padding-left: 32rpx;
  1012. display: flex;
  1013. flex-direction: column;
  1014. align-items: center;
  1015. }
  1016. }
  1017. .showOss {
  1018. /deep/.u-model,
  1019. /deep/.u-mode-center-box {
  1020. background-color: transparent;
  1021. }
  1022. }
  1023. .swiper {
  1024. height: 700rpx;
  1025. .swiperitem {
  1026. height: 700rpx;
  1027. }
  1028. }
  1029. .common-problem {
  1030. //margin: -125px 32rpx 0;
  1031. //box-shadow: 0px 2px 8px 0px #1A095A34;
  1032. border-radius: 8px;
  1033. background-color: #fff;
  1034. //padding: 20rpx 24rpx 48rpx 24rpx;
  1035. //margin: 32rpx 40rpx 40rpx 40rpx;
  1036. .title {
  1037. color: rgba(16, 16, 16, 1);
  1038. font-size: 32rpx;
  1039. padding-bottom: 20rpx;
  1040. border-bottom: 1px solid rgba(246, 246, 246, 1);
  1041. padding-left: 32rpx;
  1042. }
  1043. .tabs {
  1044. width: 400rpx;
  1045. padding-bottom: 20rpx;
  1046. border-bottom: 1px solid rgba(246, 246, 246, 1);
  1047. /deep/.u-tab-bar {
  1048. background-color: #00B962 !important;
  1049. }
  1050. }
  1051. .collapse {
  1052. padding: 0 32rpx;
  1053. }
  1054. }
  1055. </style>