orderDetail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="order-pages">
  3. <u-cell-group>
  4. <u-cell-item title="订单状态" :arrow="false">
  5. <view slot="right-icon">
  6. <text :class="orderInfo.orderStatus">{{getOptionName(orderStatusList,orderInfo?orderInfo.orderStatus:'')}}</text>
  7. </view>
  8. </u-cell-item>
  9. <u-cell-item title="订单编号" :arrow="false" >
  10. {{orderInfo.orderNo}}
  11. </u-cell-item>
  12. <u-cell-item title="创建时间" :arrow="false" >
  13. {{orderInfo.orderTime}}
  14. </u-cell-item>
  15. <u-cell-item title="服务网点" :arrow="false">
  16. {{orderInfo.storeName}}
  17. </u-cell-item>
  18. <u-cell-item title="服务项目" :arrow="false">
  19. {{orderInfo.itemName}}
  20. </u-cell-item>
  21. <u-cell-item title="手机号" :arrow="false">
  22. {{orderInfo.customerMobile}}
  23. </u-cell-item>
  24. <u-cell-item title="支付方式" :arrow="false">
  25. {{orderInfo.payType}}
  26. </u-cell-item>
  27. <u-cell-item title="应付金额" :arrow="false">
  28. ¥{{orderInfo.payableAmount}}
  29. </u-cell-item>
  30. <u-cell-item title="优惠价" :arrow="false">
  31. {{orderInfo.couponAmount?orderInfo.couponAmount:0}}
  32. </u-cell-item>
  33. <u-cell-item title="实付金额" :arrow="false">
  34. <text class="order-price">¥{{orderInfo.payStatus=='已支付' ? orderInfo.paymentAmount : 0}}</text>
  35. </u-cell-item>
  36. </u-cell-group>
  37. <view class="order-photo">
  38. <view v-if="orderInfo.beginImage">
  39. <view>洗车前</view>
  40. <u-image width="100%" height="400rpx" :src="orderInfo.beginImage"></u-image>
  41. </view>
  42. <view v-if="orderInfo.endImage">
  43. <view>洗车后</view>
  44. <u-image width="100%" height="400rpx" :src="orderInfo.endImage"></u-image>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {orderDetail} from '@/api/order.js'
  51. import {getLookUpDatas} from '@/api/data.js'
  52. export default{
  53. data() {
  54. return {
  55. orderInfo: null,
  56. src: '',
  57. orderStatusList: []
  58. }
  59. },
  60. onLoad(options) {
  61. if (options.id) {
  62. console.log(options.id)
  63. this.getOrderDetail(options.id)
  64. this.orderStatusList = this.$store.state.vuex_payStatus
  65. }
  66. },
  67. methods:{
  68. getOptionName (list,val) {
  69. if(val){
  70. let p = list.find((item) => {
  71. return item.code == val
  72. })
  73. return p ? p.dispName : '-'
  74. }
  75. return '-'
  76. },
  77. // 获取订单详情
  78. getOrderDetail (id) {
  79. let payTypeList = this.$store.state.vuex_payType
  80. orderDetail({id:id}).then(res =>{
  81. if (res.status == 200) {
  82. this.orderInfo = res.data
  83. this.orderInfo.payType = this.orderInfo.payType ? this.getOptionName(payTypeList,this.orderInfo.payType) : ''
  84. } else {
  85. }
  86. })
  87. }
  88. },
  89. }
  90. </script>
  91. <style lang="scss">
  92. .order-pages{
  93. width: 100%;
  94. .u-cell{
  95. padding:10rpx 32rpx;
  96. }
  97. .order-photo{
  98. padding:0 30rpx;
  99. >view{
  100. text-align: center;
  101. padding: 20rpx;
  102. }
  103. }
  104. .FINISHED{
  105. color: #00aa00;
  106. }
  107. .UN_PAY{
  108. color: #ff0000;
  109. }
  110. .CANCELED{
  111. color: #7e7b88;
  112. }
  113. .PAID{
  114. color: #00aaff;
  115. }
  116. .REFUNDING{
  117. color: #00557f;
  118. }
  119. .REFUNDED{
  120. color: #005500;
  121. }
  122. .order-price{
  123. font-size: 36rpx;
  124. color: red;
  125. }
  126. }
  127. </style>