home.vue 11 KB

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