hookehuyr

feat(views): 更新大师详情页样式和内容展示

重构大师详情页的布局和样式,添加角色字段和姓名格式化功能
为背景添加统一颜色,优化卡片内容和排版
...@@ -764,6 +764,7 @@ const handleNewsClick = (item) => { ...@@ -764,6 +764,7 @@ const handleNewsClick = (item) => {
764 background-repeat: no-repeat; 764 background-repeat: no-repeat;
765 background-attachment: fixed; 765 background-attachment: fixed;
766 overflow: hidden; 766 overflow: hidden;
767 + background-color: #F2EBDB;
767 } 768 }
768 769
769 /* 法会流程模块 */ 770 /* 法会流程模块 */
...@@ -1202,6 +1203,7 @@ const handleNewsClick = (item) => { ...@@ -1202,6 +1203,7 @@ const handleNewsClick = (item) => {
1202 background-size: cover; 1203 background-size: cover;
1203 background-position: center; 1204 background-position: center;
1204 background-repeat: no-repeat; 1205 background-repeat: no-repeat;
1206 + background-color: #F2EBDB;
1205 } 1207 }
1206 1208
1207 /* 左下角装饰图片 */ 1209 /* 左下角装饰图片 */
......
1 <!-- 1 <!--
2 * @Date: 2025-10-30 20:00:25 2 * @Date: 2025-10-30 20:00:25
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-10-31 14:50:05 4 + * @LastEditTime: 2025-10-31 16:01:53
5 * @FilePath: /stdj_h5/src/views/MastersDetail.vue 5 * @FilePath: /stdj_h5/src/views/MastersDetail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -9,14 +9,11 @@ ...@@ -9,14 +9,11 @@
9 <div class="masters-detail-container"> 9 <div class="masters-detail-container">
10 <section class="single-list"> 10 <section class="single-list">
11 <div class="item-card"> 11 <div class="item-card">
12 - <img 12 + <img :src="item.src" :alt="item.title" class="item-image" />
13 - :src="item.src"
14 - :alt="item.title"
15 - class="item-image"
16 - />
17 <div class="item-content"> 13 <div class="item-content">
18 - <h3 class="item-title">{{ item.title }}</h3> 14 + <div class="item-role">{{ item.role }}</div>
19 - <p class="item-text">{{ item.description }}</p> 15 + <div class="item-name" v-html="formatNameWithSuperscript(item.name)"></div>
16 + <div class="item-desc">{{ item.desc }}</div>
20 </div> 17 </div>
21 </div> 18 </div>
22 </section> 19 </section>
...@@ -30,10 +27,26 @@ import { useTitle } from '@vueuse/core'; ...@@ -30,10 +27,26 @@ import { useTitle } from '@vueuse/core';
30 useTitle('三師七證 - 詳情') 27 useTitle('三師七證 - 詳情')
31 28
32 const item = ref({ 29 const item = ref({
33 - src: 'https://via.placeholder.com/300x400?text=三師七證', 30 + id: 101,
34 - title: '三師七證 - 詳情', 31 + role: '中国·戒幢律寺',
35 - description: '三師七證是三師七證的詳情,包含三師七證的所有內容。' 32 + name: '上明仁传师',
33 + src: '/src/assets/images/02 西园戒幢律寺三坛大戒法会/截图/全家福3_副本.jpg',
34 + desc: '师法名宗思。字向愿。一九六五年出生,福建泉州人。一九八五年于虎溪岩寺,礼上广下平法师剃度出家。一九八九年于莆田广化寺,依止上妙下湛老和尚求受具足戒。先后任中国佛教协会副秘书长、福建省佛教协会常务副会长、泉州市佛教协会会长、晋江市佛教协会会长、泉州承天寺方丈、晋江庆莲寺住持、龙山寺寺务委员会主任、泉州佛学苑苑长、泉州市人大常委。 二〇一〇年,为承天寺三坛大戒教授律师,主持编修《泉州佛教梵刹文化综览》、《廋松集》「再版」、『传敏法师东西塔浮雕白描』总策划等。'
36 }) 35 })
36 +
37 +/**
38 + * 为name字段的第一个文字添加上标效果
39 + * @param {string} name - 原始姓名
40 + * @returns {string} - 带上标的HTML字符串
41 + */
42 +const formatNameWithSuperscript = (name) => {
43 + if (!name || name.length === 0) return name
44 +
45 + const firstChar = name.charAt(0)
46 + const restChars = name.slice(1)
47 +
48 + return `<sup style="font-size: 0.6rem;">上</sup>${firstChar}<sup style="font-size: 0.6rem;">下</sup>${restChars}`
49 +}
37 </script> 50 </script>
38 51
39 52
...@@ -41,7 +54,8 @@ const item = ref({ ...@@ -41,7 +54,8 @@ const item = ref({
41 .masters-detail-container { 54 .masters-detail-container {
42 padding: 1.5rem; 55 padding: 1.5rem;
43 background: #F2EBDB; 56 background: #F2EBDB;
44 - min-height: 100vh; /* 背景至少覆盖整个视口高度 */ 57 + min-height: 100vh;
58 + /* 背景至少覆盖整个视口高度 */
45 width: 100%; 59 width: 100%;
46 box-sizing: border-box; 60 box-sizing: border-box;
47 } 61 }
...@@ -59,7 +73,6 @@ const item = ref({ ...@@ -59,7 +73,6 @@ const item = ref({
59 border: 2px solid #6B4102; 73 border: 2px solid #6B4102;
60 overflow: hidden; 74 overflow: hidden;
61 transition: transform 0.2s ease; 75 transition: transform 0.2s ease;
62 - padding: 0.5rem;
63 } 76 }
64 77
65 .item-image { 78 .item-image {
...@@ -69,28 +82,23 @@ const item = ref({ ...@@ -69,28 +82,23 @@ const item = ref({
69 } 82 }
70 83
71 .item-content { 84 .item-content {
72 - padding: 0.5rem; 85 + padding: 0.85rem;
86 + text-align: center;
87 + color: #6B4102;
73 } 88 }
74 89
75 -.item-title { 90 +.item-role {
76 - font-size: 1.2rem; 91 + font-size: 0.75rem;
92 + opacity: 0.95;
93 +}
94 +
95 +.item-name {
96 + font-size: 1.25rem;
77 font-weight: 600; 97 font-weight: 600;
78 - color: #333; 98 + margin-top: 0.25rem;
79 - line-height: 1.4;
80 - margin-bottom: 0.5rem;
81 - overflow: hidden;
82 - text-overflow: ellipsis;
83 - white-space: nowrap;
84 } 99 }
85 100
86 -.item-text { 101 +.item-desc {
87 - font-size: 1rem; 102 + margin-top: 0.5rem;
88 - color: #666;
89 - line-height: 1.4;
90 - overflow: hidden;
91 - text-overflow: ellipsis;
92 - display: -webkit-box;
93 - -webkit-line-clamp: 2;
94 - -webkit-box-orient: vertical;
95 } 103 }
96 </style> 104 </style>
......