home.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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="战略合作方" link="https://www.productronicachina.com.cn/partners">
  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></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. }
  189. this.navigateTo(item.link)
  190. },
  191. onClickSearch() {
  192. this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
  193. },
  194. onClickAlbum(index) {
  195. const pics = this.albumPics.map(v => {
  196. return v
  197. })
  198. uni.previewImage({
  199. current: index,
  200. urls: pics
  201. })
  202. },
  203. getDashboardData() {
  204. getDashboardInfo('', process.env.CONFERENCE_WEBSITE).then(res => {
  205. this.logo = res.data.module0.url
  206. this.images = res.data.module1
  207. let module2 = res.data.module2
  208. for (var i = 0; i < module2.length; i++) {
  209. this.navIcons[i].name = module2[i].name
  210. this.navIcons[i].is_hide = module2[i].is_hide
  211. }
  212. this.videos = res.data.module3.video
  213. this.albumPics = res.data.module3.image
  214. this.part1 = res.data.module4.part1.logo
  215. this.part2 = res.data.module4.part2.logo
  216. })
  217. },
  218. onLogoClick(item) {
  219. if (item.url) {
  220. this.navigateTo(item.href)
  221. }
  222. },
  223. // onVisitClick() {
  224. // getBuoyInfo().then(res => {
  225. // let jump_url = res.data.visit_jump_url
  226. // this.navigateTo(jump_url)
  227. // })
  228. // },
  229. }
  230. }
  231. </script>
  232. <style lang="scss">
  233. .logo {
  234. width: 150rpx;
  235. height: 37rpx;
  236. }
  237. .panel-group {
  238. margin-top: 43rpx;
  239. background-color: #FFFFFF;
  240. &.logo-group {
  241. padding-bottom: 30rpx;
  242. }
  243. &.panel-group-1 {
  244. margin-top: 0;
  245. }
  246. }
  247. .top-container {
  248. display: flex;
  249. align-items: center;
  250. .countdown {
  251. display: flex;
  252. align-items: center;
  253. margin-left: 27rpx;
  254. font-size: $fontSize3;
  255. .days {
  256. color: #F97316;
  257. font-size: $fontSize6;
  258. font-weight: bold;
  259. padding: 0 4rpx;
  260. }
  261. }
  262. }
  263. .search-container {
  264. .search-input {
  265. height: 64rpx;
  266. border-radius: 50rpx;
  267. background-color: #FFFFFF;
  268. box-shadow: 0 4rpx 4rpx 0 rgba(0, 0, 0, 0.15);
  269. border: 2rpx solid #D9D9D9;
  270. padding: 4rpx;
  271. overflow: hidden;
  272. .van-field__placeholder {
  273. font-size: $fontSize2;
  274. }
  275. .van-cell__left-icon-wrap {
  276. height: 50rpx;
  277. }
  278. .van-field__control {
  279. font-size: $fontSize2;
  280. height: 50rpx;
  281. }
  282. }
  283. .van-search {
  284. --search-padding: 0rpx;
  285. --search-input-height: 34rpx;
  286. --search-background-color: #FFFFFF;
  287. padding-right: 24rpx;
  288. font-size: $fontSize2;
  289. }
  290. .search-text {
  291. font-size: $fontSize2;
  292. }
  293. .van-search__action {
  294. color: #333333;
  295. }
  296. .van-icon {
  297. color: #D4D4D6;
  298. }
  299. .van-cell {
  300. padding: 2rpx 0rpx 2rpx !important;
  301. }
  302. }
  303. .nav-icons {
  304. display: grid;
  305. grid-template-columns: 1fr 1fr 1fr 1fr;
  306. grid-row-gap: 53rpx;
  307. margin-top: 47rpx;
  308. margin-bottom: 41rpx;
  309. .nav-icon-wrapper {
  310. @include display-flex-center;
  311. flex-direction: column;
  312. cursor: pointer;
  313. }
  314. .nav-text {
  315. margin-top: 20rpx;
  316. font-size: $fontSize3;
  317. color: #555555;
  318. }
  319. .nav-icon {
  320. @include display-flex-center;
  321. width: 73rpx;
  322. height: 73rpx;
  323. border-radius: 50%;
  324. overflow: hidden;
  325. background-color: $buttonPrimaryColor;
  326. .iconfont {
  327. font-size: 46rpx;
  328. color: #FFFFFF;
  329. }
  330. &>view {
  331. width: 46rpx;
  332. height: 46rpx;
  333. background-size: 46rpx 46rpx;
  334. }
  335. }
  336. }
  337. .album {
  338. display: grid;
  339. grid-auto-flow: row;
  340. grid-gap: 15rpx;
  341. height: 500rpx;
  342. width: fit-content;
  343. grid-template-areas: "a b b" "c d f" "c e f";
  344. .album-pic {
  345. width: 196rpx;
  346. height: 155rpx;
  347. border-radius: 10rpx;
  348. overflow: hidden;
  349. &:nth-child(1) {
  350. grid-area: a;
  351. }
  352. &:nth-child(2) {
  353. width: 418rpx;
  354. height: 155rpx;
  355. grid-area: b;
  356. }
  357. &:nth-child(3) {
  358. grid-area: c;
  359. }
  360. &:nth-child(4) {
  361. grid-area: d;
  362. }
  363. &:nth-child(5) {
  364. grid-area: e;
  365. }
  366. &:nth-child(6) {
  367. grid-area: f;
  368. }
  369. &:nth-child(3),
  370. &:nth-child(6) {
  371. width: 196rpx;
  372. height: 324rpx;
  373. }
  374. }
  375. image {
  376. width: 100%;
  377. height: 100%;
  378. }
  379. }
  380. .partners {
  381. display: grid;
  382. grid-template-columns: repeat(3, 1fr);
  383. grid-column-gap: 9rpx;
  384. grid-row-gap: 13rpx;
  385. .partner {
  386. @include display-flex-center;
  387. width: 100%;
  388. height: 120rpx;
  389. border-radius: 5rpx;
  390. border: 1rpx solid #D9D9D9;
  391. overflow: hidden;
  392. }
  393. image {
  394. object-fit: contain;
  395. }
  396. }
  397. </style>