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