queryOrderResult.vue 3.2 KB

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