order-detail.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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" v-if="orderInfo.discountMoney">
  92. <view class="lable">{{orderInfo.discountDes}}</view>
  93. <view class="contet sum">-{{orderInfo.discountMoney?orderInfo.discountMoney.toFixed(4):"0.0000"}}元
  94. </view>
  95. </view>
  96. <view class="cell" v-if="orderInfo.firmPrice">
  97. <view class="lable">企业专享价减</view>
  98. <view class="contet sum">-{{orderInfo.firmPrice?orderInfo.firmPrice.toFixed(4):"0.0000"}}元</view>
  99. </view>
  100. <view class="cell" v-if="orderInfo.couponPrice">
  101. <view class="lable">优惠券减</view>
  102. <view class="contet sum">-{{orderInfo.couponPrice?orderInfo.couponPrice.toFixed(4):"0.0000"}}元</view>
  103. </view>
  104. <view class="cell">
  105. <view class="lable">实际结算费用</view>
  106. <view class="contet sum">{{orderInfo.realCost?orderInfo.realCost.toFixed(4):"0.0000"}}元</view>
  107. </view>
  108. </view>
  109. <view class="tips">
  110. <image src="@/static/img/warn.svg" class="icon"></image>
  111. <text>本次充电费用已从您的“充电抵扣券”中抵扣结算</text>
  112. </view>
  113. </view>
  114. </ax-body>
  115. </template>
  116. <script>
  117. export default {
  118. onLoad(opts) {
  119. console.log("启动充值页面的参数:", opts)
  120. this.getOrderInfo(opts.orderId);
  121. },
  122. data() {
  123. return {
  124. orderInfo: {
  125. id: 1
  126. }, //订单信息
  127. deviceInfo: {}, //充电桩详情
  128. }
  129. },
  130. methods: {
  131. getStopType() {
  132. var str = "用户主动终止";
  133. if (this.orderInfo.stopType) {
  134. if (this.orderInfo.stopType == 1) {
  135. str = "用户主动终止";
  136. } else if (this.orderInfo.stopType == 2) {
  137. str = "充电桩主动终止";
  138. }
  139. }
  140. return str;
  141. },
  142. clcaServicePrice() {
  143. var serivp = this.orderInfo.realCost - this.orderInfo.thirdPartyElecfee;
  144. if (this.orderInfo.discountMoney) {
  145. //有优惠价,服务费显示把优惠价加回去
  146. serivp = serivp + this.orderInfo.discountMoney;
  147. }
  148. return serivp ? serivp.toFixed(4) : "0.0000"
  149. },
  150. //查询订单详情
  151. getOrderInfo(orderId) {
  152. this.$api.base("post", "/chargeApi/queryIsSuccessStop", {
  153. "id": orderId
  154. }, {}).then(res => {
  155. console.log("订单详情:", res)
  156. this.orderInfo = res.obj.orderInfo;
  157. this.deviceInfo = res.obj.deviceInfo;
  158. })
  159. },
  160. //拆解时间
  161. splitTime(time, index) {
  162. if (!time) {
  163. return;
  164. }
  165. return time.split(" ")[index];
  166. },
  167. getOrderStatus(status) {
  168. var str = "";
  169. //状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电
  170. switch (status) {
  171. case 0:
  172. str = "待启动";
  173. break;
  174. case 1:
  175. str = "充电中";
  176. break;
  177. case 2:
  178. str = "结算中";
  179. break;
  180. case 3:
  181. str = "已完成";
  182. break;
  183. case 5:
  184. str = "未成功充电";
  185. break;
  186. }
  187. return str;
  188. }
  189. }
  190. }
  191. </script>
  192. <style scoped>
  193. @import url("order-detail.css");
  194. </style>