searchresult.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="searchType" style="background: #fff;height: 100vh;">
  3. <van-cell value-class="searchclass">
  4. <template slot="title">
  5. <view class="input-view">
  6. <uni-icon type="search" size="22" color="#666666" />
  7. <input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词"
  8. @input="confirm" />
  9. </view>
  10. </template>
  11. <template>
  12. <view>搜索</view>
  13. </template>
  14. </van-cell>
  15. <view class="hotelList">
  16. <view class="hotleLeft">
  17. <image style="width: 214upx;height: 152upx;" src=""/>
  18. </view>
  19. <view class="hotelright">
  20. <view style="font-size: 36upx;color: #303133;">华南城市酒店</view>
  21. <view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;">
  22. <view style="font-size: 40upx; color: #303133;"> 0.0</view>
  23. <view>月访客990</view>
  24. <view>8km</view>
  25. </view>
  26. <view class="undertip">
  27. <view class="tipsTop">有停车为</view>
  28. <view class="tipsTop">内置酒店</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  36. export default {
  37. components: {
  38. uniIcon
  39. },
  40. onLoad() {
  41. this.gethotelist();
  42. },
  43. data() {
  44. return {
  45. searchvalue:''
  46. }
  47. },
  48. methods: {
  49. confirm(e) {
  50. this.searchvalue = e.detail.value;
  51. },
  52. // 获取酒店列表
  53. gethotelist() {
  54. this.request({
  55.                 url:"/v2/entry/storeList",
  56.                 method:'get',
  57. data: {
  58. page: this.page,
  59. page_size: 10,
  60. keyword: this.keyword
  61. },
  62. success: (res) => {
  63. let { data,code } = res.data;
  64. if(code == 1000) {
  65. if(data.store_list.length<10) {
  66. this.ispull = false;
  67. }
  68. if(this.hotelist.length == 0) {
  69. this.hotelist = data.store_list
  70. }else {
  71. this.hotelist = this.hotelist.concat(data.store_list);
  72. }
  73. this.hotelist.forEach(item => {
  74. item.tages = item.store_summary.split(' ');
  75. })
  76. }else {
  77. console.log(_this.hotelist).$msg("网络错误稍后再试")
  78. }
  79. }
  80. })
  81. },
  82. }
  83. }
  84. </script>
  85. <style>
  86. .searchType .input-view {
  87. width: 80%;
  88. display: flex;
  89. background-color: #e7e7e7;
  90. height: 30px;
  91. border-radius: 15px;
  92. padding: 0 4%;
  93. flex-wrap: nowrap;
  94. margin: 7px 0;
  95. line-height: 30px;
  96. margin: 24upx 0 24upx 32upx;
  97. }
  98. .searchType .input-view .uni-icon {
  99. line-height: 30px !important;
  100. }
  101. .searchType .input-view .input {
  102. height: 30px;
  103. line-height: 30px;
  104. width: 94%;
  105. padding: 0 3%;
  106. }
  107. .van-cell__title {
  108. flex: 6!important;
  109. }
  110. .searchclass {
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. }
  115. .van-cell {
  116. padding: 15upx 32upx 0 32upx!important;
  117. }
  118. .hotelList {
  119. display: flex;
  120. flex-direction: row;
  121. padding: 24upx 32upx;
  122. }
  123. .hotleLeft {
  124. width: 214upx;
  125. height: 152upx;
  126. background-color: #007AFF;
  127. }
  128. .hotelright {
  129. padding-left: 16upx;
  130. display: flex;
  131. flex-direction: column;
  132. width: 100%;
  133. }
  134. .undertip {
  135. display: flex;
  136. flex-direction: row;
  137. align-items: center;
  138. }
  139. .tipsTop {
  140. border: 2upx solid #BBBBBB;
  141. margin-right: 14upx;
  142. color: #BBBBBB;
  143. padding: 4upx;
  144. }
  145. /* .van-cell__title {
  146. flex: 6!important;
  147. } */
  148. </style>