home.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <page-layout class="home-container">
  3. <nav-bar :show-title="false">
  4. <view class="top-container">
  5. <image class="logo" :src="logo" mode="aspectFit"/>
  6. <view class="countdown">
  7. 距开幕
  8. <view class="days"> 168</view>
  9. </view>
  10. </view>
  11. </nav-bar>
  12. <u-swiper :items="images" useComponentName='topSwiper' indicato-dots-style="morphing" :height="387" />
  13. <view class="main-container">
  14. <u-search v-model="searchKeyword" placeholder="搜索关键词" @search="onClickSearch" />
  15. <view class="nav-icons">
  16. <template v-for="(item, index) in navIcons">
  17. <view class="nav-icon-wrapper" :key="index" v-if="!item.is_hide">
  18. <view class="nav-icon" @click="onClickNavIcon(item)">
  19. <view v-if="item.icon.indexOf('.svg') !== -1" :style="'background-image:url(' + item.icon + ')'"></view>
  20. <view v-else-if="item.icon.indexOf('icon-') !== -1" :class="'iconfont ' + item.icon"></view>
  21. </view>
  22. <view class="nav-text">
  23. {{ item.name }}
  24. </view>
  25. </view>
  26. </template>
  27. </view>
  28. <view class="panel-group panel-group-1">
  29. <u-panel title="精彩视频" link="/pages/video/index">
  30. <u-swiper :items="videos" useComponentName="videoSwiper" :height="360" :autoplay="false" :border-radius="10"
  31. :image-width="508" :image-height="286" next-margin="100rpx" />
  32. </u-panel>
  33. <u-panel title="精彩图集" link="https://www.productronicachina.com.cn/data-facts-impressions-impressions-videos">
  34. <u-swiper :items="albumPics" useComponentName="imageSwiper" :height="360" :border-radius="10"
  35. :image-width="508" :image-height="286" next-margin="100rpx" />
  36. <!-- <view class="album">
  37. <template v-for="(item, index) in albumPics">
  38. <view class="album-pic" :key="index" @click="onClickAlbum(index)">
  39. <image :src="String(item)" mode="aspectFill" />
  40. </view>
  41. </template>
  42. </view> -->
  43. </u-panel>
  44. </view>
  45. <view class="panel-group">
  46. <u-panel title="新闻" link="/pages/news/index">
  47. <news-recommend recommend-type="home" news-type="exhibition" />
  48. </u-panel>
  49. </view>
  50. <view class="panel-group logo-group">
  51. <u-panel title="战略合作方">
  52. <u-swiper :items="part1" useComponentName="logoSwiper" image-mode="aspectFit" key="logoSwiper" :autoplay="false" :height="getPartHeight(part1)">
  53. <template v-slot="{ scope }">
  54. <view class="partners">
  55. <template v-for="(item, index) in scope">
  56. <view class="partner" :key="index" @tap="onLogoClick(item)">
  57. <image mode="aspectFit" :src="item.url" />
  58. </view>
  59. </template>
  60. </view>
  61. </template>
  62. </u-swiper>
  63. </u-panel>
  64. <u-panel title="推荐展商" link="/pages/exhibitor/index">
  65. <u-swiper :items="part3" useComponentName="logoSwiper" image-mode="aspectFit" key="logoSwiper" :autoplay="false" :height="getPartHeight(part3)">
  66. <template v-slot="{ scope }">
  67. <view class="partners">
  68. <template v-for="(item, index) in scope">
  69. <view class="partner" :key="index" @tap="onLogoClick(item)">
  70. <image mode="aspectFit" :src="item.url" />
  71. </view>
  72. </template>
  73. </view>
  74. </template>
  75. </u-swiper>
  76. </u-panel>
  77. <u-panel title="合作媒体" link="https://www.productronicachina.com.cn/partners">
  78. <u-swiper :items="part2" key="logoSwiper2" image-mode="aspectFit" useComponentName="logoSwiper" :autoplay="false" :height="getPartHeight(part2)">
  79. <template v-slot="{ scope }">
  80. <view class="partners">
  81. <template v-for="(item, index) in scope">
  82. <view class="partner" :key="index" @tap="onLogoClick(item)">
  83. <image mode="aspectFit" :src="item.url" />
  84. </view>
  85. </template>
  86. </view>
  87. </template>
  88. </u-swiper>
  89. </u-panel>
  90. </view>
  91. </view>
  92. <float-button></float-button>
  93. <van-overlay :show="isShow">
  94. <view class="ad-wrapper">
  95. <view class="img-btn-box">
  96. <view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
  97. <image :src="adInfo.ad_file" mode="widthFix" class="ad-img" />
  98. </view>
  99. <view class="home-ad-close" @click="closeAd()">
  100. <van-icon name="close" />
  101. </view>
  102. </view>
  103. </view>
  104. </van-overlay>
  105. </page-layout>
  106. </template>
  107. <script>
  108. import NavBar from '@/components/layout/nav-bar'
  109. import UScrollView from '@/components/common/u-scroll-view'
  110. import USwiper from '@/components/common/u-swiper'
  111. import USearch from '@/components/common/u-search'
  112. import UPanel from '@/components/common/u-panel'
  113. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  114. import ContactUs from '@/pages/index/components/contact-us.vue'
  115. import PopupAd from '@/pages/index/components/popup-ad.vue'
  116. import floatButton from "@/components/layout/float-button"
  117. import VanOverlay from '@/wxcomponents/vant/overlay/index'
  118. import {
  119. getDashboardInfo,
  120. getAdInfo
  121. } from '@/api'
  122. import PageLayout from "@/components/layout/page-layout";
  123. import {exhibitorsList} from "@/api/exhibitor";
  124. export default {
  125. options: {
  126. styleIsolation: 'shared'
  127. },
  128. components: {
  129. PageLayout,
  130. floatButton,
  131. NavBar,
  132. UScrollView,
  133. USwiper,
  134. USearch,
  135. UPanel,
  136. NewsRecommend,
  137. ContactUs,
  138. PopupAd,
  139. VanOverlay
  140. },
  141. data() {
  142. return {
  143. logo: '',
  144. searchKeyword: '',
  145. exhibitorList: [],
  146. showPopupAd: false,
  147. navIcons: [{
  148. icon: 'icon-xiaochengxu-guanyuzhanhuiicon',
  149. name: '关于展会',
  150. is_hide: false,
  151. link: 'https://www.productronicachina.com.cn/zh-cn/productronica-china-2025'
  152. }, {
  153. icon: 'icon-xiaochengxu-zhanshangmingluicon',
  154. name: '展商名录',
  155. is_hide: false,
  156. link: '/pages/exhibitor/index'
  157. }, {
  158. icon: 'icon-zhanpinziliaoicon',
  159. name: '展商产品',
  160. is_hide: false,
  161. link: '/pages/exhibitor/exhibit'
  162. }, {
  163. icon: 'icon-zhantaihuodongicon',
  164. name: '同期活动',
  165. is_hide: false,
  166. link: '/pages/activity/index'
  167. }, {
  168. icon: 'icon-zhanshangxinwenicon',
  169. name: '展商新闻',
  170. is_hide: false,
  171. link: '/pages/news/index?type=exhibitor'
  172. }, {
  173. icon: 'icon-xiaochengxu-zhanguanpingmiantuicon',
  174. name: '展馆平面图',
  175. is_hide: false,
  176. link: 'https://www.productronicachina.com.cn/for-visitors-fairgrounds-map'
  177. }, {
  178. icon: 'icon-xiaochengxu-guanzhongzhinanicon',
  179. name: '观众指南',
  180. is_hide: false,
  181. link: ''
  182. }, {
  183. icon: 'icon-xiaochengxu-jiaotongzhinanicon',
  184. name: '交通指南',
  185. is_hide: false,
  186. link: 'https://www.productronicachina.com.cn/travel-stay-getting-there'
  187. }],
  188. images: [],
  189. videos: [],
  190. albumPics: [],
  191. // 合作方列表
  192. part1: [],
  193. part2: [],
  194. part3: [],
  195. adInfo: {
  196. ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
  197. },
  198. isShow: false
  199. }
  200. },
  201. computed: {
  202. },
  203. created() {
  204. this.getDashboardData()
  205. this.getAdData()
  206. this.getExhibitorsList()
  207. },
  208. mounted() {
  209. this.isShow = this.$store.state.app.adIsShow
  210. },
  211. methods: {
  212. getPartHeight(part) {
  213. let height = 0
  214. if(part.length>3) {
  215. height = 250
  216. } else if(part.length<=3) {
  217. height = 120
  218. }
  219. return height
  220. },
  221. closeAd() {
  222. this.$store.commit('HIDE_AD')
  223. this.isShow = false
  224. },
  225. onClickNavIcon(item) {
  226. if (item.link === '/pages/exhibitor/index') {
  227. this.$emit('switch-tab', 'exhibitor')
  228. return
  229. } else {
  230. this.navigateTo(item.link)
  231. }
  232. },
  233. onClickSearch() {
  234. this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
  235. },
  236. onClickAlbum(index) {
  237. const pics = this.albumPics.map(v => {
  238. return v
  239. })
  240. uni.previewImage({
  241. current: index,
  242. urls: pics
  243. })
  244. },
  245. getDashboardData() {
  246. getDashboardInfo('', process.env.CONFERENCE_WEBSITE).then(res => {
  247. this.logo = res.data.module0.url
  248. this.images = res.data.module1
  249. let module2 = res.data.module2
  250. for (var i = 0; i < module2.length; i++) {
  251. this.navIcons[i].name = module2[i].name
  252. this.navIcons[i].is_hide = module2[i].is_hide
  253. }
  254. this.videos = res.data.module3.video
  255. this.albumPics = res.data.module3.image
  256. this.part1 = res.data.module4.part1.logo
  257. this.part2 = res.data.module4.part2.logo
  258. this.part3 = res.data.module4.part3.logo
  259. console.log(res.data);
  260. })
  261. },
  262. getExhibitorsList() {
  263. exhibitorsList({page: 1,page_size: 12}).then(res => {
  264. if (res.data.data) {
  265. this.exhibitorList = res.data.data
  266. }
  267. })
  268. },
  269. onLogoClick(item) {
  270. if (item.id) {
  271. this.navigateTo('/pages/exhibitor/detail?id=' + item.id)
  272. } else if (item.url) {
  273. this.navigateTo(item.href)
  274. }
  275. },
  276. getAdData() {
  277. getAdInfo({
  278. number: "IndexPopUp001"
  279. }).then(res => {
  280. this.adInfo = res.data[0]
  281. })
  282. },
  283. navigateToAdLink(href) {
  284. this.navigateTo(href)
  285. }
  286. // onVisitClick() {
  287. // getBuoyInfo().then(res => {
  288. // let jump_url = res.data.visit_jump_url
  289. // this.navigateTo(jump_url)
  290. // })
  291. // },
  292. }
  293. }
  294. </script>
  295. <style lang="scss">
  296. .ad-wrapper {
  297. display: flex;
  298. justify-content: center;
  299. align-items: center;
  300. height: 100%;
  301. .img-btn-box {
  302. display: flex;
  303. justify-content: center;
  304. width: 500rpx;
  305. position: relative;
  306. .ad-space {
  307. width: 100%;
  308. .ad-img {
  309. width: 100%;
  310. }
  311. }
  312. }
  313. .home-ad-close {
  314. position: absolute;
  315. top: -70rpx;
  316. right: -70rpx;
  317. .van-icon-close {
  318. font-size: 60rpx;
  319. color: #FFFFFF;
  320. cursor: pointer;
  321. }
  322. }
  323. }
  324. .logo {
  325. width: 150rpx;
  326. height: 37rpx;
  327. }
  328. .panel-group {
  329. margin-top: 43rpx;
  330. background-color: #FFFFFF;
  331. &.logo-group {
  332. padding-bottom: 30rpx;
  333. }
  334. &.panel-group-1 {
  335. margin-top: 0;
  336. }
  337. }
  338. .top-container {
  339. display: flex;
  340. align-items: center;
  341. .countdown {
  342. display: flex;
  343. align-items: center;
  344. margin-left: 27rpx;
  345. font-size: $fontSize3;
  346. .days {
  347. color: #F97316;
  348. font-size: $fontSize6;
  349. font-weight: bold;
  350. padding: 0 4rpx;
  351. }
  352. }
  353. }
  354. .search-container {
  355. .search-input {
  356. height: 64rpx;
  357. border-radius: 50rpx;
  358. background-color: #FFFFFF;
  359. box-shadow: 0 4rpx 4rpx 0 rgba(0, 0, 0, 0.15);
  360. border: 2rpx solid #D9D9D9;
  361. padding: 4rpx;
  362. overflow: hidden;
  363. .van-field__placeholder {
  364. font-size: $fontSize2;
  365. }
  366. .van-cell__left-icon-wrap {
  367. height: 50rpx;
  368. }
  369. .van-field__control {
  370. font-size: $fontSize2;
  371. height: 50rpx;
  372. }
  373. }
  374. .van-search {
  375. --search-padding: 0rpx;
  376. --search-input-height: 34rpx;
  377. --search-background-color: #FFFFFF;
  378. padding-right: 24rpx;
  379. font-size: $fontSize2;
  380. }
  381. .search-text {
  382. font-size: $fontSize2;
  383. }
  384. .van-search__action {
  385. color: #333333;
  386. }
  387. .van-icon {
  388. color: #D4D4D6;
  389. }
  390. .van-cell {
  391. padding: 2rpx 0rpx 2rpx !important;
  392. }
  393. }
  394. .nav-icons {
  395. display: grid;
  396. grid-template-columns: 1fr 1fr 1fr 1fr;
  397. grid-row-gap: 53rpx;
  398. margin-top: 47rpx;
  399. margin-bottom: 41rpx;
  400. .nav-icon-wrapper {
  401. @include display-flex-center;
  402. flex-direction: column;
  403. cursor: pointer;
  404. }
  405. .nav-text {
  406. margin-top: 20rpx;
  407. font-size: $fontSize3;
  408. color: #555555;
  409. }
  410. .nav-icon {
  411. @include display-flex-center;
  412. width: 73rpx;
  413. height: 73rpx;
  414. border-radius: 50%;
  415. overflow: hidden;
  416. background-color: $buttonPrimaryColor;
  417. .iconfont {
  418. font-size: 46rpx;
  419. color: #FFFFFF;
  420. }
  421. &>view {
  422. width: 46rpx;
  423. height: 46rpx;
  424. background-size: 46rpx 46rpx;
  425. }
  426. }
  427. }
  428. .album {
  429. display: grid;
  430. grid-auto-flow: row;
  431. grid-gap: 15rpx;
  432. height: 500rpx;
  433. width: fit-content;
  434. grid-template-areas: "a b b" "c d f" "c e f";
  435. .album-pic {
  436. width: 196rpx;
  437. height: 155rpx;
  438. border-radius: 10rpx;
  439. overflow: hidden;
  440. &:nth-child(1) {
  441. grid-area: a;
  442. }
  443. &:nth-child(2) {
  444. width: 418rpx;
  445. height: 155rpx;
  446. grid-area: b;
  447. }
  448. &:nth-child(3) {
  449. grid-area: c;
  450. }
  451. &:nth-child(4) {
  452. grid-area: d;
  453. }
  454. &:nth-child(5) {
  455. grid-area: e;
  456. }
  457. &:nth-child(6) {
  458. grid-area: f;
  459. }
  460. &:nth-child(3),
  461. &:nth-child(6) {
  462. width: 196rpx;
  463. height: 324rpx;
  464. }
  465. }
  466. image {
  467. width: 100%;
  468. height: 100%;
  469. }
  470. }
  471. .partners {
  472. display: grid;
  473. grid-template-columns: repeat(3, 1fr);
  474. grid-column-gap: 9rpx;
  475. grid-row-gap: 13rpx;
  476. .partner {
  477. @include display-flex-center;
  478. width: 100%;
  479. height: 120rpx;
  480. padding: 16rpx;
  481. border-radius: 5rpx;
  482. border: 1rpx solid #D9D9D9;
  483. overflow: hidden;
  484. }
  485. image {
  486. object-fit: contain;
  487. }
  488. }
  489. </style>