details.vue 25 KB

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