details.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  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;">
  64. {{chargeDetail.remark}}
  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">
  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. </view>
  296. </template>
  297. <script>
  298. import * as API from '@/apis/index.js'
  299. import * as echarts from "echarts";
  300. import * as newsApi from '@/apis/news.js'
  301. import {
  302. newDate,
  303. currentTimeStamp,
  304. parseUnixTime,
  305. secondsDistance,minuteConversion
  306. } from '@/utils'
  307. export default {
  308. data() {
  309. return {
  310. id: '',
  311. useFreeCoupon:false,
  312. useFreeMinute: 0,
  313. remarkBl:false,
  314. myChart: null,
  315. electricRecordList: [],
  316. chargeDetail: {},
  317. chargeDetails:[],
  318. bannerListJNT:[],
  319. bannerListYXJ:[],
  320. userParkingCoupon:null,
  321. userCouponObj: {},
  322. electricRecordListBl: true,
  323. elderStatus: false,
  324. consumerPhone: "",
  325. openModalBl: false,
  326. customStyle:{
  327. color: '#00B962'
  328. },
  329. payList: [{},
  330. {
  331. name: "先付后退",
  332. tips: "游客不享受平台优惠活动",
  333. value: "1",
  334. select: false,
  335. }, {
  336. name: "个人账户支付",
  337. tips: "可使用折扣卡、优惠券、折扣卷等",
  338. value: "2",
  339. select: false,
  340. }, {
  341. name: "单位账户支付",
  342. tips: "账户余额:99999元",
  343. value: "3",
  344. select: false,
  345. }, {
  346. name: "充电金",
  347. tips: "账户余额:99999元",
  348. value: "4",
  349. select: false,
  350. }, {
  351. name: "充电金",
  352. tips: "账户余额:99999元",
  353. value: "4",
  354. select: false,
  355. }],
  356. getBannerInfoTopBl: true,
  357. showTop: false,
  358. showTopImg: '',
  359. showTopIndex: 0,
  360. bannerListTop: [],
  361. tabList: [
  362. {
  363. name: '软件使用',
  364. type: 'CJWT-RJSY'
  365. },{
  366. name: '故障',
  367. type: 'CJWT-GZ'
  368. },
  369. {
  370. name: '活动优惠',
  371. type: 'CJWT-YHHD'
  372. },
  373. ],
  374. current: 0,
  375. newsList: [
  376. [],
  377. [],
  378. []
  379. ],
  380. newsType: 'CJWT-RJSY',
  381. }
  382. },
  383. onLoad(op) {
  384. if (op.id) {
  385. this.id = op.id;
  386. this.getchargingDetail();
  387. }
  388. if (this.carhelp.get("getElderModeClass") == "长辈模式") {
  389. this.elderStatus = true;
  390. } else {
  391. this.elderStatus = false;
  392. }
  393. var consumerPhone = "400-8899-619"
  394. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  395. if (consumerPhone) {
  396. this.consumerPhone = consumerPhone
  397. }
  398. this.getBannerInfo("JNT-list-end","bannerListJNT");
  399. this.getBannerInfo("YXJ-list-end","bannerListYXJ");
  400. this.getBannerInfoTop("record-end-top");
  401. this.getNewsList()
  402. },
  403. methods: {
  404. change(index) {
  405. this.current = index;
  406. this.newsType = this.tabList[index].type;
  407. if (this.newsList[this.current].length == 0) {
  408. this.getNewsList(true)
  409. }
  410. },
  411. getNewsList(bl) {
  412. if(bl){
  413. uni.showLoading({
  414. title: "加载中",
  415. mask: true,
  416. })
  417. }
  418. newsApi.newsInfoContentList({
  419. pageIndex: 1,
  420. pageSize: 100,
  421. shortName: this.newsType
  422. }).then((res) => {
  423. var newsList = res.data.data;
  424. this.newsList[this.current] = newsList.reverse()
  425. if(bl){
  426. uni.hideLoading();
  427. this.$forceUpdate()
  428. }
  429. //this.recordsTotal = res.data.recordsTotal
  430. }).catch(error => {
  431. uni.showToast({
  432. title: error,
  433. icon: "none"
  434. })
  435. })
  436. },
  437. minuteConversion(a,b){
  438. return minuteConversion(a,b)
  439. },
  440. getBannerInfoTop(code) {
  441. // var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  442. // var time = this.carhelp.get("bannerListTop");
  443. // if ((time && nowtime == time)) {
  444. // this.getBannerInfoTopBl = false;
  445. // }
  446. // uni.showLoading({
  447. // title: "加载中",
  448. // mask: true,
  449. // })
  450. newsApi.getBannerInfo(code).then((res) => {
  451. this.bannerListTop = res.data;
  452. if (this.bannerListTop.length) {
  453. this.showTop = true;
  454. this.showTopImg = this.bannerListTop[0].picUrl;
  455. this.showTopIndex = 0;
  456. }
  457. //uni.hideLoading()
  458. //document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
  459. }).catch(error => {
  460. uni.showToast({
  461. title: error,
  462. icon: "none"
  463. })
  464. })
  465. },
  466. clickBannerTopI(i) {
  467. var mod = this.bannerListTop[i];
  468. //this.showTop = false;
  469. this.clickBanner(0, true, mod)
  470. },
  471. clickBanner(index, bl, modout) {
  472. var uurl = "";
  473. var mod = {}
  474. if (modout) {
  475. mod = modout;
  476. }else{
  477. mod =this.bannerList[index]
  478. }
  479. mod.clickUrl = mod.linkUrl
  480. if (mod.linkPicUrl && !bl) {
  481. this.showOss = true;
  482. this.showOssImg = mod.linkPicUrl;
  483. this.showOssIndex = index;
  484. } else if (mod.clickUrl == null) {
  485. } else if (mod.clickUrl.indexOf('http') == 0) {
  486. window.location = mod.clickUrl + uurl;
  487. } else if (mod.clickUrl.slice(-5) == 'login' && this.userId) {
  488. } else if (mod.clickUrl.indexOf('#/') == 0) {
  489. if (mod.clickUrl.indexOf("?") == -1) {
  490. mod.clickUrl += '?';
  491. }
  492. var url = mod.clickUrl.split("#")[1]
  493. //window.location = mod.clickUrl;
  494. uni.navigateTo({
  495. url: url + uurl
  496. })
  497. } else if (mod.clickUrl == '#' || mod.clickUrl == '') {
  498. } else {
  499. uni.navigateTo({
  500. url: mod.clickUrl + uurl
  501. })
  502. }
  503. },
  504. getBannerInfo(code,list) {
  505. newsApi.getBannerInfo(code).then((res) => {
  506. if(list){
  507. this[list] = res.data;
  508. }else{
  509. this.bannerList = res.data;
  510. }
  511. //uni.hideLoading()
  512. //document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
  513. }).catch(error => {
  514. uni.showToast({
  515. title: error,
  516. icon: "none"
  517. })
  518. })
  519. },
  520. confirmPhoneBl() {
  521. this.openModalBl = false;
  522. uni.makePhoneCall({
  523. phoneNumber: this.consumerPhone //仅为示例
  524. });
  525. },
  526. getday(time) {
  527. if(time){
  528. return time.substring(0, 10);
  529. }else {
  530. return ''
  531. }
  532. },
  533. geth1(time) {
  534. if (time) {
  535. return time.substring(11)
  536. } else
  537. return ''
  538. },
  539. geth(time) {
  540. if (time) {
  541. return time.substring(11, 16)
  542. } else
  543. return ''
  544. },
  545. getPercent(chargingRecord,time,str) {
  546. if (!chargingRecord.startTime) {
  547. return '00:00:00'
  548. }
  549. var Hour = 0;
  550. var Fen = 0;
  551. var S = 0;
  552. var now = newDate(chargingRecord.startTime).getTime();
  553. var date = newDate(chargingRecord.endTime).getTime();
  554. if(time){
  555. date=date+time*1000*60
  556. }
  557. var seconds = parseInt(( date-now ) / 1000);
  558. var ms = seconds;
  559. Hour = parseInt(Math.floor(ms / (60 * 60)));
  560. Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
  561. S = parseInt(Math.floor(ms % (60)));
  562. if(str){
  563. var obj = "";
  564. if(Hour){
  565. obj+=Hour+"小时"
  566. }
  567. if(Fen){
  568. obj+=Fen+"分"
  569. }
  570. if(S){
  571. obj+=S+"秒"
  572. }
  573. return obj;
  574. }else{
  575. var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen + ":" + (S > 9 ? "" : "0") + S
  576. return obj;
  577. }
  578. },
  579. toHome() {
  580. uni.navigateTo({
  581. url: '/pages/index/index'
  582. })
  583. },
  584. getPie(data) {
  585. if (!this.myChart) {
  586. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  587. // this.myChart.on("dataZoom", (res) => {
  588. // showkey = "";
  589. // this.headitemby = "";
  590. // });
  591. }
  592. var timeList = []
  593. var seriesList1 = []
  594. var seriesList2 = []
  595. var seriesList3 = []
  596. //var sz2 = ['soc', 'power', 'ampere', 'voltage','temperature'];
  597. console.log(data)
  598. var dataInterval = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
  599. for (var i in data) {
  600. var item = data[i]
  601. timeList.push(this.geth(item.recordTime));
  602. seriesList1.push(item.soc ? item.soc : '')
  603. seriesList2.push(item.power ? (item.power / 1000).toFixed(1) : '')
  604. //seriesList3.push(item.temperature?item.temperature:0)
  605. seriesList3.push(item.temperature ? item.temperature : '')
  606. }
  607. var spaceNum = 5
  608. let maxA = Math.max(...seriesList2); // 最大值A
  609. let maxint = Math.ceil(maxA / spaceNum); //最大平均值(向上取整)= 最大值A / 间隔数
  610. let maxB = maxint * spaceNum; // 最大值B = 最大平均值 * 间隔数 (注:最大值B>最大值A)
  611. var max = Math.max(maxB, 10); // 为了防止maxB数据为0时,Y轴不显示,给个默认最大值10
  612. var interval = max / spaceNum;
  613. const colors = ['#ea9832', '#429fc8', '#b13331'];
  614. var option = {
  615. color: colors,
  616. tooltip: {
  617. formatter: (value) => {
  618. console.log(value)
  619. var name = value[0].axisValue;
  620. var style = "float: right;margin-left: 3px;"
  621. var text1 = ""
  622. var ulist = ['%', 'kW', '℃', '', '', '']
  623. for (var i in value) {
  624. var u = ulist[i];
  625. if (value[i].data == '') {
  626. continue
  627. }
  628. text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
  629. '">' + value[i].data + u + '</span></p>';
  630. }
  631. return `<p>${name}</p>` + text1
  632. },
  633. trigger: 'axis',
  634. },
  635. grid: {
  636. top:'24%',
  637. left: '8%',
  638. right: '10%',
  639. bottom: '10%',
  640. // containLabel: true
  641. },
  642. legend: {
  643. data: ['SOC', '功率', '温度']
  644. },
  645. xAxis: [{
  646. type: 'category',
  647. axisTick: {
  648. alignWithLabel: true
  649. },
  650. splitNumber: 2,
  651. // prettier-ignore
  652. data: timeList
  653. }],
  654. yAxis: [{
  655. type: 'value',
  656. name: '℃/SOC',
  657. //data: [0,10,20,30,40,50,60,70,80,90,100],
  658. max: 100,
  659. min: 0,
  660. minInterval: 10,
  661. position: 'right',
  662. alignTicks: true,
  663. axisLine: {
  664. show: true,
  665. lineStyle: {
  666. color: colors[0]
  667. }
  668. },
  669. axisLabel: {
  670. formatter: '{value}'
  671. }
  672. },
  673. {
  674. type: 'value',
  675. name: 'kW',
  676. position: 'left',
  677. alignTicks: true,
  678. interval: interval,
  679. max: max,
  680. min: 0,
  681. axisLine: {
  682. show: true,
  683. lineStyle: {
  684. color: colors[1]
  685. }
  686. },
  687. axisLabel: {
  688. formatter: '{value}'
  689. }
  690. }
  691. ],
  692. series: [{
  693. name: 'SOC',
  694. type: 'line',
  695. symbolSize: 3,
  696. data: seriesList1
  697. },
  698. {
  699. name: '功率',
  700. type: 'line',
  701. symbolSize: 3,
  702. yAxisIndex: 1,
  703. data: seriesList2
  704. },
  705. {
  706. name: '温度',
  707. type: 'line',
  708. symbolSize: 3,
  709. yAxisIndex: 0,
  710. data: seriesList3
  711. }
  712. ]
  713. };
  714. console.log(option)
  715. this.myChart.setOption(option);
  716. },
  717. getchargingDetail() {
  718. uni.showLoading({
  719. title: "加载中",
  720. mask: true,
  721. })
  722. API.chargingDetail(this.id).then((res) => {
  723. uni.hideLoading();
  724. this.chargeDetail = res.data.chargingRecord;
  725. if(this.chargeDetail.chargeDetails){
  726. this.chargeDetails=JSON.parse(this.chargeDetail.chargeDetails)
  727. }
  728. // this.useFreeCoupon=res.data.useFreeCoupon;
  729. // this.useFreeMinute=res.data.useFreeMinute;
  730. this.userParkingCoupon=res.data.userParkingCoupon
  731. this.userCouponObj = res.data.userCoupon;
  732. this.electricRecordList = res.data.electricRecordList
  733. if (res.data.electricRecordList && res.data.electricRecordList.length) {
  734. this.getPie(res.data.electricRecordList);
  735. } else {
  736. this.electricRecordListBl = false
  737. }
  738. }).catch(error => {
  739. uni.showToast({
  740. title: error,
  741. icon: "none"
  742. })
  743. })
  744. }
  745. }
  746. }
  747. </script>
  748. <style>
  749. page {
  750. background-color: #F7F7F7;
  751. }
  752. </style>
  753. <style lang="scss" scoped>
  754. .details-row-grey{
  755. background-color: rgba(245, 245, 245, 1);
  756. border-radius: 8px;
  757. padding: 20rpx 36rpx;
  758. margin-top:16rpx ;
  759. .details-row-grey-row{
  760. margin-top:4rpx ;
  761. .details-row-grey-span{
  762. float: right;
  763. }
  764. .details-row-grey-span2{
  765. text-decoration: line-through;
  766. }
  767. }
  768. }
  769. .slogan-4 {
  770. margin-top: 10px;
  771. display: flex;
  772. /* text-decoration: underline; */
  773. z-index: 999;
  774. text-align: center;
  775. position: fixed;
  776. /* top: 40px; */
  777. bottom: 180px;
  778. right: 20px;
  779. line-height: 20px;
  780. font-size: 16px;
  781. //background: linear-gradient(95deg, #FF9800, #FF5722);
  782. //box-shadow: 0 4rpx 24rpx 0 #FF5722;
  783. //padding-top: 8px;
  784. color: #fff;
  785. border-radius: 25px;
  786. flex-direction: column;
  787. align-items: flex-end;
  788. img{
  789. //height: 160rpx;
  790. width: 144rpx;
  791. }
  792. }
  793. .time-head {
  794. background: linear-gradient(180deg, rgba(0, 185, 98, 1) 0%, rgba(246, 248, 248, 1) 240px);
  795. padding-bottom: 20px;
  796. }
  797. .details-time {
  798. background: linear-gradient(180deg, #b7ebcf 0%, rgba(255, 255, 255, 1) 33%);
  799. .time {
  800. display: flex;
  801. justify-content: space-between;
  802. //border-bottom: 1px solid #E8E8E8;
  803. white-space: pre;
  804. .time1 {
  805. .time13 {
  806. font-size: 28rpx;
  807. font-weight: bold;
  808. }
  809. .time11 {
  810. font-size: 24rpx;
  811. }
  812. .time12 {
  813. font-size: 36rpx;
  814. color: rgba(0, 185, 98, 1);
  815. margin: 4rpx 0;
  816. font-weight: bold;
  817. text-align: center;
  818. }
  819. }
  820. .time2 {
  821. color: #B8B8B8;
  822. width: 90%;
  823. // align-items: center;
  824. // display: flex;
  825. // justify-content: space-between;
  826. display: flex;
  827. flex-direction: column;
  828. justify-content: center;
  829. align-items: center;
  830. .time21 {
  831. //border: 1px solid #B8B8B8;
  832. //border-radius: 100rpx;
  833. // line-height: 46rpx;
  834. // height: 48rpx;
  835. // width: 48rpx;
  836. color: rgba(51, 51, 51, 1);
  837. font-size: 28rpx;
  838. text-align: center;
  839. }
  840. .time22 {
  841. width: 80%;
  842. border-top: 1px solid #CFCFCF;
  843. }
  844. }
  845. }
  846. }
  847. .oldTextClassF {
  848. .oldTextjp18px {
  849. font-size: 36rpx !important;
  850. }
  851. .oldTextjp20px {
  852. font-size: 40rpx !important;
  853. }
  854. }
  855. .detailsBtn {
  856. margin: 16px;
  857. .detailsBtn-btn {
  858. border-color: #00B962 !important;
  859. border-radius: 8px !important;
  860. background: none !important;
  861. color: #00B962 !important;
  862. }
  863. }
  864. .details-title {
  865. margin-bottom: 16px;
  866. h4 {
  867. font-weight: bold;
  868. font-size: 16px;
  869. position: relative;
  870. padding-left: 10px;
  871. &::after {
  872. content: '';
  873. position: absolute;
  874. height: 12px;
  875. width: 4px;
  876. background-color: #27B148;
  877. left: 0;
  878. top: 5px;
  879. }
  880. }
  881. }
  882. .details-row {
  883. display: flex;
  884. justify-content: space-between;
  885. align-items: center;
  886. margin-top: 10px;
  887. p {
  888. color: #333;
  889. //width: 180rpx;
  890. min-width: 80px;
  891. }
  892. span {
  893. color: #101010;
  894. font-weight: bold;
  895. }
  896. }
  897. .chargeDetailsClass{
  898. span {
  899. color: rgb(51, 51, 51);
  900. font-weight: normal;
  901. }
  902. }
  903. .details-row-sum{
  904. font-size: 24rpx;
  905. color: rgb(158, 158, 158);
  906. margin-top: 4px;
  907. }
  908. .details,
  909. .details-time {
  910. margin: 32rpx;
  911. padding: 32rpx;
  912. background-color: #fff;
  913. border-radius: 8px;
  914. box-shadow: 0px 2px 6px 0px #00b96226;
  915. border: 1px solid rgba(255, 255, 255, 1);
  916. .details-head {
  917. display: flex;
  918. align-items: center;
  919. justify-content: center;
  920. h4 {
  921. font-size: 18px;
  922. font-weight: normal;
  923. margin-left: 4px;
  924. }
  925. }
  926. .details-price {
  927. margin-top: 28px;
  928. display: flex;
  929. align-items: flex-end;
  930. justify-content: center;
  931. h3 {
  932. font-size: 36px;
  933. color: #FF6200;
  934. line-height: 36px;
  935. margin: 0 4px;
  936. font-weight: normal;
  937. }
  938. span {
  939. font-size: 20px;
  940. color: #FF6200;
  941. }
  942. }
  943. .details-main {
  944. text-align: center;
  945. margin-bottom: 20px;
  946. p {
  947. color: #777;
  948. margin-top: 4px;
  949. }
  950. }
  951. }
  952. .qr-code {
  953. font-size: 24px;
  954. color: #666666;
  955. // position: absolute;
  956. right: 16px;
  957. }
  958. .buttonClass{
  959. display: flex;
  960. text-align: center;
  961. position: fixed;
  962. bottom: 0px;
  963. width: 100%;
  964. background: #fff;
  965. padding: 10px 0;
  966. .detailsBtn-btn{
  967. // margin:0 32rpx;
  968. }
  969. }
  970. .showCoupon{
  971. display: flex;
  972. justify-content: space-between;
  973. align-items: center;
  974. padding: 0 ;
  975. .padding1{
  976. padding-left: 32rpx;
  977. }
  978. .padding2{
  979. padding-right: 32rpx;
  980. }
  981. .showCoupon1{
  982. .showCoupon111{
  983. padding: 2rpx 24rpx;
  984. border-radius: 8px 0px 8px 0px;
  985. background-color: rgba(255, 61, 0, 1);
  986. color: rgba(255, 255, 255, 1);
  987. }
  988. .showCoupon13{
  989. padding-bottom: 32rpx;
  990. font-weight: bold;
  991. }
  992. .showCoupon12{
  993. color: red;
  994. font-size: 48rpx;
  995. font-weight: bold;
  996. margin: 16rpx 0 4rpx 0;
  997. }
  998. }
  999. .showCoupon2{
  1000. border-left: 1px solid #CFCFCF;
  1001. padding-left: 32rpx;
  1002. display: flex;
  1003. flex-direction: column;
  1004. align-items: center;
  1005. }
  1006. }
  1007. .showOss {
  1008. /deep/.u-model,
  1009. /deep/.u-mode-center-box {
  1010. background-color: transparent;
  1011. }
  1012. }
  1013. .swiper {
  1014. height: 700rpx;
  1015. .swiperitem {
  1016. height: 700rpx;
  1017. }
  1018. }
  1019. .common-problem {
  1020. //margin: -125px 32rpx 0;
  1021. //box-shadow: 0px 2px 8px 0px #1A095A34;
  1022. border-radius: 8px;
  1023. background-color: #fff;
  1024. //padding: 20rpx 24rpx 48rpx 24rpx;
  1025. //margin: 32rpx 40rpx 40rpx 40rpx;
  1026. .title {
  1027. color: rgba(16, 16, 16, 1);
  1028. font-size: 32rpx;
  1029. padding-bottom: 20rpx;
  1030. border-bottom: 1px solid rgba(246, 246, 246, 1);
  1031. padding-left: 32rpx;
  1032. }
  1033. .tabs {
  1034. width: 400rpx;
  1035. padding-bottom: 20rpx;
  1036. border-bottom: 1px solid rgba(246, 246, 246, 1);
  1037. /deep/.u-tab-bar {
  1038. background-color: #00B962 !important;
  1039. }
  1040. }
  1041. .collapse {
  1042. padding: 0 32rpx;
  1043. }
  1044. }
  1045. </style>