selectCheckinType.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <!-- #ifdef MP-WEIXIN -->
  5. <NavigateBar title="源享住" control="back"></NavigateBar>
  6. <!-- #endif -->
  7. <!-- #ifdef MP-ALIPAY -->
  8. <NavigateBar title="源享住"></NavigateBar>
  9. <!-- #endif -->
  10. </view>
  11. <view class="adv-pic">
  12. <u-swiper :list="advPicList" keyName="image" indicator indicatorMode="dot" circular height="540rpx"
  13. imgMode="aspectFit" interval="2500"></u-swiper>
  14. </view>
  15. <view class="hotel-name">
  16. <view class="hotel-name--fix" :style="[fixStyle]"></view>
  17. <view class="hotel-name--content" :style="currentHotel.name.length > 14 ? 'font-size: 30rpx' : ''">
  18. <view>{{ currentHotel.name }}</view>
  19. </view>
  20. <view class="hotel-name--fix" @click="gotoSelectHotel">
  21. <img src="/static/switch.svg" style="width: 30rpx; height: 30rpx;">
  22. 切换
  23. </view>
  24. </view>
  25. <view class="btn-area">
  26. <button v-for="btn in btnList" :key=btn.text v-text="btn.text" @click="navigateTo(btn.url)"></button>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. mapState,
  33. mapMutations
  34. } from "vuex";
  35. import {
  36. IMG_BASE_URL
  37. } from "../../config.js"
  38. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  39. export default {
  40. components: {
  41. NavigateBar
  42. },
  43. data() {
  44. return {
  45. btnList: [{
  46. text: "无预定",
  47. url: "/subpkg_checkin/selectRoomType/selectRoomType"
  48. },
  49. {
  50. text: "有预定",
  51. url: "/subpkg_checkin/queryOrder/queryOrder"
  52. }
  53. ],
  54. advPicList: [{
  55. image: IMG_BASE_URL + "/home_adv1.png",
  56. title: ""
  57. },
  58. {
  59. image: IMG_BASE_URL + "/home_adv2.png",
  60. title: ""
  61. }
  62. ]
  63. };
  64. },
  65. computed: {
  66. ...mapState("m_business", ["currentHotel"]),
  67. fixStyle() {
  68. let style = {}
  69. if (this.currentHotel.name.length <= 14) return style
  70. style.display = "none"
  71. return style
  72. }
  73. },
  74. methods: {
  75. ...mapMutations("m_business", ["updateOrder", "updateCheckinInfo"]),
  76. navigateTo(url) {
  77. uni.navigateTo({
  78. url: url
  79. })
  80. },
  81. gotoSelectHotel() {
  82. uni.redirectTo({
  83. url: '/subpkg/chooseHotel/chooseHotel?source=selectCheckinType'
  84. })
  85. }
  86. },
  87. onLoad() {
  88. this.updateOrder({})
  89. this.updateCheckinInfo([])
  90. },
  91. // #ifdef MP-WEIXIN
  92. onShareAppMessage(info) {
  93. return {
  94. title: '源享住',
  95. path: 'pages/login/login',
  96. imageUrl: "/static/logo.png"
  97. }
  98. }
  99. // #endif
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. @import "../../config.scss";
  104. .container {
  105. height: 100%;
  106. width: 100%;
  107. display: flex;
  108. flex-direction: column;
  109. .top {
  110. width: 100%;
  111. height: 130rpx;
  112. position: fixed;
  113. top: 0;
  114. left: 0;
  115. right: 0;
  116. z-index: 99;
  117. }
  118. .adv-pic {
  119. width: 100%;
  120. height: 540rpx;
  121. }
  122. .hotel-name {
  123. margin: 0 40rpx;
  124. display: flex;
  125. flex-direction: row;
  126. color: #FFFFFF;
  127. background-color: hsla(0, 100%, 0%, 0.5);
  128. padding: 20rpx 0;
  129. border-radius: 10rpx;
  130. transform: translateY(-60rpx);
  131. .hotel-name--fix {
  132. font-size: 20rpx;
  133. width: 100rpx;
  134. padding-right: 16rpx;
  135. display: flex;
  136. flex-direction: row;
  137. align-items: center;
  138. }
  139. .hotel-name--content {
  140. width: 100%;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. }
  145. }
  146. .btn-area {
  147. margin-top: 100rpx;
  148. button {
  149. color: #FFFFFF;
  150. background-color: #9e97c3;
  151. margin: 0 60rpx 60rpx;
  152. font-size: 33rpx;
  153. }
  154. }
  155. }
  156. </style>