queryOrderResult.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="container">
  3. <view>
  4. <!-- #ifdef MP-WEIXIN -->
  5. <NavigateBar title="查询结果" control="back" bgcolor="#a09cc4"></NavigateBar>
  6. <!-- #endif -->
  7. <!-- #ifdef MP-ALIPAY -->
  8. <NavigateBar title="查询结果" bgcolor="#a09cc4"></NavigateBar>
  9. <!-- #endif -->
  10. </view>
  11. <view class="order-item" v-for="(order,index) in orderList" @click="gotoSelectRoom(index)" :key="index">
  12. <view class="order-item-top">
  13. <u-text :text="order.roomTypeName+order.room" color="#333333" bold size="18"></u-text>
  14. <view class="order-item-top-right">
  15. <u-text :text="order.status" color="#A5B6F1" align="center"></u-text>
  16. </view>
  17. </view>
  18. <u-text :text="order.orderId"></u-text>
  19. <u-text :text="order.createTime"></u-text>
  20. <u-text :text="order.duration"></u-text>
  21. <view class="payment-info">
  22. <view class="">
  23. <u-text :text="order.paymentStatus"></u-text>
  24. </view>
  25. <view class="">
  26. <u-text :text="order.price" color="#F7312F"></u-text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import moment from "moment"
  34. import {
  35. mapState,
  36. mapMutations
  37. } from 'vuex'
  38. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  39. export default {
  40. components: {
  41. NavigateBar
  42. },
  43. data() {
  44. return {
  45. orderList: [],
  46. paymentStatus: {
  47. UNPAID: '待支付',
  48. PAID: '已支付'
  49. },
  50. status: {
  51. ORDER_PLACED: '未入住'
  52. }
  53. };
  54. },
  55. computed: {
  56. ...mapState('m_business', ['queryOrderResult']),
  57. },
  58. methods: {
  59. ...mapMutations('m_business', ['updateOrder']),
  60. gotoSelectRoom(index) {
  61. console.log(index)
  62. this.updateOrder(this.queryOrderResult[index])
  63. uni.navigateTo({
  64. url: '/subpkg_checkin/addGuest/addGuest'
  65. })
  66. }
  67. },
  68. onLoad() {
  69. this.orderList = JSON.parse(JSON.stringify(this.queryOrderResult))
  70. this.orderList.forEach(order => {
  71. order.paymentStatus = this.paymentStatus[order.paymentStatus] + ':'
  72. order.status = '待入住'
  73. order.orderId = '订单号:' + order.orderId
  74. order.createTime = '订单创建时间:' + moment(order.createTime).format('YYYY/MM/DD HH:mm:ss')
  75. order.duration = moment(order.startTime).format('YYYY-MM-DD') + '至' + moment(order.endTime).format(
  76. 'YYYY-MM-DD')
  77. order.price = '¥' + order.price
  78. })
  79. },
  80. // #ifdef MP-WEIXIN
  81. onShareAppMessage(info) {
  82. return {
  83. title: '源享住',
  84. path: 'pages/login/login',
  85. imageUrl: "/static/logo.png"
  86. }
  87. }
  88. // #endif
  89. }
  90. </script>
  91. <style>
  92. page {
  93. background-color: #EFEFF4;
  94. }
  95. </style>
  96. <style lang="scss" scoped>
  97. .container {
  98. display: flex;
  99. flex-direction: column;
  100. .order-item {
  101. background-color: #FFFFFF;
  102. box-shadow: 0px 10px 6px 1px rgba(75, 75, 75, 0.1);
  103. border-radius: 10px;
  104. margin: 20rpx;
  105. padding: 30rpx;
  106. .order-item-top {
  107. display: flex;
  108. justify-content: space-between;
  109. .order-item-top-right {
  110. width: 120rpx;
  111. height: 60rpx;
  112. background-color: #E7EDFD;
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. }
  117. }
  118. .payment-info {
  119. display: flex;
  120. }
  121. }
  122. }
  123. .u-text__value {
  124. margin: 10rpx 0;
  125. }
  126. </style>