home.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  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 show-menu-by-longpress :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. showPopupAd: false,
  146. navIcons: [{
  147. icon: 'icon-xiaochengxu-guanyuzhanhuiicon',
  148. name: '关于展会',
  149. is_hide: false,
  150. link: 'https://www.productronicachina.com.cn/zh-cn/productronica-china-2025'
  151. }, {
  152. icon: 'icon-xiaochengxu-zhanshangmingluicon',
  153. name: '展商名录',
  154. is_hide: false,
  155. link: '/pages/exhibitor/index'
  156. }, {
  157. icon: 'icon-zhanpinziliaoicon',
  158. name: '展商产品',
  159. is_hide: false,
  160. link: '/pages/exhibitor/exhibit'
  161. }, {
  162. icon: 'icon-zhantaihuodongicon',
  163. name: '同期活动',
  164. is_hide: false,
  165. link: '/pages/activity/index'
  166. }, {
  167. icon: 'icon-zhanshangxinwenicon',
  168. name: '展商新闻',
  169. is_hide: false,
  170. link: '/pages/news/index?type=exhibitor'
  171. }, {
  172. icon: 'icon-xiaochengxu-zhanguanpingmiantuicon',
  173. name: '展馆平面图',
  174. is_hide: false,
  175. link: 'https://www.productronicachina.com.cn/for-visitors-fairgrounds-map'
  176. }, {
  177. icon: 'icon-xiaochengxu-guanzhongzhinanicon',
  178. name: '观众指南',
  179. is_hide: false,
  180. link: '/pages/files/index'
  181. }, {
  182. icon: 'icon-xiaochengxu-jiaotongzhinanicon',
  183. name: '交通指南',
  184. is_hide: false,
  185. link: 'https://www.productronicachina.com.cn/travel-stay-getting-there'
  186. }],
  187. images: [],
  188. videos: [],
  189. albumPics: [],
  190. // 合作方列表
  191. part1: [],
  192. part2: [],
  193. part3: [],
  194. adInfo: {
  195. ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
  196. },
  197. isShow: false
  198. }
  199. },
  200. computed: {
  201. },
  202. created() {
  203. this.getDashboardData()
  204. this.getAdData()
  205. },
  206. mounted() {
  207. this.isShow = this.$store.state.app.adIsShow
  208. },
  209. methods: {
  210. getPartHeight(part) {
  211. let height = 0
  212. if(part.length>3) {
  213. height = 250
  214. } else if(part.length<=3) {
  215. height = 120
  216. }
  217. return height
  218. },
  219. closeAd() {
  220. this.$store.commit('HIDE_AD')
  221. this.isShow = false
  222. },
  223. onClickNavIcon(item) {
  224. // this.navigateTo(item.link)
  225. if (item.link === '/pages/exhibitor/index') {
  226. this.$emit('switch-tab', 'exhibitor')
  227. this.$store.commit('SET_PAGE', 'exhibitor');
  228. } else if (item.link === '/pages/activity/index') {
  229. this.$emit('switch-tab', 'activity')
  230. this.$store.commit('SET_PAGE', 'activity');
  231. } else if(item.link === '/pages/exhibitor/exhibit') {
  232. this.$emit('switch-tab', 'product')
  233. this.$store.commit('SET_PAGE', 'product');
  234. } else {
  235. this.navigateTo(item.link)
  236. }
  237. },
  238. onClickSearch() {
  239. this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
  240. },
  241. onClickAlbum(index) {
  242. const pics = this.albumPics.map(v => {
  243. return v
  244. })
  245. uni.previewImage({
  246. current: index,
  247. urls: pics
  248. })
  249. },
  250. getDashboardData() {
  251. getDashboardInfo('', process.env.CONFERENCE_WEBSITE).then(res => {
  252. this.logo = res.data.module0.url
  253. this.images = res.data.module1
  254. let module2 = res.data.module2
  255. for (var i = 0; i < module2.length; i++) {
  256. this.navIcons[i].name = module2[i].name
  257. this.navIcons[i].is_hide = module2[i].is_hide
  258. }
  259. this.videos = res.data.module3.video
  260. this.albumPics = res.data.module3.image
  261. this.part1 = res.data.module4.part1.logo
  262. this.part2 = res.data.module4.part2.logo
  263. this.part3 = res.data.module4.part3.logo
  264. })
  265. },
  266. onLogoClick(item) {
  267. if (item.id) {
  268. this.navigateTo('/pages/exhibitor/detail?id=' + item.id)
  269. } else if (item.url) {
  270. this.navigateTo(item.href)
  271. }
  272. },
  273. getAdData() {
  274. getAdInfo({
  275. number: "IndexPopUp001"
  276. }).then(res => {
  277. this.adInfo = res.data[0]
  278. })
  279. },
  280. navigateToAdLink(href) {
  281. this.navigateTo(href)
  282. }
  283. // onVisitClick() {
  284. // getBuoyInfo().then(res => {
  285. // let jump_url = res.data.visit_jump_url
  286. // this.navigateTo(jump_url)
  287. // })
  288. // },
  289. }
  290. }
  291. </script>
  292. <style lang="scss">
  293. .ad-wrapper {
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. height: 100%;
  298. .img-btn-box {
  299. display: flex;
  300. justify-content: center;
  301. width: 600rpx;
  302. position: relative;
  303. .ad-space {
  304. width: 100%;
  305. .ad-img {
  306. width: 100%;
  307. }
  308. }
  309. }
  310. .home-ad-close {
  311. position: absolute;
  312. bottom: -118rpx;
  313. .van-icon-close {
  314. font-size: 68rpx;
  315. color: #FFFFFF;
  316. cursor: pointer;
  317. }
  318. }
  319. }
  320. .logo {
  321. width: 150rpx;
  322. height: 37rpx;
  323. }
  324. .panel-group {
  325. margin-top: 43rpx;
  326. background-color: #FFFFFF;
  327. &.logo-group {
  328. padding-bottom: 30rpx;
  329. }
  330. &.panel-group-1 {
  331. margin-top: 0;
  332. }
  333. }
  334. .top-container {
  335. display: flex;
  336. align-items: center;
  337. .countdown {
  338. display: flex;
  339. align-items: center;
  340. margin-left: 27rpx;
  341. font-size: $fontSize3;
  342. .days {
  343. color: #F97316;
  344. font-size: $fontSize6;
  345. font-weight: bold;
  346. padding: 0 4rpx;
  347. }
  348. }
  349. }
  350. .search-container {
  351. .search-input {
  352. height: 64rpx;
  353. border-radius: 50rpx;
  354. background-color: #FFFFFF;
  355. box-shadow: 0 4rpx 4rpx 0 rgba(0, 0, 0, 0.15);
  356. border: 2rpx solid #D9D9D9;
  357. padding: 4rpx;
  358. overflow: hidden;
  359. .van-field__placeholder {
  360. font-size: $fontSize2;
  361. }
  362. .van-cell__left-icon-wrap {
  363. height: 50rpx;
  364. }
  365. .van-field__control {
  366. font-size: $fontSize2;
  367. height: 50rpx;
  368. }
  369. }
  370. .van-search {
  371. --search-padding: 0rpx;
  372. --search-input-height: 34rpx;
  373. --search-background-color: #FFFFFF;
  374. padding-right: 24rpx;
  375. font-size: $fontSize2;
  376. }
  377. .search-text {
  378. font-size: $fontSize2;
  379. }
  380. .van-search__action {
  381. color: #333333;
  382. }
  383. .van-icon {
  384. color: #D4D4D6;
  385. }
  386. .van-cell {
  387. padding: 2rpx 0rpx 2rpx !important;
  388. }
  389. }
  390. .nav-icons {
  391. display: grid;
  392. grid-template-columns: 1fr 1fr 1fr 1fr;
  393. grid-row-gap: 53rpx;
  394. margin-top: 47rpx;
  395. margin-bottom: 41rpx;
  396. .nav-icon-wrapper {
  397. @include display-flex-center;
  398. flex-direction: column;
  399. cursor: pointer;
  400. }
  401. .nav-text {
  402. margin-top: 20rpx;
  403. font-size: $fontSize3;
  404. color: #555555;
  405. }
  406. .nav-icon {
  407. @include display-flex-center;
  408. width: 73rpx;
  409. height: 73rpx;
  410. border-radius: 50%;
  411. overflow: hidden;
  412. background-color: $buttonPrimaryColor;
  413. .iconfont {
  414. font-size: 46rpx;
  415. color: #FFFFFF;
  416. }
  417. &>view {
  418. width: 46rpx;
  419. height: 46rpx;
  420. background-size: 46rpx 46rpx;
  421. }
  422. }
  423. }
  424. .album {
  425. display: grid;
  426. grid-auto-flow: row;
  427. grid-gap: 15rpx;
  428. height: 500rpx;
  429. width: fit-content;
  430. grid-template-areas: "a b b" "c d f" "c e f";
  431. .album-pic {
  432. width: 196rpx;
  433. height: 155rpx;
  434. border-radius: 10rpx;
  435. overflow: hidden;
  436. &:nth-child(1) {
  437. grid-area: a;
  438. }
  439. &:nth-child(2) {
  440. width: 418rpx;
  441. height: 155rpx;
  442. grid-area: b;
  443. }
  444. &:nth-child(3) {
  445. grid-area: c;
  446. }
  447. &:nth-child(4) {
  448. grid-area: d;
  449. }
  450. &:nth-child(5) {
  451. grid-area: e;
  452. }
  453. &:nth-child(6) {
  454. grid-area: f;
  455. }
  456. &:nth-child(3),
  457. &:nth-child(6) {
  458. width: 196rpx;
  459. height: 324rpx;
  460. }
  461. }
  462. image {
  463. width: 100%;
  464. height: 100%;
  465. }
  466. }
  467. .partners {
  468. display: grid;
  469. grid-template-columns: repeat(3, 1fr);
  470. grid-column-gap: 9rpx;
  471. grid-row-gap: 13rpx;
  472. .partner {
  473. @include display-flex-center;
  474. width: 100%;
  475. height: 120rpx;
  476. padding: 16rpx;
  477. border-radius: 5rpx;
  478. border: 1rpx solid #D9D9D9;
  479. overflow: hidden;
  480. }
  481. image {
  482. object-fit: contain;
  483. }
  484. }
  485. </style>