home.vue 12 KB

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