index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <div class="service" id="service-first-page">
  3. <div
  4. class="banner"
  5. :style="{
  6. backgroundImage: `url(${bannerImgUrl})`
  7. }"
  8. >
  9. <!-- <SearchBar class="search-bar" @search="onSearch" @click.stop></SearchBar> -->
  10. </div>
  11. <menu>
  12. <button class="entry" @click="onClickBooking">
  13. <img src="@/assets/img/service/booking.png" alt="" draggable="false">
  14. <div>预约</div>
  15. </button>
  16. <router-link class="entry" :to="{name: 'FoodList'}">
  17. <img src="@/assets/img/service/美食.png" alt="" draggable="false">
  18. <div>美食</div>
  19. </router-link>
  20. <router-link class="entry" :to="{name: 'HotelList'}">
  21. <img src="@/assets/img/service/酒店住宿.png" alt="" draggable="false">
  22. <div>酒店住宿</div>
  23. </router-link>
  24. <router-link
  25. class="entry"
  26. :to="{
  27. name: 'MapNav',
  28. query: {
  29. x: 118.35714,
  30. y: 31.336011,
  31. name: '老芜湖海关',
  32. },
  33. }"
  34. >
  35. <img src="@/assets/img/service/路线.png" alt="" draggable="false">
  36. <div>导航</div>
  37. </router-link>
  38. </menu>
  39. <!-- <div class="travel-route-1">
  40. <router-link class="entry" to="/">一日游推荐路线</router-link>
  41. </div> -->
  42. <div class="travel-route-2">
  43. <h3>推荐路线</h3>
  44. <router-link class="more" :to="{name: 'RecommendedPath'}">更多 》</router-link>
  45. <div class="grid-wrap">
  46. <div class="left-wrap card" @click="onClickPathItem(recoPathList[0].id)">
  47. <img src="@/assets/img/service/推荐路线-动感滨江.jpg" alt="" draggable="false">
  48. <h4>{{recoPathList[0].name}}</h4>
  49. </div>
  50. <div class="right-wrap">
  51. <div class="card" @click="onClickPathItem(recoPathList[1].id)">
  52. <img src="@/assets/img/service/推荐路线-魅力湾沚.png" alt="" draggable="false">
  53. <h4>{{recoPathList[1].name}}</h4>
  54. </div>
  55. <div class="card" @click="onClickPathItem(recoPathList[2].id)">
  56. <img src="@/assets/img/service/推荐路线-探源繁昌.png" alt="" draggable="false">
  57. <h4>{{recoPathList[2].name}}</h4>
  58. </div>
  59. <div class="card" @click="onClickPathItem(recoPathList[3].id)">
  60. <img src="@/assets/img/service/推荐路线-乡约南陵.png" alt="" draggable="false">
  61. <h4>{{recoPathList[3].name}}</h4>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <!-- <div class="travel-plague">
  67. <h3>出游防疫</h3>
  68. <router-link class="more" :to="{name: 'TravelPlague'}">更多 》</router-link>
  69. <TabbarSmall :tabList="['景点开放', '出行政策']" @change="onTravelPlageTabbarChange"></TabbarSmall>
  70. <div class="open-status" v-show="travelPlagueActiveIdx === 0">
  71. <div class="swiper-container">
  72. <div class="swiper-wrapper">
  73. <div class="swiper-slide">
  74. <img src="@/assets/img/service/【古建筑】.png" alt="">
  75. <div class="title-wrap">
  76. <h4>芜湖方特旅游区</h4>
  77. </div>
  78. </div>
  79. <div class="swiper-slide">
  80. <img src="@/assets/img/service/【快速浏览】.png" alt="">
  81. <div class="title-wrap">
  82. <h4>芜湖方特旅游区</h4>
  83. </div>
  84. </div>
  85. <div class="swiper-slide">
  86. <img src="@/assets/img/service/【西洋建筑】.png" alt="">
  87. <div class="title-wrap">
  88. <h4>芜湖方特旅游区</h4>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="open-status" v-show="travelPlagueActiveIdx === 1">
  95. <div class="swiper-container">
  96. <div class="swiper-wrapper">
  97. <div class="swiper-slide">
  98. <img src="@/assets/img/service/【古建筑】.png" alt="">
  99. <div class="title-wrap">
  100. <h4>电话1</h4>
  101. </div>
  102. </div>
  103. <div class="swiper-slide">
  104. <img src="@/assets/img/service/【快速浏览】.png" alt="">
  105. <div class="title-wrap">
  106. <h4>电话2</h4>
  107. </div>
  108. </div>
  109. <div class="swiper-slide">
  110. <img src="@/assets/img/service/【西洋建筑】.png" alt="">
  111. <div class="title-wrap">
  112. <h4>电话3</h4>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div> -->
  119. <!-- <div class="help-center">
  120. <h3>帮助中心</h3>
  121. <router-link class="more" :to="{name: 'HelpCenter'}">更多 》</router-link>
  122. <TabbarSmall :tabList="['常见问题', '服务电话']" @change="onHelpCenterTabbarChange"></TabbarSmall>
  123. <ul class="questions" v-show="helpCenterActiveIdx === 0">
  124. <div v-for="n in 10" :key="n">
  125. <h4>芜湖全员核酸检测点最新安排出炉</h4>
  126. <span class="name">佚名用户</span>
  127. <span class="time">2022-10-10</span>
  128. </div>
  129. </ul>
  130. <ul class="phones" v-show="helpCenterActiveIdx === 1">
  131. <div v-for="n in 10" :key="n">
  132. <h4>电话电话电话</h4>
  133. <span class="name">佚名用户</span>
  134. <span class="time">2022-10-10</span>
  135. </div>
  136. </ul>
  137. </div> -->
  138. <!-- <div class="public-service" @click="pleaseWait">
  139. <h3>公共服务</h3>
  140. <router-link class="more" :to="{name: ''}">更多 》</router-link>
  141. <menu>
  142. <router-link class="entry" :to="{name: ''}">
  143. <img src="@/assets/img/service/景区舒适区.png" alt="" draggable="false">
  144. <div>景区舒适区</div>
  145. </router-link>
  146. <router-link class="entry" :to="{name: ''}">
  147. <img src="@/assets/img/service/找厕所.png" alt="" draggable="false">
  148. <div>找厕所</div>
  149. </router-link>
  150. <router-link class="entry" :to="{name: ''}">
  151. <img src="@/assets/img/service/停车场.png" alt="" draggable="false">
  152. <div>停车场</div>
  153. </router-link>
  154. <router-link class="entry" :to="{name: ''}">
  155. <img src="@/assets/img/service/12348.png" alt="" draggable="false">
  156. <div>12348</div>
  157. </router-link>
  158. </menu>
  159. </div> -->
  160. <!-- <div class="wen-chuang-zuo-pin" @click="pleaseWait">
  161. <h3>文创作品</h3>
  162. <router-link class="more" :to="{name: ''}">更多 》</router-link>
  163. <div class="card-list">
  164. <div
  165. class="card"
  166. v-for="(item, index) in wenChuangZuoPinList"
  167. :key="index"
  168. >
  169. <img class="photo" :src="item.img" alt="" draggable="false">
  170. <h3>{{item.title}}</h3>
  171. <div class="bottom-bar">
  172. <div class="price">
  173. ¥ {{item.price}} 元
  174. </div>
  175. <img class="icon" src="@/assets/img/service/购物车.png" alt="">
  176. </div>
  177. </div>
  178. </div>
  179. </div> -->
  180. <BackTop class="back-top" :targetId="'service-first-page'">
  181. <img src="@/assets/img/service/back-top.png" alt="" draggable="false">
  182. </BackTop>
  183. </div>
  184. </template>
  185. <script>
  186. import BackTop from "@/components/BackTop.vue";
  187. import TabbarSmall from "@/components/TabbarSmall.vue";
  188. import Swiper from "../../assets/libs/swiper.js";
  189. import SearchBar from "@/components/SearchRedBtn.vue";
  190. import serveData from "@/assets/data/serve/data.js";
  191. export default {
  192. components: {
  193. BackTop,
  194. TabbarSmall,
  195. SearchBar,
  196. },
  197. data() {
  198. return {
  199. searchKeyword: '',
  200. // travelPlagueActiveIdx: '',
  201. wenChuangZuoPinList: [
  202. {
  203. img: require('@/assets/img/service/goods1.png'),
  204. title: '文创作品名称',
  205. price: '35',
  206. },
  207. {
  208. img: require('@/assets/img/service/goods2.png'),
  209. title: '文创作品名称',
  210. price: '35',
  211. },
  212. {
  213. img: require('@/assets/img/service/goods3.png'),
  214. title: '文创作品名称',
  215. price: '35',
  216. },
  217. {
  218. img: require('@/assets/img/service/goods4.png'),
  219. title: '文创作品名称',
  220. price: '35',
  221. },
  222. ]
  223. };
  224. },
  225. computed: {
  226. ...globalMapState([
  227. 'latestConstructId',
  228. ]),
  229. recoPathList() {
  230. return serveData.pathList
  231. },
  232. bannerImgUrl() {
  233. return require(`@/assets/img/home/${this.latestConstructId}.jpg`)
  234. }
  235. },
  236. watch: {},
  237. methods: {
  238. onSearch(v) {
  239. console.log('search: ', v);
  240. },
  241. // onTravelPlageTabbarChange(idx) {
  242. // this.travelPlagueActiveIdx = idx
  243. // this.$nextTick(() => {
  244. // new Swiper(".swiper-container", {
  245. // slidesPerView: 1.4,
  246. // spaceBetween: 15,
  247. // centeredSlides: true,
  248. // })
  249. // })
  250. // },
  251. onClickBooking() {
  252. const loginStatus = globalUtils.checkLoginStatus()
  253. // const loginStatus = false
  254. // const loginStatus = true
  255. if (loginStatus) {
  256. this.$router.push({name: 'Booking'})
  257. } else {
  258. globalUtils.getUserCode('https://yifangyice.4dage.com/web/index.html#/layout/serve/booking')
  259. }
  260. },
  261. onClickPathItem(id) {
  262. this.$router.push({name: 'RecommendedPathDetail', query: {id}})
  263. },
  264. pleaseWait() {
  265. globalToast("敬请期待!")
  266. }
  267. },
  268. created() {
  269. document.querySelector("#app").style.maxWidth = "";
  270. },
  271. mounted() {
  272. },
  273. beforeCreate() {}, //生命周期 - 创建之前
  274. beforeMount() {}, //生命周期 - 挂载之前
  275. beforeUpdate() {}, //生命周期 - 更新之前
  276. updated() {}, //生命周期 - 更新之后
  277. beforeDestroy() {}, //生命周期 - 销毁之前
  278. destroyed() {
  279. document.querySelector("#app").style.maxWidth = "500px";
  280. }, //生命周期 - 销毁完成
  281. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  282. }
  283. </script>
  284. <style lang='less' scoped>
  285. @import "~@/assets/libs/swiper.css";
  286. .service {
  287. background-color: #f0f0f0;
  288. height: calc(100% - 80px);
  289. overflow: auto;
  290. .banner {
  291. height: 57.9vw;
  292. background-size: cover;
  293. background-repeat: no-repeat;
  294. background-position: center center;
  295. overflow: hidden;
  296. margin-bottom: 3.3vw;
  297. text-align: center;
  298. .search-bar {
  299. margin: 6.1vw 4.4vw 0 4.4vw;
  300. }
  301. }
  302. > menu {
  303. margin: 0 0.8vw 4vw 0.8vw;
  304. background: #fff;
  305. display: flex;
  306. justify-content: space-around;
  307. align-items: center;
  308. height: 23.5vw;
  309. border-radius: 1.1vw;
  310. > .entry {
  311. flex: 0 0 auto;
  312. width: 18vw;
  313. height: 12.2vw;
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: space-between;
  317. align-items: center;
  318. font-size: 3.5vw;
  319. font-weight: bold;
  320. color: #535353;
  321. line-height: 1.1em;
  322. white-space: pre;
  323. > img {
  324. width: 8vw;
  325. height: auto;
  326. margin-bottom: 2.7vw;
  327. }
  328. }
  329. }
  330. // > .travel-route-1 {
  331. // margin: 0 0 4vw 0;
  332. // height: 41.5vw;
  333. // background-image: url(~@/assets/img/service/travel-route-bg.png);
  334. // background-size: cover;
  335. // background-repeat: no-repeat;
  336. // background-position: center center;
  337. // overflow: hidden;
  338. // position: relative;
  339. // .entry {
  340. // position: absolute;
  341. // top: 1.5vw;
  342. // right: 0.7vw;
  343. // padding: 3.1vw 1.5vw;
  344. // background: rgba(15, 5, 9, 0.39);
  345. // font-size: 3.5vw;
  346. // font-weight: bold;
  347. // color: #FFFAFA;
  348. // }
  349. // }
  350. > .travel-route-2 {
  351. border-radius: 1.1vw;
  352. margin: 0 0.7vw 4vw 0.7vw;
  353. overflow: hidden;
  354. position: relative;
  355. padding: 3.7vw 3.5vw 4.5vw;
  356. background: #fff;
  357. > h3 {
  358. font-size: 3.5vw;
  359. font-weight: bold;
  360. color: #000000;
  361. }
  362. .more {
  363. position: absolute;
  364. top: 4vw;
  365. right: 3.6vw;
  366. font-size: 2.7vw;
  367. color: #333333;
  368. }
  369. .grid-wrap {
  370. margin-top: 3.1vw;
  371. display: flex;
  372. align-items: center;
  373. .left-wrap {
  374. flex: 0 1 auto;
  375. display: inline-block;
  376. position: relative;
  377. width: 41.9vw;
  378. height: 56.8vw;
  379. border-radius: 1.3vw;
  380. margin-right: 2vw;
  381. > img {
  382. position: absolute;
  383. left: 0;
  384. top: 0;
  385. width: 100%;
  386. height: 100%;
  387. }
  388. > h4 {
  389. position: absolute;
  390. left: 3.9vw;
  391. top: 3.1vw;
  392. font-size: 6.4vw;
  393. font-weight: bold;
  394. color: #FFFFFF;
  395. text-shadow: 0px 4px 4px #3A180F;
  396. writing-mode: vertical-lr;
  397. }
  398. }
  399. .right-wrap {
  400. display: inline-block;
  401. flex: 0 1 auto;
  402. width: 47.5vw;
  403. > .card {
  404. position: relative;
  405. width: 100%;
  406. height: 18.4vw;
  407. margin-bottom: 0.8vw;
  408. &:last-of-type {
  409. margin-bottom: initial;
  410. }
  411. > img {
  412. position: absolute;
  413. right: 0;
  414. top: 0;
  415. width: 100%;
  416. height: 100%;
  417. }
  418. > h4 {
  419. position: absolute;
  420. left: 0;
  421. top: 0;
  422. width: 100%;
  423. height: 100%;
  424. background: linear-gradient(270deg, rgba(38,146,237,0.79) 15%, rgba(0,0,0,0) 100%);
  425. padding-right: 1.1vw;
  426. padding-top: 2.5vw;
  427. padding-bottom: 2.5vw;
  428. height: 100%;
  429. font-size: 2.7vw;
  430. font-weight: 500;
  431. color: #FEFEFE;
  432. writing-mode: vertical-rl;
  433. letter-spacing: 0.12em;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. // > .travel-plague {
  440. // border-radius: 1.1vw;
  441. // margin: 0 0.7vw 4vw 0.7vw;
  442. // overflow: hidden;
  443. // position: relative;
  444. // padding: 1.9vw 3.5vw 4.5vw;
  445. // background: #fff;
  446. // > h3 {
  447. // font-size: 3.5vw;
  448. // font-weight: bold;
  449. // color: #000000;
  450. // }
  451. // .more {
  452. // position: absolute;
  453. // top: 2.7vw;
  454. // right: 3.6vw;
  455. // font-size: 2.7vw;
  456. // color: #333333;
  457. // }
  458. // .open-status {
  459. // margin-top: 6vw;
  460. // .swiper-slide {
  461. // width: 75.5vw;
  462. // height: 31.2vw;
  463. // > img {
  464. // position: absolute;
  465. // left: 0;
  466. // top: 0;
  467. // width: 100%;
  468. // height: 100%;
  469. // }
  470. // > .title-wrap {
  471. // position: absolute;
  472. // left: 0;
  473. // bottom: 0;
  474. // width: 100%;
  475. // height: 8.5vw;
  476. // background-color: rgba(15, 5, 9, 0.54);
  477. // display: flex;
  478. // justify-content: center;
  479. // align-items: center;
  480. // > h4 {
  481. // font-size: 3.2vw;
  482. // font-weight: 600;
  483. // color: #FFFFFF;
  484. // }
  485. // }
  486. // }
  487. // }
  488. // }
  489. // > .help-center {
  490. // border-radius: 1.1vw;
  491. // margin: 0 0.7vw 4vw 0.7vw;
  492. // position: relative;
  493. // padding: 1.9vw 3.5vw 4.5vw;
  494. // background: #fff;
  495. // // 滚动条整体部分,其中的属性有width,height,background,border等。
  496. // ::-webkit-scrollbar { width: 1.3vw; height: 1.3vw; } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
  497. // // 滚动条两端的按钮。可以用display:none让其不显示,也可以添加背景图片,改变颜色。
  498. // ::-webkit-scrollbar-button { display: none; }
  499. // // 滑动轨道。可以用display:none让其不显示,也可以添加背景图片,改变颜色。另外还有::webkit-scrollbar-track-piece这个是内层轨道?有吗?
  500. // ::-webkit-scrollbar-track { background: rgba(84, 84, 84, 0.11); border-radius: 0.5vw; }
  501. // // 滑块
  502. // ::-webkit-scrollbar-thumb { background: linear-gradient(0deg, #FF615C 0%, #FF9877 100%); border-radius: 0.5vw; }
  503. // // 横竖滚动条轨道交汇处
  504. // ::-webkit-scrollbar-corner { display: none; }
  505. // ::-webkit-scrollbar-resizer { display: none; }
  506. // > h3 {
  507. // font-size: 3.5vw;
  508. // font-weight: bold;
  509. // color: #000000;
  510. // }
  511. // .more {
  512. // position: absolute;
  513. // top: 2.7vw;
  514. // right: 3.6vw;
  515. // font-size: 2.7vw;
  516. // color: #333333;
  517. // }
  518. // > ul {
  519. // margin-top: 6vw;
  520. // height: 42vw;
  521. // overflow: auto;
  522. // > div {
  523. // border-bottom: 1px solid #E5E5E5;
  524. // margin-bottom: 7.1vw;
  525. // &:last-of-type {
  526. // border-bottom: initial;
  527. // margin-bottom: initial;
  528. // }
  529. // > h4 {
  530. // font-size: 3.2vw;
  531. // font-weight: bold;
  532. // color: #000000;
  533. // overflow: hidden;
  534. // white-space: pre;
  535. // text-overflow: ellipsis;
  536. // margin-bottom: 3.9vw;
  537. // }
  538. // > span {
  539. // display: inline-block;
  540. // margin-right: 2em;
  541. // margin-bottom: 1.5vw;
  542. // font-size: 3.2vw;
  543. // color: #DCDCDC;
  544. // }
  545. // }
  546. // }
  547. // }
  548. > .public-service {
  549. margin: 0 0.8vw 6.5vw 0.8vw;
  550. background: #fff;
  551. border-radius: 1.1vw;
  552. overflow: hidden;
  553. position: relative;
  554. padding: 3.7vw 3.5vw 2vw;
  555. > h3 {
  556. font-size: 3.5vw;
  557. font-weight: bold;
  558. color: #000000;
  559. }
  560. .more {
  561. position: absolute;
  562. top: 4vw;
  563. right: 3.6vw;
  564. font-size: 2.7vw;
  565. color: #333333;
  566. }
  567. > menu {
  568. display: flex;
  569. justify-content: space-around;
  570. align-items: center;
  571. height: 23.5vw;
  572. border-radius: 1.1vw;
  573. > .entry {
  574. flex: 0 0 auto;
  575. width: 15vw;
  576. height: 15vw;
  577. display: flex;
  578. flex-direction: column;
  579. justify-content: space-between;
  580. align-items: center;
  581. font-size: 2.9vw;
  582. font-weight: bold;
  583. color: #535353;
  584. line-height: 1.1em;
  585. white-space: pre;
  586. > img {
  587. height: 8vw;
  588. margin-bottom: 2.7vw;
  589. }
  590. }
  591. }
  592. }
  593. > .wen-chuang-zuo-pin {
  594. margin: 0 0.8vw 6.5vw 0.8vw;
  595. background: #fff;
  596. border-radius: 1.1vw;
  597. overflow: hidden;
  598. position: relative;
  599. padding: 3.7vw 3.5vw 4.5vw;
  600. > h3 {
  601. font-size: 3.5vw;
  602. font-weight: bold;
  603. color: #000000;
  604. margin-bottom: 4vw;;
  605. }
  606. .more {
  607. position: absolute;
  608. top: 4vw;
  609. right: 3.6vw;
  610. font-size: 2.7vw;
  611. color: #333333;
  612. }
  613. > div.card-list {
  614. margin-right: -4.1vw;
  615. > .card {
  616. display: inline-block;
  617. width: calc(50% - 4.1vw);
  618. height: 64.7vw;
  619. background: #F7F8FA;
  620. border-radius: 1.1vw;
  621. overflow: hidden;
  622. margin-right: 4.1vw;
  623. margin-bottom: 2.3vw;
  624. > img.photo {
  625. width: 100%;
  626. height: 44.5vw;
  627. object-fit: cover;
  628. margin-bottom: 3.1vw;
  629. }
  630. > h3 {
  631. font-size: 3.2vw;
  632. font-weight: bold;
  633. color: #333333;
  634. margin-left: 2.3vw;
  635. margin-right: 2.3vw;
  636. margin-bottom: 3.5vw;
  637. }
  638. > .bottom-bar {
  639. margin-left: 2.3vw;
  640. margin-right: 2.3vw;
  641. display: flex;
  642. justify-content: space-between;
  643. align-items: center;
  644. > .price {
  645. font-size: 2.7vw;
  646. font-weight: bold;
  647. color: #FF0000;
  648. }
  649. > img.icon {
  650. width: 4.1vw;
  651. height: 4.1vw;
  652. }
  653. }
  654. }
  655. }
  656. }
  657. > .back-top {
  658. position: fixed;
  659. bottom: calc(1.7vw + 80px);
  660. right: 1.7vw;
  661. width: 9.3vw;
  662. height: 9.3vw;
  663. > img {
  664. width: 100%;
  665. height: 100%;
  666. }
  667. }
  668. }
  669. </style>