details.vue 31 KB

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