preengagedListDetails.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <view>
  3. <ujp-navbar title="预约单详情" :custom-back="customback" >
  4. </ujp-navbar>
  5. <u-alert-tips type="warning" v-if="detail.status==0" :description="description"></u-alert-tips>
  6. <view class="reverse-time">
  7. <view class="time">
  8. 预留30分钟
  9. </view>
  10. <view class="details-item">
  11. <view class="item">
  12. <view class="item-name">
  13. 预约单号
  14. </view>
  15. <view class="item-content">
  16. 0000111122223333
  17. </view>
  18. </view>
  19. <view class="item">
  20. <view class="item-name">
  21. 预计开始充电
  22. </view>
  23. <view class="item-content">
  24. 2022-05-31 09:30:00
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="item-name">
  29. 预计充电时长
  30. </view>
  31. <view class="item-content">
  32. 6小时
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 充电桩详情 -->
  38. <view class="charge-pile">
  39. <view class="box" @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=3865b3a3-13fd-461a-8145-ee9711df35a2')">
  40. <view class="name">
  41. 荆鹏软件园充电站/1号快充桩
  42. </view>
  43. <view class="address">
  44. 湖北省荆州市沙市区江津东路附155号
  45. </view>
  46. <text class="iconfont more">
  47. &#xe600;
  48. </text>
  49. </view>
  50. <!-- <view class="tel">
  51. <view class="tel-text">
  52. 联系电话
  53. </view>
  54. <view class="tel-num">
  55. 李先生 15100001111
  56. <text class="iconfont more2">
  57. &#xe600;
  58. </text>
  59. </view>
  60. </view> -->
  61. <view class="details-item">
  62. <view class="item">
  63. <view class="item-name">
  64. 预约单生成时间
  65. </view>
  66. <view class="item-content">
  67. 2022-05-31 09:00:00
  68. </view>
  69. </view>
  70. <view class="item">
  71. <view class="item-name">
  72. 电费单价
  73. </view>
  74. <view class="item-content">
  75. 1.00元/度
  76. </view>
  77. </view>
  78. <view class="item">
  79. <view class="item-name">
  80. 充电服务费
  81. </view>
  82. <view class="item-content">
  83. 1.00元/度
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 底部按钮 -->
  89. <view class="bottom" v-if="false">
  90. <u-button shape='circle' class="refuse-btn">拒绝</u-button>
  91. <u-button type="success" shape='circle'>确认</u-button>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import * as API from '@/apis/apointment.js'
  97. import {
  98. newDate,
  99. hourDistanceArr,
  100. currentTimeStamp,
  101. parseUnixTime
  102. } from '@/utils'
  103. export default {
  104. data() {
  105. return {
  106. isback:false,
  107. detail:{},
  108. price:{},
  109. chargingDevice:{},
  110. description: '等待桩主确认预约单,剩余时间04:59:59'
  111. }
  112. },onLoad(op) {
  113. //预约充电跳转过来则 返回首页
  114. if(op.isback){
  115. this.isback=true
  116. }
  117. if(op.qr){
  118. //扫码进入的
  119. }
  120. this.id= op.id;
  121. this.getInfo()
  122. },
  123. methods:{
  124. getInfo(bl){
  125. //(bl)
  126. if(!bl){
  127. uni.showLoading({
  128. title: "加载中",
  129. mask: true,
  130. })
  131. }
  132. API.myAppointmentDetail({
  133. id:this.id,
  134. }).then((res) => {
  135. if(!bl){
  136. uni.hideLoading()
  137. }
  138. this.detail= res.data.chargingAppointment;
  139. this.chargingDevice=res.data.chargingDevice;
  140. this.price=res.data.price;
  141. if(this.detail.status=="0"){
  142. //this.description= '等待桩主确认预约单,剩余时间'
  143. var data=newDate(this.detail.createTime).getTime()
  144. var c=hourDistanceArr(new Date(),new Date(data+5*60*1000))
  145. this.description= '等待桩主确认预约单,剩余时间'+c[1]+'分'+c[2]+"秒";
  146. setTimeout(()=>{
  147. this.getInfo(true);
  148. },1000)
  149. }
  150. }).catch(error => {
  151. uni.showToast({
  152. title: error
  153. })
  154. })
  155. },
  156. customback(){
  157. if(this.isback){
  158. uni.reLaunch({
  159. url:"/pages/index/index"
  160. })
  161. }else{
  162. uni.navigateBack({
  163. })
  164. }
  165. },
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. page{
  171. padding-bottom: 151px;
  172. }
  173. .tittle-font {
  174. font-size: 24px;
  175. position: fixed;
  176. top: 12px;
  177. right: 16px;
  178. z-index: 99999;
  179. }
  180. ::v-deep.u-alert-desc {
  181. width: 100vw;
  182. text-align: center;
  183. color: #ff5a00;
  184. }
  185. .reverse-time {
  186. background-color: #fff;
  187. padding: 36px 12px 16px 28px;
  188. .time {
  189. height: 36px;
  190. color: rgba(0, 185, 98, 100);
  191. font-size: 36px;
  192. text-align: center;
  193. }
  194. }
  195. .details-item {
  196. margin-top: 32px;
  197. padding-right: 16px;
  198. padding-bottom: 12px;
  199. .item {
  200. display: flex;
  201. justify-content: space-between;
  202. margin-top: 8px;
  203. }
  204. }
  205. // 充电桩详情
  206. .charge-pile {
  207. background-color: #fff;
  208. margin-top: 12px;
  209. padding: 0 0 12px 16px;
  210. .box {
  211. position: relative;
  212. height: 66px;
  213. padding: 12px 0;
  214. .more {
  215. position: absolute;
  216. top: 19px;
  217. right: 12px;
  218. font-size: 24px;
  219. color: #b3b3b3;
  220. }
  221. }
  222. .name {
  223. line-height: 18px;
  224. color: rgba(16, 16, 16, 100);
  225. font-size: 18px;
  226. font-weight: 600;
  227. }
  228. .address {
  229. line-height: 20px;
  230. color: rgba(51, 51, 51, 100);
  231. margin-top: 4px;
  232. }
  233. // 联系电话
  234. .tel {
  235. line-height: 48px;
  236. display: flex;
  237. justify-content: space-between;
  238. border: 1px solid #eef2f0;
  239. border-left: none;
  240. position: relative;
  241. .tel-num {
  242. width: 50%;
  243. }
  244. .more2 {
  245. display: inline-block;
  246. font-size: 24px;
  247. color: #b3b3b3;
  248. height: 48px;
  249. position: absolute;
  250. top: 1px;
  251. right: 12px;
  252. }
  253. }
  254. .item {
  255. margin-top: 20px;
  256. }
  257. }
  258. // 按钮
  259. .bottom{
  260. width: 100%;
  261. height: 56px;
  262. position: fixed;
  263. bottom: 0;
  264. background-color: #fff;
  265. display: flex;
  266. .refuse-btn{
  267. background-color: #DBDBDB;
  268. }
  269. .u-btn{
  270. width: 44%;
  271. height: 40px;
  272. margin: auto;
  273. font-size: 18px;
  274. }
  275. }
  276. </style>