home.vue 10 KB

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