home3.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. <template>
  2. <view class="container">
  3. <view class="header2" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-if="headerType">
  4. <view class="title">靖安乡村民宿</view>
  5. </view>
  6. <!-- 顶部图片区域 -->
  7. <view class="header">
  8. <img mode="aspectFill" src="https://chtech.ncjti.edu.cn/hotelReservation/image/14.png" />
  9. <img class="img" src="https://chtech.ncjti.edu.cn/hotelReservation/image/16.png" />
  10. <img class="img2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/17.png" />
  11. <view class="header_msg">有一种生活叫靖安</view>
  12. </view>
  13. <view class="content">
  14. <!-- 条件筛选区域 -->
  15. <view class="search">
  16. <!-- 选择乡镇区域 -->
  17. <view class="search_town" :class="{ active: town }" @click="handleOpen">
  18. {{ town ? town : '请选择乡镇' }}
  19. <img src="../../static/index/right2.png" />
  20. </view>
  21. <!-- 关键词搜索和民宿级别区域 -->
  22. <view class="search_center">
  23. <view class="center_input">
  24. <input type="text" v-model="keywords" placeholder="民宿/地名/关键词" placeholder-style="color:#A6A6A6;font-weight:400;" />
  25. </view>
  26. <img class="img" src="../../static/index/right2.png" />
  27. |
  28. <view class="center_level" :class="{ active: level }" @click="handleChooseLv">{{ level ? level : '请选择民宿级别' }}</view>
  29. <img class="img2" src="../../static/index/right2.png" @click="handleChooseLv" />
  30. </view>
  31. <!-- 查找按钮区域 -->
  32. <view class="search_btn" @click="handleSearch">查找</view>
  33. </view>
  34. <!-- 图标列表区域 -->
  35. <!-- <view class="icons">
  36. <view class="icon_item" @click="handleTest">
  37. <view class="item_top color">
  38. <img src="../../static/index/icon.png" />
  39. </view>
  40. <view class="item_bottom">推文</view>
  41. </view>
  42. <view class="icon_item" @click="handleTest">
  43. <view class="item_top color2">
  44. <img class="img2" src="../../static/index/icon2.png" />
  45. </view>
  46. <view class="item_bottom">周边</view>
  47. </view>
  48. <view class="icon_item" @click="handleGoSetMeal">
  49. <view class="item_top color3">
  50. <img class="img3" src="../../static/index/icon3.png" />
  51. </view>
  52. <view class="item_bottom">套餐</view>
  53. </view>
  54. <view class="icon_item" @click="handleTest">
  55. <view class="item_top color4">
  56. <img src="../../static/index/icon4.png" />
  57. </view>
  58. <view class="item_bottom">招商</view>
  59. </view>
  60. <view class="icon_item" @click="handleTest">
  61. <view class="item_top color5">
  62. <img src="../../static/index/icon5.png" />
  63. </view>
  64. <view class="item_bottom">其他</view>
  65. </view>
  66. </view> -->
  67. <!-- 轮播图区域 -->
  68. <swiper class="swiper" indicator-dots circular indicator-color="#BBD8FE" indicator-active-color="#1E7DFB" autoplay interval="3000" v-if="townList.length">
  69. <swiper-item v-for="(ele, index) in townList" :key="index">
  70. <view class="swiper_item">
  71. <view class="item_box" v-for="(swi, index2) in ele" :key="index2" @click="handleChooseTown2(swi.name)">
  72. <img v-if="index === 0 && index2 === 0" src="https://chtech.ncjti.edu.cn/hotelReservation/image/1.png" mode="aspectFill" />
  73. <img v-if="index === 0 && index2 === 1" src="https://chtech.ncjti.edu.cn/hotelReservation/image/2.png" mode="aspectFill" />
  74. <img v-if="index === 0 && index2 === 2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/3.png" mode="aspectFill" />
  75. <img v-if="index === 1 && index2 === 0" src="https://chtech.ncjti.edu.cn/hotelReservation/image/4.png" mode="aspectFill" />
  76. <img v-if="index === 1 && index2 === 1" src="https://chtech.ncjti.edu.cn/hotelReservation/image/5.png" mode="aspectFill" />
  77. <img v-if="index === 1 && index2 === 2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/6.png" mode="aspectFill" />
  78. <img v-if="index === 2 && index2 === 0" src="https://chtech.ncjti.edu.cn/hotelReservation/image/7.png" mode="aspectFill" />
  79. <img v-if="index === 2 && index2 === 1" src="https://chtech.ncjti.edu.cn/hotelReservation/image/8.png" mode="aspectFill" />
  80. <img v-if="index === 2 && index2 === 2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/9.png" mode="aspectFill" />
  81. <img v-if="index === 3 && index2 === 0" src="https://chtech.ncjti.edu.cn/hotelReservation/image/10.png" mode="aspectFill" />
  82. <img v-if="index === 3 && index2 === 1" src="https://chtech.ncjti.edu.cn/hotelReservation/image/11.png" mode="aspectFill" />
  83. <img v-if="index === 3 && index2 === 2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/12.png" mode="aspectFill" />
  84. <view class="box_town">{{ swi.name }}</view>
  85. <view class="box_count">剩{{ swi.residueNumber }}间</view>
  86. </view>
  87. </view>
  88. </swiper-item>
  89. </swiper>
  90. <view class="body">
  91. <!-- 精选攻略区域 -->
  92. <view class="body_top">
  93. <view class="circle"></view>
  94. <view class="circle color"></view>
  95. <view class="top_title">精选攻略 .</view>
  96. <view class="top_msg">宝藏分享社区</view>
  97. <view class="top_more" @click="handleTest">
  98. 更多
  99. <img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
  100. </view>
  101. </view>
  102. <view class="body_strategy" @click="handleGoDetail">
  103. <img mode="aspectfill" src="https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg" />
  104. <view class="strategy_info">
  105. <view class="info_title">这里不是瑞士!是江西靖安!</view>
  106. <view class="info_tags">
  107. <view class="tag">南昌周边游</view>
  108. <view class="tag">江西旅游</view>
  109. <view class="tag">靖安民宿</view>
  110. </view>
  111. <view class="info_desc">
  112. 南昌周边度假的宝藏民宿🏠享受山野间森呼吸🌿很适合逃离城市奔向大自然的快乐躺平☁️阴雨绵绵也抵挡不住它的美☔心向山野 尽请赴约 🍃一房一景 设计独特
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 招商资讯区域 -->
  117. <view class="body_top">
  118. <view class="circle"></view>
  119. <view class="circle color"></view>
  120. <view class="top_title">招商资讯 .</view>
  121. <view class="top_msg">以招商引资,推动镇域经济</view>
  122. <view class="top_more" @click="handleTest">
  123. 更多
  124. <img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
  125. </view>
  126. </view>
  127. <view class="body_strategy">
  128. <img mode="aspectfill" src="https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg" />
  129. <view class="strategy_info">
  130. <view class="info_title2">以招商引资,推动镇域经济!以招商引资,推动镇域经济以招商引资,推动镇域经济!</view>
  131. <view class="info_desc">
  132. 南昌周边度假的宝藏民宿🏠享受山野间森呼吸🌿很适合逃离城市奔向大自然的快乐躺平☁️阴雨绵绵也抵挡不住它的美☔心向山野 尽请赴约 🍃一房一景 设计独特
  133. </view>
  134. </view>
  135. </view>
  136. <view class="body_strategy">
  137. <img mode="aspectfill" src="https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg" />
  138. <view class="strategy_info">
  139. <view class="info_title2">以招商引资,推动镇域经济!以招商引资,推动镇域经济以招商引资,推动镇域经济!</view>
  140. <view class="info_desc">
  141. 南昌周边度假的宝藏民宿🏠享受山野间森呼吸🌿很适合逃离城市奔向大自然的快乐躺平☁️阴雨绵绵也抵挡不住它的美☔心向山野 尽请赴约 🍃一房一景 设计独特
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 精选推荐区域 -->
  146. <view class="body_top">
  147. <view class="circle"></view>
  148. <view class="circle color"></view>
  149. <view class="top_title">精选推荐 .</view>
  150. <view class="top_msg">线上订民宿,住着玩个遍</view>
  151. <view class="top_more" @click="handleTest">
  152. 更多
  153. <img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
  154. </view>
  155. </view>
  156. <view class="body_list">
  157. <!-- 每一个民宿区域 -->
  158. <view class="list_item" v-for="item in hotelList" :key="item.id" @click="goPageDetail(item)">
  159. <image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
  160. <view class="descrition">
  161. <text class="title">{{ item.hotel_name }}</text>
  162. <text class="type">{{ item.hTypeName }}</text>
  163. <text class="distance">距您直线{{ item.distance }}公里</text>
  164. <view class="detail">
  165. <img class="img" src="../../static/index/hotel.png" />
  166. <view class="price">
  167. <text class="txt1">¥{{ item.min_price }}</text>
  168. <text class="txt2">起</text>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <!-- 没有数据时展示的页面 -->
  175. <view class="noData" v-if="!hotelList.length">
  176. <img src="../../static/images/noData.png" />
  177. 暂无推荐数据
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 选择乡镇弹窗区域 -->
  182. <uni-popup ref="popup" type="center">
  183. <view class="popup_body">
  184. <view class="body_header">
  185. <img src="../../static/my/popup_title.png" />
  186. <view class="header_title">请选择乡镇</view>
  187. <img src="../../static/my/popup_title.png" />
  188. </view>
  189. <view class="body_content">
  190. <view class="content_box" v-for="(item, index) in popList" :key="index" @click="handleChooseTown(item.name)">
  191. <img v-if="index === 0" src="https://chtech.ncjti.edu.cn/hotelReservation/image/1.png" mode="aspectFill" />
  192. <img v-if="index === 1" src="https://chtech.ncjti.edu.cn/hotelReservation/image/2.png" mode="aspectFill" />
  193. <img v-if="index === 2" src="https://chtech.ncjti.edu.cn/hotelReservation/image/3.png" mode="aspectFill" />
  194. <img v-if="index === 3" src="https://chtech.ncjti.edu.cn/hotelReservation/image/4.png" mode="aspectFill" />
  195. <img v-if="index === 4" src="https://chtech.ncjti.edu.cn/hotelReservation/image/5.png" mode="aspectFill" />
  196. <img v-if="index === 5" src="https://chtech.ncjti.edu.cn/hotelReservation/image/6.png" mode="aspectFill" />
  197. <img v-if="index === 6" src="https://chtech.ncjti.edu.cn/hotelReservation/image/7.png" mode="aspectFill" />
  198. <img v-if="index === 7" src="https://chtech.ncjti.edu.cn/hotelReservation/image/8.png" mode="aspectFill" />
  199. <img v-if="index === 8" src="https://chtech.ncjti.edu.cn/hotelReservation/image/9.png" mode="aspectFill" />
  200. <img v-if="index === 9" src="https://chtech.ncjti.edu.cn/hotelReservation/image/10.png" mode="aspectFill" />
  201. <img v-if="index === 10" src="https://chtech.ncjti.edu.cn/hotelReservation/image/11.png" mode="aspectFill" />
  202. <img v-if="index === 11" src="https://chtech.ncjti.edu.cn/hotelReservation/image/12.png" mode="aspectFill" />
  203. <view class="box_town">{{ item.name }}</view>
  204. <view class="box_count">剩{{ item.residueNumber }}间</view>
  205. </view>
  206. </view>
  207. </view>
  208. </uni-popup>
  209. <!-- 公告弹窗区域 -->
  210. <uv-popup ref="popup_sale" mode="center" :closeOnClickOverlay="false" bgColor="none">
  211. <view class="popupClass">
  212. <img src="../../static/index/popup_bg.png" />
  213. <!-- 立即前往区域 -->
  214. <!-- <view class="btn_go" @click="handleGo"></view> -->
  215. <view class="btn_text">系统处于迭代试用状态,请勿下单预订酒店,如需预订请电联店家老板确认预订渠道。</view>
  216. <!-- 关闭按钮区域 -->
  217. <view class="btn_close" @click="handleClose"></view>
  218. </view>
  219. </uv-popup>
  220. </view>
  221. </template>
  222. <script>
  223. export default {
  224. data() {
  225. return {
  226. // 用户定位经度
  227. myLng: 0,
  228. // 用户定位纬度
  229. myLat: 0,
  230. // 是否显示距离差
  231. showdDistance: false,
  232. // 搜索框绑定数据
  233. keywords: '',
  234. // 当前页
  235. page: 1,
  236. // 每页多少条
  237. rows: 6,
  238. // 总条数
  239. total: null,
  240. // 地区数组
  241. placeList: [
  242. {
  243. name: '靖安县'
  244. }
  245. ],
  246. // 当前选择地区索引
  247. placeIndex: 0,
  248. // 选择乡镇弹窗数据
  249. popList: [],
  250. // 民宿列表数组
  251. hotelList: [],
  252. // 当前乡镇
  253. town: '',
  254. level: '',
  255. townList: [],
  256. headerType: false,
  257. // 状态栏高度
  258. statusBarH: 0,
  259. // 胶囊按钮栏高度
  260. customBarH: 0
  261. }
  262. },
  263. created() {
  264. // 获取系统信息
  265. uni.getSystemInfo({
  266. success: (e) => {
  267. // 获取状态栏高度
  268. this.statusBarH = e.statusBarHeight + 10
  269. // // 获取菜单按钮栏高度
  270. let custom = uni.getMenuButtonBoundingClientRect()
  271. this.customBarH = custom.height + 10
  272. }
  273. })
  274. },
  275. mounted() {
  276. // 开启转发功能
  277. uni.showShareMenu({
  278. withShareTicket: true,
  279. menus: ['shareAppMessage', 'shareTimeline']
  280. })
  281. },
  282. onReachBottom() {
  283. if (this.hotelList.length < this.total) {
  284. this.page++
  285. this.getHotelList()
  286. } else {
  287. uni.showToast({
  288. title: '没有更多数据了',
  289. icon: 'none'
  290. })
  291. }
  292. },
  293. onPageScroll(e) {
  294. if (e.scrollTop > 100) {
  295. this.headerType = true
  296. } else {
  297. this.headerType = false
  298. }
  299. },
  300. onPullDownRefresh() {
  301. this.hotelList = []
  302. this.page = 1
  303. this.getLocation()
  304. this.getResidueCount()
  305. setTimeout(() => {
  306. uni.stopPullDownRefresh()
  307. }, 1000)
  308. },
  309. onLoad() {
  310. this.getResidueCount()
  311. this.getLocation()
  312. },
  313. methods: {
  314. // 获取用户当前位置
  315. getLocation() {
  316. uni.getSetting({
  317. success: (res) => {
  318. if (!res.authSetting['scope.userLocation']) {
  319. uni.authorize({
  320. scope: 'scope.userLocation',
  321. success: (res) => {
  322. // 授权成功
  323. uni.getLocation({
  324. type: 'gcj02',
  325. success: (res) => {
  326. this.myLat = res.latitude
  327. this.myLng = res.longitude
  328. this.showdDistance = true
  329. this.getHotelList()
  330. }
  331. })
  332. },
  333. fail: () => {
  334. uni.showModal({
  335. content: '获取定位权限失败将会影响使用部分功能,是否去设置打开?',
  336. confirmText: '确认',
  337. cancelText: '取消',
  338. success: (res) => {
  339. if (res.confirm) {
  340. uni.openSetting({
  341. success: (res) => {
  342. console.log(res)
  343. this.getLocation()
  344. }
  345. })
  346. } else {
  347. this.showdDistance = false
  348. this.getHotelList()
  349. uni.showToast({
  350. title: '获取定位权限失败',
  351. icon: 'none'
  352. })
  353. }
  354. }
  355. })
  356. }
  357. })
  358. } else {
  359. uni.getLocation({
  360. type: 'gcj02',
  361. success: (res) => {
  362. this.myLat = res.latitude
  363. this.myLng = res.longitude
  364. this.showdDistance = true
  365. this.getHotelList()
  366. }
  367. })
  368. }
  369. },
  370. fail: () => {
  371. uni.showToast({
  372. title: '获取用户设置权限失败',
  373. icon: 'none',
  374. mask: true
  375. })
  376. }
  377. })
  378. },
  379. handleGoDetail() {
  380. uni.navigateTo({
  381. url: `/pages/strategyDetatil/strategyDetatil`
  382. })
  383. },
  384. // 获取民宿列表
  385. async getHotelList() {
  386. const res = await this.$myRequest({
  387. url: '/mhotel/ahphomePage.action',
  388. data: {
  389. // queryValue: this.keywords,
  390. page: this.page,
  391. rows: this.rows,
  392. type: 3,
  393. // hotel_township: this.placeList[this.placeIndex].id || '',
  394. userId: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo').id : ''
  395. }
  396. })
  397. // console.log(res)
  398. if (res.code === 200) {
  399. this.hotelList = [...this.hotelList, ...res.data.pageList]
  400. this.total = res.data.total
  401. // 如果定位成功则获取和民宿之间的距离
  402. if (this.showdDistance && this.hotelList.length) {
  403. this.hotelList.forEach((ele) => {
  404. let lat = ele.hpositionWens.split(',')[0]
  405. let lng = ele.hpositionWens.split(',')[1]
  406. ele.distance = this.calculateDistance(lat, lng)
  407. })
  408. }
  409. this.$refs.popup_sale.open()
  410. }
  411. },
  412. handleOpen() {
  413. this.$refs.popup.open()
  414. // this.getResidueCount()
  415. },
  416. // 获取乡镇
  417. async getResidueCount() {
  418. const res = await this.$myRequest({
  419. url: '/mhotel/ahpgetResidueCount.action'
  420. })
  421. // console.log(res)
  422. if (res.code === 200) {
  423. let temNum = 0
  424. res.data.forEach((ele) => {
  425. temNum += ele.residueNumber
  426. })
  427. res.data.unshift({
  428. name: '靖安县',
  429. residueNumber: temNum
  430. })
  431. this.popList = res.data
  432. this.townList = this.changeList(this.popList, 3)
  433. }
  434. },
  435. // 变成二维数组
  436. changeList(arr, num) {
  437. let newArr = []
  438. const total = Math.ceil(arr.length / num)
  439. for (let i = 0; i < total; i++) {
  440. let a = arr.slice(i * num, (i + 1) * num)
  441. newArr.push(a)
  442. }
  443. return newArr
  444. },
  445. // 弹窗点击选择乡镇地址回调
  446. handleChooseTown(name) {
  447. this.town = name
  448. this.$refs.popup.close()
  449. },
  450. handleChooseTown2(name) {
  451. // this.town = name
  452. uni.navigateTo({
  453. url: `/pages/home/home?town=${name}&keywords=${this.keywords}&level=${this.level}`
  454. })
  455. },
  456. handleChooseLv() {
  457. uni.showActionSheet({
  458. itemList: ['白金', '金宿', '银宿'],
  459. success: (res) => {
  460. if (res.tapIndex === 0) {
  461. this.level = '白金'
  462. } else if (res.tapIndex === 1) {
  463. this.level = '金宿'
  464. } else if (res.tapIndex === 2) {
  465. this.level = '银宿'
  466. }
  467. }
  468. })
  469. },
  470. handleSearch() {
  471. uni.navigateTo({
  472. url: `/pages/home/home?town=${this.town}&keywords=${this.keywords}&level=${this.level}`
  473. })
  474. },
  475. handleTest() {
  476. uni.showToast({
  477. title: '功能开发中',
  478. icon: 'none',
  479. mask: true
  480. })
  481. },
  482. handleGoSetMeal() {
  483. uni.navigateTo({
  484. url: '/pages/setMeal/setMeal'
  485. })
  486. },
  487. goPageDetail(item) {
  488. uni.navigateTo({
  489. url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}`
  490. })
  491. },
  492. // 弹窗关闭按钮回调
  493. handleClose() {
  494. this.$refs.popup_sale.close()
  495. },
  496. // 立即前往按钮回调
  497. handleGo() {
  498. console.log(111)
  499. },
  500. // 计算两个点之间的距离
  501. calculateDistance(lat, lng) {
  502. let centerLat = lat
  503. let centerLng = lng
  504. let red1 = (this.myLat * Math.PI) / 180.0
  505. let red2 = (centerLat * Math.PI) / 180.0
  506. let a = red1 - red2
  507. let b = (this.myLng * Math.PI) / 180.0 - (centerLng * Math.PI) / 180.0
  508. let R = 6378137
  509. let distance = R * 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(red1) * Math.cos(red2) * Math.pow(Math.sin(b / 2), 2)))
  510. let res = (distance / 1000).toFixed(2) * 1
  511. return res
  512. }
  513. }
  514. }
  515. </script>
  516. <style lang="scss" scoped>
  517. .container {
  518. display: flex;
  519. flex-direction: column;
  520. min-height: 100vh;
  521. overflow-y: auto;
  522. background-color: #f2f2f2;
  523. .header {
  524. position: relative;
  525. height: 505rpx;
  526. img {
  527. width: 100%;
  528. height: 100%;
  529. border-radius: 0 0 20rpx 20rpx;
  530. }
  531. .img {
  532. position: absolute;
  533. top: 135rpx;
  534. left: 61rpx;
  535. width: 160rpx;
  536. height: 40rpx;
  537. }
  538. .img2 {
  539. position: absolute;
  540. top: 193rpx;
  541. left: 38rpx;
  542. width: 268rpx;
  543. height: 88rpx;
  544. }
  545. .header_msg {
  546. position: absolute;
  547. top: 283rpx;
  548. left: 38rpx;
  549. display: flex;
  550. justify-content: center;
  551. align-items: center;
  552. width: 291rpx;
  553. height: 65rpx;
  554. font-size: 31rpx;
  555. color: #fff;
  556. border-radius: 16rpx;
  557. background: rgba(255, 255, 255, 0.2);
  558. }
  559. }
  560. .header2 {
  561. z-index: 999;
  562. position: fixed;
  563. top: 0;
  564. left: 0;
  565. right: 0;
  566. text-align: center;
  567. background-color: #fff;
  568. .title {
  569. font-size: 34rpx;
  570. }
  571. }
  572. .content {
  573. z-index: 1;
  574. margin: -102rpx auto 0;
  575. width: 690rpx;
  576. border-radius: 12rpx 12rpx 0 0;
  577. background-color: #f2f2f2;
  578. .search {
  579. box-sizing: border-box;
  580. padding: 0 28rpx;
  581. width: 690rpx;
  582. height: 353rpx;
  583. border-radius: 12rpx;
  584. background-color: #fff;
  585. .search_town {
  586. display: flex;
  587. justify-content: space-between;
  588. align-items: center;
  589. height: 89rpx;
  590. color: #a6a6a6;
  591. font-size: 32rpx;
  592. border-bottom: 1rpx solid #e6e6e6;
  593. img {
  594. width: 40rpx;
  595. height: 40rpx;
  596. }
  597. }
  598. .active {
  599. font-weight: bold;
  600. color: #000;
  601. }
  602. .search_center {
  603. display: flex;
  604. align-items: center;
  605. height: 89rpx;
  606. color: #a6a6a6;
  607. font-size: 28rpx;
  608. img {
  609. width: 40rpx;
  610. height: 40rpx;
  611. }
  612. .center_input {
  613. margin-right: 12rpx;
  614. width: 250rpx;
  615. color: #000;
  616. font-weight: bold;
  617. }
  618. .img {
  619. margin-right: 12rpx;
  620. }
  621. .center_level {
  622. flex: 1;
  623. margin-left: 24rpx;
  624. font-weight: 400;
  625. }
  626. .active {
  627. font-weight: bold;
  628. color: #000;
  629. }
  630. .img2 {
  631. margin-left: auto;
  632. }
  633. }
  634. .search_btn {
  635. display: flex;
  636. justify-content: center;
  637. align-items: center;
  638. margin-top: 23rpx;
  639. width: 623rpx;
  640. height: 100rpx;
  641. border-radius: 57rpx;
  642. color: #fff;
  643. font-size: 32rpx;
  644. background: linear-gradient(90deg, #2697ef 0%, #5e35eb 100%);
  645. }
  646. }
  647. .icons {
  648. display: flex;
  649. justify-content: space-around;
  650. align-items: center;
  651. margin: 20rpx auto;
  652. width: 690rpx;
  653. height: 180rpx;
  654. border-radius: 12rpx;
  655. background-color: #fff;
  656. .icon_item {
  657. display: flex;
  658. flex-direction: column;
  659. align-items: center;
  660. width: 20%;
  661. .item_top {
  662. display: flex;
  663. align-items: center;
  664. justify-content: center;
  665. width: 60rpx;
  666. height: 60rpx;
  667. border-radius: 50%;
  668. img {
  669. width: 28rpx;
  670. height: 27rpx;
  671. }
  672. .img2 {
  673. width: 40rpx;
  674. height: 25.5rpx;
  675. }
  676. .img3 {
  677. width: 31rpx;
  678. height: 21rpx;
  679. }
  680. }
  681. .color {
  682. background-color: #d8e8e8;
  683. }
  684. .color2 {
  685. background-color: #c2f2d5;
  686. }
  687. .color3 {
  688. background-color: #f7d4ba;
  689. }
  690. .color4 {
  691. background-color: #fae1e2;
  692. }
  693. .color5 {
  694. background-color: #d0e0f2;
  695. }
  696. .item_bottom {
  697. margin-top: 6rpx;
  698. font-size: 28rpx;
  699. }
  700. }
  701. }
  702. .swiper {
  703. margin: 20rpx auto 0;
  704. width: 690rpx;
  705. height: 214rpx;
  706. border-radius: 12rpx;
  707. background-color: #fff;
  708. .swiper_item {
  709. display: flex;
  710. justify-content: space-around;
  711. align-items: center;
  712. width: 100%;
  713. height: 100%;
  714. .item_box {
  715. position: relative;
  716. width: 195rpx;
  717. height: 128rpx;
  718. border-radius: 12rpx;
  719. color: #fff;
  720. img {
  721. width: 195rpx;
  722. height: 128rpx;
  723. border-radius: 12rpx;
  724. }
  725. .box_town {
  726. position: absolute;
  727. top: 30rpx;
  728. left: 0;
  729. right: 0;
  730. text-align: center;
  731. font-size: 28rpx;
  732. font-weight: bold;
  733. }
  734. .box_count {
  735. position: absolute;
  736. top: 75rpx;
  737. left: 0;
  738. right: 0;
  739. text-align: center;
  740. font-size: 18rpx;
  741. }
  742. }
  743. }
  744. }
  745. .body {
  746. margin: 0 auto;
  747. width: 690rpx;
  748. .body_top {
  749. display: flex;
  750. align-items: center;
  751. height: 89rpx;
  752. .circle {
  753. width: 30rpx;
  754. height: 30rpx;
  755. border-radius: 50%;
  756. background-color: #485bed;
  757. }
  758. .color {
  759. margin-left: -15rpx;
  760. opacity: 0.5;
  761. background-color: #fff;
  762. }
  763. .top_title {
  764. margin-left: 15rpx;
  765. font-size: 32rpx;
  766. font-weight: bold;
  767. }
  768. .top_msg {
  769. margin-top: 5rpx;
  770. margin-left: 12rpx;
  771. color: #666666;
  772. font-size: 24rpx;
  773. }
  774. .top_more {
  775. display: flex;
  776. align-items: center;
  777. margin-left: auto;
  778. color: #a6a6a6;
  779. font-size: 24rpx;
  780. img {
  781. width: 32rpx;
  782. height: 32rpx;
  783. }
  784. }
  785. }
  786. .body_strategy {
  787. display: flex;
  788. box-sizing: border-box;
  789. padding: 20rpx;
  790. margin-bottom: 10rpx;
  791. width: 690rpx;
  792. height: 235rpx;
  793. border-radius: 12rpx;
  794. background-color: #fff;
  795. img {
  796. width: 253rpx;
  797. height: 190rpx;
  798. border-radius: 7rpx;
  799. }
  800. .strategy_info {
  801. flex: 1;
  802. display: flex;
  803. flex-direction: column;
  804. justify-content: space-between;
  805. margin-left: 20rpx;
  806. width: 500rpx;
  807. height: 170rpx;
  808. font-size: 24rpx;
  809. color: #666666;
  810. overflow: hidden;
  811. .info_title {
  812. font-size: 32rpx;
  813. font-weight: bold;
  814. color: #000;
  815. overflow: hidden;
  816. text-overflow: ellipsis;
  817. white-space: nowrap;
  818. }
  819. .info_title2 {
  820. font-size: 32rpx;
  821. font-weight: bold;
  822. color: #000;
  823. display: -webkit-box;
  824. -webkit-box-orient: vertical;
  825. -webkit-line-clamp: 2;
  826. overflow: hidden;
  827. }
  828. .info_tags {
  829. display: flex;
  830. .tag {
  831. margin-right: 10rpx;
  832. box-sizing: border-box;
  833. padding: 0 5rpx;
  834. height: 35rpx;
  835. color: #1e7dfb;
  836. font-size: 20rpx;
  837. border-radius: 30rpx;
  838. border: 1rpx solid #1e7dfb;
  839. }
  840. }
  841. .info_desc {
  842. display: -webkit-box;
  843. -webkit-box-orient: vertical;
  844. -webkit-line-clamp: 2;
  845. overflow: hidden;
  846. }
  847. }
  848. }
  849. .body_list {
  850. display: flex;
  851. flex-wrap: wrap;
  852. justify-content: space-between;
  853. .list_item {
  854. width: 335rpx;
  855. box-sizing: border-box;
  856. margin-bottom: 20rpx;
  857. .item-img {
  858. width: 100%;
  859. height: 223rpx;
  860. border-radius: 18rpx 18rpx 0 0;
  861. box-sizing: border-box;
  862. }
  863. .descrition {
  864. display: flex;
  865. flex-direction: column;
  866. width: 100%;
  867. border-radius: 0 0 18rpx 18rpx;
  868. box-sizing: border-box;
  869. background: rgba(255, 255, 255, 1);
  870. margin-top: -10rpx;
  871. .title {
  872. font-size: 28rpx;
  873. font-weight: 600;
  874. padding: 20rpx 20rpx 10rpx;
  875. color: rgba(0, 0, 0, 1);
  876. overflow: hidden;
  877. white-space: nowrap;
  878. text-overflow: ellipsis;
  879. }
  880. .type {
  881. padding: 5rpx 20rpx;
  882. height: 40rpx;
  883. font-size: 24rpx;
  884. color: #a6a6a6;
  885. }
  886. .distance {
  887. padding: 10rpx 20rpx;
  888. font-size: 24rpx;
  889. color: #a6a6a6;
  890. }
  891. .detail {
  892. display: flex;
  893. flex-direction: row;
  894. justify-content: space-between;
  895. align-items: center;
  896. padding: 0 20rpx 20rpx 20rpx;
  897. color: rgba(0, 0, 0, 1);
  898. .img {
  899. width: 40rpx;
  900. height: 40rpx;
  901. }
  902. .price {
  903. .txt1 {
  904. font-size: 36rpx;
  905. font-weight: 600;
  906. color: rgba(255, 87, 51, 1);
  907. }
  908. .txt2 {
  909. font-size: 24rpx;
  910. font-weight: 400;
  911. color: #a6a6a6;
  912. }
  913. }
  914. .score {
  915. font-size: 24rpx;
  916. font-weight: 400;
  917. padding-top: 10rpx;
  918. color: rgba(166, 166, 166, 1);
  919. }
  920. }
  921. }
  922. }
  923. }
  924. .noData {
  925. display: flex;
  926. flex-direction: column;
  927. justify-content: center;
  928. align-items: center;
  929. padding-bottom: 65rpx;
  930. img {
  931. margin-top: 80rpx;
  932. width: 600rpx;
  933. height: 600rpx;
  934. }
  935. }
  936. }
  937. }
  938. .popup_body {
  939. width: 618rpx;
  940. height: 687rpx;
  941. border-radius: 21rpx;
  942. background-color: #fff;
  943. .body_header {
  944. display: flex;
  945. justify-content: center;
  946. align-items: center;
  947. position: relative;
  948. height: 113rpx;
  949. border-bottom: 1rpx solid #e6e6e6;
  950. img {
  951. width: 16rpx;
  952. height: 16rpx;
  953. }
  954. .header_title {
  955. margin: 0 10rpx;
  956. font-size: 34rpx;
  957. font-weight: bold;
  958. color: #0f194d;
  959. }
  960. }
  961. .body_content {
  962. display: grid;
  963. grid-template-columns: repeat(auto-fill, 160rpx);
  964. gap: 28rpx;
  965. box-sizing: border-box;
  966. padding: 26rpx 40rpx 50rpx;
  967. .content_box {
  968. position: relative;
  969. width: 160rpx;
  970. height: 105rpx;
  971. color: #fff;
  972. border-radius: 10rpx;
  973. img {
  974. width: 160rpx;
  975. height: 105rpx;
  976. border-radius: 10rpx;
  977. }
  978. .box_town {
  979. position: absolute;
  980. top: 20rpx;
  981. left: 0;
  982. right: 0;
  983. text-align: center;
  984. font-size: 28rpx;
  985. font-weight: bold;
  986. }
  987. .box_count {
  988. position: absolute;
  989. top: 62rpx;
  990. left: 0;
  991. right: 0;
  992. text-align: center;
  993. font-size: 18rpx;
  994. }
  995. }
  996. }
  997. }
  998. .popupClass {
  999. position: relative;
  1000. width: 481rpx;
  1001. height: 764rpx;
  1002. img {
  1003. width: 100%;
  1004. height: 665rpx;
  1005. }
  1006. .btn_go {
  1007. position: absolute;
  1008. top: 415rpx;
  1009. left: 40rpx;
  1010. width: 396rpx;
  1011. height: 76rpx;
  1012. border-radius: 43rpx;
  1013. }
  1014. .btn_text {
  1015. position: absolute;
  1016. top: 265rpx;
  1017. left: 40rpx;
  1018. display: flex;
  1019. justify-content: center;
  1020. align-items: center;
  1021. width: 400rpx;
  1022. height: 260rpx;
  1023. color: #0f194d;
  1024. font-size: 28rpx;
  1025. border-radius: 43rpx;
  1026. background-color: #fff;
  1027. }
  1028. .btn_close {
  1029. position: absolute;
  1030. top: 586rpx;
  1031. left: 212rpx;
  1032. width: 58rpx;
  1033. height: 58rpx;
  1034. border-radius: 50%;
  1035. }
  1036. }
  1037. }
  1038. </style>