home.vue 13 KB

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