orderDetail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view>
  3. <view>
  4. <uni-card :title="checkinInfo.hotelName" extra="入住信息" note="Tips">
  5. <view class="card-item">
  6. <view class="card-item-left">
  7. <text>房间类型:</text>
  8. </view>
  9. <text>{{checkinInfo.roomTypeName}}\n</text>
  10. </view>
  11. <view class="card-item">
  12. <view class="card-item-left">
  13. <text>起始时间:</text>
  14. </view>
  15. <text>{{checkinInfo.startTime}}\n</text>
  16. </view>
  17. <view class="card-item">
  18. <view class="card-item-left">
  19. <text>结束时间:</text>
  20. </view>
  21. <text>{{checkinInfo.endTime}}</text>
  22. </view>
  23. </uni-card>
  24. <view class="completeBtn">
  25. <u-button type="primary" @click="gotoSelectRoom">办理入住</u-button>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import moment from 'moment'
  32. import {
  33. mapState,
  34. mapMutations
  35. } from 'vuex'
  36. export default {
  37. data() {
  38. return {
  39. checkinInfo: {
  40. hotelName: ""
  41. }
  42. };
  43. },
  44. computed: {
  45. ...mapState('m_business', ['reservationInfo']),
  46. },
  47. methods: {
  48. gotoSelectRoom() {
  49. uni.navigateTo({
  50. url: '/subpkg_checkin/selectRoom/selectRoom?roomType=' + this.checkinInfo.roomType
  51. })
  52. },
  53. getCheckinInfo() {
  54. this.checkinInfo.hotelName = this.reservationInfo.orderInfo.hotelName
  55. this.checkinInfo.roomType = this.reservationInfo.orderInfo.roomType
  56. this.checkinInfo.roomTypeName = this.reservationInfo.orderInfo.roomTypeName
  57. this.checkinInfo.startTime = this.reservationInfo.orderInfo.startTime
  58. this.checkinInfo.endTime = this.reservationInfo.orderInfo.endTime
  59. this.checkinInfo.startTime = moment(this.checkinInfo.startTime).format('YYYY/MM/DD HH:mm')
  60. this.checkinInfo.endTime = moment(this.checkinInfo.endTime).format('YYYY/MM/DD HH:mm')
  61. }
  62. },
  63. onLoad() {
  64. this.getCheckinInfo()
  65. console.log(this.checkinInfo)
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .card-item {
  71. margin-bottom: 40rpx;
  72. display: flex;
  73. .card-item-left {
  74. width: 140rpx;
  75. }
  76. }
  77. .completeBtn {
  78. left: 80rpx;
  79. right: 80rpx;
  80. bottom: 120rpx;
  81. position: fixed;
  82. background-color: #0081ff;
  83. color: #ffffff;
  84. }
  85. .not-reservation {
  86. display: flex;
  87. justify-content: center;
  88. height: 100%;
  89. text-align: center;
  90. vertical-align: 100rpx;
  91. }
  92. .tip {
  93. padding-top: 40%;
  94. }
  95. </style>