home.vue 11 KB

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