orderDetail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. // #ifdef MP-WEIXIN
  68. onShareAppMessage(info) {
  69. return {
  70. title: '源享住',
  71. path: 'pages/login/login',
  72. imageUrl: "/static/logo.png"
  73. }
  74. }
  75. // #endif
  76. }
  77. </script>
  78. <style lang="scss">
  79. .card-item {
  80. margin-bottom: 40rpx;
  81. display: flex;
  82. .card-item-left {
  83. width: 140rpx;
  84. }
  85. }
  86. .completeBtn {
  87. left: 80rpx;
  88. right: 80rpx;
  89. bottom: 120rpx;
  90. position: fixed;
  91. background-color: #0081ff;
  92. color: #ffffff;
  93. }
  94. .not-reservation {
  95. display: flex;
  96. justify-content: center;
  97. height: 100%;
  98. text-align: center;
  99. vertical-align: 100rpx;
  100. }
  101. .tip {
  102. padding-top: 40%;
  103. }
  104. </style>