order-detail.vue 5.7 KB

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