orderDetail.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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="order-finish">{{orderInfo.payStatus}}</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>洗车前</view>
  39. <u-image width="100%" height="400rpx" :src="item.beginImage"></u-image>
  40. <view>洗车后</view>
  41. <u-image width="100%" height="400rpx" :src="item.endImage"></u-image>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {orderDetail} from '@/api/order.js'
  47. import {getLookUpDatas} from '@/api/data.js'
  48. export default{
  49. data() {
  50. return {
  51. orderInfo: null,
  52. src: ''
  53. }
  54. },
  55. onLoad(options) {
  56. if (options.id) {
  57. console.log(options.id)
  58. this.getOrderDetail(options.id)
  59. }
  60. },
  61. methods:{
  62. getOptionName (list,val) {
  63. let p = list.find((item) => {
  64. return item.code == val
  65. })
  66. return p ? p.dispName : '-'
  67. },
  68. // 获取订单详情
  69. getOrderDetail (id) {
  70. let orderStatusList = this.$store.state.vuex_payStatus
  71. let payTypeList = this.$store.state.vuex_payType
  72. orderDetail({id:id}).then(res =>{
  73. if (res.status == 200) {
  74. this.orderInfo = res.data
  75. this.orderInfo.payStatus = this.getOptionName(orderStatusList,this.orderInfo.payStatus)
  76. this.orderInfo.payType = this.orderInfo.payType ? this.getOptionName(payTypeList,this.orderInfo.payType) : ''
  77. } else {
  78. this.toashMsg(res.message)
  79. }
  80. })
  81. }
  82. },
  83. }
  84. </script>
  85. <style lang="scss">
  86. .order-pages{
  87. width: 100%;
  88. .u-cell{
  89. padding:10rpx 32rpx;
  90. }
  91. .order-photo{
  92. padding:0 30rpx;
  93. >view{
  94. text-align: center;
  95. padding: 20rpx;
  96. }
  97. }
  98. .order-finish{
  99. color: #00aa00;
  100. }
  101. .order-unPay{
  102. color: #ff0000;
  103. }
  104. .order-cansel{
  105. color: #7e7b88;
  106. }
  107. .order-price{
  108. font-size: 36rpx;
  109. color: red;
  110. }
  111. }
  112. </style>