details.vue 31 KB

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