details.vue 32 KB

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