index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <view class="home-page">
  3. <scroll-view class="main-scroll" scroll-y :show-scrollbar="false" :enhanced="true">
  4. <!-- 1. 灵动大屏轮播 (无缝全屏感) -->
  5. <view class="hero-section">
  6. <swiper class="hero-swiper" circular autoplay interval="5000" duration="800"
  7. @change="handleBannerChange">
  8. <swiper-item v-for="(item, index) in banners" :key="index">
  9. <view class="hero-card">
  10. <image :src="item.url" mode="aspectFill" class="hero-img"></image>
  11. <view class="hero-overlay"></view>
  12. <view class="hero-text-content">
  13. <text class="hero-tag">{{ item.tag }}</text>
  14. <text class="hero-main-title">{{ item.title }}</text>
  15. <text class="hero-sub-title">{{ item.subTitle }}</text>
  16. </view>
  17. </view>
  18. </swiper-item>
  19. </swiper>
  20. <!-- 胶囊样式指示器 -->
  21. <view class="hero-indicators">
  22. <view v-for="(item, index) in banners" :key="index" class="indicator-pill"
  23. :class="{ active: currentBanner === index }"></view>
  24. </view>
  25. </view>
  26. <!-- 2. 精英咨询入口 (悬浮毛玻璃效果) -->
  27. <view class="contact-card" @click="callService">
  28. <view class="contact-info">
  29. <view class="contact-icon-box">
  30. <image src="https://img.icons8.com/ios-filled/50/C1001C/phone.png" mode="aspectFit"></image>
  31. </view>
  32. <view class="contact-texts">
  33. <text class="main-txt">尊享 VIP 咨询服务</text>
  34. <text class="sub-txt">15年行业专家 为您定制型材解决方案</text>
  35. </view>
  36. </view>
  37. <view class="call-btn-circle">
  38. <image src="https://img.icons8.com/ios-glyphs/30/ffffff/phone--v1.png" mode="aspectFit"></image>
  39. </view>
  40. </view>
  41. <!-- 3. 魔幻型材空间 (2x2 魔方布局) -->
  42. <view class="cube-section">
  43. <view class="section-header">
  44. <view class="title-with-line">
  45. <text class="zh">精选分类</text>
  46. <text class="en">CATEGORIES</text>
  47. </view>
  48. </view>
  49. <view class="cube-container">
  50. <view class="cube-grid">
  51. <view class="cube-card" v-for="(item, index) in cubeProducts" :key="index" @click="goToOrder">
  52. <image :src="item.image" mode="aspectFill" class="cube-bg"></image>
  53. <view class="cube-mask"></view>
  54. <view class="cube-content">
  55. <text class="cube-title">{{ item.name }}</text>
  56. <view class="cube-line"></view>
  57. <text class="cube-desc">{{ item.desc }}</text>
  58. </view>
  59. <view class="cube-arrow">→</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 4. 品牌硬实力 (深色大气卡片) -->
  65. <view class="brand-strength">
  66. <view class="strength-card">
  67. <view class="s-header">
  68. <text class="s-title">华晟 · 硬核实力</text>
  69. <text class="s-subtitle">Reliable Quality & Professional Service</text>
  70. </view>
  71. <view class="s-stats">
  72. <view class="stat-box">
  73. <text class="num">15<text class="unit">年</text></text>
  74. <text class="label">专注型材研发</text>
  75. </view>
  76. <view class="stat-divider"></view>
  77. <view class="stat-box">
  78. <text class="num">3<text class="unit">大</text></text>
  79. <text class="label">现代生产基地</text>
  80. </view>
  81. <view class="stat-divider"></view>
  82. <view class="stat-box">
  83. <text class="num">500<text class="unit">+</text></text>
  84. <text class="label">合作伙伴认可</text>
  85. </view>
  86. </view>
  87. <view class="s-footer">
  88. <text>品质铸就品牌 · 服务创造价值</text>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 底部占位 -->
  93. <view class="safe-bottom-gap"></view>
  94. </scroll-view>
  95. <!-- 底部通用导航 -->
  96. <erp-tab-bar active="home"></erp-tab-bar>
  97. </view>
  98. </template>
  99. <script>
  100. import ErpTabBar from '@/components/erp-tab-bar/erp-tab-bar.vue';
  101. import assets from '@/utils/assets.js';
  102. import banners from '@/mock/banners.json';
  103. import cubeProducts from '@/json/cube-products.json';
  104. export default {
  105. components: { ErpTabBar },
  106. data() {
  107. return {
  108. assets,
  109. statusBarHeight: 0,
  110. currentBanner: 0,
  111. banners,
  112. cubeProducts
  113. }
  114. },
  115. onLoad() {
  116. },
  117. methods: {
  118. handleBannerChange(e) { this.currentBanner = e.detail.current; },
  119. callService() {
  120. uni.showModal({
  121. title: '管家式服务',
  122. content: '即将为您拨打华晟型材专家电话 13888888888',
  123. confirmText: '立即咨询',
  124. confirmColor: '#C1001C',
  125. cancelText: '稍后再说',
  126. cancelColor: '#999',
  127. success: (res) => {
  128. if (res.confirm) {
  129. uni.makePhoneCall({ phoneNumber: '13888888888' });
  130. }
  131. }
  132. });
  133. },
  134. goToOrder() { uni.reLaunch({ url: '/pages/order/index' }); }
  135. }
  136. }
  137. </script>
  138. <style scoped>
  139. .home-page {
  140. width: 100vw;
  141. height: 100vh;
  142. background-color: #F8FAFC;
  143. display: flex;
  144. flex-direction: column;
  145. }
  146. .main-scroll {
  147. flex: 1;
  148. height: 0;
  149. }
  150. /* 英雄轮播区 */
  151. .hero-section {
  152. position: relative;
  153. width: 100%;
  154. height: 500rpx;
  155. overflow: hidden;
  156. }
  157. .hero-swiper {
  158. height: 100%;
  159. }
  160. .hero-card {
  161. position: relative;
  162. width: 100%;
  163. height: 100%;
  164. }
  165. .hero-img {
  166. width: 100%;
  167. height: 100%;
  168. }
  169. .hero-overlay {
  170. position: absolute;
  171. inset: 0;
  172. background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
  173. }
  174. .hero-text-content {
  175. position: absolute;
  176. left: 40rpx;
  177. bottom: 80rpx;
  178. color: #fff;
  179. z-index: 2;
  180. }
  181. .hero-tag {
  182. font-size: 20rpx;
  183. background: rgba(193, 0, 28, 0.8);
  184. padding: 4rpx 16rpx;
  185. border-radius: 4rpx;
  186. margin-bottom: 12rpx;
  187. display: inline-block;
  188. }
  189. .hero-main-title {
  190. font-size: 44rpx;
  191. font-weight: bold;
  192. display: block;
  193. margin-bottom: 8rpx;
  194. }
  195. .hero-sub-title {
  196. font-size: 24rpx;
  197. opacity: 0.8;
  198. letter-spacing: 1rpx;
  199. }
  200. .hero-indicators {
  201. position: absolute;
  202. bottom: 40rpx;
  203. right: 40rpx;
  204. display: flex;
  205. gap: 8rpx;
  206. }
  207. .indicator-pill {
  208. width: 12rpx;
  209. height: 6rpx;
  210. background: rgba(255, 255, 255, 0.3);
  211. border-radius: 4rpx;
  212. transition: 0.3s;
  213. }
  214. .indicator-pill.active {
  215. width: 32rpx;
  216. background: #fff;
  217. }
  218. /* 咨询卡片 */
  219. .contact-card {
  220. margin: -40rpx 40rpx 40rpx;
  221. position: relative;
  222. z-index: 10;
  223. background: rgba(255, 255, 255, 0.9);
  224. backdrop-filter: blur(20px);
  225. border-radius: 24rpx;
  226. padding: 32rpx 40rpx;
  227. display: flex;
  228. align-items: center;
  229. justify-content: space-between;
  230. border: 1rpx solid #fff;
  231. box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.06);
  232. }
  233. .contact-info {
  234. display: flex;
  235. align-items: center;
  236. }
  237. .contact-icon-box {
  238. width: 88rpx;
  239. height: 88rpx;
  240. background: #FFF1F2;
  241. border-radius: 50%;
  242. display: flex;
  243. align-items: center;
  244. justify-content: center;
  245. margin-right: 24rpx;
  246. }
  247. .contact-icon-box image {
  248. width: 44rpx;
  249. height: 44rpx;
  250. }
  251. .main-txt {
  252. font-size: 30rpx;
  253. font-weight: bold;
  254. color: #1a1a1a;
  255. display: block;
  256. margin-bottom: 4rpx;
  257. }
  258. .sub-txt {
  259. font-size: 22rpx;
  260. color: #7a7a7a;
  261. }
  262. .call-btn-circle {
  263. width: 72rpx;
  264. height: 72rpx;
  265. background: #C1001C;
  266. border-radius: 50%;
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. box-shadow: 0 6rpx 12rpx rgba(193, 0, 28, 0.3);
  271. }
  272. .call-btn-circle image {
  273. width: 32rpx;
  274. height: 32rpx;
  275. }
  276. /* 魔方布局 */
  277. .cube-section {
  278. padding: 20rpx 40rpx;
  279. }
  280. .section-header {
  281. margin-bottom: 30rpx;
  282. }
  283. .title-with-line {
  284. display: flex;
  285. align-items: baseline;
  286. gap: 16rpx;
  287. }
  288. .title-with-line .zh {
  289. font-size: 36rpx;
  290. font-weight: 800;
  291. color: #1a1a1a;
  292. }
  293. .title-with-line .en {
  294. font-size: 20rpx;
  295. color: #999;
  296. font-family: 'Georgia';
  297. letter-spacing: 2rpx;
  298. }
  299. .cube-container {
  300. width: 100%;
  301. }
  302. .cube-grid {
  303. display: grid;
  304. grid-template-columns: repeat(2, 1fr);
  305. gap: 20rpx;
  306. }
  307. .cube-card {
  308. position: relative;
  309. height: 320rpx;
  310. border-radius: 20rpx;
  311. overflow: hidden;
  312. background: #eee;
  313. transition: 0.3s;
  314. }
  315. .cube-bg {
  316. width: 100%;
  317. height: 100%;
  318. }
  319. .cube-mask {
  320. position: absolute;
  321. inset: 0;
  322. background: rgba(0, 0, 0, 0.3);
  323. }
  324. .cube-content {
  325. position: absolute;
  326. left: 30rpx;
  327. top: 30rpx;
  328. z-index: 2;
  329. }
  330. .cube-title {
  331. font-size: 32rpx;
  332. font-weight: bold;
  333. color: #fff;
  334. margin-bottom: 12rpx;
  335. display: block;
  336. }
  337. .cube-line {
  338. width: 40rpx;
  339. height: 4rpx;
  340. background: #C1001C;
  341. margin-bottom: 12rpx;
  342. }
  343. .cube-desc {
  344. font-size: 20rpx;
  345. color: rgba(255, 255, 255, 0.8);
  346. max-width: 240rpx;
  347. line-height: 1.4;
  348. display: block;
  349. }
  350. .cube-arrow {
  351. position: absolute;
  352. right: 30rpx;
  353. bottom: 30rpx;
  354. color: #fff;
  355. font-size: 30rpx;
  356. opacity: 0.6;
  357. }
  358. /* 企业实力 */
  359. .brand-strength {
  360. padding: 40rpx;
  361. margin-bottom: 40rpx;
  362. }
  363. .strength-card {
  364. background: #1a1a1a;
  365. border-radius: 32rpx;
  366. padding: 48rpx 40rpx;
  367. color: #fff;
  368. box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
  369. }
  370. .s-header {
  371. margin-bottom: 50rpx;
  372. }
  373. .s-title {
  374. font-size: 34rpx;
  375. font-weight: bold;
  376. display: block;
  377. margin-bottom: 8rpx;
  378. color: #fff;
  379. letter-spacing: 4rpx;
  380. }
  381. .s-subtitle {
  382. font-size: 18rpx;
  383. color: #666;
  384. font-family: 'Arial';
  385. text-transform: uppercase;
  386. }
  387. .s-stats {
  388. display: flex;
  389. justify-content: space-between;
  390. align-items: center;
  391. margin-bottom: 40rpx;
  392. }
  393. .stat-box {
  394. text-align: center;
  395. flex: 1;
  396. }
  397. .stat-box .num {
  398. font-size: 44rpx;
  399. font-weight: 800;
  400. color: #FFD700;
  401. display: block;
  402. margin-bottom: 4rpx;
  403. }
  404. .stat-box .unit {
  405. font-size: 20rpx;
  406. margin-left: 4rpx;
  407. font-weight: normal;
  408. }
  409. .stat-box .label {
  410. font-size: 22rpx;
  411. color: #ababab;
  412. }
  413. .stat-divider {
  414. width: 1rpx;
  415. height: 50rpx;
  416. background: rgba(255, 255, 255, 0.1);
  417. }
  418. .s-footer {
  419. border-top: 1rpx solid rgba(255, 255, 255, 0.05);
  420. padding-top: 30rpx;
  421. text-align: center;
  422. }
  423. .s-footer text {
  424. font-size: 18rpx;
  425. color: #555;
  426. letter-spacing: 6rpx;
  427. }
  428. .safe-bottom-gap {
  429. height: 140rpx;
  430. }
  431. </style>