home3.vue 39 KB

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