Home.vue
32.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
<template>
<div class="home-container">
<!-- 主要内容区域 -->
<div class="main-content">
<!-- 顶部Banner图片 -->
<div class="banner-section">
<img
src="https://cdn.ipadbiz.cn/stdj/images/home/banner@2x.png"
alt="三坛大戒法会Banner"
class="banner-image"
/>
</div>
<!-- 视频播放器区域 -->
<div class="video-section">
<VideoPlayer
:video-url="videoUrl"
video-id="home-video"
:autoplay="false"
:options="videoOptions"
/>
</div>
<!-- 法会流程容器 -->
<div class="ceremony-wrapper">
<!-- 法会流程 -->
<div class="ceremony-process">
<!-- 标题 -->
<div class="ceremony-title">
<img src="https://cdn.ipadbiz.cn/stdj/images/home/%E6%B3%95%E6%9C%83%E6%B5%81%E7%A8%8B@2x.png" alt="法会流程" />
</div>
<!-- 流程步骤 -->
<div class="process-container">
<!-- 麻绳背景 -->
<div class="rope-background"></div>
<!-- 流程步骤 -->
<div class="process-steps" ref="processStepsRef">
<div
v-for="(step, index) in processSteps"
:key="index"
class="process-step"
:class="{ active: step.active }"
@click="selectStep(index)"
>
<!-- 顶部白色圆形占位(选中状态) -->
<div class="top-circle"></div>
<!-- 步骤内容 -->
<div class="step-content">
<span class="step-text">{{ step.name }}</span>
</div>
</div>
<!-- 全局底部箭头:跟随选中项移动 -->
<div v-show="processSteps.length" class="bottom-arrow moving-arrow" :style="arrowStyle">
<img src="https://cdn.ipadbiz.cn/stdj/images/home/%E7%82%B9@2x.png" alt="选中" />
</div>
</div>
</div>
</div>
<!-- 法会流程内容 -->
<div v-if="currentStep" class="ceremony-intro">
<div class="intro-container">
<!-- 背景图片 -->
<div class="intro-background" :style="{ backgroundImage: `url(${currentStep?.cover})` }"></div>
<!-- 步骤标题 -->
<div class="step-title" ref="stepTitleRef">
<span class="step-title-text">{{ currentStep.name }}</span>
</div>
<!-- 装饰线 -->
<div class="decorative-line" :style="decorativeLineStyle"></div>
<!-- 查看更多按钮 -->
<div class="more-button" @click="viewMore('法会流程')">
<span class="more-text">查看更多</span>
</div>
</div>
</div>
</div>
<!-- 三师七证 -->
<div class="three-masters-section">
<!-- 标题图片 -->
<div class="common-title">
<img src="https://cdn.ipadbiz.cn/stdj/images/home/%E4%B8%89%E5%B8%AB%E4%B8%83%E8%AD%89@2x.png" alt="三师七证" class="title-image">
</div>
<!-- 三个栏目 -->
<div class="three-columns">
<!-- 三师七证栏目 -->
<div class="column-item" v-for="(item, index) in mastersList" :key="index">
<div class="column-content" :style="{ backgroundImage: `url(${item.cover})` }">
<div class="column-overlay"></div>
<div class="column-text">
<h3 class="column-title">{{ item.name }}</h3>
<div class="more-button" @click="viewMore(item.name, item)">
<span class="more-text">查看更多</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 相关新闻 -->
<div class="news-section">
<!-- 标题 -->
<div class="common-title">
<img src="https://cdn.ipadbiz.cn/stdj/images/home/%E7%9B%B8%E5%85%B3%E6%96%B0%E8%81%9E@2x.png" alt="相关新闻" class="title-image">
</div>
<!-- 轮播容器 -->
<div
class="news-carousel-container"
ref="newsCarouselContainer"
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
>
<div class="news-carousel" ref="newsCarousel">
<div class="news-item" v-for="(item, index) in displayNewsItems" :key="index" @click="handleNewsClick(item)">
<div class="news-image">
<img :src="item.image" :alt="item.title">
</div>
<div class="news-content">
<div class="news-title">{{ item.title }}</div>
<div class="news-date">{{ item.date }}</div>
</div>
</div>
</div>
<!-- 导航按钮 -->
<div class="carousel-nav">
<img
class="nav-btn prev-btn"
src="https://cdn.ipadbiz.cn/stdj/images/home/%E4%B8%8A@2x.png"
alt="上一张"
@click="prevSlide"
>
<img
class="nav-btn next-btn"
src="https://cdn.ipadbiz.cn/stdj/images/home/%E4%B8%8B@2x.png"
alt="下一张"
@click="nextSlide"
>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, computed, nextTick, onMounted, onActivated, watch } from 'vue'
import VideoPlayer from '@/components/VideoPlayer.vue'
import { useTitle } from '@vueuse/core';
import { useRouter } from 'vue-router'
import { showToast } from 'vant'
// 导入接口
import { homePageAPI } from '@/api/index.js'
const router = useRouter()
// 页面标题
useTitle('西园戒幢律寺三坛大戒法会');
// TODO: 视频配置
const videoUrl = ref('https://cdn.ipadbiz.cn/stdj/video/sample-10s.mp4')
const videoOptions = ref({
fluid: true,
responsive: true,
aspectRatio: '16:9',
controls: true,
preload: 'metadata',
poster: '',
playbackRates: [0.5, 1, 1.25, 1.5, 2],
})
// 法会流程步骤数据
const processSteps = ref([])
// 流程步骤容器引用
const processStepsRef = ref(null)
// 底部箭头的动态样式
const arrowStyle = ref({ left: '50%', bottom: '-1.25rem', transform: 'translateX(-50%)' })
// 获取当前选中的步骤
const currentStep = computed(() => {
return processSteps.value.find(step => step.active) || processSteps.value[0]
})
// 步骤标题的ref引用
const stepTitleRef = ref(null)
// 装饰线的动态样式
const decorativeLineStyle = ref({
top: '4.5rem',
bottom: '4rem'
})
// 计算装饰线位置的函数
const calculateLinePosition = async () => {
await nextTick()
if (stepTitleRef.value) {
const titleElement = stepTitleRef.value
const containerElement = titleElement.closest('.intro-container')
const moreButton = containerElement?.querySelector('.more-button')
if (containerElement && moreButton) {
// 获取标题和按钮的位置信息
const titleRect = titleElement.getBoundingClientRect()
const buttonRect = moreButton.getBoundingClientRect()
const containerRect = containerElement.getBoundingClientRect()
// 计算相对于容器的位置
const titleBottom = titleRect.bottom - containerRect.top
const buttonTop = buttonRect.top - containerRect.top
// 装饰线从标题底部开始,留0.5rem间距
const spacing = 8 // 0.5rem = 8px (基准字体16px)
const lineTop = titleBottom + spacing
// 装饰线到按钮上方,留0.5rem间距
const lineBottom = containerRect.height - (buttonTop - spacing)
decorativeLineStyle.value = {
top: `${lineTop}px`,
bottom: `${lineBottom}px`
}
}
}
}
/**
* 确保页面滚动位置在顶部(进入或激活时立即回顶)
* 说明:使用立即滚动(非平滑)以避免过渡被用户察觉。
*/
const ensurePageScrollTop = () => {
if (typeof window !== 'undefined') {
// 立即滚动到顶部
window.scrollTo({ top: 0, behavior: 'auto' })
}
// 兜底处理,兼容部分浏览器
if (document && document.documentElement) {
document.documentElement.scrollTop = 0
}
if (document && document.body) {
document.body.scrollTop = 0
}
}
/**
* 点击切换步骤状态并更新底部箭头位置
* @param {number} index 选中步骤索引
*/
const selectStep = (index) => {
processSteps.value.forEach((step, i) => {
step.active = i === index
})
// 切换步骤后重新计算装饰线位置
calculateLinePosition()
// 切换步骤后更新底部箭头位置
updateArrowPosition()
}
// 三师七证数据列表
const mastersList = ref([])
// 组件挂载后计算装饰线位置
onMounted(async () => {
// 进入页面时立即回到顶部
ensurePageScrollTop()
await calculateLinePosition();
// 调用接口获取首页数据
const { code, list } = await homePageAPI();
if (code) {
// 法会流程
processSteps.value = list?.STDJFHLC?.map(item => ({
id: item.id,
parent_sn: item.parent_sn,
name: item.category_name,
cover: item.cover || '',
active: false,
category_link: item.category_link || '',
})) || [];
processSteps.value[0].active = true;
// 三师七证
mastersList.value = list?.STDJSSQZ?.map(item => ({
id: item.id,
parent_sn: item.parent_sn,
name: item.category_name,
cover: item.cover || '',
category_link: item.category_link || '',
})) || [];
// 相关新闻
newsItems.value = list?.STDJXGXW?.map(item => ({
id: item.id,
parent_sn: item.parent_sn,
title: item.post_title,
date: item.post_date,
image: item.photo || '',
post_link: item.post_link || '',
})) || [];
// 初始化轮播位置
nextTick(() => {
updateCarouselPosition(false)
// 初始化底部箭头位置
updateArrowPosition()
// 列表内容渲染后再兜底回顶一次,避免外部干扰
ensurePageScrollTop()
})
}
})
// 组件被 keep-alive 激活时,立即回到顶部
onActivated(() => {
ensurePageScrollTop()
})
// 监听当前步骤变化,重新计算装饰线位置
watch(currentStep, () => {
calculateLinePosition()
updateArrowPosition()
}, { deep: true })
// 查看更多按钮点击事件
const viewMore = (type, item) => {
switch (type) {
case '法会流程':
// 跳转页面
if (currentStep.value?.category_link) {
location.href = currentStep.value?.category_link;
} else {
// 提示用户没有详情页
showToast('该法会流程没有跳转链接')
}
break
case '三师七证':
// 跳转到三师七证页面的逻辑
if (item?.category_link) {
location.href = item?.category_link;
} else {
router.push(`/masters?pid=${item.id}`)
}
break
case '戒子':
// 跳转到戒子页面的逻辑
if (item?.category_link) {
location.href = location.origin + location.pathname + '#/' + item?.category_link;
} else {
router.push(`/students?i=${item.id}`)
}
break
case '义工':
// 跳转到义工页面的逻辑
if (item?.category_link) {
location.href = location.origin + location.pathname + '#/' + item?.category_link;
} else {
router.push(`/volunteers?i=${item.id}`)
}
break
}
}
// 新闻轮播相关逻辑
const newsCarousel = ref(null)
const currentSlide = ref(1) // 从1开始,因为0是克隆的最后一项
const isTransitioning = ref(false)
// 轮播容器引用(用于触摸滑动)
const newsCarouselContainer = ref(null)
// 触摸滑动相关状态
const touchStartX = ref(0)
const touchStartY = ref(0)
const touchDeltaX = ref(0)
const touchDeltaY = ref(0)
const isSwiping = ref(false)
const swipeThreshold = 30 // 滑动触发阈值,单位px
// 新闻数据
const newsItems = ref([])
const displayNewsItems = computed(() => {
if (newsItems.value.length === 0) {
return []
}
// 克隆第一项和最后一项以实现无缝滚动
return [newsItems.value[newsItems.value.length - 1], ...newsItems.value, newsItems.value[0]]
})
// 上一张
const prevSlide = () => {
if (isTransitioning.value) return
isTransitioning.value = true
currentSlide.value--
updateCarouselPosition()
if (currentSlide.value === 0) {
setTimeout(() => {
isTransitioning.value = false
currentSlide.value = newsItems.value.length
updateCarouselPosition(false) // 无动画地跳转
}, 300) // 等待过渡动画完成
} else {
setTimeout(() => {
isTransitioning.value = false
}, 300)
}
}
// 下一张
const nextSlide = () => {
if (isTransitioning.value) return
isTransitioning.value = true
currentSlide.value++
updateCarouselPosition()
if (currentSlide.value === displayNewsItems.value.length - 1) {
setTimeout(() => {
isTransitioning.value = false
currentSlide.value = 1
updateCarouselPosition(false) // 无动画地跳转
}, 300) // 等待过渡动画完成
} else {
setTimeout(() => {
isTransitioning.value = false
}, 300)
}
}
// 更新轮播位置
const updateCarouselPosition = (animated = true) => {
const carouselEl = newsCarousel.value
if (!carouselEl) return
const firstItem = carouselEl.querySelector('.news-item')
if (!firstItem) return
const itemWidth = firstItem.getBoundingClientRect().width
let gapStr = getComputedStyle(carouselEl).gap
if (!gapStr || gapStr === 'normal') {
gapStr = '8px'
}
const gapPx = parseFloat(gapStr) || 8
const distance = currentSlide.value * (itemWidth + gapPx)
carouselEl.style.transition = animated ? 'transform 0.3s ease' : 'none'
carouselEl.style.transform = `translateX(-${distance}px)`
}
/**
* 触摸开始事件:记录初始触摸点
* @param {TouchEvent} e 触摸事件对象
*/
const onTouchStart = (e) => {
const t = e.touches && e.touches[0]
if (!t) return
touchStartX.value = t.clientX
touchStartY.value = t.clientY
touchDeltaX.value = 0
touchDeltaY.value = 0
isSwiping.value = false
}
/**
* 触摸移动事件:计算水平与垂直位移,判断是否为水平滑动
* @param {TouchEvent} e 触摸事件对象
*/
const onTouchMove = (e) => {
const t = e.touches && e.touches[0]
if (!t) return
touchDeltaX.value = t.clientX - touchStartX.value
touchDeltaY.value = t.clientY - touchStartY.value
// 以水平位移为主且超过轻微阈值时,认定为滑动
if (Math.abs(touchDeltaX.value) > Math.abs(touchDeltaY.value) && Math.abs(touchDeltaX.value) > 10) {
isSwiping.value = true
// 阻止默认滚动,避免与页面垂直滚动冲突
e.preventDefault()
} else {
isSwiping.value = false
}
}
/**
* 触摸结束事件:根据滑动距离与方向触发上一张/下一张
*/
const onTouchEnd = () => {
if (!isSwiping.value) return
if (isTransitioning.value) return
if (Math.abs(touchDeltaX.value) >= swipeThreshold) {
if (touchDeltaX.value < 0) {
// 左滑,下一张
nextSlide()
} else {
// 右滑,上一张
prevSlide()
}
}
// 重置状态
touchStartX.value = 0
touchStartY.value = 0
touchDeltaX.value = 0
touchDeltaY.value = 0
isSwiping.value = false
}
// 处理新闻点击事件
const handleNewsClick = (item) => {
// 这里可以添加跳转到新闻详情页面的逻辑
if (item.post_link) {
location.href = item.post_link
} else {
router.push({ name: 'NewsDetail', params: { id: item.id } })
}
}
/**
* 更新底部箭头的位置,使其移动到当前选中步骤下方
*/
const updateArrowPosition = () => {
const containerEl = processStepsRef.value
if (!containerEl) return
const stepsEls = containerEl.querySelectorAll('.process-step')
const activeIndex = processSteps.value.findIndex(s => s.active)
if (activeIndex < 0 || !stepsEls[activeIndex]) return
const activeEl = stepsEls[activeIndex]
const containerRect = containerEl.getBoundingClientRect()
const activeRect = activeEl.getBoundingClientRect()
// 计算选中项中心点相对容器的left位置
const centerX = activeRect.left + activeRect.width / 2 - containerRect.left
// 使用px进行精确定位(移动端rem布局下,定位需要像素计算)
arrowStyle.value = {
left: `${centerX}px`,
bottom: '-1.25rem',
transform: 'translateX(-50%)'
}
}
</script>
<style scoped>
.home-container {
position: relative;
min-height: 100vh;
width: 100%;
overflow-x: hidden;
}
/* 主要内容区域 */
.main-content {
position: relative;
z-index: 1;
width: 100%;
}
/* Banner区域 */
.banner-section {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.banner-image {
width: 100%;
height: auto;
display: block;
object-fit: cover;
}
/* 视频播放器区域 */
.video-section {
width: 100%;
margin: 0;
padding: 0;
}
.video-section :deep(.video-player-container) {
width: 100%;
background: transparent;
}
.video-section :deep(.video-player) {
width: 100%;
height: auto;
}
/* 响应式设计 */
@media (max-width: 768px) {
.ceremony-process {
padding: 2rem 1rem;
}
.ceremony-intro {
padding: 0.5rem; /* 进一步从0.75rem减少到0.5rem */
}
.ceremony-title {
font-size: 1.5rem;
}
.ceremony-subtitle {
font-size: 0.875rem;
}
.ceremony-description {
font-size: 0.875rem;
}
.process-steps {
gap: 1rem;
}
.step-item {
height: 15rem;
}
.step-title-text {
font-size: 2rem; /* 从1.5rem调整为2rem */
}
.more-button {
height: 2.5rem;
}
.more-text {
font-size: 0.75rem;
}
}
/* 三师七证模块样式 */
.three-masters-section {
padding: 2rem 1rem;
background: #E5DAC2;
}
/* 通用标题样式 */
.common-title {
text-align: center;
margin-bottom: 2rem;
position: relative;
z-index: 3;
}
.common-title img {
max-width: 15rem; /* 比原来的12rem更大 */
height: auto;
}
/* 标题图片样式 - 保持向下兼容 */
.section-title {
text-align: center;
margin-bottom: 2rem;
}
.title-image {
max-width: 15rem; /* 调整为更大的尺寸 */
height: auto;
}
/* 三个栏目容器 */
.three-columns {
display: flex !important;
flex-direction: row !important;
gap: 1rem;
justify-content: space-between;
align-items: stretch;
}
/* 强制桌面端水平布局 */
@media (min-width: 481px) {
.three-columns {
display: flex !important;
flex-direction: row !important;
}
}
/* 单个栏目样式 */
.column-item {
flex: 1;
min-height: 20rem;
height: 20rem;
}
.column-content {
position: relative;
width: 100%;
height: 100%;
min-height: 20rem;
border-radius: 1.17rem;
border: 0.08rem solid #C1A16A;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
overflow: hidden;
cursor: pointer;
transition: all 0.3s ease;
}
.column-content:hover {
transform: translateY(-0.25rem);
box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}
/* 蒙版效果 */
.column-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, transparent 0%, rgba(152, 81, 34, 0.3) 50%, rgba(152, 81, 34, 0.8) 100%);
z-index: 1;
}
/* 栏目文字内容 */
.column-text {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 1.5rem;
z-index: 2;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.column-title {
color: white;
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 1rem;
text-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.8);
width: 100%;
text-align: center;
}
/* 栏目内的查看更多按钮 */
.column-text .more-button {
position: static;
margin: 0 auto;
height: 2.5rem;
width: 6rem;
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/button-bg@2x.png');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 3;
transition: all 0.3s ease;
}
.column-text .more-button:hover {
transform: scale(1.05);
filter: brightness(1.1);
}
.column-text .more-text {
color: white;
font-size: 0.75rem;
font-weight: 600;
text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
}
/* 三师七证模块响应式设计 */
/* 大屏幕 (>1200px) */
@media (min-width: 1200px) {
.column-title {
font-size: 1.5rem;
}
.column-text .more-text {
font-size: 0.875rem;
}
.column-text .more-button {
height: 3rem;
width: 7rem;
}
}
/* 中等屏幕 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
.column-title {
font-size: 1.5rem;
}
.column-text .more-text {
font-size: 0.875rem;
}
.column-text .more-button {
height: 2.5rem;
width: 100%;
}
}
/* 小屏幕 (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
.column-title {
font-size: 1.25rem;
}
.column-text .more-text {
font-size: 0.875rem;
}
.column-text .more-button {
height: 2.25rem;
width: 100%;
}
.column-text {
padding: 1.25rem;
}
}
/* 超小屏幕 (321px - 480px) */
@media (min-width: 321px) and (max-width: 480px) {
.column-title {
font-size: 1rem;
}
.column-text .more-text {
font-size: 0.75rem;
}
.column-text .more-button {
height: 2rem;
width: 100%;
}
.column-text {
padding: 1rem 0.5rem;
}
}
/* 三师七证模块响应式设计 - 只在很小的屏幕上使用垂直布局 */
@media (max-width: 320px) {
.three-masters-section {
padding: 2rem 1rem;
}
.three-columns {
flex-direction: column !important;
gap: 1rem;
}
.column-item {
min-height: 15rem;
height: 15rem;
}
.title-image {
max-width: 10rem; /* 从8rem调整为10rem */
}
.column-title {
font-size: 0.875rem;
}
.column-text .more-text {
font-size: 0.5rem;
}
.column-text .more-button {
height: 1.75rem;
width: 100%;
}
.column-text {
padding: 0.75rem;
}
}
/* 法会流程容器 */
.ceremony-wrapper {
position: relative;
width: 100vw;
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/%E8%83%8C%E6%99%AF@2x.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
overflow: hidden;
background-color: #F2EBDB;
padding-bottom: 1.5rem;
}
/* 法会流程模块 */
.ceremony-process {
width: 100%;
padding: 2rem 1rem;
position: relative;
z-index: 2;
}
/* 标题部分 */
.ceremony-title {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 2rem;
}
.ceremony-title img {
max-width: 12rem;
height: auto;
}
/* 流程容器 */
.process-container {
position: relative;
width: 100%;
}
/* 麻绳背景 */
.rope-background {
position: absolute;
top: 10%;
left: 0;
right: 0;
height: 0.3rem;
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/%E9%BA%BB%E7%BB%B3@2x.png');
background-size: cover;
background-position: top;
background-repeat: repeat-x;
transform: translateY(-10%);
z-index: 1;
}
/* 流程步骤容器 */
.process-steps {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
z-index: 2;
padding: 0 0.5rem;
gap: 0.5rem;
}
/* 单个流程步骤 */
.process-step {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
cursor: pointer;
transition: transform 0.2s ease;
}
.process-step:hover {
transform: scale(1.05);
}
/* 步骤内容 */
.step-content {
width: 4rem;
height: 10rem;
background: linear-gradient(180deg, #DAC39E 0%, #BE9C63 100%);
border-radius: 0.75rem;
display: flex;
align-items: center;
justify-content: center;
position: relative;
transition: all 0.3s ease;
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}
/* 选中状态的步骤内容 */
.process-step.active .step-content {
background: linear-gradient(180deg, #C8916C 0%, #975021 100%);
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}
/* 步骤文字 */
.step-text {
color: white;
font-size: 1rem;
font-weight: 600;
text-align: center;
line-height: 1.3;
writing-mode: vertical-rl;
text-orientation: mixed;
text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
margin-top: 0.85rem;
/* 文字间隔 */
letter-spacing: 0.05rem;
}
/* 顶部白色圆形占位 */
.top-circle {
position: absolute;
top: 0.5rem;
left: 50%;
transform: translateX(-50%);
width: 0.45rem;
height: 0.45rem;
background: white;
border-radius: 50%;
z-index: 3;
}
/* 底部箭头 */
.bottom-arrow {
position: absolute;
bottom: -1.25rem;
left: 50%;
transform: translateX(-50%);
z-index: 3;
}
.bottom-arrow img {
width: 1rem;
height: 1rem;
/* 底部箭头左右位移动画 */
animation: arrowHSlide 1.8s ease-in-out infinite;
will-change: transform;
}
/* 可移动箭头样式:启用left过渡,实现平滑跟随 */
.moving-arrow {
transition: left 0.3s ease;
pointer-events: none;
}
/* 响应式调整 */
@media (max-width: 48rem) {
.ceremony-process {
padding: 2.5rem 0.5rem;
}
.ceremony-title img {
max-width: 12.5rem; /* 从10rem调整为12.5rem */
}
.title-image {
max-width: 12.5rem; /* 从10rem调整为12.5rem */
}
.common-title img {
max-width: 12.5rem;
}
.step-content {
width: 3rem;
height: 8rem;
}
.step-text {
font-size: 0.9rem;
}
.process-steps {
padding: 0 0.25rem;
gap: 0.25rem;
}
}
@media (max-width: 30rem) {
.ceremony-process {
padding: 2rem 0.25rem;
}
.ceremony-title img {
max-width: 10rem; /* 从8rem调整为10rem */
}
.title-image {
max-width: 10rem; /* 从8rem调整为10rem */
}
.common-title img {
max-width: 10rem;
}
.step-content {
width: 2.5rem;
height: 6.5rem;
}
.step-text {
font-size: 0.8rem;
}
.top-circle {
width: 0.5rem;
height: 0.5rem;
}
.bottom-arrow img {
width: 1rem;
height: 0.75rem;
}
.process-steps {
gap: 0.125rem;
}
}
/* 介绍容器样式 */
.ceremony-intro {
display: flex;
justify-content: center;
align-items: center;
}
.intro-container {
position: relative;
width: 100%;
margin: 0.5rem; /* 从1rem减少到0.5rem */
border-radius: 1.17rem;
border: 0.08rem solid #C1A16A;
overflow: hidden;
cursor: pointer;
transition: all 0.3s ease;
aspect-ratio: 28.75 / 16.18;
}
.intro-container:hover {
transform: translateY(-0.125rem);
box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}
/* 背景图片 */
.intro-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
opacity: 0.8;
z-index: 1;
}
.intro-background::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(90deg, rgba(152, 81, 34, 1) 0%, rgba(152, 81, 34, 0.5) 30%, rgba(65, 44, 12, 0.15) 70%, transparent 100%);
z-index: 2;
}
/* 步骤标题 */
.step-title {
position: absolute;
top: 1.5rem;
left: 1.5rem;
z-index: 3;
}
.step-title-text {
color: white;
font-size: 2.5rem; /* 从2rem调整为2.5rem,更大 */
font-weight: 700;
writing-mode: vertical-rl;
text-orientation: mixed;
text-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.8);
letter-spacing: 0.1rem;
line-height: 1.2;
}
/* 装饰线 */
.decorative-line {
position: absolute;
left: 2.2rem;
width: 0.125rem;
border-left: 0.125rem dotted #FFF;
z-index: 3;
}
/* 查看更多按钮 */
.more-button {
position: absolute;
bottom: 1.5rem;
left: 1.5rem;
height: 3rem;
aspect-ratio: 3 / 1;
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/button-bg@2x.png');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 3;
transition: all 0.3s ease;
}
.more-button:hover {
transform: scale(1.05);
filter: brightness(1.1);
}
.more-text {
color: white;
font-size: 0.875rem;
font-weight: 600;
text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
}
/* 步骤描述(隐藏,可用于后续扩展) */
.step-description {
display: none;
}
/* 响应式设计 */
@media (max-width: 48rem) {
.intro-container {
margin: 0.375rem; /* 从默认0.5rem进一步减少 */
padding: 0.625rem; /* 从0.875rem减少 */
}
.step-title-text {
font-size: 2.25rem; /* 从1.75rem调整为2.25rem */
}
.more-button {
bottom: 0.75rem;
left: 1rem;
height: 2.5rem;
}
.more-text {
font-size: 0.75rem;
}
}
/* 中等小屏幕 (24rem - 30rem, 384px - 480px) */
@media (max-width: 30rem) and (min-width: 24rem) {
.intro-container {
margin: 0.25rem; /* 进一步减少margin */
padding: 0.5rem; /* 从0.75rem减少 */
}
.step-title {
top: 1rem;
left: 1rem;
}
.step-title-text {
font-size: 1.25rem; /* 调整为更合适的大小 */
}
.decorative-line {
left: 1.8rem;
}
.more-button {
bottom: 0.75rem;
left: 1rem;
height: 2rem;
}
.more-text {
font-size: 0.7rem;
}
}
/* 小屏幕 (20rem - 24rem, 320px - 384px) */
@media (max-width: 24rem) and (min-width: 20rem) {
.intro-container {
margin: 0.125rem; /* 最小化margin */
padding: 0.375rem; /* 从0.625rem减少 */
}
.step-title {
top: 0.875rem;
left: 0.875rem;
}
.step-title-text {
font-size: 1.125rem; /* 进一步减小 */
}
.decorative-line {
left: 1.6rem;
}
.more-button {
bottom: 0.875rem;
left: 0.875rem;
height: 1.375rem;
}
.more-text {
font-size: 0.65rem;
}
}
/* 超小屏幕 (小于20rem, 小于320px) */
@media (max-width: 20rem) {
.intro-container {
margin: 0.125rem; /* 保持最小margin */
padding: 0.25rem; /* 从0.5rem减少 */
}
.step-title {
top: 0.75rem;
left: 0.75rem;
}
.step-title-text {
font-size: 1rem; /* 最小尺寸 */
}
.decorative-line {
left: 1.4rem;
}
.more-button {
bottom: 0.75rem;
left: 0.75rem;
height: 1.25rem;
}
.more-text {
font-size: 0.6rem;
}
}
/* 相关新闻样式 */
.news-section {
padding: 3rem 1.5rem;
position: relative;
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/%E8%83%8C%E6%99%AF@2x.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-color: #F2EBDB;
}
/* 左下角装饰图片 */
.news-section::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%; /* 可根据实际图片大小调整 */
height: 200px; /* 可根据实际图片大小调整 */
background-image: url('https://cdn.ipadbiz.cn/stdj/images/home/bg@2x.png');
background-size: cover;
background-repeat: no-repeat;
z-index: 1;
pointer-events: none; /* 确保不影响交互 */
}
.news-carousel-container {
position: relative;
overflow: hidden;
margin-top: 2rem;
z-index: 2; /* 确保轮播容器在背景图片之上 */
/* 仅允许垂直滚动,优化左右滑动体验 */
touch-action: pan-y;
}
.news-carousel {
display: flex;
transition: transform 0.3s ease;
gap: 0.5rem; /* 减小间距 */
}
.news-item {
flex: 0 0 75%; /* 调整宽度为75% */
background: white;
border-radius: 0.75rem;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.news-image {
width: 100%;
height: 12rem;
overflow: hidden;
}
.news-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.news-content {
padding: 1rem;
background: white;
}
.news-title {
font-size: 1rem;
font-weight: 600;
color: #333;
line-height: 1.4;
margin-bottom: 0.5rem;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
}
.news-date {
font-size: 0.875rem;
color: #999;
}
.carousel-nav {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 1.5rem;
position: relative;
z-index: 3; /* 确保导航按钮在最上层 */
}
.nav-btn {
width: 3rem;
height: 3rem;
cursor: pointer;
transition: all 0.3s ease;
object-fit: contain;
}
.nav-btn:hover:not(.disabled) {
transform: scale(1.1);
}
.nav-btn.disabled {
opacity: 0.3;
cursor: not-allowed;
}
/* 响应式设计 */
@media (max-width: 48rem) {
.news-section {
padding: 3rem 1rem;
}
.news-item {
flex: 0 0 78%; /* 调整中等屏幕宽度 */
}
.news-image {
height: 10rem;
}
.news-title {
font-size: 0.9rem;
}
.nav-btn {
width: 2.5rem;
height: 2.5rem;
}
}
@media (max-width: 30rem) {
.news-section {
padding: 3rem 0.75rem;
}
.news-item {
flex: 0 0 82%; /* 调整小屏幕宽度 */
}
.news-image {
height: 8rem;
}
.news-content {
padding: 0.75rem;
}
.news-title {
font-size: 0.85rem;
}
.news-date {
font-size: 0.75rem;
}
}
</style>