selectHotel.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view>
  3. <view class="order-item" v-for="hotel in hotelList">
  4. <view class="one-order" @click="gotoHome(hotel)">
  5. <view class="order--no">
  6. <view class="order--no__no">
  7. <view>{{ hotel.name }}</view>
  8. </view>
  9. <view class="order--no__status"></view>
  10. </view>
  11. <view class="order--room">
  12. <view class="order--room__pic">
  13. <u-image :src="getHotelPicPath(hotel.picturePath)" width="180rpx" height="180rpx"></u-image>
  14. </view>
  15. <view class="order--room__desc">
  16. {{ hotel.address || '' }}
  17. </view>
  18. </view>
  19. <view class="order--option"></view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. IMG_BASE_URL
  27. } from "../../config"
  28. import {
  29. mapState,
  30. mapMutations
  31. } from 'vuex'
  32. export default {
  33. data() {
  34. return {
  35. hotelList: [],
  36. };
  37. },
  38. methods: {
  39. ...mapMutations('m_business', ['updateCurrentHotel']),
  40. async getHotelAndNames() {
  41. let res = await uni.$http.post('/hotel', {
  42. isTest: false,
  43. pageNo: 1,
  44. pageSize: 999
  45. })
  46. this.hotelList = res.data.data.records
  47. },
  48. gotoHome(hotel) {
  49. this.updateCurrentHotel(hotel)
  50. uni.switchTab({
  51. url: '/pages/home/home'
  52. })
  53. },
  54. getHotelPicPath(path) {
  55. return IMG_BASE_URL + '/' + path
  56. }
  57. },
  58. async onLoad() {
  59. await this.getHotelAndNames()
  60. },
  61. // #ifdef MP-WEIXIN
  62. onShareAppMessage(info) {
  63. return {
  64. title: '源享住',
  65. path: 'pages/login/login',
  66. imageUrl: "/static/logo.png"
  67. }
  68. }
  69. // #endif
  70. }
  71. </script>
  72. <style lang="scss">
  73. page {
  74. background-color: #EBEAF0;
  75. position: absolute;
  76. .top-subsection {
  77. top: 0;
  78. position: sticky;
  79. background-color: #EBEAF0;
  80. z-index: 99;
  81. }
  82. .order-item {
  83. width: 100%;
  84. display: flex;
  85. flex-direction: column;
  86. .one-order {
  87. display: flex;
  88. flex-direction: column;
  89. background-color: #ffffff;
  90. margin-top: 2*5rpx;
  91. margin-left: 2*10rpx;
  92. margin-right: 2*10rpx;
  93. margin-bottom: 2*5rpx;
  94. border-radius: 2*12rpx;
  95. .order--no {
  96. display: flex;
  97. flex-direction: row;
  98. font-size: 28rpx;
  99. margin-top: 2*10rpx;
  100. margin-left: 2*10rpx;
  101. margin-right: 2*10rpx;
  102. margin-bottom: 2*5rpx;
  103. .order--no__no {
  104. display: flex;
  105. flex-direction: row;
  106. }
  107. }
  108. .order--room {
  109. display: flex;
  110. flex-direction: row;
  111. background-color: #f1f1f4;
  112. margin-left: 2*10rpx;
  113. margin-right: 2*10rpx;
  114. margin-top: 2*5rpx;
  115. margin-bottom: 2*5rpx;
  116. padding-top: 2*12rpx;
  117. padding-bottom: 2*12rpx;
  118. border-radius: 2*8rpx;
  119. .order--room__pic {
  120. padding-left: 5rpx;
  121. width: 190rpx;
  122. }
  123. .order--room__desc {
  124. display: flex;
  125. align-items: center;
  126. width: 100%;
  127. padding-left: 20rpx;
  128. }
  129. .order--room__price {
  130. display: flex;
  131. align-items: center;
  132. justify-content: end;
  133. width: 200rpx;
  134. padding-right: 20rpx;
  135. color: red;
  136. font-size: 40rpx;
  137. }
  138. }
  139. .order--duration {
  140. display: flex;
  141. flex-direction: row;
  142. background-color: #f1f1f4;
  143. margin-left: 2*10rpx;
  144. margin-right: 2*10rpx;
  145. margin-top: 2*5rpx;
  146. margin-bottom: 2*5rpx;
  147. border-radius: 2*8rpx;
  148. .order--duration__start {
  149. display: flex;
  150. flex-direction: column;
  151. width: 1000rpx;
  152. margin-top: 2*5rpx;
  153. margin-bottom: 2*10rpx;
  154. margin-left: 2*5rpx;
  155. margin-right: 2*5rpx;
  156. .order--duration__start-title {
  157. display: flex;
  158. font-size: 28rpx;
  159. height: 60rpx;
  160. align-items: center;
  161. }
  162. .order--duration__start-date {
  163. display: flex;
  164. flex-direction: row;
  165. justify-content: space-between;
  166. height: 50rpx;
  167. align-items: center;
  168. font-size: 24rpx;
  169. }
  170. }
  171. .order--duration__end {
  172. display: flex;
  173. flex-direction: column;
  174. width: 1000rpx;
  175. margin-top: 2*5rpx;
  176. margin-bottom: 2*10rpx;
  177. margin-left: 2*30rpx;
  178. margin-right: 2*5rpx;
  179. .order--duration__end-title {
  180. display: flex;
  181. font-size: 28rpx;
  182. height: 60rpx;
  183. align-items: center;
  184. }
  185. .order--duration__end-date {
  186. display: flex;
  187. flex-direction: row;
  188. justify-content: space-between;
  189. height: 50rpx;
  190. align-items: center;
  191. font-size: 24rpx;
  192. }
  193. }
  194. .order--duration__total {
  195. width: 100%;
  196. display: flex;
  197. align-items: center;
  198. justify-content: flex-end;
  199. padding-right: 20rpx;
  200. font-weight: bold;
  201. }
  202. }
  203. .order--option {
  204. display: flex;
  205. flex-direction: row;
  206. margin-left: 2*10rpx;
  207. margin-right: 2*10rpx;
  208. margin-top: 2*5rpx;
  209. margin-bottom: 2*5rpx;
  210. }
  211. }
  212. .card-item {
  213. margin-top: 10rpx;
  214. margin-bottom: 10rpx;
  215. display: flex;
  216. .card-item-left {
  217. width: 140rpx;
  218. }
  219. }
  220. }
  221. }
  222. </style>