searchresult.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.gethotelist();
  59. },
  60. // 获取酒店列表
  61. gethotelist() {
  62. if(this.searchvalue == '') {
  63. this.$msg("关键字不能为空")
  64. return;
  65. }
  66. this.request({
  67.                 url:"/v2/entry/storeList",
  68.                 method:'get',
  69. data: {
  70. page: this.page,
  71. page_size: 10,
  72. keyword: this.searchvalue
  73. },
  74. success: (res) => {
  75. let { data,code } = res.data;
  76. if(code == 1000) {
  77. if(data.store_list.length<10) {
  78. this.ispull = false;
  79. }
  80. if(this.hotelist.length == 0) {
  81. this.hotelist = data.store_list
  82. }else {
  83. this.hotelist = this.hotelist.concat(data.store_list);
  84. }
  85. }else {
  86. this.$msg("网络错误稍后再试")
  87. }
  88. }
  89. })
  90. },
  91. }
  92. }
  93. </script>
  94. <style>
  95. .searchType .input-view {
  96. width: 80%;
  97. display: flex;
  98. background-color: #e7e7e7;
  99. height: 30px;
  100. border-radius: 15px;
  101. padding: 0 4%;
  102. flex-wrap: nowrap;
  103. margin: 7px 0;
  104. line-height: 30px;
  105. margin: 24upx 0 24upx 32upx;
  106. }
  107. .searchType .input-view .uni-icon {
  108. line-height: 30px !important;
  109. }
  110. .searchType .input-view .input {
  111. height: 30px;
  112. line-height: 30px;
  113. width: 94%;
  114. padding: 0 3%;
  115. }
  116. .van-cell__title {
  117. flex: 6!important;
  118. }
  119. .searchclass {
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. }
  124. .van-cell {
  125. padding: 15upx 32upx 0 32upx!important;
  126. }
  127. .hotelList {
  128. display: flex;
  129. flex-direction: row;
  130. padding: 24upx 32upx;
  131. }
  132. .hotleLeft {
  133. width: 214upx;
  134. height: 152upx;
  135. }
  136. .hotelright {
  137. padding-left: 16upx;
  138. display: flex;
  139. flex-direction: column;
  140. width: 100%;
  141. }
  142. .undertip {
  143. display: flex;
  144. flex-direction: row;
  145. align-items: center;
  146. }
  147. .tipsTop {
  148. border: 2upx solid #BBBBBB;
  149. margin-right: 14upx;
  150. color: #BBBBBB;
  151. padding: 4upx;
  152. }
  153. /* .van-cell__title {
  154. flex: 6!important;
  155. } */
  156. </style>