home3.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139
  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="handleGoPage">
  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. handleGoPage() {
  514. uni.switchTab({
  515. url: '/pages/community/community'
  516. })
  517. }
  518. }
  519. }
  520. </script>
  521. <style lang="scss" scoped>
  522. .container {
  523. display: flex;
  524. flex-direction: column;
  525. min-height: 100vh;
  526. overflow-y: auto;
  527. background-color: #f2f2f2;
  528. .header {
  529. position: relative;
  530. height: 505rpx;
  531. img {
  532. width: 100%;
  533. height: 100%;
  534. border-radius: 0 0 20rpx 20rpx;
  535. }
  536. .img {
  537. position: absolute;
  538. top: 135rpx;
  539. left: 61rpx;
  540. width: 160rpx;
  541. height: 40rpx;
  542. }
  543. .img2 {
  544. position: absolute;
  545. top: 193rpx;
  546. left: 38rpx;
  547. width: 268rpx;
  548. height: 88rpx;
  549. }
  550. .header_msg {
  551. position: absolute;
  552. top: 283rpx;
  553. left: 38rpx;
  554. display: flex;
  555. justify-content: center;
  556. align-items: center;
  557. width: 291rpx;
  558. height: 65rpx;
  559. font-size: 31rpx;
  560. color: #fff;
  561. border-radius: 16rpx;
  562. background: rgba(255, 255, 255, 0.2);
  563. }
  564. }
  565. .header2 {
  566. z-index: 999;
  567. position: fixed;
  568. top: 0;
  569. left: 0;
  570. right: 0;
  571. text-align: center;
  572. background-color: #fff;
  573. .title {
  574. font-size: 34rpx;
  575. }
  576. }
  577. .content {
  578. z-index: 1;
  579. margin: -102rpx auto 0;
  580. width: 690rpx;
  581. border-radius: 12rpx 12rpx 0 0;
  582. background-color: #f2f2f2;
  583. .search {
  584. box-sizing: border-box;
  585. padding: 0 28rpx;
  586. width: 690rpx;
  587. height: 353rpx;
  588. border-radius: 12rpx;
  589. background-color: #fff;
  590. .search_town {
  591. display: flex;
  592. justify-content: space-between;
  593. align-items: center;
  594. height: 89rpx;
  595. color: #a6a6a6;
  596. font-size: 32rpx;
  597. border-bottom: 1rpx solid #e6e6e6;
  598. img {
  599. width: 40rpx;
  600. height: 40rpx;
  601. }
  602. }
  603. .active {
  604. font-weight: bold;
  605. color: #000;
  606. }
  607. .search_center {
  608. display: flex;
  609. align-items: center;
  610. height: 89rpx;
  611. color: #a6a6a6;
  612. font-size: 28rpx;
  613. img {
  614. width: 40rpx;
  615. height: 40rpx;
  616. }
  617. .center_input {
  618. margin-right: 12rpx;
  619. width: 250rpx;
  620. color: #000;
  621. font-weight: bold;
  622. }
  623. .img {
  624. margin-right: 12rpx;
  625. }
  626. .center_level {
  627. flex: 1;
  628. margin-left: 24rpx;
  629. font-weight: 400;
  630. }
  631. .active {
  632. font-weight: bold;
  633. color: #000;
  634. }
  635. .img2 {
  636. margin-left: auto;
  637. }
  638. }
  639. .search_btn {
  640. display: flex;
  641. justify-content: center;
  642. align-items: center;
  643. margin-top: 23rpx;
  644. width: 623rpx;
  645. height: 100rpx;
  646. border-radius: 57rpx;
  647. color: #fff;
  648. font-size: 32rpx;
  649. background: linear-gradient(90deg, #2697ef 0%, #5e35eb 100%);
  650. }
  651. }
  652. .icons {
  653. display: flex;
  654. justify-content: space-around;
  655. align-items: center;
  656. margin: 20rpx auto;
  657. width: 690rpx;
  658. height: 180rpx;
  659. border-radius: 12rpx;
  660. background-color: #fff;
  661. .icon_item {
  662. display: flex;
  663. flex-direction: column;
  664. align-items: center;
  665. width: 20%;
  666. .item_top {
  667. display: flex;
  668. align-items: center;
  669. justify-content: center;
  670. width: 60rpx;
  671. height: 60rpx;
  672. border-radius: 50%;
  673. img {
  674. width: 28rpx;
  675. height: 27rpx;
  676. }
  677. .img2 {
  678. width: 40rpx;
  679. height: 25.5rpx;
  680. }
  681. .img3 {
  682. width: 31rpx;
  683. height: 21rpx;
  684. }
  685. }
  686. .color {
  687. background-color: #d8e8e8;
  688. }
  689. .color2 {
  690. background-color: #c2f2d5;
  691. }
  692. .color3 {
  693. background-color: #f7d4ba;
  694. }
  695. .color4 {
  696. background-color: #fae1e2;
  697. }
  698. .color5 {
  699. background-color: #d0e0f2;
  700. }
  701. .item_bottom {
  702. margin-top: 6rpx;
  703. font-size: 28rpx;
  704. }
  705. }
  706. }
  707. .swiper {
  708. margin: 20rpx auto 0;
  709. width: 690rpx;
  710. height: 214rpx;
  711. border-radius: 12rpx;
  712. background-color: #fff;
  713. .swiper_item {
  714. display: flex;
  715. justify-content: space-around;
  716. align-items: center;
  717. width: 100%;
  718. height: 100%;
  719. .item_box {
  720. position: relative;
  721. width: 195rpx;
  722. height: 128rpx;
  723. border-radius: 12rpx;
  724. color: #fff;
  725. img {
  726. width: 195rpx;
  727. height: 128rpx;
  728. border-radius: 12rpx;
  729. }
  730. .box_town {
  731. position: absolute;
  732. top: 30rpx;
  733. left: 0;
  734. right: 0;
  735. text-align: center;
  736. font-size: 28rpx;
  737. font-weight: bold;
  738. }
  739. .box_count {
  740. position: absolute;
  741. top: 75rpx;
  742. left: 0;
  743. right: 0;
  744. text-align: center;
  745. font-size: 18rpx;
  746. }
  747. }
  748. }
  749. }
  750. .body {
  751. margin: 0 auto;
  752. width: 690rpx;
  753. .body_top {
  754. display: flex;
  755. align-items: center;
  756. height: 89rpx;
  757. .circle {
  758. width: 30rpx;
  759. height: 30rpx;
  760. border-radius: 50%;
  761. background-color: #485bed;
  762. }
  763. .color {
  764. margin-left: -15rpx;
  765. opacity: 0.5;
  766. background-color: #fff;
  767. }
  768. .top_title {
  769. margin-left: 15rpx;
  770. font-size: 32rpx;
  771. font-weight: bold;
  772. }
  773. .top_msg {
  774. margin-top: 5rpx;
  775. margin-left: 12rpx;
  776. color: #666666;
  777. font-size: 24rpx;
  778. }
  779. .top_more {
  780. display: flex;
  781. align-items: center;
  782. margin-left: auto;
  783. color: #a6a6a6;
  784. font-size: 24rpx;
  785. img {
  786. width: 32rpx;
  787. height: 32rpx;
  788. }
  789. }
  790. }
  791. .body_strategy {
  792. display: flex;
  793. box-sizing: border-box;
  794. padding: 20rpx;
  795. margin-bottom: 10rpx;
  796. width: 690rpx;
  797. height: 235rpx;
  798. border-radius: 12rpx;
  799. background-color: #fff;
  800. img {
  801. width: 253rpx;
  802. height: 190rpx;
  803. border-radius: 7rpx;
  804. }
  805. .strategy_info {
  806. flex: 1;
  807. display: flex;
  808. flex-direction: column;
  809. justify-content: space-between;
  810. margin-left: 20rpx;
  811. width: 500rpx;
  812. height: 170rpx;
  813. font-size: 24rpx;
  814. color: #666666;
  815. overflow: hidden;
  816. .info_title {
  817. font-size: 32rpx;
  818. font-weight: bold;
  819. color: #000;
  820. overflow: hidden;
  821. text-overflow: ellipsis;
  822. white-space: nowrap;
  823. }
  824. .info_title2 {
  825. font-size: 32rpx;
  826. font-weight: bold;
  827. color: #000;
  828. display: -webkit-box;
  829. -webkit-box-orient: vertical;
  830. -webkit-line-clamp: 2;
  831. overflow: hidden;
  832. }
  833. .info_tags {
  834. display: flex;
  835. .tag {
  836. margin-right: 10rpx;
  837. box-sizing: border-box;
  838. padding: 0 5rpx;
  839. height: 35rpx;
  840. color: #1e7dfb;
  841. font-size: 20rpx;
  842. border-radius: 30rpx;
  843. border: 1rpx solid #1e7dfb;
  844. }
  845. }
  846. .info_desc {
  847. display: -webkit-box;
  848. -webkit-box-orient: vertical;
  849. -webkit-line-clamp: 2;
  850. overflow: hidden;
  851. }
  852. }
  853. }
  854. .body_list {
  855. display: flex;
  856. flex-wrap: wrap;
  857. justify-content: space-between;
  858. .list_item {
  859. width: 335rpx;
  860. box-sizing: border-box;
  861. margin-bottom: 20rpx;
  862. .item-img {
  863. width: 100%;
  864. height: 223rpx;
  865. border-radius: 18rpx 18rpx 0 0;
  866. box-sizing: border-box;
  867. }
  868. .descrition {
  869. display: flex;
  870. flex-direction: column;
  871. width: 100%;
  872. border-radius: 0 0 18rpx 18rpx;
  873. box-sizing: border-box;
  874. background: rgba(255, 255, 255, 1);
  875. margin-top: -10rpx;
  876. .title {
  877. font-size: 28rpx;
  878. font-weight: 600;
  879. padding: 20rpx 20rpx 10rpx;
  880. color: rgba(0, 0, 0, 1);
  881. overflow: hidden;
  882. white-space: nowrap;
  883. text-overflow: ellipsis;
  884. }
  885. .type {
  886. padding: 5rpx 20rpx;
  887. height: 40rpx;
  888. font-size: 24rpx;
  889. color: #a6a6a6;
  890. }
  891. .distance {
  892. padding: 10rpx 20rpx;
  893. font-size: 24rpx;
  894. color: #a6a6a6;
  895. }
  896. .detail {
  897. display: flex;
  898. flex-direction: row;
  899. justify-content: space-between;
  900. align-items: center;
  901. padding: 0 20rpx 20rpx 20rpx;
  902. color: rgba(0, 0, 0, 1);
  903. .img {
  904. width: 40rpx;
  905. height: 40rpx;
  906. }
  907. .price {
  908. .txt1 {
  909. font-size: 36rpx;
  910. font-weight: 600;
  911. color: rgba(255, 87, 51, 1);
  912. }
  913. .txt2 {
  914. font-size: 24rpx;
  915. font-weight: 400;
  916. color: #a6a6a6;
  917. }
  918. }
  919. .score {
  920. font-size: 24rpx;
  921. font-weight: 400;
  922. padding-top: 10rpx;
  923. color: rgba(166, 166, 166, 1);
  924. }
  925. }
  926. }
  927. }
  928. }
  929. .noData {
  930. display: flex;
  931. flex-direction: column;
  932. justify-content: center;
  933. align-items: center;
  934. padding-bottom: 65rpx;
  935. img {
  936. margin-top: 80rpx;
  937. width: 600rpx;
  938. height: 600rpx;
  939. }
  940. }
  941. }
  942. }
  943. .popup_body {
  944. width: 618rpx;
  945. height: 687rpx;
  946. border-radius: 21rpx;
  947. background-color: #fff;
  948. .body_header {
  949. display: flex;
  950. justify-content: center;
  951. align-items: center;
  952. position: relative;
  953. height: 113rpx;
  954. border-bottom: 1rpx solid #e6e6e6;
  955. img {
  956. width: 16rpx;
  957. height: 16rpx;
  958. }
  959. .header_title {
  960. margin: 0 10rpx;
  961. font-size: 34rpx;
  962. font-weight: bold;
  963. color: #0f194d;
  964. }
  965. }
  966. .body_content {
  967. display: grid;
  968. grid-template-columns: repeat(auto-fill, 160rpx);
  969. gap: 28rpx;
  970. box-sizing: border-box;
  971. padding: 26rpx 40rpx 50rpx;
  972. .content_box {
  973. position: relative;
  974. width: 160rpx;
  975. height: 105rpx;
  976. color: #fff;
  977. border-radius: 10rpx;
  978. img {
  979. width: 160rpx;
  980. height: 105rpx;
  981. border-radius: 10rpx;
  982. }
  983. .box_town {
  984. position: absolute;
  985. top: 20rpx;
  986. left: 0;
  987. right: 0;
  988. text-align: center;
  989. font-size: 28rpx;
  990. font-weight: bold;
  991. }
  992. .box_count {
  993. position: absolute;
  994. top: 62rpx;
  995. left: 0;
  996. right: 0;
  997. text-align: center;
  998. font-size: 18rpx;
  999. }
  1000. }
  1001. }
  1002. }
  1003. .popupClass {
  1004. position: relative;
  1005. width: 481rpx;
  1006. height: 764rpx;
  1007. img {
  1008. width: 100%;
  1009. height: 665rpx;
  1010. }
  1011. .btn_go {
  1012. position: absolute;
  1013. top: 415rpx;
  1014. left: 40rpx;
  1015. width: 396rpx;
  1016. height: 76rpx;
  1017. border-radius: 43rpx;
  1018. }
  1019. .btn_text {
  1020. position: absolute;
  1021. top: 265rpx;
  1022. left: 40rpx;
  1023. display: flex;
  1024. justify-content: center;
  1025. align-items: center;
  1026. width: 400rpx;
  1027. height: 260rpx;
  1028. color: #0f194d;
  1029. font-size: 28rpx;
  1030. border-radius: 43rpx;
  1031. background-color: #fff;
  1032. }
  1033. .btn_close {
  1034. position: absolute;
  1035. top: 586rpx;
  1036. left: 212rpx;
  1037. width: 58rpx;
  1038. height: 58rpx;
  1039. border-radius: 50%;
  1040. }
  1041. }
  1042. }
  1043. </style>