searchresult.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 @click="search">搜索</view>
  13. </template>
  14. </van-cell>
  15. <view class="hotelList" v-for="(item,index) in hotelist" :key="index">
  16. <view class="hotleLeft">
  17. <image style="width: 214upx;height: 152upx;" :src="pictureUrl+'/uploads/home/store/'+item.store_id+'/'+item.store_banner" />
  18. </view>
  19. <view class="hotelright">
  20. <view style="font-size: 32upx;color: #303133;font-weight: 550;">{{item.store_name}}
  21. </view>
  22. <view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 10rpx 0;">
  23. <view style="font-size: 32upx; color: #303133;font-weight: 550;">{{item.store_servicecredit}}</view>
  24. <view style="color: #606266;font-size: 24upx;">月访客{{item.store_visitor}}</view>
  25. <view style="color: #606266;font-size: 24upx;">{{item.distance}}</view>
  26. </view>
  27. <view v-if="item.tages.length!=1" class="undertip">
  28. <view v-for="(items,index) in item.tages" :key="index" class="tipsTop">{{items}}</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. pictureUrl: this.pictureUrl,
  46. hotelist: [],
  47. searchvalue:'',
  48. page: 1
  49. }
  50. },
  51. methods: {
  52. search() {
  53. this.hotelist = [];
  54. this.gethotelist();
  55. },
  56. confirm(e) {
  57. this.searchvalue = e.detail.value;
  58. this.hotelist = [];
  59. this.gethotelist();
  60. },
  61. // 获取酒店列表
  62. gethotelist() {
  63. if(this.searchvalue == '') {
  64. this.$msg("关键字不能为空")
  65. return;
  66. }
  67. this.request({
  68.                 url:"/v2/entry/storeList",
  69.                 method:'get',
  70. data: {
  71. page: this.page,
  72. page_size: 10,
  73. keyword: this.searchvalue
  74. },
  75. success: (res) => {
  76. let { data,code } = res.data;
  77. if(code == 1000) {
  78. if(data.store_list.length<10) {
  79. this.ispull = false;
  80. }
  81. if(this.hotelist.length == 0) {
  82. this.hotelist = data.store_list
  83. }else {
  84. this.hotelist = this.hotelist.concat(data.store_list);
  85. }
  86. }else {
  87. this.$msg("网络错误稍后再试")
  88. }
  89. }
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style>
  96. .searchType .input-view {
  97. width: 80%;
  98. display: flex;
  99. background-color: #e7e7e7;
  100. height: 30px;
  101. border-radius: 15px;
  102. padding: 0 4%;
  103. flex-wrap: nowrap;
  104. margin: 7px 0;
  105. line-height: 30px;
  106. margin: 24upx 0 24upx 32upx;
  107. }
  108. .searchType .input-view .uni-icon {
  109. line-height: 30px !important;
  110. }
  111. .searchType .input-view .input {
  112. height: 30px;
  113. line-height: 30px;
  114. width: 94%;
  115. padding: 0 3%;
  116. }
  117. .van-cell__title {
  118. flex: 6!important;
  119. }
  120. .searchclass {
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. }
  125. .van-cell {
  126. padding: 15upx 32upx 0 32upx!important;
  127. }
  128. .hotelList {
  129. display: flex;
  130. flex-direction: row;
  131. padding: 24upx 32upx;
  132. }
  133. .hotleLeft {
  134. width: 214upx;
  135. height: 152upx;
  136. }
  137. .hotelright {
  138. padding-left: 16upx;
  139. display: flex;
  140. flex-direction: column;
  141. width: 100%;
  142. }
  143. .undertip {
  144. display: flex;
  145. flex-direction: row;
  146. align-items: center;
  147. }
  148. .tipsTop {
  149. border: 2upx solid #BBBBBB;
  150. margin-right: 14upx;
  151. color: #BBBBBB;
  152. padding: 4upx;
  153. }
  154. /* .van-cell__title {
  155. flex: 6!important;
  156. } */
  157. </style>