preengagedListDetails.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <view>
  3. <u-navbar title="预约单详情" :custom-back="customback" >
  4. </u-navbar>
  5. <u-alert-tips type="warning" v-if="detail.chargingAppointment.status == '0'" :description="description"></u-alert-tips>
  6. <view class="reverse-time">
  7. <view class="time" v-if="detail.chargingAppointment.status == '0'">
  8. 预留{{detail.chargingAppointment.reserveMinutes}}分钟
  9. </view>
  10. <view class="time" v-if="detail.chargingAppointment.status == '1'">
  11. 预留{{detail.chargingAppointment.reserveMinutes}}分钟
  12. <view class="img-box">
  13. <img src="../../assets/img/finished.png" alt="">
  14. </view>
  15. </view>
  16. <view class="time" v-if="detail.chargingAppointment.status == '3'">
  17. 预留{{detail.chargingAppointment.reserveMinutes}}分钟
  18. <view class="img-box">
  19. <img src="../../assets/img/canc.png" alt="">
  20. </view>
  21. </view>
  22. <view class="time" v-if="detail.chargingAppointment.status == '2'">
  23. 预留{{detail.chargingAppointment.reserveMinutes}}分钟
  24. <view class="img-box">
  25. <img src="../../assets/img/f.png" alt="">
  26. </view>
  27. </view>
  28. <view class="time refused" v-if="detail.chargingAppointment.status == '4'">
  29. {{detail.chargingAppointment.statusText}}
  30. </view>
  31. <view class="time refused" v-if="detail.chargingAppointment.status == '5'">
  32. {{detail.chargingAppointment.statusText}}
  33. </view>
  34. <view class="time refused" v-if="detail.chargingAppointment.status == '6'">
  35. {{detail.chargingAppointment.statusText}}
  36. </view>
  37. <view class="details-item">
  38. <view class="item">
  39. <view class="item-name">
  40. 预约单号
  41. </view>
  42. <view class="item-content">
  43. {{detail.chargingAppointment.flowNo}}
  44. </view>
  45. </view>
  46. <view class="item">
  47. <view class="item-name">
  48. 预计开始充电
  49. </view>
  50. <view class="item-content">
  51. {{detail.chargingAppointment.endTime}}
  52. </view>
  53. </view>
  54. <view class="item">
  55. <view class="item-name">
  56. 预计充电时长
  57. </view>
  58. <view class="item-content">
  59. {{(detail.chargingAppointment.estimateMinutes/60).toFixed(1)}}小时
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 充电桩详情 -->
  65. <view class="charge-pile">
  66. <view class="tel">
  67. </view>
  68. <view class="box">
  69. <view class="name ellipsis">
  70. {{detail.chargingDevice.stationName}}/{{detail.chargingDevice.name}}
  71. </view>
  72. <view class="address ellipsis">
  73. {{detail.chargingDevice.address}}
  74. </view>
  75. </view>
  76. <view class="tel">
  77. </view>
  78. <view class="details-item">
  79. <view class="item">
  80. <view class="item-name">
  81. 预约单生成时间
  82. </view>
  83. <view class="item-content">
  84. {{detail.chargingAppointment.createTime}}
  85. </view>
  86. </view>
  87. <view class="item">
  88. <view class="item-name">
  89. 电费单价
  90. </view>
  91. <view class="item-content">
  92. {{detail.price.electricityPrice}}元/度
  93. </view>
  94. </view>
  95. <view class="item">
  96. <view class="item-name">
  97. 充电服务费
  98. </view>
  99. <view class="item-content">
  100. {{detail.price.servicePrice}}元/度
  101. </view>
  102. </view>
  103. <view class="item" v-if="detail.chargingAppointment.status == '2'">
  104. <view class="item-name">
  105. 充电订单信息
  106. </view>
  107. <view class="item-content" @click="gotoUrl('pages/charge/chargeDetails?id='+detail.chargingRecord.id)" style="color: #00B962;">
  108. 查看
  109. </view>
  110. </view>
  111. <view class="item" v-if="detail.chargingAppointment.status == '4'">
  112. <view class="item-name">
  113. 拒绝时间
  114. </view>
  115. <view class="item-content">
  116. {{detail.chargingAppointment.confirmTime}}
  117. </view>
  118. </view>
  119. <view v-if="detail.chargingAppointment.status == '3'">
  120. <view class="item">
  121. <view class="item-name">
  122. 取消时间
  123. </view>
  124. <view class="item-content">
  125. {{detail.chargingAppointment.confirmTime}}
  126. </view>
  127. </view>
  128. <view class="item">
  129. <view class="item-name">
  130. 取消类型
  131. </view>
  132. <view class="item-content">
  133. {{detail.chargingAppointment.remark}}
  134. </view>
  135. </view>
  136. </view>
  137. <view v-if="detail.chargingAppointment.status == '5'">
  138. <view class="item">
  139. <view class="item-name">
  140. 过期时间
  141. </view>
  142. <view class="item-content">
  143. {{detail.chargingAppointment.confirmTime}}
  144. </view>
  145. </view>
  146. <view class="item">
  147. <view class="item-name">
  148. 过期原因
  149. </view>
  150. <view class="item-content">
  151. {{detail.chargingAppointment.remark}}
  152. </view>
  153. </view>
  154. </view>
  155. <view v-if="detail.chargingAppointment.status == '6'">
  156. <view class="item">
  157. <view class="item-name">
  158. 过期时间
  159. </view>
  160. <view class="item-content">
  161. {{detail.chargingAppointment.confirmTime}}
  162. </view>
  163. </view>
  164. <view class="item">
  165. <view class="item-name">
  166. 过期原因
  167. </view>
  168. <view class="item-content">
  169. {{detail.chargingAppointment.remark}}
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. <!-- 底部按钮 -->
  176. <view class="bottom">
  177. <u-button shape='circle' class="refuse-btn" v-if="detail.chargingAppointment.status == '0'" @click="refuseClick(detail.chargingAppointment)">拒绝</u-button>
  178. <u-button type="success" shape='circle' v-if="detail.chargingAppointment.status == '0'" @click="sureClick(detail.chargingAppointment)">确认</u-button>
  179. <!-- <u-button shape='circle' class="cancel-btn" v-if="detail.chargingAppointment.status == '4' || detail.chargingAppointment.status == '9'">删除订单</u-button> -->
  180. </view>
  181. </view>
  182. </template>
  183. <script>
  184. import * as myApi from '@/apis/my.js'
  185. import {
  186. hourDistanceArr,
  187. currentTimeStamp,
  188. parseUnixTime
  189. } from '@/utils'
  190. export default {
  191. data() {
  192. return {
  193. description: '等待桩主确认预约单,剩余时间04:59:59',
  194. id: '',
  195. isback:false,
  196. detail: {},
  197. estimateMinutes: '',
  198. }
  199. },
  200. onLoad(op) {
  201. if(op.notice){
  202. this.isback=true
  203. }
  204. if(op.id) {
  205. this.id = op.id;
  206. this.getAppointmentDetail();
  207. }
  208. },
  209. methods: {
  210. customback(){
  211. if(this.isback){
  212. uni.reLaunch({
  213. url:"/pagesFinance/user/index"
  214. })
  215. }else{
  216. uni.navigateBack({
  217. })
  218. }
  219. },
  220. getAppointmentDetail(bl) {
  221. if(!bl){
  222. uni.showLoading({
  223. title: "加载中",
  224. mask: true,
  225. })
  226. }
  227. myApi.merchantAppointmentDetail(this.id).then((res) => {
  228. if(!bl){
  229. uni.hideLoading()
  230. }
  231. this.detail = res.data;
  232. if(this.detail.chargingAppointment.status=="0"){
  233. //this.description= '等待桩主确认预约单,剩余时间'
  234. var data=new Date(this.detail.chargingAppointment.createTime).getTime()
  235. var c=hourDistanceArr(new Date(),new Date(data+5*60*1000))
  236. this.description= '等待桩主确认预约单,剩余时间'+c[1]+'分'+c[2]+"秒";
  237. setTimeout(()=>{
  238. this.getAppointmentDetail(true);
  239. },2000)
  240. }
  241. }).catch(error => {
  242. uni.showToast({
  243. title: error,
  244. icon: "none"
  245. })
  246. })
  247. },
  248. sureClick(item) {
  249. uni.showLoading({
  250. title: "加载中",
  251. mask: true,
  252. })
  253. myApi.merchantChangeStatus({
  254. id: item.id,
  255. status: '1'
  256. }).then((res) => {
  257. uni.hideLoading();
  258. this.id = item.id;
  259. this.getAppointmentDetail();
  260. }).catch(error => {
  261. uni.showToast({
  262. title: error,
  263. icon: "none"
  264. })
  265. })
  266. },
  267. refuseClick(item) {
  268. uni.showLoading({
  269. title: "加载中",
  270. mask: true,
  271. })
  272. myApi.merchantChangeStatus({
  273. id: item.id,
  274. status: '4'
  275. }).then((res) => {
  276. uni.hideLoading();
  277. this.id = item.id;
  278. this.getAppointmentDetail();
  279. }).catch(error => {
  280. uni.showToast({
  281. title: error,
  282. icon: "none"
  283. })
  284. })
  285. },
  286. },
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. page{
  291. padding-bottom: 151px;
  292. background-color: #f6f8f6;
  293. }
  294. .tittle-font {
  295. font-size: 24px;
  296. position: fixed;
  297. top: 12px;
  298. right: 16px;
  299. z-index: 99999;
  300. }
  301. /deep/.u-alert-desc {
  302. width: 100vw;
  303. text-align: center;
  304. color: #ff5a00;
  305. }
  306. .reverse-time {
  307. background-color: #fff;
  308. padding: 36px 12px 16px 28px;
  309. .time {
  310. height: 36px;
  311. color: rgba(0, 185, 98, 100);
  312. font-size: 36px;
  313. text-align: center;
  314. position: relative;
  315. .img-box{
  316. width: 72px;
  317. height: 72px;
  318. img{
  319. width: 72px;
  320. height: 72px;
  321. position: absolute;
  322. top: -12px;
  323. right: -2px;
  324. }
  325. }
  326. }
  327. .refused{
  328. color: #666666;
  329. }
  330. }
  331. .details-item {
  332. margin-top: 40px;
  333. padding-right: 16px;
  334. padding-bottom: 12px;
  335. .item {
  336. display: flex;
  337. justify-content: space-between;
  338. margin-top: 8px;
  339. }
  340. }
  341. // 充电桩详情
  342. .charge-pile {
  343. background-color: #fff;
  344. margin-top: 12px;
  345. padding: 0 0 12px 16px;
  346. .box {
  347. position: relative;
  348. height: 66px;
  349. padding: 12px 0;
  350. .more {
  351. position: absolute;
  352. top: 19px;
  353. right: 12px;
  354. font-size: 24px;
  355. color: #b3b3b3;
  356. }
  357. }
  358. .name {
  359. width: 90%;
  360. line-height: 18px;
  361. color: rgba(16, 16, 16, 100);
  362. font-size: 18px;
  363. font-weight: 600;
  364. }
  365. .ellipsis{
  366. white-space: nowrap;
  367. text-overflow: ellipsis;
  368. overflow: hidden;
  369. }
  370. .address {
  371. width: 90%;
  372. line-height: 20px;
  373. color: rgba(51, 51, 51, 100);
  374. margin-top: 4px;
  375. }
  376. // 联系电话
  377. .tel {
  378. line-height: 48px;
  379. display: flex;
  380. justify-content: space-between;
  381. border: 1px solid #eef2f0;
  382. border-left: none;
  383. position: relative;
  384. .tel-num {
  385. width: 50%;
  386. }
  387. .more2 {
  388. display: inline-block;
  389. font-size: 24px;
  390. color: #b3b3b3;
  391. height: 48px;
  392. position: absolute;
  393. top: 1px;
  394. right: 12px;
  395. }
  396. }
  397. .item {
  398. margin-top: 20px;
  399. }
  400. }
  401. // 按钮
  402. .bottom{
  403. width: 100%;
  404. height: 56px;
  405. position: fixed;
  406. bottom: 0;
  407. background-color: #fff;
  408. display: flex;
  409. .refuse-btn{
  410. background-color: #DBDBDB;
  411. }
  412. .u-btn{
  413. width: 44%;
  414. height: 40px;
  415. margin: auto;
  416. font-size: 18px;
  417. }
  418. .cancel-btn{
  419. width: 91.4%;
  420. background-color: #dbdbdb;
  421. color: #666666
  422. }
  423. }
  424. </style>