detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="wrapper">
  3. <view class="top-bg">
  4. <!-- #ifndef MP-ALIPAY -->
  5. <u-navbar :border-bottom="false" title="订单详情" back-icon-color="#fff" title-color="#fff" :background="{ background: 'tranparent' }"></u-navbar>
  6. <!-- #endif -->
  7. <view class="layer-icon">
  8. <image style="width: 90rpx; height: 85rpx;vertical-align: top;margin-right:20rpx;" src="/static/order/order-complete.png" mode="scaleToFill" />
  9. <view class="tip">
  10. <view v-if="info.startChargeSeqStat == 4">已完成</view>
  11. <view class="sub" v-if="info.billInfo.occupyPrice>0 && info.billInfo.occupyFlag==1">请尽快拔枪驶离</view>
  12. <view class="sub" v-if="info.billInfo.occupyPrice==0 && info.billInfo.occupyFlag==1">您还未拔枪</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="layer-top">
  17. <image style="width: 32rpx; height: 32rpx;vertical-align: top;margin-right:10rpx;" src="/static/order/station.png" mode="scaleToFill" />
  18. {{ info.stationName }}
  19. </view>
  20. <view class="layer-divider"></view>
  21. <!-- 基本信息 -->
  22. <view class="card-box layer-middle">
  23. <view class="card-row">
  24. <view class="lable">充电枪编号</view>
  25. <view class="content">{{ info.connectorId }}</view>
  26. </view>
  27. <view class="card-row">
  28. <view class="lable">充电电量</view>
  29. <view class="content">{{ info.totalPower }}度</view>
  30. </view>
  31. <view class="card-row">
  32. <view class="lable">充电时长</view>
  33. <view class="content">{{ parseInt(info.chargeDur / 1000 / 60) }}分{{ parseInt(info.chargeDur / 1000) % 60 }}秒</view>
  34. </view>
  35. <view class="card-row">
  36. <view class="lable">启动时间</view>
  37. <view class="content">{{ info.startTime }}</view>
  38. </view>
  39. <view class="card-row">
  40. <view class="lable">停止时间</view>
  41. <view class="content">{{ info.endTime }}</view>
  42. </view>
  43. <view class="divider"></view>
  44. <view class="card-row">
  45. <view class="lable">订单编号</view>
  46. <view class="content">{{ info.startChargeSeq }}</view>
  47. </view>
  48. <view class="card-row">
  49. <view class="lable">创建时间</view>
  50. <view class="content">{{ info.createTime }}</view>
  51. </view>
  52. <view class="card-row">
  53. <view class="lable">支付时间</view>
  54. <view class="content">{{ info.payInfo.payTime }}</view>
  55. </view>
  56. </view>
  57. <view class="layer-divider"></view>
  58. <!-- 基本信息 -->
  59. <view class="card-box pay layer-middle" v-if="info.payState == 1">
  60. <view class="card-row">
  61. <view class="lable">充电费</view>
  62. <view class="content">¥{{ info.totalElecMoney | unitPrice }}</view>
  63. </view>
  64. <view class="card-row">
  65. <view class="lable">服务费</view>
  66. <view class="content">¥{{ info.totalServiceMoney | unitPrice }}</view>
  67. </view>
  68. <view class="card-row">
  69. <view class="lable">订单总额</view>
  70. <view class="content">¥{{ info.totalMoney | unitPrice }}</view>
  71. </view>
  72. <view class="card-row">
  73. <view class="lable"></view>
  74. <view class="content">
  75. 实际支付
  76. <text class="actual-pay">¥{{ info.realPayMoney | unitPrice }}</text>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="layer-bottom"></view>
  81. <view style="height:60rpx;"></view>
  82. </div>
  83. </template>
  84. <script>
  85. import { getOrderDetail } from "@/api/order";
  86. export default {
  87. data() {
  88. return {
  89. keyword: "",
  90. params: {
  91. id: ""
  92. },
  93. info: [], //订单数据
  94. };
  95. },
  96. onLoad(options) {
  97. this.params.id = options.id;
  98. this.init();
  99. },
  100. onShow() {
  101. this.$nextTick(() => {
  102. this.$refs.carRef && this.$refs.carRef.reload();
  103. })
  104. },
  105. methods: {
  106. navigateTo(url) {
  107. uni.navigateTo({
  108. url,
  109. });
  110. },
  111. async init() {
  112. let res = await getOrderDetail(this.params.id);
  113. if (res.data.code == 200) {
  114. this.info = res.data.data;
  115. }
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="scss">
  121. page {
  122. background-color: #f7f7f7;
  123. }
  124. /* DarkMode 下的样式 start */
  125. @media (prefers-color-scheme: dark) {
  126. page {
  127. background-color: #121425;
  128. }
  129. }
  130. </style>
  131. <style lang="scss" scoped>
  132. .wrapper {
  133. }
  134. .top-bg {
  135. background-image: linear-gradient(230deg, #00a5ff 7%, #0089c9 100%);
  136. // background-size: 100% 400rpx;
  137. background-repeat: no-repeat;
  138. height: 400rpx;
  139. /* #ifdef MP-ALIPAY */
  140. height: 450rpx;
  141. margin-top: -50rpx;
  142. padding-top: 200rpx;
  143. /* #endif */
  144. }
  145. .layer-icon {
  146. width: 100%;
  147. height: 100rpx;
  148. margin-top: 50rpx;
  149. margin-bottom: 20rpx;
  150. text-align: left;
  151. font-size: 32rpx;
  152. line-height: 100rpx;
  153. font-weight: 500;
  154. color: #fff;
  155. display: flex;
  156. justify-content: center;
  157. .tip {
  158. // display: flex;
  159. // flex-wrap: wrap;
  160. line-height: 1;
  161. align-self: center;
  162. max-width: 590rpx;
  163. .sub {
  164. font-size: 24rpx;
  165. margin-top: 10rpx;
  166. }
  167. }
  168. }
  169. .layer-top {
  170. background: transparent url("@/static/order/order-t.png") no-repeat;
  171. background-size: 100%;
  172. height: 100rpx;
  173. line-height: 35rpx;
  174. text-align: left;
  175. padding: 0px 80rpx;
  176. padding-top: 50rpx;
  177. margin-top: -50rpx;
  178. font-size: 32rpx;
  179. font-weight: 500;
  180. }
  181. .layer-divider {
  182. background: transparent url("@/static/order/order-m.png") no-repeat;
  183. background-size: 100%;
  184. width: 100%;
  185. height: 30rpx;
  186. }
  187. .layer-middle {
  188. background: transparent url("@/static/order/order-bg.png") repeat-y;
  189. background-size: 100%;
  190. padding: 0px 80rpx;
  191. }
  192. .layer-bottom {
  193. background: transparent url("@/static/order/order-b.png") no-repeat;
  194. background-size: 100%;
  195. width: 100%;
  196. height: 64rpx;
  197. }
  198. .card-row {
  199. display: flex;
  200. align-items: center;
  201. font-size: 24rpx;
  202. line-height: 40rpx;
  203. padding: 10rpx 0;
  204. .lable {
  205. width: 150rpx;
  206. color: #bdbfc0;
  207. }
  208. .content {
  209. flex: 1;
  210. text-align: left;
  211. }
  212. .orange {
  213. color: #ff9920;
  214. }
  215. }
  216. .card-box.pay .content {
  217. text-align: right;
  218. }
  219. .actual-pay {
  220. font-size: 32rpx;
  221. margin-left: 10rpx;
  222. }
  223. /* DarkMode 下的样式 start */
  224. @media (prefers-color-scheme: dark) {
  225. .layer-top {
  226. background: transparent url("@/static/order/order-t-dark.png") no-repeat;
  227. background-size: 100%;
  228. }
  229. .layer-divider {
  230. background: transparent url("@/static/order/order-m-dark.png") no-repeat;
  231. background-size: 100%;
  232. }
  233. .layer-middle {
  234. background: transparent url("@/static/order/order-bg-dark.png") repeat-y;
  235. background-size: 100%;
  236. }
  237. .layer-bottom {
  238. background: transparent url("@/static/order/order-b-dark.png") no-repeat;
  239. background-size: 100%;
  240. }
  241. }
  242. </style>