index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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" @change="handleBannerChange">
  7. <swiper-item v-for="(item, index) in banners" :key="index">
  8. <view class="hero-card">
  9. <image :src="item.url" mode="aspectFill" class="hero-img"></image>
  10. <view class="hero-overlay"></view>
  11. <view class="hero-text-content">
  12. <text class="hero-tag">{{item.tag}}</text>
  13. <text class="hero-main-title">{{item.title}}</text>
  14. <text class="hero-sub-title">{{item.subTitle}}</text>
  15. </view>
  16. </view>
  17. </swiper-item>
  18. </swiper>
  19. <!-- 胶囊样式指示器 -->
  20. <view class="hero-indicators">
  21. <view v-for="(item, index) in banners" :key="index"
  22. class="indicator-pill" :class="{ active: currentBanner === index }"></view>
  23. </view>
  24. </view>
  25. <!-- 2. 精英咨询入口 (悬浮毛玻璃效果) -->
  26. <view class="contact-card" @click="callService">
  27. <view class="contact-info">
  28. <view class="contact-icon-box">
  29. <image src="https://img.icons8.com/ios-filled/50/C1001C/phone.png" mode="aspectFit"></image>
  30. </view>
  31. <view class="contact-texts">
  32. <text class="main-txt">尊享 VIP 咨询服务</text>
  33. <text class="sub-txt">15年行业专家 为您定制型材解决方案</text>
  34. </view>
  35. </view>
  36. <view class="call-btn-circle">
  37. <image src="https://img.icons8.com/ios-glyphs/30/ffffff/phone--v1.png" mode="aspectFit"></image>
  38. </view>
  39. </view>
  40. <!-- 3. 魔幻型材空间 (2x2 魔方布局) -->
  41. <view class="cube-section">
  42. <view class="section-header">
  43. <view class="title-with-line">
  44. <text class="zh">精选分类</text>
  45. <text class="en">CATEGORIES</text>
  46. </view>
  47. </view>
  48. <view class="cube-container">
  49. <view class="cube-grid">
  50. <view class="cube-card" v-for="(item, index) in cubeProducts" :key="index" @click="goToOrder">
  51. <image :src="item.image" mode="aspectFill" class="cube-bg"></image>
  52. <view class="cube-mask"></view>
  53. <view class="cube-content">
  54. <text class="cube-title">{{item.name}}</text>
  55. <view class="cube-line"></view>
  56. <text class="cube-desc">{{item.desc}}</text>
  57. </view>
  58. <view class="cube-arrow">→</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 4. 品牌硬实力 (深色大气卡片) -->
  64. <view class="brand-strength">
  65. <view class="strength-card">
  66. <view class="s-header">
  67. <text class="s-title">华晟 · 硬核实力</text>
  68. <text class="s-subtitle">Reliable Quality & Professional Service</text>
  69. </view>
  70. <view class="s-stats">
  71. <view class="stat-box">
  72. <text class="num">15<text class="unit">年</text></text>
  73. <text class="label">专注型材研发</text>
  74. </view>
  75. <view class="stat-divider"></view>
  76. <view class="stat-box">
  77. <text class="num">3<text class="unit">大</text></text>
  78. <text class="label">现代生产基地</text>
  79. </view>
  80. <view class="stat-divider"></view>
  81. <view class="stat-box">
  82. <text class="num">500<text class="unit">+</text></text>
  83. <text class="label">合作伙伴认可</text>
  84. </view>
  85. </view>
  86. <view class="s-footer">
  87. <text>品质铸就品牌 · 服务创造价值</text>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 底部占位 -->
  92. <view class="safe-bottom-gap"></view>
  93. </scroll-view>
  94. <!-- 底部通用导航 -->
  95. <erp-tab-bar active="home"></erp-tab-bar>
  96. </view>
  97. </template>
  98. <script>
  99. import ErpTabBar from '@/components/erp-tab-bar/erp-tab-bar.vue';
  100. import assets from '@/utils/assets.js';
  101. export default {
  102. components: { ErpTabBar },
  103. data() {
  104. return {
  105. assets,
  106. statusBarHeight: 0,
  107. currentBanner: 0,
  108. banners: [
  109. {
  110. url: '/static/index/banner2.jpg',
  111. tag: '建筑美学',
  112. title: '高端系统门窗',
  113. subTitle: '智造美好生活空间'
  114. },
  115. {
  116. url: '/static/index/banner1.jpg',
  117. tag: '领航品质',
  118. title: '工业铝型材定制',
  119. subTitle: '提供一站式工业型材解决方案'
  120. }
  121. ],
  122. cubeProducts: [
  123. { name: '建筑铝材', desc: '门窗/幕墙/家装', image: '/static/index/cube1.jpg' },
  124. { name: '工业型材', desc: '光伏/轨道/汽配', image: '/static/index/cube2.jpg' },
  125. { name: '特种定制', desc: '精密开模/特种合金', image: '/static/index/cube3.jpg' },
  126. { name: '深加工', desc: '切割/冲压/CNC', image: '/static/index/cube4.jpg' }
  127. ]
  128. }
  129. },
  130. onLoad() {
  131. },
  132. methods: {
  133. handleBannerChange(e) { this.currentBanner = e.detail.current; },
  134. callService() {
  135. uni.showModal({
  136. title: '管家式服务',
  137. content: '即将为您拨打华晟型材专家电话 13888888888',
  138. confirmText: '立即咨询',
  139. confirmColor: '#C1001C',
  140. cancelText: '稍后再说',
  141. cancelColor: '#999',
  142. success: (res) => {
  143. if (res.confirm) {
  144. uni.makePhoneCall({ phoneNumber: '13888888888' });
  145. }
  146. }
  147. });
  148. },
  149. goToOrder() { uni.reLaunch({ url: '/pages/order/order' }); }
  150. }
  151. }
  152. </script>
  153. <style scoped>
  154. .home-page { width: 100vw; height: 100vh; background-color: #F8FAFC; display: flex; flex-direction: column; }
  155. .main-scroll { flex: 1; height: 0; }
  156. /* 英雄轮播区 */
  157. .hero-section { position: relative; width: 100%; height: 500rpx; overflow: hidden; }
  158. .hero-swiper { height: 100%; }
  159. .hero-card { position: relative; width: 100%; height: 100%; }
  160. .hero-img { width: 100%; height: 100%; }
  161. .hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5)); }
  162. .hero-text-content { position: absolute; left: 40rpx; bottom: 80rpx; color: #fff; z-index: 2; }
  163. .hero-tag { font-size: 20rpx; background: rgba(193,0,28,0.8); padding: 4rpx 16rpx; border-radius: 4rpx; margin-bottom: 12rpx; display: inline-block; }
  164. .hero-main-title { font-size: 44rpx; font-weight: bold; display: block; margin-bottom: 8rpx; }
  165. .hero-sub-title { font-size: 24rpx; opacity: 0.8; letter-spacing: 1rpx; }
  166. .hero-indicators { position: absolute; bottom: 40rpx; right: 40rpx; display: flex; gap: 8rpx; }
  167. .indicator-pill { width: 12rpx; height: 6rpx; background: rgba(255,255,255,0.3); border-radius: 4rpx; transition: 0.3s; }
  168. .indicator-pill.active { width: 32rpx; background: #fff; }
  169. /* 咨询卡片 */
  170. .contact-card {
  171. margin: -40rpx 40rpx 40rpx; position: relative; z-index: 10;
  172. background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
  173. border-radius: 24rpx; padding: 32rpx 40rpx; display: flex; align-items: center;
  174. justify-content: space-between; border: 1rpx solid #fff;
  175. box-shadow: 0 12rpx 40rpx rgba(0,0,0,0.06);
  176. }
  177. .contact-info { display: flex; align-items: center; }
  178. .contact-icon-box { width: 88rpx; height: 88rpx; background: #FFF1F2; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 24rpx; }
  179. .contact-icon-box image { width: 44rpx; height: 44rpx; }
  180. .main-txt { font-size: 30rpx; font-weight: bold; color: #1a1a1a; display: block; margin-bottom: 4rpx; }
  181. .sub-txt { font-size: 22rpx; color: #7a7a7a; }
  182. .call-btn-circle { width: 72rpx; height: 72rpx; background: #C1001C; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 6rpx 12rpx rgba(193,0,28,0.3); }
  183. .call-btn-circle image { width: 32rpx; height: 32rpx; }
  184. /* 魔方布局 */
  185. .cube-section { padding: 20rpx 40rpx; }
  186. .section-header { margin-bottom: 30rpx; }
  187. .title-with-line { display: flex; align-items: baseline; gap: 16rpx; }
  188. .title-with-line .zh { font-size: 36rpx; font-weight: 800; color: #1a1a1a; }
  189. .title-with-line .en { font-size: 20rpx; color: #999; font-family: 'Georgia'; letter-spacing: 2rpx; }
  190. .cube-container { width: 100%; }
  191. .cube-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20rpx; }
  192. .cube-card {
  193. position: relative; height: 320rpx; border-radius: 20rpx; overflow: hidden;
  194. background: #eee; transition: 0.3s;
  195. }
  196. .cube-bg { width: 100%; height: 100%; }
  197. .cube-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
  198. .cube-content { position: absolute; left: 30rpx; top: 30rpx; z-index: 2; }
  199. .cube-title { font-size: 32rpx; font-weight: bold; color: #fff; margin-bottom: 12rpx; display: block; }
  200. .cube-line { width: 40rpx; height: 4rpx; background: #C1001C; margin-bottom: 12rpx; }
  201. .cube-desc { font-size: 20rpx; color: rgba(255,255,255,0.8); max-width: 240rpx; line-height: 1.4; display: block; }
  202. .cube-arrow { position: absolute; right: 30rpx; bottom: 30rpx; color: #fff; font-size: 30rpx; opacity: 0.6; }
  203. /* 企业实力 */
  204. .brand-strength { padding: 40rpx; margin-bottom: 40rpx; }
  205. .strength-card {
  206. background: #1a1a1a; border-radius: 32rpx; padding: 48rpx 40rpx; color: #fff;
  207. box-shadow: 0 20rpx 60rpx rgba(0,0,0,0.15);
  208. }
  209. .s-header { margin-bottom: 50rpx; }
  210. .s-title { font-size: 34rpx; font-weight: bold; display: block; margin-bottom: 8rpx; color: #fff; letter-spacing: 4rpx; }
  211. .s-subtitle { font-size: 18rpx; color: #666; font-family: 'Arial'; text-transform: uppercase; }
  212. .s-stats { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40rpx; }
  213. .stat-box { text-align: center; flex: 1; }
  214. .stat-box .num { font-size: 44rpx; font-weight: 800; color: #FFD700; display: block; margin-bottom: 4rpx; }
  215. .stat-box .unit { font-size: 20rpx; margin-left: 4rpx; font-weight: normal; }
  216. .stat-box .label { font-size: 22rpx; color: #ababab; }
  217. .stat-divider { width: 1rpx; height: 50rpx; background: rgba(255,255,255,0.1); }
  218. .s-footer { border-top: 1rpx solid rgba(255,255,255,0.05); padding-top: 30rpx; text-align: center; }
  219. .s-footer text { font-size: 18rpx; color: #555; letter-spacing: 6rpx; }
  220. .safe-bottom-gap { height: 140rpx; }
  221. </style>