home.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view class="content">
  3. <nav-bar :show-title="false">
  4. <view class="top-container">
  5. <image class="logo" src="/static/logo.png" />
  6. <view class="countdown">
  7. 距开幕 <view class="days"> 168 </view> 天
  8. </view>
  9. </view>
  10. </nav-bar>
  11. <u-swiper :items="images" 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">
  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. <u-panel title="精彩视频" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
  28. <u-swiper :items="videos" :height="360" :autoplay="false" :border-radius="10" :image-width="508" :image-height="286"
  29. next-margin="100rpx" />
  30. </u-panel>
  31. <u-panel title="精彩图集" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
  32. <view class="album">
  33. <template v-for="(item, index) in albumPics">
  34. <view class="album-pic" :key="index" @click="onClickAlbum(index)">
  35. <image :src="item.src" mode="aspectFill" />
  36. </view>
  37. </template>
  38. </view>
  39. </u-panel>
  40. <u-panel title="新闻" link="/pages/news/index">
  41. <news-recommend />
  42. </u-panel>
  43. <u-panel title="战略合作方" link="https://www.productronicachina.com.cn/partners">
  44. <u-swiper :items="partners" :height="250">
  45. <template v-slot="{ scope }">
  46. <view class="partners">
  47. <template v-for="(item, index) in scope.children">
  48. <view class="partner" :key="index">
  49. <image :src="item.icon" />
  50. </view>
  51. </template>
  52. </view>
  53. </template>
  54. </u-swiper>
  55. </u-panel>
  56. <u-panel title="推荐展商" link="https://www.productronicachina.com.cn/partners">
  57. <u-swiper :items="partners" :height="250">
  58. <template v-slot="{ scope }">
  59. <view class="partners">
  60. <template v-for="(item, index) in scope.children">
  61. <view class="partner" :key="index">
  62. <image :src="item.icon" />
  63. </view>
  64. </template>
  65. </view>
  66. </template>
  67. </u-swiper>
  68. </u-panel>
  69. <u-panel title="合作媒体" link="https://www.productronicachina.com.cn/partners">
  70. <u-swiper :items="partners" :autoplay="false" :height="250">
  71. <template v-slot="{ scope }">
  72. <view class="partners">
  73. <template v-for="(item, index) in scope.children">
  74. <view class="partner" :key="index">
  75. <image :src="item.icon" />
  76. </view>
  77. </template>
  78. </view>
  79. </template>
  80. </u-swiper>
  81. </u-panel>
  82. </view>
  83. <contact-us :show.sync="showContactUs" />
  84. <popup-ad :show.sync="showPopupAd" />
  85. <view class="floating-buttons">
  86. <view hover-class="hover" @click="showPopupAd = true">
  87. <view class="iconfont icon-xiaochengxu-canguandengjiicon"></view>
  88. <view class="floating-button-label">参观登记</view>
  89. </view>
  90. <view hover-class="hover" @click="showContactUs = true">
  91. <view class="iconfont icon-xiaochengxu-lianxiwomenicon"></view>
  92. <view class="floating-button-label">联系我们</view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import NavBar from '@/components/layout/nav-bar'
  99. import UScrollView from '@/components/common/u-scroll-view'
  100. import USwiper from '@/components/common/u-swiper'
  101. import USearch from '@/components/common/u-search'
  102. import UPanel from '@/components/common/u-panel'
  103. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  104. import ContactUs from '@/pages/index/components/contact-us.vue'
  105. import PopupAd from '@/pages/index/components/popup-ad.vue'
  106. export default {
  107. options: {
  108. styleIsolation: 'shared'
  109. },
  110. components: {
  111. NavBar,
  112. UScrollView,
  113. USwiper,
  114. USearch,
  115. UPanel,
  116. NewsRecommend,
  117. ContactUs,
  118. PopupAd
  119. },
  120. data() {
  121. return {
  122. searchKeyword: '',
  123. showContactUs: false,
  124. showPopupAd: false,
  125. navIcons: [{
  126. icon: 'icon-xiaochengxu-guanyuzhanhuiicon',
  127. name: '关于展会',
  128. link: ''
  129. }, {
  130. icon: 'icon-xiaochengxu-zhanshangmingluicon',
  131. name: '展商名录',
  132. link: '/pages/exhibitor/index'
  133. }, {
  134. icon: 'icon-zhanpinziliaoicon',
  135. name: '展商产品',
  136. link: '/pages/exhibitor/exhibit'
  137. }, {
  138. icon: 'icon-zhantaihuodongicon',
  139. name: '同期活动',
  140. link: '/pages/activity/index'
  141. }, {
  142. icon: 'icon-zhanshangxinwenicon',
  143. name: '展商新闻',
  144. link: '/pages/news/index?type=exhibitor'
  145. }, {
  146. icon: 'icon-xiaochengxu-zhanguanpingmiantuicon',
  147. name: '展馆平面图',
  148. link: ''
  149. }, {
  150. icon: 'icon-xiaochengxu-guanzhongzhinanicon',
  151. name: '观众指南',
  152. link: ''
  153. }, {
  154. icon: 'icon-xiaochengxu-jiaotongzhinanicon',
  155. name: '交通指南',
  156. link: ''
  157. }],
  158. images: [{
  159. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
  160. url: 'https://www.productronicachina.com.cn/'
  161. }, {
  162. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
  163. url: 'https://www.productronicachina.com.cn/'
  164. }, {
  165. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
  166. url: 'https://www.productronicachina.com.cn/'
  167. }],
  168. videos: [{
  169. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a8add02.jpeg?x-oss-process=image/resize,w_500',
  170. url: 'https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2023/1113/655190052f376.mp4'
  171. }, {
  172. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a8add02.jpeg?x-oss-process=image/resize,w_500',
  173. url: 'https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2023/1113/655190052f376.mp4'
  174. }],
  175. albumPics: [{
  176. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d0387b5.jpeg?x-oss-process=image/resize,w_200'
  177. }, {
  178. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d081488.jpeg?x-oss-process=image/resize,w_200'
  179. }, {
  180. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d0dd2a1.jpeg?x-oss-process=image/resize,w_200'
  181. }, {
  182. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d13e734.jpeg?x-oss-process=image/resize,w_200'
  183. }, {
  184. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d1a47e6.jpeg?x-oss-process=image/resize,w_200'
  185. }, {
  186. src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da4d214927.jpeg?x-oss-process=image/resize,w_200'
  187. }],
  188. // 合作方列表
  189. partners: [{
  190. name: '第一页',
  191. children: [{
  192. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a454718d/1 中国工控网.png'
  193. }, {
  194. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b806511810/2 智汇工业.png'
  195. }, {
  196. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a4536d7e/4 SMT China&化合物半导体.png'
  197. }, {
  198. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a451f071/3 中国电子制造&亚洲控制.png'
  199. }, {
  200. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a454718d/1 中国工控网.png'
  201. }, {
  202. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b806511810/2 智汇工业.png'
  203. }, {
  204. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a4536d7e/4 SMT China&化合物半导体.png'
  205. }, {
  206. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a451f071/3 中国电子制造&亚洲控制.png'
  207. }]
  208. }, {
  209. name: '第二页',
  210. children: [{
  211. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a454718d/1 中国工控网.png'
  212. }, {
  213. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b806511810/2 智汇工业.png'
  214. }, {
  215. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a4536d7e/4 SMT China&化合物半导体.png'
  216. }, {
  217. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a451f071/3 中国电子制造&亚洲控制.png'
  218. }, {
  219. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a454718d/1 中国工控网.png'
  220. }, {
  221. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b806511810/2 智汇工业.png'
  222. }, {
  223. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a4536d7e/4 SMT China&化合物半导体.png'
  224. }, {
  225. icon: 'https://www.productronicachina.com.cn/resources/files/0626/667b7a451f071/3 中国电子制造&亚洲控制.png'
  226. }]
  227. }],
  228. }
  229. },
  230. created() {
  231. uni.loadFontFace({
  232. family: 'Poppins',
  233. source: 'url("https://oss.starify.cn/test/Poppins-SemiBold.ttf")',
  234. desc: {
  235. fontPath: '', // 本地字体文件的路径
  236. },
  237. success: () => {
  238. console.log('字体加载成功');
  239. },
  240. fail: (e) => {
  241. console.log(e)
  242. console.error('字体加载失败');
  243. },
  244. })
  245. },
  246. methods: {
  247. onClickNavIcon(item) {
  248. if (item.link === '/pages/exhibitor/index') {
  249. this.$emit('switch-tab', 'exhibitor')
  250. return
  251. }
  252. this.navigateTo(item.link)
  253. },
  254. onClickSearch() {
  255. uni.navigateTo({
  256. url: '/pages/index/search?query=' + this.searchKeyword
  257. })
  258. },
  259. onClickAlbum(index) {
  260. const pics = this.albumPics.map(v => {
  261. return v.src
  262. })
  263. uni.previewImage({
  264. current: index,
  265. urls: pics
  266. })
  267. }
  268. }
  269. }
  270. </script>
  271. <style lang="scss">
  272. .logo {
  273. width: 150rpx;
  274. height: 37rpx;
  275. }
  276. .top-container {
  277. display: flex;
  278. align-items: center;
  279. .countdown {
  280. display: flex;
  281. align-items: center;
  282. margin-left: 27rpx;
  283. font-size: $fontSize2;
  284. .days {
  285. color: #F97316;
  286. font-size: $fontSize5;
  287. font-weight: bold;
  288. padding: 0 4rpx;
  289. }
  290. }
  291. }
  292. .search-container {
  293. .search-input {
  294. height: 64rpx;
  295. border-radius: 50rpx;
  296. background-color: #FFFFFF;
  297. box-shadow: 0 4rpx 4rpx 0 rgba(0, 0, 0, 0.15);
  298. border: 2rpx solid #D9D9D9;
  299. padding: 4rpx;
  300. overflow: hidden;
  301. .van-field__placeholder{
  302. font-size: $fontSize1;
  303. }
  304. .van-cell__left-icon-wrap{
  305. height: 50rpx;
  306. }
  307. .van-field__control{
  308. font-size: $fontSize1;
  309. height: 50rpx;
  310. }
  311. }
  312. .van-search {
  313. --search-padding: 0rpx;
  314. --search-input-height: 34rpx;
  315. --search-background-color: #FFFFFF;
  316. padding-right: 24rpx;
  317. font-size: $fontSize1;
  318. }
  319. .search-text{
  320. font-size: $fontSize1;
  321. }
  322. .van-search__action {
  323. color: #333333;
  324. }
  325. .van-icon {
  326. color: #D4D4D6;
  327. }
  328. .van-cell {
  329. padding: 2rpx 0rpx 2rpx !important;
  330. }
  331. }
  332. .nav-icons {
  333. display: grid;
  334. grid-template-columns: 1fr 1fr 1fr 1fr;
  335. grid-row-gap: 53rpx;
  336. margin-top: 47rpx;
  337. margin-bottom: 41rpx;
  338. .nav-icon-wrapper {
  339. @include display-flex-center;
  340. flex-direction: column;
  341. }
  342. .nav-text {
  343. margin-top: 20rpx;
  344. font-size: $fontSize2;
  345. color: #555555;
  346. }
  347. .nav-icon {
  348. @include display-flex-center;
  349. width: 73rpx;
  350. height: 73rpx;
  351. border-radius: 50%;
  352. overflow: hidden;
  353. background-color: $buttonPrimaryColor;
  354. .iconfont{
  355. font-size: 46rpx;
  356. color: #FFFFFF;
  357. }
  358. &>view {
  359. width: 46rpx;
  360. height: 46rpx;
  361. background-size: 46rpx 46rpx;
  362. }
  363. }
  364. }
  365. .album {
  366. display: grid;
  367. grid-auto-flow: row;
  368. grid-gap: 15rpx;
  369. height: 500rpx;
  370. width: fit-content;
  371. grid-template-areas: "a b b" "c d f" "c e f";
  372. .album-pic {
  373. width: 196rpx;
  374. height: 155rpx;
  375. border-radius: 10rpx;
  376. overflow: hidden;
  377. &:nth-child(1) {
  378. grid-area: a;
  379. }
  380. &:nth-child(2) {
  381. width: 418rpx;
  382. height: 155rpx;
  383. grid-area: b;
  384. }
  385. &:nth-child(3) {
  386. grid-area: c;
  387. }
  388. &:nth-child(4) {
  389. grid-area: d;
  390. }
  391. &:nth-child(5) {
  392. grid-area: e;
  393. }
  394. &:nth-child(6) {
  395. grid-area: f;
  396. }
  397. &:nth-child(3),
  398. &:nth-child(6) {
  399. width: 196rpx;
  400. height: 324rpx;
  401. }
  402. }
  403. image {
  404. width: 100%;
  405. height: 100%;
  406. }
  407. }
  408. .partners {
  409. display: grid;
  410. grid-template-columns: repeat(4, 1fr);
  411. grid-column-gap: 9rpx;
  412. grid-row-gap: 13rpx;
  413. .partner{
  414. @include display-flex-center;
  415. width: 150rpx;
  416. height: 91rpx;
  417. }
  418. image {
  419. width: 127rpx;
  420. height: 25rpx;
  421. }
  422. }
  423. .floating-buttons{
  424. position: fixed;
  425. right: 30rpx;
  426. bottom: 200rpx;
  427. display: grid;
  428. grid-template-columns: 1fr;
  429. grid-row-gap: 19rpx;
  430. &>view{
  431. @include display-flex-center;
  432. flex-direction: column;
  433. width: 100rpx;
  434. height: 100rpx;
  435. background-color: #FFFFFF;
  436. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.25);
  437. border-radius: 50%;
  438. }
  439. .floating-button-label{
  440. width: 64rpx;
  441. margin-top: 6rpx;
  442. font-size: $fontSize0;
  443. color: #94A3B8;
  444. }
  445. .iconfont{
  446. font-size: 44rpx;
  447. color: $textActionColor;
  448. }
  449. }
  450. </style>