order-detail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <ax-body>
  3. <view class="page-background">
  4. <image src="@/static/img/my-bg.svg" mode="widthFix"></image>
  5. </view>
  6. <view class="body">
  7. <!-- 基础信息 -->
  8. <view class="base-info">
  9. <view class="content">
  10. <view class="name">
  11. <image src="@/static/img/order-detail-icon.png" class="icon" mode="widthFix"></image>
  12. <text>充电度数</text>
  13. </view>
  14. <view class="val"><text class="value">{{orderInfo.totalCharge || 0}}</text><text
  15. class="unit">度电</text></view>
  16. </view>
  17. <image src="@/static/img/order-detail-bg.png" class="bg" mode="widthFix"></image>
  18. </view>
  19. <!-- 单元格 -->
  20. <view class="cell-group multi-line">
  21. <view class="cell">
  22. <view class="lable">起始时间</view>
  23. <view class="contet">{{orderInfo.startTime || '未知'}}</view>
  24. </view>
  25. <view class="cell">
  26. <view class="lable">终止时间</view>
  27. <view class="contet">{{orderInfo.endTime || '未知'}}</view>
  28. </view>
  29. <view class="cell">
  30. <view class="lable">终止方式</view>
  31. <view class="contet">{{getStopType()}}</view>
  32. </view>
  33. </view>
  34. <view class="cell-group" v-if="orderInfo.maspStatus!=0">
  35. <template v-if="orderInfo.maspStatus===1">
  36. <view class="cell">
  37. <view class="load-payment">待补缴</view>
  38. <view class="load-payment-btn" @click="$app.url.goto('/pages/coupon-buy/coupon-buy')">去补缴</view>
  39. </view>
  40. <view class="cell">
  41. <view class="lable">超充金额</view>
  42. <view class="flow-money">{{(orderInfo.maspAmount+orderInfo.maspRealAmount).toFixed(2)||'0'}}元
  43. </view>
  44. </view>
  45. </template>
  46. <template v-else-if="orderInfo.maspStatus===2">
  47. <view class="finish-payment">已补缴</view>
  48. <view class="cell">
  49. <view class="lable">超充金额</view>
  50. <view class="contet">{{(orderInfo.maspAmount+orderInfo.maspRealAmount).toFixed(2)}}</view>
  51. </view>
  52. <view class="cell">
  53. <view class="lable">补缴时间</view>
  54. <view class="contet">{{orderInfo.maspTime}}</view>
  55. </view>
  56. </template>
  57. </view>
  58. <!-- 单元格 -->
  59. <view class="cell-group">
  60. <view class="cell">
  61. <view class="lable">订单状态</view>
  62. <view class="contet">{{getOrderStatus(orderInfo.status)}}</view>
  63. </view>
  64. <view class="cell">
  65. <view class="lable">订单编号</view>
  66. <view class="contet">{{orderInfo.id}}</view>
  67. </view>
  68. <view class="cell">
  69. <view class="lable">订单时间</view>
  70. <view class="contet">{{orderInfo.createTime}}</view>
  71. </view>
  72. <view class="cell">
  73. <view class="lable">充电电站</view>
  74. <view class="contet">{{deviceInfo.thirdPartyStationName}}</view>
  75. </view>
  76. <view class="cell">
  77. <view class="lable">终端名称</view>
  78. <view class="contet">{{deviceInfo.deviceName}}</view>
  79. </view>
  80. <view class="cell">
  81. <view class="lable">终端编号</view>
  82. <view class="contet">{{deviceInfo.deviceNo}}</view>
  83. </view>
  84. <view class="cell">
  85. <view class="lable">车位编号</view>
  86. <view class="contet">{{deviceInfo.parkNo ? deviceInfo.parkNo : "无"}}</view>
  87. </view>
  88. <!-- <view class="cell"><view class="lable">电费</view><view class="contet">{{orderInfo.thirdPartyElecfee?orderInfo.thirdPartyElecfee.toFixed(4):"0.0000"}}元</view></view>
  89. <view class="cell"><view class="lable">服务费</view><view class="contet">{{clcaServicePrice(orderInfo)}}元</view></view> -->
  90. <view class="hr"></view>
  91. <view class="cell">
  92. <view class="lable">订单金额</view>
  93. <view class="contet sum">{{(orderInfo.discountMoney+orderInfo.firmPrice+orderInfo.couponPrice+orderInfo.realCost).toFixed(4)||"0.0000"}}元</view>
  94. </view>
  95. <view class="cell" v-if="orderInfo.discountMoney">
  96. <view class="lable">{{orderInfo.discountDes}}</view>
  97. <view class="contet sum">-{{orderInfo.discountMoney?orderInfo.discountMoney.toFixed(4):"0.0000"}}元
  98. </view>
  99. </view>
  100. <view class="cell" v-if="orderInfo.firmPrice">
  101. <view class="lable">企业专享价减</view>
  102. <view class="contet sum">-{{orderInfo.firmPrice?orderInfo.firmPrice.toFixed(4):"0.0000"}}元</view>
  103. </view>
  104. <view class="cell" v-if="orderInfo.couponPrice">
  105. <view class="lable">优惠券减</view>
  106. <view class="contet sum">-{{orderInfo.couponPrice?orderInfo.couponPrice.toFixed(4):"0.0000"}}元</view>
  107. </view>
  108. <view class="cell">
  109. <view class="lable">实际付款</view>
  110. <view class="contet sum">{{orderInfo.realCost?orderInfo.realCost.toFixed(4):"0.0000"}}元</view>
  111. </view>
  112. </view>
  113. <view class="tips">
  114. <image src="@/static/img/warn.svg" class="icon"></image>
  115. <text>本次充电费用已从您的“充电抵扣券”中抵扣结算</text>
  116. </view>
  117. </view>
  118. </ax-body>
  119. </template>
  120. <script>
  121. export default {
  122. onLoad(opts) {
  123. console.log("启动充值页面的参数:", opts)
  124. this.getOrderInfo(opts.orderId);
  125. },
  126. data() {
  127. return {
  128. orderInfo: {
  129. id: 1
  130. }, //订单信息
  131. deviceInfo: {}, //充电桩详情
  132. }
  133. },
  134. methods: {
  135. getStopType() {
  136. var str = "用户主动终止";
  137. if (this.orderInfo.stopType) {
  138. if (this.orderInfo.stopType == 1) {
  139. str = "用户主动终止";
  140. } else if (this.orderInfo.stopType == 2) {
  141. str = "充电桩主动终止";
  142. }
  143. }
  144. return str;
  145. },
  146. clcaServicePrice() {
  147. var serivp = this.orderInfo.realCost - this.orderInfo.thirdPartyElecfee;
  148. if (this.orderInfo.discountMoney) {
  149. //有优惠价,服务费显示把优惠价加回去
  150. serivp = serivp + this.orderInfo.discountMoney;
  151. }
  152. return serivp ? serivp.toFixed(4) : "0.0000"
  153. },
  154. //查询订单详情
  155. getOrderInfo(orderId) {
  156. this.$api.base("post", "/chargeApi/queryIsSuccessStop", {
  157. "id": orderId
  158. }, {}).then(res => {
  159. console.log("订单详情:", res)
  160. this.orderInfo = res.obj.orderInfo;
  161. this.deviceInfo = res.obj.deviceInfo;
  162. })
  163. },
  164. //拆解时间
  165. splitTime(time, index) {
  166. if (!time) {
  167. return;
  168. }
  169. return time.split(" ")[index];
  170. },
  171. getOrderStatus(status) {
  172. var str = "";
  173. //状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电
  174. switch (status) {
  175. case 0:
  176. str = "待启动";
  177. break;
  178. case 1:
  179. str = "充电中";
  180. break;
  181. case 2:
  182. str = "结算中";
  183. break;
  184. case 3:
  185. str = "已完成";
  186. break;
  187. case 5:
  188. str = "未成功充电";
  189. break;
  190. }
  191. return str;
  192. }
  193. }
  194. }
  195. </script>
  196. <style scoped>
  197. @import url("order-detail.css");
  198. </style>