preengagedListDetails.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <view>
  3. <u-navbar title="预约单详情" :custom-back="customback" >
  4. </u-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. hourDistanceArr,
  99. currentTimeStamp,
  100. parseUnixTime
  101. } from '@/utils'
  102. export default {
  103. data() {
  104. return {
  105. isback:false,
  106. detail:{},
  107. price:{},
  108. chargingDevice:{},
  109. description: '等待桩主确认预约单,剩余时间04:59:59'
  110. }
  111. },onLoad(op) {
  112. //预约充电跳转过来则 返回首页
  113. if(op.isback){
  114. this.isback=true
  115. }
  116. if(op.qr){
  117. //扫码进入的
  118. }
  119. this.id= op.id;
  120. this.getInfo()
  121. },
  122. methods:{
  123. getInfo(bl){
  124. console.log(bl)
  125. if(!bl){
  126. uni.showLoading({
  127. title: "加载中",
  128. mask: true,
  129. })
  130. }
  131. API.myAppointmentDetail({
  132. id:this.id,
  133. }).then((res) => {
  134. if(!bl){
  135. uni.hideLoading()
  136. }
  137. this.detail= res.data.chargingAppointment;
  138. this.chargingDevice=res.data.chargingDevice;
  139. this.price=res.data.price;
  140. if(this.detail.status=="0"){
  141. //this.description= '等待桩主确认预约单,剩余时间'
  142. var data=new Date(this.detail.createTime).getTime()
  143. var c=hourDistanceArr(new Date(),new Date(data+5*60*1000))
  144. this.description= '等待桩主确认预约单,剩余时间'+c[1]+'分'+c[2]+"秒";
  145. setTimeout(()=>{
  146. this.getInfo(true);
  147. },1000)
  148. }
  149. }).catch(error => {
  150. uni.showToast({
  151. title: error
  152. })
  153. })
  154. },
  155. customback(){
  156. if(this.isback){
  157. uni.reLaunch({
  158. url:"/pages/index/index"
  159. })
  160. }else{
  161. uni.navigateBack({
  162. })
  163. }
  164. },
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. page{
  170. padding-bottom: 151px;
  171. }
  172. .tittle-font {
  173. font-size: 24px;
  174. position: fixed;
  175. top: 12px;
  176. right: 16px;
  177. z-index: 99999;
  178. }
  179. /deep/.u-alert-desc {
  180. width: 100vw;
  181. text-align: center;
  182. color: #ff5a00;
  183. }
  184. .reverse-time {
  185. background-color: #fff;
  186. padding: 36px 12px 16px 28px;
  187. .time {
  188. height: 36px;
  189. color: rgba(0, 185, 98, 100);
  190. font-size: 36px;
  191. text-align: center;
  192. }
  193. }
  194. .details-item {
  195. margin-top: 32px;
  196. padding-right: 16px;
  197. padding-bottom: 12px;
  198. .item {
  199. display: flex;
  200. justify-content: space-between;
  201. margin-top: 8px;
  202. }
  203. }
  204. // 充电桩详情
  205. .charge-pile {
  206. background-color: #fff;
  207. margin-top: 12px;
  208. padding: 0 0 12px 16px;
  209. .box {
  210. position: relative;
  211. height: 66px;
  212. padding: 12px 0;
  213. .more {
  214. position: absolute;
  215. top: 19px;
  216. right: 12px;
  217. font-size: 24px;
  218. color: #b3b3b3;
  219. }
  220. }
  221. .name {
  222. line-height: 18px;
  223. color: rgba(16, 16, 16, 100);
  224. font-size: 18px;
  225. font-weight: 600;
  226. }
  227. .address {
  228. line-height: 20px;
  229. color: rgba(51, 51, 51, 100);
  230. margin-top: 4px;
  231. }
  232. // 联系电话
  233. .tel {
  234. line-height: 48px;
  235. display: flex;
  236. justify-content: space-between;
  237. border: 1px solid #eef2f0;
  238. border-left: none;
  239. position: relative;
  240. .tel-num {
  241. width: 50%;
  242. }
  243. .more2 {
  244. display: inline-block;
  245. font-size: 24px;
  246. color: #b3b3b3;
  247. height: 48px;
  248. position: absolute;
  249. top: 1px;
  250. right: 12px;
  251. }
  252. }
  253. .item {
  254. margin-top: 20px;
  255. }
  256. }
  257. // 按钮
  258. .bottom{
  259. width: 100%;
  260. height: 56px;
  261. position: fixed;
  262. bottom: 0;
  263. background-color: #fff;
  264. display: flex;
  265. .refuse-btn{
  266. background-color: #DBDBDB;
  267. }
  268. .u-btn{
  269. width: 44%;
  270. height: 40px;
  271. margin: auto;
  272. font-size: 18px;
  273. }
  274. }
  275. </style>