index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="goods-hotel">
  3. <view class="search">
  4. <u-input placeholder="搜索" border='none' v-model="search" @input="searchText">
  5. <template slot="suffix" style='margin-right:40rpx;'>
  6. <u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
  7. height="32rpx"></u-image>
  8. </template>
  9. </u-input>
  10. </view>
  11. <view class="content">
  12. <view class="content-item" v-for="item in 2">
  13. <image style="flex: none;width: 112rpx;height: 112rpx;border-radius: 50%;" src="/static/icon/youyue.png"
  14. mode=""></image>
  15. <view class="content-item-main">
  16. <text class="content-item-main-text">成都环球中心天堂洲际大饭店</text>
  17. <view class="content-item-main-call" style="margin: 20rpx 0 12rpx;">
  18. <image style="width: 26rpx;height: 26rpx; margin-right: 8rpx;" src="/static/icon/phone02.png"
  19. mode=""></image>
  20. <text>028-129320</text>
  21. </view>
  22. <view class="content-item-main-call">
  23. <image style="width: 24rpx;height: 28rpx; margin-right: 8rpx; " src="/static/icon/address01.png"
  24. mode=""></image>
  25. <text>1.2km</text>
  26. </view>
  27. </view>
  28. <view class="content-item-right">
  29. <image style="width: 50rpx;height: 48rpx;" src="/static/icon/navigation.png" mode=""></image>
  30. <text class="content-item-right-text">去这里</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 触底 -->
  35. <view class="home-bottom">
  36. <uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import util from '../../../utils/util.js'
  42. export default {
  43. data() {
  44. return {
  45. // 搜索
  46. search:'',
  47. // 组价uni-load-more
  48. status: 'noMore',
  49. contentText: {
  50. contentdown: '查看更多',
  51. contentrefresh: '加载中',
  52. contentnomore: '—— 已经到底啦 ——'
  53. },
  54. // 酒店列表
  55. hotelList:[],
  56. // 产品id
  57. product_id:'',
  58. }
  59. },
  60. onLoad(op) {
  61. this.product_id=op.product_id
  62. if(op.product_id!=''){
  63. this.getHotelList(op.product_id)
  64. }
  65. },
  66. methods: {
  67. // 获取酒店列表
  68. getHotelList(id){
  69. this.$api.hotel.getHotelList({
  70. page:1,
  71. product_id:id
  72. }).then(res=>{
  73. console.log(res,"酒店列表")
  74. if(res.code==0){
  75. this.hotelList=res.data.data
  76. }
  77. })
  78. },
  79. // 搜索防抖
  80. searchText:util.debounce(function(){
  81. this.goSearch()
  82. },1000),
  83. // 搜索
  84. goSearch(){
  85. this.$api.hotel.getHotelList({
  86. page:1,
  87. name:this.search,
  88. product_id:this.product_id
  89. }).then(res=>{
  90. console.log(res,'搜索酒店列表')
  91. if(res.code==0){
  92. this.hotelList=res.data.data
  93. }
  94. })
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. $pageColor:#F9F9F9;
  101. $bgColor:#FFFFFF;
  102. @mixin flexlayout {
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. }
  107. page {
  108. height: 100% !important;
  109. background: #F9F9F9 !important;
  110. }
  111. .goods-hotel {
  112. height: 100%;
  113. background: #F9F9F9;
  114. }
  115. .home-bottom {
  116. background-color: #f9f9f9;
  117. }
  118. .content {
  119. width: 100%;
  120. padding: 24rpx 30rpx;
  121. padding-bottom: 30rpx;
  122. background-color: #F9F9F9;
  123. .content-item {
  124. margin-bottom: 24rpx;
  125. padding: 0 24rpx;
  126. padding-top: 20rpx;
  127. padding-bottom: 20rpx;
  128. height: 204rpx;
  129. background: #FFFFFF;
  130. box-shadow: 0px 4rpx 24rpx -10rpx rgba(101, 95, 90, 0.3);
  131. border-radius: 12rpx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: space-between;
  135. .content-item-main {
  136. flex: 1;
  137. display: flex;
  138. flex-direction: column;
  139. align-items: flex-start;
  140. justify-content: center;
  141. margin-left: 20rpx;
  142. margin-top: 12rpx;
  143. .content-item-main-text {
  144. font-weight: 500;
  145. color: #333333;
  146. font-size: 30rpx;
  147. }
  148. .content-item-main-call {
  149. font-weight: 500;
  150. color: #666666;
  151. font-size: 26rpx;
  152. display: flex;
  153. align-items: center;
  154. justify-content: flex-start;
  155. }
  156. }
  157. .content-item-right {
  158. flex: none;
  159. display: flex;
  160. flex-direction: column;
  161. align-items: center;
  162. justify-content: center;
  163. .content-item-right-text {
  164. font-weight: bold;
  165. color: #FF6201;
  166. font-size: 24rpx;
  167. margin-top: 16rpx;
  168. }
  169. }
  170. }
  171. }
  172. .search {
  173. padding: 0 30rpx;
  174. height: 124rpx;
  175. background: #FFFFFF;
  176. box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. ::v-deep .u-input {
  181. width: 690rpx !important;
  182. height: 68rpx !important;
  183. background: #F1F1F1;
  184. border-radius: 74rpx;
  185. }
  186. ::v-deep .u-input__content__field-wrapper {
  187. padding-left: 36rpx;
  188. }
  189. ::v-deep .u-input__content__field-wrapper__field {
  190. color: #999999 !important;
  191. font-size: 28rpx !important;
  192. }
  193. }
  194. </style>