searchPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="pages">
  3. <div class="title-top">
  4. <u-input placeholder="位置/酒店/关键词" :customStyle="{background:'rgb(243, 243, 243)'}">
  5. <u--text @click="handleToCity" text="长沙" slot="prefix" margin="0 3px 0 0" type="tips"></u--text>
  6. <div slot="suffix" class="search-right">
  7. <div>住{{timeList[0]}}</div>
  8. <div v-if="timeList.length==1">离{{timeList[timeList.length-1]}}</div>
  9. </div>
  10. </u-input>
  11. </div>
  12. <div class="tabs">
  13. <div @click="sort">推荐排序</div>
  14. <div @click="starPriceShow=true">星级价格</div>
  15. <div @click="locationAreaShow=true">位置区域</div>
  16. <div @click="screenShow=true">筛选</div>
  17. </div>
  18. <!-- 推荐排序弹窗 -->
  19. <u-action-sheet :actions="sortList" :show="sortShow" safeAreaInsetBottom @close="sortClose" @select="sortSelect" round="8"></u-action-sheet>
  20. <!-- 星级价格弹窗 -->
  21. <u-action-sheet :show="starPriceShow" safeAreaInsetBottom @close="starPriceShow=false" @select="starPriceSelect" round="8">
  22. <div style="height:36vh;padding:10px">
  23. <div class="star-top">
  24. <div>星级</div>
  25. <div style="display:flex;justify-content:space-between;flex-wrap:wrap;align-items:center;margin-top:10px">
  26. <div class="star-top-box" v-for="item in starPriceList" :key="item.id">{{item}}</div>
  27. </div>
  28. </div>
  29. <div class="star-top">
  30. <div>价格:{{starValue}}-不限</div>
  31. <div>
  32. <u-slider v-model="starValue" max="1000"></u-slider>
  33. </div>
  34. </div>
  35. <div class="star-btn">
  36. <div style="width:80px">
  37. 清空
  38. </div>
  39. <u-button type="primary">确定</u-button>
  40. </div>
  41. </div>
  42. </u-action-sheet>
  43. <!-- 位置区域弹窗 -->
  44. <u-action-sheet :show="locationAreaShow" safeAreaInsetBottom @close="locationAreaShow=false" round="8">
  45. <Sidebar :dataList="locationAreaList" />
  46. </u-action-sheet>
  47. <!-- 筛选弹窗 -->
  48. <u-action-sheet :show="screenShow" safeAreaInsetBottom @close="screenShow=false" round="8">
  49. <Sidebar :dataList="screenList" />
  50. </u-action-sheet>
  51. <!-- 酒店列表 -->
  52. <div class="card-list" v-for="item in 15" :key="item.id" @click="handleToHotelDetail(item)">
  53. <div class="card-list-image">
  54. <u-image :showLoading="true" mode="scaleToFill" src="@/static/niu.jpg" width="120px" height="190px" @click="click"></u-image>
  55. </div>
  56. <div class="card-list-right">
  57. <div style="font-size: 18px;color:#000;">练习时长两年半的酒店</div>
  58. <div>0分 0条评论 | 经济型</div>
  59. <div>距离市中心66.66km · 四川省理塘县(世界最高城)</div>
  60. <div>
  61. <span style="border:1px solid #ff9900;color:#ff9900;padding:3px 4px;border-radius:5px;margin-right:5px;">交通方便</span>
  62. <span style="border:1px solid #19be6b;color:#19be6b;padding:3px 4px;border-radius:5px;">服务周到</span>
  63. </div>
  64. <div style="margin-left:auto;color:#3c9cff;margin-right:10px;font-size: 18px;">70起</div>
  65. </div>
  66. </div>
  67. </view>
  68. </template>
  69. <script>
  70. import Sidebar from '../sidebar.vue'
  71. import { mapState } from 'vuex'
  72. export default {
  73. components:{
  74. Sidebar
  75. },
  76. computed:{
  77. ...mapState({
  78. timeList:state=>state.timeList
  79. })
  80. },
  81. data() {
  82. return {
  83. sortList: [{
  84. name: '推荐排序',
  85. // subname:"选项一描述",
  86. },
  87. {
  88. name: '距离优先',
  89. // disabled:false
  90. },
  91. {
  92. name: '低价优先', //开启后文字不显示
  93. // loading:true
  94. },
  95. {
  96. name: '评分优先'
  97. },
  98. {
  99. name: '评论数优先'
  100. }
  101. ],
  102. sortShow: false,
  103. starPriceList: ['经济型', '二星/实惠', '三星/舒适', '四星/高档', '五星/豪华'],
  104. starPriceShow: false,
  105. starValue: 0,
  106. locationAreaShow: false,
  107. locationAreaList: [
  108. {
  109. name:'距离我',
  110. children:[
  111. {
  112. name:'500m'
  113. },
  114. {
  115. name:'1km'
  116. },
  117. {
  118. name:'2km'
  119. },
  120. {
  121. name:'3km'
  122. },
  123. {
  124. name:'5km'
  125. },
  126. {
  127. name:'10km'
  128. },
  129. ]
  130. },
  131. {
  132. name:'热门推荐'
  133. },
  134. {
  135. name:'商业区'
  136. },
  137. {
  138. name:'行政区'
  139. },
  140. {
  141. name:'热门景点'
  142. },
  143. {
  144. name:'机场车站'
  145. },
  146. {
  147. name:'地铁线路',
  148. children:[
  149. {
  150. name:'1号线',
  151. children:[
  152. {
  153. name:'开福区政府'
  154. }
  155. ]
  156. },
  157. {
  158. name:'2号线',
  159. children:[
  160. {
  161. name:'五一广场'
  162. }
  163. ]
  164. },
  165. {
  166. name:'3号线',
  167. children:[
  168. {
  169. name:'阳光100'
  170. }
  171. ]
  172. },
  173. {
  174. name:'4号线',
  175. children:[
  176. {
  177. name:'罐子岭'
  178. }
  179. ]
  180. },
  181. {
  182. name:'5号线',
  183. children:[
  184. {
  185. name:'万家丽广场'
  186. }
  187. ]
  188. },
  189. {
  190. name:'6号线',
  191. children:[
  192. {
  193. name:'芙蓉区政府'
  194. }
  195. ]
  196. }
  197. ]
  198. },
  199. {
  200. name:'大学周边'
  201. },
  202. {
  203. name:'医院周边'
  204. }
  205. ],
  206. screenShow:false,
  207. screenList:[
  208. {
  209. name:'主题类型',
  210. children:[
  211. {
  212. name:'情侣约会'
  213. },
  214. {
  215. name:'亲子家庭'
  216. },
  217. {
  218. name:'快捷连锁'
  219. },
  220. {
  221. name:'主题特色'
  222. },
  223. {
  224. name:'海滨风光'
  225. }
  226. ]
  227. },
  228. {
  229. name:'点评推荐',
  230. children:[
  231. {
  232. name:'评分',
  233. children:[
  234. {
  235. name:'3分以上'
  236. }
  237. ]
  238. },
  239. {
  240. name:'数量',
  241. children:[
  242. {
  243. name:'100条以上'
  244. }
  245. ]
  246. }
  247. ]
  248. },
  249. {
  250. name:'酒店品牌',
  251. children:[
  252. {
  253. name:'豪华型',
  254. children:[
  255. {
  256. name:'希尔顿'
  257. }
  258. ]
  259. },
  260. {
  261. name:'高档型',
  262. children:[
  263. {
  264. name:'万豪'
  265. }
  266. ]
  267. }
  268. ]
  269. },
  270. {
  271. name:'设施服务',
  272. children:[
  273. {
  274. name:'温泉',
  275. },
  276. {
  277. name:'租车',
  278. }
  279. ]
  280. }
  281. ]
  282. }
  283. },
  284. methods: {
  285. handleToCity() {
  286. uni.navigateTo({
  287. url: '/components/city/linzq-citySelect/linzq-citySelect'
  288. })
  289. },
  290. sort() {
  291. this.sortShow = true
  292. },
  293. sortClose() {
  294. this.sortShow = false
  295. },
  296. sortSelect(e) {
  297. console.log(e)
  298. this.sortShow = false
  299. },
  300. handleToHotelDetail(){
  301. uni.navigateTo({
  302. url:'/components/hotelDetail/hotelDetail'
  303. })
  304. }
  305. }
  306. }
  307. </script>
  308. <style lang="scss" scoped>
  309. .pages {
  310. background-color: rgb(243, 243, 243);
  311. height: 100vh;
  312. }
  313. .title-top {
  314. padding: 0 10px;
  315. background: #fff;
  316. height: 60px;
  317. display: flex;
  318. align-items: center;
  319. }
  320. .search-right {
  321. display: flex;
  322. flex-direction: column;
  323. justify-content: space-between;
  324. align-items: center;
  325. font-size: 12px;
  326. color: #00000060;
  327. }
  328. .tabs {
  329. height: 50px;
  330. background: #fff;
  331. margin-bottom: 10px;
  332. display: flex;
  333. justify-content: space-evenly;
  334. align-items: center;
  335. }
  336. .star-top {
  337. text-align: left;
  338. .star-top-box {
  339. padding: 5px 10px;
  340. border: 1px solid #2979ff;
  341. color: #2979ff;
  342. border-radius: 20px;
  343. text-align: center;
  344. margin-bottom: 5px;
  345. }
  346. }
  347. .star-btn {
  348. display: flex;
  349. align-items: center;
  350. margin-top: 20px;
  351. }
  352. .card-list{
  353. background: #fff;
  354. width: 100%;
  355. height: 200px;
  356. padding: 5px;
  357. box-sizing: border-box;
  358. display: flex;
  359. align-items: center;
  360. box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.75);
  361. .card-list-right{
  362. height: 90%;
  363. display: flex;
  364. flex-direction: column;
  365. justify-content: space-between;
  366. margin-left: 10px;
  367. flex: 1;
  368. color: #00000060;
  369. }
  370. }
  371. </style>