home3.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  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. <swiper class="header_swiper" autoplay circular :interval="3000">
  9. <swiper-item v-for="banner in headerImgList" :key="banner.id" @click="handleClickBanner(banner)">
  10. <img mode="aspectFill" class="img" :src="banner.imageUrl" />
  11. <img v-if="banner.logoUrl.indexOf('2.png') != -1" mode="aspectFill" class="img2" :src="banner.logoUrl" />
  12. <img v-if="banner.logoUrl.indexOf('1.png') != -1" mode="aspectFill" class="img3" :src="banner.logoUrl" />
  13. </swiper-item>
  14. </swiper>
  15. </view>
  16. <!-- 主体内容区域 -->
  17. <view class="content">
  18. <!-- 条件筛选区域 -->
  19. <view class="search">
  20. <!-- 选择乡镇区域 -->
  21. <view class="search_town" :class="{ active: town }" @click="handleOpen">
  22. <view class="town_text">
  23. <img class="img" v-if="town" src="../../static/images/4.png" />
  24. {{ town ? town : '请选择乡镇' }}
  25. </view>
  26. <img src="../../static/index/right2.png" />
  27. </view>
  28. <!-- 关键词搜索和民宿级别区域 -->
  29. <view class="search_center">
  30. <view class="center_input">
  31. <input type="text" v-model="keywords" placeholder="乡村民宿/地名/关键词" placeholder-style="color:#808080;font-weight:400;" />
  32. </view>
  33. <img class="img" src="../../static/index/right2.png" />
  34. |
  35. <view class="center_level" :class="{ active: level }" @click="handleChooseLv">{{ level ? level : '请选择级别' }}</view>
  36. <img class="img2" src="../../static/index/right2.png" @click="handleChooseLv" />
  37. </view>
  38. <!-- 查找按钮区域 -->
  39. <view class="search_btn" @click="handleSearch">查找</view>
  40. <view class="search_msg">
  41. <view class="msg_box">
  42. <img class="box_img" src="@/static/images/1.png" />
  43. 真实房源
  44. </view>
  45. <view class="msg_box">
  46. <img class="box_img2" src="@/static/images/3.png" />
  47. 安心入住
  48. </view>
  49. <view class="msg_box">
  50. <img class="box_img3" src="@/static/images/2.png" />
  51. 专业客服
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 轮播图区域 -->
  56. <swiper class="swiper" indicator-dots circular indicator-color="#BBD8FE" indicator-active-color="#1E7DFB" autoplay interval="3000" v-if="townList.length">
  57. <swiper-item v-for="(ele, index) in townList" :key="index">
  58. <view class="swiper_item">
  59. <view class="item_box" v-for="(swi, index2) in ele" :key="index2" @click="handleChooseTown2(swi.name)">
  60. <img
  61. v-if="index === 0 && index2 === 0"
  62. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163202_1.png"
  63. mode="aspectFill"
  64. />
  65. <img
  66. v-if="index === 0 && index2 === 1"
  67. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163133_2.png"
  68. mode="aspectFill"
  69. />
  70. <img
  71. v-if="index === 0 && index2 === 2"
  72. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163218_3.png"
  73. mode="aspectFill"
  74. />
  75. <img
  76. v-if="index === 1 && index2 === 0"
  77. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163234_4.png"
  78. mode="aspectFill"
  79. />
  80. <img
  81. v-if="index === 1 && index2 === 1"
  82. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163251_5.png"
  83. mode="aspectFill"
  84. />
  85. <img
  86. v-if="index === 1 && index2 === 2"
  87. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163307_6.png"
  88. mode="aspectFill"
  89. />
  90. <img
  91. v-if="index === 2 && index2 === 0"
  92. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163321_7.png"
  93. mode="aspectFill"
  94. />
  95. <img
  96. v-if="index === 2 && index2 === 1"
  97. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163344_8.png"
  98. mode="aspectFill"
  99. />
  100. <img
  101. v-if="index === 2 && index2 === 2"
  102. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163357_9.png"
  103. mode="aspectFill"
  104. />
  105. <img
  106. v-if="index === 3 && index2 === 0"
  107. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163411_10.png"
  108. mode="aspectFill"
  109. />
  110. <img
  111. v-if="index === 3 && index2 === 1"
  112. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163428_11.png"
  113. mode="aspectFill"
  114. />
  115. <img
  116. v-if="index === 3 && index2 === 2"
  117. src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163458_13.png"
  118. mode="aspectFill"
  119. />
  120. <view class="box_town">{{ swi.name }}</view>
  121. <view class="box_count">剩{{ swi.residueNumber }}间</view>
  122. </view>
  123. </view>
  124. </swiper-item>
  125. </swiper>
  126. <view class="body">
  127. <!-- 优选民宿区域 -->
  128. <uv-skeletons :loading="loading" :skeleton="skeleton">
  129. <view class="body_top" v-if="hotelList_you.length">
  130. <view class="circle"></view>
  131. <view class="circle color"></view>
  132. <view class="top_title">优选乡村民宿 .</view>
  133. <view class="top_msg">让旅途充满乐趣</view>
  134. <view class="top_more" @click="handleGoHome">查看更多 ></view>
  135. </view>
  136. <swiper class="body_swiper" indicator-dots circular indicator-color="#BBD8FE" indicator-active-color="#1E7DFB" interval="3000" v-if="hotelList_you.length">
  137. <swiper-item v-for="(ele, index) in hotelList_you" :key="index">
  138. <view class="swiper_box">
  139. <view class="list_item" v-for="(item, index2) in ele" :key="item.id" @click="goPageDetail(item)">
  140. <image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
  141. <view class="descrition">
  142. <text class="title">{{ item.hotel_name }}</text>
  143. <text class="type">
  144. {{ item.hTypeName }} &nbsp;&nbsp;
  145. <text class="type_level" v-if="item.type == 1">银宿级</text>
  146. <text class="type_level" v-if="item.type == 2">金宿级</text>
  147. <text class="type_level" v-if="item.type == 3">白金级</text>
  148. </text>
  149. <text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
  150. <view class="detail">
  151. <img class="img" src="../../static/index/hotel.png" />
  152. <view class="price_home">
  153. <text class="txt1">¥{{ item.min_price ? item.min_price : 0 }}</text>
  154. <text class="txt2">起</text>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. </swiper-item>
  161. </swiper>
  162. </uv-skeletons>
  163. <!-- 精选攻略区域 -->
  164. <view class="body_top" v-if="bestNewsList.length">
  165. <view class="circle"></view>
  166. <view class="circle color"></view>
  167. <view class="top_title">精选攻略 .</view>
  168. <view class="top_msg">宿管家带你住靖安</view>
  169. <view class="top_more" @click="handleGoPage">查看更多 ></view>
  170. </view>
  171. <swiper class="body_strategy" indicator-dots indicator-color="#BBD8FE" indicator-active-color="#1E7DFB" circular :interval="3000" v-if="bestNewsList.length">
  172. <swiper-item v-for="item in bestNewsList" :key="item.id" @click="handleGoDetail(item)">
  173. <img v-if="item.image" class="strategy_cover" mode="aspectFill" :src="item.image" />
  174. <video
  175. v-if="item.video"
  176. class="strategy_cover"
  177. :src="item.video"
  178. :controls="false"
  179. :show-center-play-btn="false"
  180. :show-fullscreen-btn="false"
  181. :show-play-btn="false"
  182. ></video>
  183. <view class="strategy_info">
  184. <view class="info_title">{{ item.title }}</view>
  185. <view class="info_tags">
  186. <view class="tag">{{ item.townName }}</view>
  187. </view>
  188. <text class="info_desc">{{ item.content }}</text>
  189. </view>
  190. </swiper-item>
  191. </swiper>
  192. <!-- 每日推荐区域 -->
  193. <view class="body_top" v-if="hotelList.length">
  194. <view class="circle"></view>
  195. <view class="circle color"></view>
  196. <view class="top_title">每日推荐 .</view>
  197. <view class="top_msg">线上订民宿,住着玩个遍</view>
  198. <view class="top_more" @click="handleGoHome">查看更多 ></view>
  199. </view>
  200. <view class="body_list">
  201. <!-- 每一个民宿区域 -->
  202. <view class="list_item" v-for="item in hotelList" :key="item.id" @click="goPageDetail(item)">
  203. <image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
  204. <view class="descrition">
  205. <text class="title">{{ item.hotel_name }}</text>
  206. <text class="type">
  207. {{ item.hTypeName }}
  208. <text class="type_level" v-if="item.type == 1">银宿级</text>
  209. <text class="type_level" v-if="item.type == 2">金宿级</text>
  210. <text class="type_level" v-if="item.type == 3">白金级</text>
  211. </text>
  212. <text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
  213. <view class="detail">
  214. <img class="img" src="../../static/index/hotel.png" />
  215. <view class="price_home">
  216. <text class="txt1">¥{{ item.min_price ? item.min_price : 0 }}</text>
  217. <text class="txt2">起</text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. <!-- 特产甄选区域 -->
  224. <view class="body_top" v-if="goodsList.length">
  225. <view class="circle"></view>
  226. <view class="circle color"></view>
  227. <view class="top_title">特产甄选 .</view>
  228. <view class="top_msg">明优推荐,土的自然,购的放心</view>
  229. <view class="top_more" @click="clickGoods">查看更多 ></view>
  230. </view>
  231. <view class="body_list">
  232. <!-- 每一个特产区域 -->
  233. <view class="item_goods" v-for="item in goodsList" :key="item.id" @click="to_detail(item)">
  234. <img class="goods_img" mode="aspectFill" :src="item.imgs.split(',')[0]" />
  235. <view class="goods_name">{{ item.name }}</view>
  236. <view class="goods_detail">
  237. <img class="img" src="../../static/index/goods.png" />
  238. <view class="price_good">
  239. <text class="txt1">¥{{ item.price }}</text>
  240. <text class="txt2">起</text>
  241. </view>
  242. </view>
  243. </view>
  244. </view>
  245. <!-- 两山资产区域 -->
  246. <view class="body_top" v-if="newsList.length">
  247. <view class="circle"></view>
  248. <view class="circle color"></view>
  249. <view class="top_title">两山资产 .</view>
  250. <view class="top_msg">以招商引资,推动镇域经济</view>
  251. <view class="top_more" @click="handleGoNewsList">查看更多 ></view>
  252. </view>
  253. <!-- 两山资产轮播图 -->
  254. <uni-swiper-dot :info="newsList" mode="round" :dotsStyles="dotsStyles" :current="current">
  255. <swiper circular autoplay interval="3000" class="body_news" @change="changeDot">
  256. <swiper-item v-for="item in newsList" :key="item.id" @click="handleGoNews(item)">
  257. <uv-image width="633rpx" height="332rpx" radius="8rpx" mode="aspectFill" :src="item.url" />
  258. <view class="news_title">
  259. {{ item.title ? item.title : '无标题' }}
  260. </view>
  261. <view class="news_desc">
  262. {{ item.desc }}
  263. </view>
  264. <mp-html v-if="item.showHtml" @load="htmlLoad(item)" :ref="item.id + 'html'" :content="item.content" />
  265. </swiper-item>
  266. </swiper>
  267. </uni-swiper-dot>
  268. </view>
  269. </view>
  270. <!-- 选择乡镇弹窗区域 -->
  271. <uni-popup ref="popup" type="center">
  272. <view class="popup_body">
  273. <view class="body_header">
  274. <img src="../../static/my/popup_title.png" />
  275. <view class="header_title">请选择乡镇</view>
  276. <img src="../../static/my/popup_title.png" />
  277. </view>
  278. <view class="body_content">
  279. <view class="content_box" v-for="(item, index) in popList" :key="index" @click="handleChooseTown(item.name)">
  280. <img v-if="index === 0" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163202_1.png" mode="aspectFill" />
  281. <img v-if="index === 1" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163133_2.png" mode="aspectFill" />
  282. <img v-if="index === 2" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163218_3.png" mode="aspectFill" />
  283. <img v-if="index === 3" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163234_4.png" mode="aspectFill" />
  284. <img v-if="index === 4" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163251_5.png" mode="aspectFill" />
  285. <img v-if="index === 5" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163307_6.png" mode="aspectFill" />
  286. <img v-if="index === 6" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163321_7.png" mode="aspectFill" />
  287. <img v-if="index === 7" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163344_8.png" mode="aspectFill" />
  288. <img v-if="index === 8" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163357_9.png" mode="aspectFill" />
  289. <img v-if="index === 9" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163411_10.png" mode="aspectFill" />
  290. <img v-if="index === 10" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163428_11.png" mode="aspectFill" />
  291. <img v-if="index === 11" src="https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240523163458_13.png" mode="aspectFill" />
  292. <view class="box_town">{{ item.name }}</view>
  293. <view class="box_count">剩{{ item.residueNumber }}间</view>
  294. </view>
  295. </view>
  296. </view>
  297. </uni-popup>
  298. <!-- 公告弹窗区域 -->
  299. <uv-popup ref="popup_sale" mode="center" :closeOnClickOverlay="false" bgColor="none">
  300. <view class="popupClass">
  301. <img src="../../static/index/popup_bg.png" />
  302. <!-- 立即前往区域 -->
  303. <view class="btn_text">系统处于迭代试用状态,请勿下单预订酒店,如需预订请电联店家老板确认预订渠道。</view>
  304. <!-- 关闭按钮区域 -->
  305. <view class="btn_close" @click="handleClose"></view>
  306. </view>
  307. </uv-popup>
  308. </view>
  309. </template>
  310. <script>
  311. export default {
  312. data() {
  313. return {
  314. // 用户定位经度
  315. myLng: 0,
  316. // 用户定位纬度
  317. myLat: 0,
  318. // 是否显示距离差
  319. showdDistance: false,
  320. // 搜索框绑定数据
  321. keywords: '',
  322. // 当前页
  323. page: 1,
  324. // 每页多少条
  325. rows: 6,
  326. // 总条数
  327. total: null,
  328. // 地区数组
  329. placeList: [
  330. {
  331. name: '靖安县'
  332. }
  333. ],
  334. // 当前选择地区索引
  335. placeIndex: 0,
  336. // 选择乡镇弹窗数据
  337. popList: [],
  338. // 每日推荐民宿列表数组
  339. hotelList: [],
  340. // 优选民宿列表数组
  341. hotelList_you: [],
  342. // 当前乡镇
  343. town: '',
  344. // 民宿级别
  345. level: '',
  346. // 乡镇列表
  347. townList: [],
  348. // 顶部导航栏显示隐藏控制
  349. headerType: false,
  350. // 状态栏高度
  351. statusBarH: 0,
  352. // 胶囊按钮栏高度
  353. customBarH: 0,
  354. // 两山资产列表
  355. newsList: [],
  356. // 精选攻略数据
  357. bestNewsList: [],
  358. // 两山资产轮播图指示点样式
  359. dotsStyles: {
  360. backgroundColor: '#BBD8FE',
  361. selectedBackgroundColor: '#1E7DFB',
  362. border: 'none',
  363. selectedBorder: 'none'
  364. },
  365. // 两山资产轮播图当前索引值
  366. current: 0,
  367. // 特产甄选列表
  368. goodsList: [],
  369. // 是否显示骨架屏
  370. loading: true,
  371. // 骨架屏参数
  372. skeleton: [
  373. {
  374. type: 'line',
  375. style: { height: '90rpx', marginTop: '10rpx' }
  376. },
  377. 30,
  378. {
  379. type: 'flex',
  380. num: 2,
  381. children: [
  382. {
  383. type: 'custom',
  384. style: 'width:335rpx;height:460rpx;borderRadius:18rpx'
  385. },
  386. {
  387. type: 'custom',
  388. style: 'width:335rpx;height:460rpx;borderRadius:18rpx;marginLeft:50rpx;'
  389. }
  390. ]
  391. }
  392. ],
  393. // 顶部轮播图图片数组
  394. headerImgList: []
  395. }
  396. },
  397. created() {
  398. // 获取系统信息
  399. uni.getSystemInfo({
  400. success: (e) => {
  401. // 获取状态栏高度
  402. this.statusBarH = e.statusBarHeight + 10
  403. // // 获取菜单按钮栏高度
  404. let custom = uni.getMenuButtonBoundingClientRect()
  405. this.customBarH = custom.height + 10
  406. }
  407. })
  408. },
  409. mounted() {
  410. // 开启转发功能
  411. uni.showShareMenu({
  412. withShareTicket: true,
  413. menus: ['shareAppMessage', 'shareTimeline']
  414. })
  415. },
  416. onPageScroll(e) {
  417. if (e.scrollTop > 100) {
  418. this.headerType = true
  419. } else {
  420. this.headerType = false
  421. }
  422. },
  423. onPullDownRefresh() {
  424. this.loading = true
  425. this.hotelList_you = []
  426. this.hotelList = []
  427. this.page = 1
  428. this.getLocation()
  429. this.getHeaderImgList()
  430. this.getResidueCount()
  431. this.getBestNews()
  432. this.getNews()
  433. this.getGoodsList()
  434. setTimeout(() => {
  435. uni.stopPullDownRefresh()
  436. }, 1000)
  437. },
  438. onLoad() {
  439. // 获取顶部轮播图数据
  440. this.getHeaderImgList()
  441. // 获取乡镇列表
  442. this.getResidueCount()
  443. // 获取定位
  444. this.getLocation()
  445. // 获取精选攻略
  446. this.getBestNews()
  447. // 获取特产列表
  448. this.getGoodsList()
  449. // 获取两山资产列表
  450. this.getNews()
  451. },
  452. methods: {
  453. async getHeaderImgList() {
  454. const res = await this.$myRequest({
  455. url: '/mhotel/advertiseopenList.action'
  456. })
  457. // console.log(res)
  458. if (res.code == 200) {
  459. this.headerImgList = res.data
  460. }
  461. },
  462. async getBestNews() {
  463. const res = await this.$myRequest({
  464. url: '/mhotel/articlequeryTop3ArticleLike.action'
  465. })
  466. // console.log(res)
  467. if (res.code == 200 && res.data) {
  468. this.bestNewsList = res.data
  469. }
  470. },
  471. async getNews() {
  472. const res = await this.$myRequest({
  473. url: '/mhotel/appnewlist.action',
  474. data: {
  475. page: 1,
  476. rows: 3
  477. }
  478. })
  479. // console.log(res)
  480. if (res.code === 200) {
  481. this.newsList = res.rows
  482. this.newsList.forEach((ele) => {
  483. this.$set(ele, 'showHtml', true)
  484. })
  485. }
  486. },
  487. async getGoodsList() {
  488. const res = await this.$myRequest_shop({
  489. url: '/goods/open/page',
  490. data: {
  491. curPage: 1,
  492. pageSize: 4,
  493. hot: 1,
  494. state: 1
  495. }
  496. })
  497. // console.log(res)
  498. if (res.code === '1') {
  499. this.goodsList = res.data.list
  500. }
  501. },
  502. //跳转到商城总类
  503. to_detail(options) {
  504. let userInfo = uni.getStorageSync('userInfo')
  505. let tokenId = uni.getStorageSync('tokenId')
  506. if (!userInfo || !tokenId) {
  507. uni.showModal({
  508. title: '提示',
  509. content: '您当前未登录,请授权登录查看社区信息',
  510. showCancel: false,
  511. success: (res) => {
  512. if (res.confirm) {
  513. uni.navigateTo({
  514. url: '/pages/login/login'
  515. })
  516. }
  517. }
  518. })
  519. } else {
  520. this.$api.togoods({ id: options.id })
  521. }
  522. },
  523. //跳转到特产商城
  524. clickGoods() {
  525. let userInfo = uni.getStorageSync('userInfo')
  526. let tokenId = uni.getStorageSync('tokenId')
  527. if (!userInfo || !tokenId) {
  528. uni.showModal({
  529. title: '提示',
  530. content: '您当前未登录,请授权登录查看社区信息',
  531. showCancel: false,
  532. success: (res) => {
  533. if (res.confirm) {
  534. uni.navigateTo({
  535. url: '/pages/login/login'
  536. })
  537. }
  538. }
  539. })
  540. } else {
  541. uni.navigateTo({
  542. url: '/packageShang/pages/tabbar/home'
  543. })
  544. }
  545. },
  546. // 获取用户当前位置
  547. getLocation() {
  548. uni.getSetting({
  549. success: (res) => {
  550. if (!res.authSetting['scope.userLocation']) {
  551. uni.authorize({
  552. scope: 'scope.userLocation',
  553. success: (res) => {
  554. // 授权成功
  555. uni.getLocation({
  556. type: 'gcj02',
  557. success: (res) => {
  558. this.myLat = res.latitude
  559. this.myLng = res.longitude
  560. this.showdDistance = true
  561. this.getHotelList_you()
  562. this.getHotelList_jing()
  563. }
  564. })
  565. },
  566. fail: () => {
  567. uni.showModal({
  568. content: '获取定位权限失败将会影响使用部分功能,是否去设置打开?',
  569. confirmText: '确认',
  570. cancelText: '取消',
  571. success: (res) => {
  572. if (res.confirm) {
  573. uni.openSetting({
  574. success: (res) => {
  575. console.log(res)
  576. this.getLocation()
  577. }
  578. })
  579. } else {
  580. this.showdDistance = false
  581. this.getHotelList_you()
  582. this.getHotelList_jing()
  583. uni.showToast({
  584. title: '获取定位权限失败',
  585. icon: 'none'
  586. })
  587. }
  588. }
  589. })
  590. }
  591. })
  592. } else {
  593. uni.getLocation({
  594. type: 'gcj02',
  595. success: (res) => {
  596. this.myLat = res.latitude
  597. this.myLng = res.longitude
  598. this.showdDistance = true
  599. this.getHotelList_you()
  600. this.getHotelList_jing()
  601. }
  602. })
  603. }
  604. },
  605. fail: () => {
  606. uni.showToast({
  607. title: '获取用户设置权限失败',
  608. icon: 'none',
  609. mask: true
  610. })
  611. }
  612. })
  613. },
  614. handleGoDetail(info) {
  615. let openid = uni.getStorageSync('openid')
  616. if (openid) {
  617. uni.navigateTo({
  618. url: `/pagesSub/tweetDetail/tweetDetail?id=${info.id}&townId=${info.townId}`
  619. })
  620. } else {
  621. uni.showToast({
  622. title: '请先登录',
  623. icon: 'none',
  624. mask: true
  625. })
  626. setTimeout(() => {
  627. uni.navigateTo({
  628. url: '/pages/login/login'
  629. })
  630. }, 1500)
  631. }
  632. },
  633. // 获取民宿列表 优选
  634. async getHotelList_you() {
  635. const res = await this.$myRequest({
  636. url: '/mhotel/ahppreferredPage.action',
  637. data: {
  638. page: 1,
  639. rows: 4,
  640. type: 3,
  641. userId: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo').id : ''
  642. }
  643. })
  644. // console.log(res)
  645. if (res.code === 200) {
  646. this.hotelList_you = res.data.pageList
  647. // 如果定位成功则获取和民宿之间的距离
  648. if (this.showdDistance && this.hotelList_you.length) {
  649. this.hotelList_you.forEach((ele) => {
  650. let lat = ele.hpositionWens.split(',')[0]
  651. let lng = ele.hpositionWens.split(',')[1]
  652. ele.distance = this.calculateDistance(lat, lng)
  653. })
  654. this.hotelList_you = this.changeList(this.hotelList_you, 2)
  655. }
  656. this.loading = false
  657. }
  658. },
  659. // 获取民宿列表 每日推荐
  660. async getHotelList_jing() {
  661. const res = await this.$myRequest({
  662. url: '/mhotel/ahpselectedPage.action',
  663. data: {
  664. page: this.page,
  665. rows: this.rows,
  666. type: 3,
  667. userId: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo').id : ''
  668. }
  669. })
  670. // console.log(res)
  671. if (res.code === 200) {
  672. this.hotelList = [...this.hotelList, ...res.data.pageList]
  673. this.total = res.data.total
  674. // 如果定位成功则获取和民宿之间的距离
  675. if (this.showdDistance && this.hotelList.length) {
  676. this.hotelList.forEach((ele) => {
  677. let lat = ele.hpositionWens.split(',')[0]
  678. let lng = ele.hpositionWens.split(',')[1]
  679. ele.distance = this.calculateDistance(lat, lng)
  680. })
  681. }
  682. }
  683. },
  684. handleOpen() {
  685. this.$refs.popup.open()
  686. },
  687. // 获取乡镇
  688. async getResidueCount() {
  689. const res = await this.$myRequest({
  690. url: '/mhotel/ahpgetResidueCount.action'
  691. })
  692. // console.log(res)
  693. if (res.code === 200) {
  694. let temNum = 0
  695. res.data.forEach((ele) => {
  696. temNum += ele.residueNumber
  697. })
  698. res.data.unshift({
  699. name: '靖安县',
  700. residueNumber: temNum
  701. })
  702. this.popList = res.data
  703. this.townList = this.changeList(this.popList, 3)
  704. }
  705. },
  706. // 变成二维数组
  707. changeList(arr, num) {
  708. let newArr = []
  709. const total = Math.ceil(arr.length / num)
  710. for (let i = 0; i < total; i++) {
  711. let a = arr.slice(i * num, (i + 1) * num)
  712. newArr.push(a)
  713. }
  714. return newArr
  715. },
  716. // 弹窗点击选择乡镇地址回调
  717. handleChooseTown(name) {
  718. this.town = name
  719. this.$refs.popup.close()
  720. },
  721. handleChooseTown2(name) {
  722. // this.town = name
  723. uni.navigateTo({
  724. url: `/pagesSub/home/home?town=${name}&keywords=${this.keywords}&level=${this.level}`
  725. })
  726. },
  727. handleChooseLv() {
  728. uni.showActionSheet({
  729. itemList: ['白金级', '金宿级', '银宿级'],
  730. success: (res) => {
  731. if (res.tapIndex === 0) {
  732. this.level = '白金级'
  733. } else if (res.tapIndex === 1) {
  734. this.level = '金宿级'
  735. } else if (res.tapIndex === 2) {
  736. this.level = '银宿级'
  737. }
  738. }
  739. })
  740. },
  741. handleSearch() {
  742. uni.navigateTo({
  743. url: `/pagesSub/home/home?town=${this.town}&keywords=${this.keywords}&level=${this.level}`
  744. })
  745. },
  746. goPageDetail(item) {
  747. uni.navigateTo({
  748. url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}&town=${item.hotelTownshipName}`
  749. })
  750. },
  751. // 弹窗关闭按钮回调
  752. handleClose() {
  753. this.$refs.popup_sale.close()
  754. },
  755. // 计算两个点之间的距离
  756. calculateDistance(lat, lng) {
  757. let centerLat = lat
  758. let centerLng = lng
  759. let red1 = (this.myLat * Math.PI) / 180.0
  760. let red2 = (centerLat * Math.PI) / 180.0
  761. let a = red1 - red2
  762. let b = (this.myLng * Math.PI) / 180.0 - (centerLng * Math.PI) / 180.0
  763. let R = 6378137
  764. 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)))
  765. let res = (distance / 1000).toFixed(2) * 1
  766. return res
  767. },
  768. handleGoPage() {
  769. uni.switchTab({
  770. url: '/pages/community/community'
  771. })
  772. },
  773. handleGoNews(item) {
  774. let info = encodeURIComponent(JSON.stringify(item))
  775. uni.navigateTo({
  776. url: `/pagesSub/newsDetail/newsDetail?info=${info}`
  777. })
  778. },
  779. handleGoNewsList() {
  780. uni.navigateTo({
  781. url: '/pagesSub/newsList/newsList'
  782. })
  783. },
  784. htmlLoad(item) {
  785. let id = item.id + 'html'
  786. let ctx = this.$refs[id][0]
  787. let text = ctx.getText()
  788. let imgs = ctx.imgList[0]
  789. item.showHtml = false
  790. item.desc = text
  791. item.url = imgs
  792. },
  793. handleGoHome() {
  794. uni.navigateTo({
  795. url: '/pagesSub/home/home'
  796. })
  797. },
  798. changeDot(e) {
  799. this.current = e.detail.current
  800. },
  801. // 点击顶部轮播图广告回调
  802. handleClickBanner(banner) {
  803. // console.log(banner)
  804. switch (banner.jumpWay) {
  805. case '网页':
  806. uni.navigateTo({
  807. url: `/pagesSub/web/web?url=${banner.jumpPoint}`
  808. })
  809. break
  810. case '小程序':
  811. let openid = uni.getStorageSync('openid')
  812. let tokenId = uni.getStorageSync('tokenId')
  813. if (openid && tokenId) {
  814. if (banner.jumpDirection == '民宿') {
  815. uni.navigateTo({
  816. url: `/pages/detail/detail?id=${banner.jumpPoint}&distance=&town=${banner.townId}`
  817. })
  818. } else if (banner.jumpDirection == '商品') {
  819. if (banner.jumpPoint == '首页') {
  820. uni.navigateTo({
  821. url: '/packageShang/pages/tabbar/home'
  822. })
  823. } else {
  824. uni.navigateTo({
  825. url: `/packageShang/pages/goods/goods?id=${banner.jumpPoint}`
  826. })
  827. }
  828. } else if (banner.jumpDirection == '攻略') {
  829. if (banner.jumpPoint == '首页') {
  830. uni.switchTab({
  831. url: '/pages/community/community'
  832. })
  833. } else {
  834. uni.navigateTo({
  835. url: `/pagesSub/tweetDetail/tweetDetail?id=${banner.jumpPoint}&townId=${banner.townId}`
  836. })
  837. }
  838. } else if (banner.jumpDirection == '优惠券') {
  839. uni.navigateTo({
  840. url: `/pagesSub/couponCenter/couponCenter?id=${banner.jumpPoint}`
  841. })
  842. }
  843. } else {
  844. uni.showToast({
  845. title: '请先登录',
  846. icon: 'none',
  847. mask: true
  848. })
  849. setTimeout(() => {
  850. uni.navigateTo({
  851. url: '/pages/login/login'
  852. })
  853. }, 1500)
  854. }
  855. break
  856. default:
  857. uni.previewImage({
  858. urls: [banner.imageUrl]
  859. })
  860. break
  861. }
  862. }
  863. }
  864. }
  865. </script>
  866. <style lang="scss" scoped>
  867. .container {
  868. display: flex;
  869. flex-direction: column;
  870. min-height: 100vh;
  871. overflow-y: auto;
  872. background-color: #f2f2f2;
  873. .header {
  874. position: relative;
  875. height: 505rpx;
  876. .header_swiper {
  877. width: 100%;
  878. height: 100%;
  879. .img {
  880. width: 100%;
  881. height: 100%;
  882. }
  883. .img2 {
  884. position: absolute;
  885. top: 175rpx;
  886. left: 38rpx;
  887. width: 208rpx;
  888. height: 200rpx;
  889. }
  890. .img3 {
  891. position: absolute;
  892. top: 240rpx;
  893. left: 38rpx;
  894. width: 305rpx;
  895. height: 80rpx;
  896. }
  897. }
  898. }
  899. .header2 {
  900. z-index: 999;
  901. position: fixed;
  902. top: 0;
  903. left: 0;
  904. right: 0;
  905. box-sizing: content-box;
  906. text-align: center;
  907. background-color: #fff;
  908. .title {
  909. font-size: 34rpx;
  910. }
  911. }
  912. .content {
  913. margin: 20rpx auto 0;
  914. width: 690rpx;
  915. border-radius: 12rpx 12rpx 0 0;
  916. background-color: #f2f2f2;
  917. .search {
  918. box-sizing: border-box;
  919. padding: 0 28rpx;
  920. width: 690rpx;
  921. height: 395rpx;
  922. border-radius: 12rpx;
  923. background-color: #fff;
  924. .search_town {
  925. display: flex;
  926. justify-content: space-between;
  927. align-items: center;
  928. height: 89rpx;
  929. color: #808080;
  930. font-size: 32rpx;
  931. border-bottom: 1rpx solid #e6e6e6;
  932. .town_text {
  933. display: flex;
  934. align-items: center;
  935. margin-left: 10rpx;
  936. .img {
  937. margin-right: 23rpx;
  938. width: 38rpx;
  939. height: 38rpx;
  940. }
  941. }
  942. img {
  943. width: 40rpx;
  944. height: 40rpx;
  945. }
  946. }
  947. .active {
  948. font-weight: bold;
  949. color: #000;
  950. }
  951. .search_center {
  952. display: flex;
  953. align-items: center;
  954. height: 89rpx;
  955. color: #a6a6a6;
  956. font-size: 28rpx;
  957. img {
  958. width: 40rpx;
  959. height: 40rpx;
  960. }
  961. .center_input {
  962. margin: 0 12rpx;
  963. width: 280rpx;
  964. color: #000;
  965. font-weight: bold;
  966. }
  967. .img {
  968. margin-right: 12rpx;
  969. }
  970. .center_level {
  971. flex: 1;
  972. margin-left: 24rpx;
  973. font-weight: 400;
  974. color: #808080;
  975. }
  976. .active {
  977. font-weight: bold;
  978. color: #000;
  979. }
  980. .img2 {
  981. margin-left: auto;
  982. }
  983. }
  984. .search_btn {
  985. display: flex;
  986. justify-content: center;
  987. align-items: center;
  988. margin-top: 23rpx;
  989. width: 623rpx;
  990. height: 100rpx;
  991. border-radius: 57rpx;
  992. color: #fff;
  993. font-size: 32rpx;
  994. background-image: url(https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20240329163323_dc9c53e05ab4568185d808ca366b5d0.png);
  995. background-size: cover;
  996. }
  997. .search_msg {
  998. display: flex;
  999. justify-content: space-evenly;
  1000. align-items: center;
  1001. width: 623rpx;
  1002. height: 92rpx;
  1003. color: #0095ff;
  1004. font-size: 24rpx;
  1005. .msg_box {
  1006. display: flex;
  1007. align-items: center;
  1008. .box_img {
  1009. margin-right: 8rpx;
  1010. width: 27rpx;
  1011. height: 24rpx;
  1012. }
  1013. .box_img2 {
  1014. margin-right: 8rpx;
  1015. width: 36rpx;
  1016. height: 36rpx;
  1017. }
  1018. .box_img3 {
  1019. margin-right: 8rpx;
  1020. width: 28rpx;
  1021. height: 28rpx;
  1022. }
  1023. }
  1024. }
  1025. }
  1026. .swiper {
  1027. margin: 20rpx auto 0;
  1028. width: 690rpx;
  1029. height: 214rpx;
  1030. border-radius: 12rpx;
  1031. background-color: #fff;
  1032. .swiper_item {
  1033. display: flex;
  1034. justify-content: space-around;
  1035. align-items: center;
  1036. width: 100%;
  1037. height: 100%;
  1038. .item_box {
  1039. position: relative;
  1040. width: 195rpx;
  1041. height: 128rpx;
  1042. border-radius: 12rpx;
  1043. color: #fff;
  1044. img {
  1045. width: 195rpx;
  1046. height: 128rpx;
  1047. border-radius: 12rpx;
  1048. }
  1049. .box_town {
  1050. position: absolute;
  1051. top: 30rpx;
  1052. left: 0;
  1053. right: 0;
  1054. text-align: center;
  1055. font-size: 28rpx;
  1056. font-weight: bold;
  1057. }
  1058. .box_count {
  1059. position: absolute;
  1060. top: 75rpx;
  1061. left: 0;
  1062. right: 0;
  1063. text-align: center;
  1064. font-size: 18rpx;
  1065. }
  1066. }
  1067. }
  1068. }
  1069. .body {
  1070. margin: 0 auto;
  1071. padding-bottom: 20rpx;
  1072. width: 690rpx;
  1073. .body_top {
  1074. display: flex;
  1075. align-items: center;
  1076. height: 89rpx;
  1077. .circle {
  1078. width: 30rpx;
  1079. height: 30rpx;
  1080. border-radius: 50%;
  1081. background-color: #485bed;
  1082. }
  1083. .color {
  1084. margin-left: -15rpx;
  1085. opacity: 0.5;
  1086. background-color: #fff;
  1087. }
  1088. .top_title {
  1089. margin-left: 15rpx;
  1090. font-size: 32rpx;
  1091. font-weight: bold;
  1092. }
  1093. .top_msg {
  1094. margin-top: 5rpx;
  1095. margin-left: 12rpx;
  1096. color: #666666;
  1097. font-size: 22rpx;
  1098. }
  1099. .top_more {
  1100. display: flex;
  1101. align-items: center;
  1102. margin-left: auto;
  1103. color: #4693eb;
  1104. font-size: 24rpx;
  1105. }
  1106. }
  1107. .body_swiper {
  1108. height: 520rpx;
  1109. border-radius: 12rpx;
  1110. .swiper_box {
  1111. display: flex;
  1112. justify-content: space-around;
  1113. .list_item {
  1114. width: 335rpx;
  1115. box-sizing: border-box;
  1116. .item-img {
  1117. width: 100%;
  1118. height: 223rpx;
  1119. border-radius: 18rpx 18rpx 0 0;
  1120. box-sizing: border-box;
  1121. }
  1122. .descrition {
  1123. display: flex;
  1124. flex-direction: column;
  1125. width: 100%;
  1126. border-radius: 0 0 18rpx 18rpx;
  1127. box-sizing: border-box;
  1128. background: rgba(255, 255, 255, 1);
  1129. margin-top: -10rpx;
  1130. .title {
  1131. font-size: 28rpx;
  1132. font-weight: 600;
  1133. padding: 20rpx 20rpx 10rpx;
  1134. color: rgba(0, 0, 0, 1);
  1135. overflow: hidden;
  1136. white-space: nowrap;
  1137. text-overflow: ellipsis;
  1138. }
  1139. .type {
  1140. padding: 5rpx 20rpx;
  1141. height: 40rpx;
  1142. font-size: 24rpx;
  1143. color: #a6a6a6;
  1144. .type_level {
  1145. margin-left: 20rpx;
  1146. }
  1147. }
  1148. .distance {
  1149. padding: 10rpx 20rpx;
  1150. font-size: 24rpx;
  1151. color: #a6a6a6;
  1152. }
  1153. .detail {
  1154. display: flex;
  1155. flex-direction: row;
  1156. justify-content: space-between;
  1157. align-items: center;
  1158. padding: 0 20rpx 20rpx 20rpx;
  1159. color: rgba(0, 0, 0, 1);
  1160. .img {
  1161. width: 40rpx;
  1162. height: 40rpx;
  1163. }
  1164. .price_home {
  1165. .txt1 {
  1166. font-size: 36rpx;
  1167. font-weight: 600;
  1168. color: rgba(255, 87, 51, 1);
  1169. }
  1170. .txt2 {
  1171. font-size: 24rpx;
  1172. font-weight: 400;
  1173. color: #a6a6a6;
  1174. }
  1175. }
  1176. .score {
  1177. font-size: 24rpx;
  1178. font-weight: 400;
  1179. padding-top: 10rpx;
  1180. color: rgba(166, 166, 166, 1);
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187. .body_strategy {
  1188. display: flex;
  1189. box-sizing: border-box;
  1190. padding: 24rpx;
  1191. margin-bottom: 10rpx;
  1192. width: 690rpx;
  1193. height: 718rpx;
  1194. border-radius: 12rpx;
  1195. background-color: #fff;
  1196. .strategy_cover {
  1197. width: 640rpx;
  1198. height: 400rpx;
  1199. border-radius: 7rpx;
  1200. }
  1201. .strategy_info {
  1202. flex: 1;
  1203. display: flex;
  1204. flex-direction: column;
  1205. justify-content: space-between;
  1206. margin-left: 20rpx;
  1207. width: 100%;
  1208. height: 190rpx;
  1209. font-size: 24rpx;
  1210. color: #666666;
  1211. overflow: hidden;
  1212. .info_title {
  1213. flex: 1.5;
  1214. display: flex;
  1215. align-items: center;
  1216. font-size: 32rpx;
  1217. font-weight: bold;
  1218. color: #000;
  1219. overflow: hidden;
  1220. text-overflow: ellipsis;
  1221. white-space: nowrap;
  1222. }
  1223. .info_tags {
  1224. flex: 1;
  1225. display: flex;
  1226. .tag {
  1227. margin-right: 10rpx;
  1228. box-sizing: border-box;
  1229. padding: 0 12rpx;
  1230. height: 35rpx;
  1231. color: #1e7dfb;
  1232. font-size: 20rpx;
  1233. border-radius: 30rpx;
  1234. border: 1rpx solid #1e7dfb;
  1235. }
  1236. }
  1237. .info_desc {
  1238. flex: 1.5;
  1239. display: -webkit-box;
  1240. -webkit-box-orient: vertical;
  1241. -webkit-line-clamp: 2;
  1242. overflow: hidden;
  1243. line-height: 35rpx;
  1244. }
  1245. }
  1246. }
  1247. .body_list {
  1248. display: flex;
  1249. flex-wrap: wrap;
  1250. justify-content: space-between;
  1251. .list_item {
  1252. width: 335rpx;
  1253. box-sizing: border-box;
  1254. margin-bottom: 20rpx;
  1255. .item-img {
  1256. width: 100%;
  1257. height: 223rpx;
  1258. border-radius: 18rpx 18rpx 0 0;
  1259. box-sizing: border-box;
  1260. }
  1261. .descrition {
  1262. display: flex;
  1263. flex-direction: column;
  1264. width: 100%;
  1265. border-radius: 0 0 18rpx 18rpx;
  1266. box-sizing: border-box;
  1267. background: rgba(255, 255, 255, 1);
  1268. margin-top: -10rpx;
  1269. .title {
  1270. font-size: 28rpx;
  1271. font-weight: 600;
  1272. padding: 20rpx 20rpx 10rpx;
  1273. color: rgba(0, 0, 0, 1);
  1274. overflow: hidden;
  1275. white-space: nowrap;
  1276. text-overflow: ellipsis;
  1277. }
  1278. .type {
  1279. padding: 5rpx 20rpx;
  1280. height: 40rpx;
  1281. font-size: 24rpx;
  1282. color: #a6a6a6;
  1283. .type_level {
  1284. margin-left: 20rpx;
  1285. }
  1286. }
  1287. .distance {
  1288. padding: 10rpx 20rpx;
  1289. font-size: 24rpx;
  1290. color: #a6a6a6;
  1291. }
  1292. .detail {
  1293. display: flex;
  1294. flex-direction: row;
  1295. justify-content: space-between;
  1296. align-items: center;
  1297. padding: 0 20rpx 20rpx 20rpx;
  1298. color: rgba(0, 0, 0, 1);
  1299. .img {
  1300. width: 40rpx;
  1301. height: 40rpx;
  1302. }
  1303. .price_home {
  1304. .txt1 {
  1305. font-size: 36rpx;
  1306. font-weight: 600;
  1307. color: rgba(255, 87, 51, 1);
  1308. }
  1309. .txt2 {
  1310. font-size: 24rpx;
  1311. font-weight: 400;
  1312. color: #a6a6a6;
  1313. }
  1314. }
  1315. .score {
  1316. font-size: 24rpx;
  1317. font-weight: 400;
  1318. padding-top: 10rpx;
  1319. color: rgba(166, 166, 166, 1);
  1320. }
  1321. }
  1322. }
  1323. }
  1324. .item_goods {
  1325. margin-bottom: 20rpx;
  1326. width: 335rpx;
  1327. height: 367rpx;
  1328. border-radius: 10rpx;
  1329. background-color: #fff;
  1330. overflow: hidden;
  1331. .goods_img {
  1332. width: 335rpx;
  1333. height: 223rpx;
  1334. border-bottom: 1rpx solid #eee;
  1335. }
  1336. .goods_name {
  1337. margin: 18rpx 5rpx 18rpx 30rpx;
  1338. font-size: 28rpx;
  1339. font-weight: bold;
  1340. overflow: hidden;
  1341. white-space: nowrap;
  1342. text-overflow: ellipsis;
  1343. }
  1344. .goods_detail {
  1345. display: flex;
  1346. flex-direction: row;
  1347. justify-content: space-between;
  1348. align-items: center;
  1349. padding: 0 20rpx 20rpx 20rpx;
  1350. color: rgba(0, 0, 0, 1);
  1351. .img {
  1352. width: 40rpx;
  1353. height: 40rpx;
  1354. }
  1355. .price_good {
  1356. .txt1 {
  1357. font-size: 36rpx;
  1358. font-weight: 600;
  1359. color: rgba(255, 87, 51, 1);
  1360. }
  1361. .txt2 {
  1362. font-size: 24rpx;
  1363. font-weight: 400;
  1364. color: #a6a6a6;
  1365. }
  1366. }
  1367. .score {
  1368. font-size: 24rpx;
  1369. font-weight: 400;
  1370. padding-top: 10rpx;
  1371. color: rgba(166, 166, 166, 1);
  1372. }
  1373. }
  1374. }
  1375. }
  1376. .body_news {
  1377. box-sizing: border-box;
  1378. padding: 25rpx;
  1379. width: 690rpx;
  1380. height: 566rpx;
  1381. border-radius: 12rpx;
  1382. background-color: #fff;
  1383. .news_title {
  1384. margin: 20rpx 0;
  1385. font-size: 32rpx;
  1386. font-weight: bold;
  1387. overflow: hidden;
  1388. text-overflow: ellipsis;
  1389. white-space: nowrap;
  1390. }
  1391. .news_desc {
  1392. font-size: 24rpx;
  1393. color: #666666;
  1394. display: -webkit-box;
  1395. -webkit-box-orient: vertical;
  1396. -webkit-line-clamp: 2;
  1397. overflow: hidden;
  1398. }
  1399. }
  1400. }
  1401. }
  1402. .popup_body {
  1403. width: 618rpx;
  1404. height: 687rpx;
  1405. border-radius: 21rpx;
  1406. background-color: #fff;
  1407. .body_header {
  1408. display: flex;
  1409. justify-content: center;
  1410. align-items: center;
  1411. position: relative;
  1412. height: 113rpx;
  1413. border-bottom: 1rpx solid #e6e6e6;
  1414. img {
  1415. width: 16rpx;
  1416. height: 16rpx;
  1417. }
  1418. .header_title {
  1419. margin: 0 10rpx;
  1420. font-size: 34rpx;
  1421. font-weight: bold;
  1422. color: #0f194d;
  1423. }
  1424. }
  1425. .body_content {
  1426. display: grid;
  1427. grid-template-columns: repeat(auto-fill, 160rpx);
  1428. gap: 28rpx;
  1429. box-sizing: border-box;
  1430. padding: 26rpx 40rpx 50rpx;
  1431. .content_box {
  1432. position: relative;
  1433. width: 160rpx;
  1434. height: 105rpx;
  1435. color: #fff;
  1436. border-radius: 10rpx;
  1437. img {
  1438. width: 160rpx;
  1439. height: 105rpx;
  1440. border-radius: 10rpx;
  1441. }
  1442. .box_town {
  1443. position: absolute;
  1444. top: 20rpx;
  1445. left: 0;
  1446. right: 0;
  1447. text-align: center;
  1448. font-size: 28rpx;
  1449. font-weight: bold;
  1450. }
  1451. .box_count {
  1452. position: absolute;
  1453. top: 62rpx;
  1454. left: 0;
  1455. right: 0;
  1456. text-align: center;
  1457. font-size: 18rpx;
  1458. }
  1459. }
  1460. }
  1461. }
  1462. .popupClass {
  1463. position: relative;
  1464. width: 481rpx;
  1465. height: 764rpx;
  1466. img {
  1467. width: 100%;
  1468. height: 665rpx;
  1469. }
  1470. .btn_text {
  1471. position: absolute;
  1472. top: 265rpx;
  1473. left: 40rpx;
  1474. display: flex;
  1475. justify-content: center;
  1476. align-items: center;
  1477. width: 400rpx;
  1478. height: 260rpx;
  1479. color: #0f194d;
  1480. font-size: 28rpx;
  1481. border-radius: 43rpx;
  1482. background-color: #fff;
  1483. }
  1484. .btn_close {
  1485. position: absolute;
  1486. top: 586rpx;
  1487. left: 212rpx;
  1488. width: 58rpx;
  1489. height: 58rpx;
  1490. border-radius: 50%;
  1491. }
  1492. }
  1493. }
  1494. </style>