feat(首页): 新增三坛大戒模块并优化命名
- 新增三坛大戒模块展示(垂直布局) - 将"三师七证"更名为"临坛十师"(更符合佛教规范) - 优化法会流程跳转逻辑(使用 parent_sn 跳转) - 更新 API 文档注释(新增三坛大戒字段说明) - 添加工单目录到 .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Showing
3 changed files
with
156 additions
and
23 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-08-24 09:42:27 | 2 | * @Date: 2023-08-24 09:42:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-11-12 14:53:22 | 4 | + * @LastEditTime: 2026-03-06 11:41:04 |
| 5 | * @FilePath: /stdj_h5/src/api/index.js | 5 | * @FilePath: /stdj_h5/src/api/index.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -16,23 +16,40 @@ const Api = { | ... | @@ -16,23 +16,40 @@ const Api = { |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | - * @description: 首页数据 | 19 | + * @description: 首页数据, 接口里面给的STDJ字段忽略掉, 后端说不知道怎么出来的. |
| 20 | * @returns {Object} list | 20 | * @returns {Object} list |
| 21 | - * @property [Object] list.STDJSSQZ 三师七证 | 21 | + * @property [Object] list.STDJSSQZ 临坛十师 |
| 22 | * @property integer list.STDJSSQZ.id 分类id | 22 | * @property integer list.STDJSSQZ.id 分类id |
| 23 | * @property string list.STDJSSQZ.category_name 分类名称 | 23 | * @property string list.STDJSSQZ.category_name 分类名称 |
| 24 | * @property string list.STDJSSQZ.cover 封面图 | 24 | * @property string list.STDJSSQZ.cover 封面图 |
| 25 | - * @property string list.STDJSSQZ.parent_sn 父分类id | 25 | + * @property string list.STDJSSQZ.parent_sn 父级sn |
| 26 | + * @property string list.STDJSSQZ.category_sn 当前sn | ||
| 26 | * @property [Object] list.STDJFHLC 法会流程 | 27 | * @property [Object] list.STDJFHLC 法会流程 |
| 27 | * @property integer list.STDJFHLC.id 分类id | 28 | * @property integer list.STDJFHLC.id 分类id |
| 28 | * @property string list.STDJFHLC.category_name 分类名称 | 29 | * @property string list.STDJFHLC.category_name 分类名称 |
| 29 | * @property string list.STDJFHLC.cover 封面图 | 30 | * @property string list.STDJFHLC.cover 封面图 |
| 30 | - * @property string list.STDJFHLC.parent_sn 父分类id | 31 | + * @property string list.STDJFHLC.category_link 分类链接 |
| 32 | + * @property string list.STDJFHLC.parent_sn 父级sn | ||
| 33 | + * @property string list.STDJFHLC.category_sn 当前sn | ||
| 34 | + * @property [Object] list.STDJFHLC.articles 文章列表 | ||
| 35 | + * @property integer list.STDJFHLC.articles.id 文章id | ||
| 36 | + * @property string list.STDJFHLC.articles.post_title 文章标题 | ||
| 31 | * @property [Object] list.STDJXGXW 新闻 | 37 | * @property [Object] list.STDJXGXW 新闻 |
| 32 | * @property integer list.STDJXGXW.id 分类id | 38 | * @property integer list.STDJXGXW.id 分类id |
| 33 | * @property string list.STDJXGXW.post_title 新闻标题 | 39 | * @property string list.STDJXGXW.post_title 新闻标题 |
| 34 | * @property string list.STDJXGXW.post_date 发布日期 | 40 | * @property string list.STDJXGXW.post_date 发布日期 |
| 35 | * @property string list.STDJXGXW.photo 封面图 | 41 | * @property string list.STDJXGXW.photo 封面图 |
| 42 | + * @property string list.STDJXGXW.post_link 文章链接 | ||
| 43 | + * @property [Object] list.STDJXQ 三坛大戒 | ||
| 44 | + * @property integer list.STDJXQ.id 分类id | ||
| 45 | + * @property string list.STDJXQ.category_name 分类名称 | ||
| 46 | + * @property string list.STDJXQ.category_link 分类链接 | ||
| 47 | + * @property string list.STDJXQ.cover 封面图 | ||
| 48 | + * @property string list.STDJXQ.parent_sn 父级sn | ||
| 49 | + * @property string list.STDJXQ.category_sn 当前sn | ||
| 50 | + * @property [Object] list.STDJXQ.articles 文章列表 | ||
| 51 | + * @property integer list.STDJXQ.articles.id 文章id | ||
| 52 | + * @property string list.STDJXQ.articles.post_title 文章标题 | ||
| 36 | */ | 53 | */ |
| 37 | export const homePageAPI = (params) => fn(fetch.get(Api.GET_HOME, params)); | 54 | export const homePageAPI = (params) => fn(fetch.get(Api.GET_HOME, params)); |
| 38 | 55 | ... | ... |
| ... | @@ -90,23 +90,48 @@ | ... | @@ -90,23 +90,48 @@ |
| 90 | <div class="decorative-line" :style="decorativeLineStyle"></div> | 90 | <div class="decorative-line" :style="decorativeLineStyle"></div> |
| 91 | 91 | ||
| 92 | <!-- 查看更多按钮 --> | 92 | <!-- 查看更多按钮 --> |
| 93 | - <div class="more-button" @click="viewMore('法会流程')"> | 93 | + <div class="more-button" @click="viewMore('法会流程', currentStep)"> |
| 94 | <span class="more-text">查看更多</span> | 94 | <span class="more-text">查看更多</span> |
| 95 | </div> | 95 | </div> |
| 96 | </div> | 96 | </div> |
| 97 | </div> | 97 | </div> |
| 98 | </div> | 98 | </div> |
| 99 | 99 | ||
| 100 | - <!-- 三师七证 --> | 100 | + |
| 101 | + <!-- 三坛大戒 --> | ||
| 102 | + <div class="three-masters-section"> | ||
| 103 | + <!-- 标题图片 --> | ||
| 104 | + <div class="common-title"> | ||
| 105 | + <img src="https://cdn.ipadbiz.cn/stdj/images/home/%E4%B8%89%E5%9D%9B%E5%A4%A7%E6%88%92@2x.png" alt="三坛大戒" class="title-image"> | ||
| 106 | + </div> | ||
| 107 | + | ||
| 108 | + <!-- 三个栏目 --> | ||
| 109 | + <div class="vertical-masters-list"> | ||
| 110 | + <!-- 三坛大戒栏目 --> | ||
| 111 | + <div class="vertical-item" v-for="(item, index) in threeMastersList" :key="index"> | ||
| 112 | + <div class="vertical-content" :style="{ backgroundImage: `url(${item.cover + '?imageMogr2/thumbnail/400x/strip/quality/70'})` }"> | ||
| 113 | + <div class="vertical-overlay"></div> | ||
| 114 | + <div class="vertical-text"> | ||
| 115 | + <h3 class="vertical-title">{{ item.name }}</h3> | ||
| 116 | + <div class="vertical-more-btn" @click="viewMore(item.name, item)"> | ||
| 117 | + <span class="more-text">查看更多</span> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + </div> | ||
| 124 | + | ||
| 125 | + <!-- 临坛十师 --> | ||
| 101 | <div class="three-masters-section"> | 126 | <div class="three-masters-section"> |
| 102 | <!-- 标题图片 --> | 127 | <!-- 标题图片 --> |
| 103 | <div class="common-title"> | 128 | <div class="common-title"> |
| 104 | - <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"> | 129 | + <img src="https://cdn.ipadbiz.cn/stdj/images/home/%E4%B8%B4%E5%9D%9B%E5%8D%81%E5%B8%88@2x.png" alt="临坛十师" class="title-image"> |
| 105 | </div> | 130 | </div> |
| 106 | 131 | ||
| 107 | <!-- 三个栏目 --> | 132 | <!-- 三个栏目 --> |
| 108 | <div class="three-columns"> | 133 | <div class="three-columns"> |
| 109 | - <!-- 三师七证栏目 --> | 134 | + <!-- 临坛十师栏目 --> |
| 110 | <div class="column-item" v-for="(item, index) in mastersList" :key="index"> | 135 | <div class="column-item" v-for="(item, index) in mastersList" :key="index"> |
| 111 | <div class="column-content" :style="{ backgroundImage: `url(${item.cover + '?imageMogr2/thumbnail/100x/strip/quality/70'})` }"> | 136 | <div class="column-content" :style="{ backgroundImage: `url(${item.cover + '?imageMogr2/thumbnail/100x/strip/quality/70'})` }"> |
| 112 | <div class="column-overlay"></div> | 137 | <div class="column-overlay"></div> |
| ... | @@ -357,7 +382,9 @@ const scrollToPage = (pageIndex) => { | ... | @@ -357,7 +382,9 @@ const scrollToPage = (pageIndex) => { |
| 357 | container.scrollTo({ left: pageIndex * pageWidth, behavior: 'smooth' }) | 382 | container.scrollTo({ left: pageIndex * pageWidth, behavior: 'smooth' }) |
| 358 | } | 383 | } |
| 359 | 384 | ||
| 360 | -// 三师七证数据列表 | 385 | +// 三坛大戒数据列表 |
| 386 | +const threeMastersList = ref([]) | ||
| 387 | +// 临坛十师数据列表 | ||
| 361 | const mastersList = ref([]) | 388 | const mastersList = ref([]) |
| 362 | 389 | ||
| 363 | // 组件挂载后计算装饰线位置 | 390 | // 组件挂载后计算装饰线位置 |
| ... | @@ -393,9 +420,19 @@ onMounted(async () => { | ... | @@ -393,9 +420,19 @@ onMounted(async () => { |
| 393 | processSteps.value[0].active = true; | 420 | processSteps.value[0].active = true; |
| 394 | // 首次默认选中,立即显示箭头,避免首次点击前不显示 | 421 | // 首次默认选中,立即显示箭头,避免首次点击前不显示 |
| 395 | arrow_visible.value = true; | 422 | arrow_visible.value = true; |
| 396 | - // 三师七证 | 423 | + // 三坛大戒 |
| 424 | + threeMastersList.value = list?.STDJXQ?.map(item => ({ | ||
| 425 | + id: item.id, | ||
| 426 | + category_sn: item.category_sn, | ||
| 427 | + parent_sn: item.parent_sn, | ||
| 428 | + name: item.category_name, | ||
| 429 | + cover: item.cover || '', | ||
| 430 | + category_link: item.category_link || '', | ||
| 431 | + })) || []; | ||
| 432 | + // 临坛十师 | ||
| 397 | mastersList.value = list?.STDJSSQZ?.map(item => ({ | 433 | mastersList.value = list?.STDJSSQZ?.map(item => ({ |
| 398 | id: item.id, | 434 | id: item.id, |
| 435 | + category_sn: item.category_sn, | ||
| 399 | parent_sn: item.parent_sn, | 436 | parent_sn: item.parent_sn, |
| 400 | name: item.category_name, | 437 | name: item.category_name, |
| 401 | cover: item.cover || '', | 438 | cover: item.cover || '', |
| ... | @@ -446,16 +483,11 @@ watch(currentStep, () => { | ... | @@ -446,16 +483,11 @@ watch(currentStep, () => { |
| 446 | const viewMore = (type, item) => { | 483 | const viewMore = (type, item) => { |
| 447 | switch (type) { | 484 | switch (type) { |
| 448 | case '法会流程': | 485 | case '法会流程': |
| 449 | - // 跳转页面 | 486 | + // 使用 parent_sn 作为 id 跳转到新闻详情页 |
| 450 | - if (currentStep.value?.category_link) { | 487 | + router.push({ name: 'NewsDetail', params: { id: item.parent_sn || item.id } }) |
| 451 | - location.href = currentStep.value?.category_link; | ||
| 452 | - } else { | ||
| 453 | - // 提示用户没有详情页 | ||
| 454 | - showToast('该法会流程没有跳转链接') | ||
| 455 | - } | ||
| 456 | break | 488 | break |
| 457 | - case '三师七证': | 489 | + case '临坛十师': |
| 458 | - // 跳转到三师七证页面的逻辑 | 490 | + // 跳转到临坛十师页面的逻辑 |
| 459 | if (item?.category_link) { | 491 | if (item?.category_link) { |
| 460 | location.href = item?.category_link; | 492 | location.href = item?.category_link; |
| 461 | } else { | 493 | } else { |
| ... | @@ -748,7 +780,7 @@ const handlePhotoClick = () => { | ... | @@ -748,7 +780,7 @@ const handlePhotoClick = () => { |
| 748 | } | 780 | } |
| 749 | } | 781 | } |
| 750 | 782 | ||
| 751 | -/* 三师七证模块样式 */ | 783 | +/* 临坛十师模块样式 */ |
| 752 | .three-masters-section { | 784 | .three-masters-section { |
| 753 | padding: 2rem 1rem; | 785 | padding: 2rem 1rem; |
| 754 | background: #E5DAC2; | 786 | background: #E5DAC2; |
| ... | @@ -932,7 +964,7 @@ const handlePhotoClick = () => { | ... | @@ -932,7 +964,7 @@ const handlePhotoClick = () => { |
| 932 | text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5); | 964 | text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5); |
| 933 | } | 965 | } |
| 934 | 966 | ||
| 935 | -/* 三师七证模块响应式设计 */ | 967 | +/* 临坛十师模块响应式设计 */ |
| 936 | 968 | ||
| 937 | /* 大屏幕 (>1200px) */ | 969 | /* 大屏幕 (>1200px) */ |
| 938 | @media (min-width: 1200px) { | 970 | @media (min-width: 1200px) { |
| ... | @@ -1006,7 +1038,7 @@ const handlePhotoClick = () => { | ... | @@ -1006,7 +1038,7 @@ const handlePhotoClick = () => { |
| 1006 | } | 1038 | } |
| 1007 | } | 1039 | } |
| 1008 | 1040 | ||
| 1009 | -/* 三师七证模块响应式设计 - 只在很小的屏幕上使用垂直布局 */ | 1041 | +/* 临坛十师模块响应式设计 - 只在很小的屏幕上使用垂直布局 */ |
| 1010 | @media (max-width: 320px) { | 1042 | @media (max-width: 320px) { |
| 1011 | .three-masters-section { | 1043 | .three-masters-section { |
| 1012 | padding: 2rem 1rem; | 1044 | padding: 2rem 1rem; |
| ... | @@ -1737,4 +1769,86 @@ const handlePhotoClick = () => { | ... | @@ -1737,4 +1769,86 @@ const handlePhotoClick = () => { |
| 1737 | font-size: 0.75rem; | 1769 | font-size: 0.75rem; |
| 1738 | } | 1770 | } |
| 1739 | } | 1771 | } |
| 1772 | + | ||
| 1773 | +/* 新增垂直列表样式 - 三坛大戒 */ | ||
| 1774 | +.vertical-masters-list { | ||
| 1775 | + display: flex; | ||
| 1776 | + flex-direction: column; | ||
| 1777 | + gap: 1rem; | ||
| 1778 | +} | ||
| 1779 | + | ||
| 1780 | +.vertical-item { | ||
| 1781 | + width: 100%; | ||
| 1782 | + height: 9rem; /* 约144px,高度适中 */ | ||
| 1783 | +} | ||
| 1784 | + | ||
| 1785 | +.vertical-content { | ||
| 1786 | + position: relative; | ||
| 1787 | + width: 100%; | ||
| 1788 | + height: 100%; | ||
| 1789 | + border-radius: 1rem; | ||
| 1790 | + background-size: cover; | ||
| 1791 | + background-position: center; | ||
| 1792 | + background-repeat: no-repeat; | ||
| 1793 | + overflow: hidden; | ||
| 1794 | + box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1); | ||
| 1795 | + border: 0.08rem solid #C1A16A; /* 保持与原有风格一致的边框颜色 */ | ||
| 1796 | +} | ||
| 1797 | + | ||
| 1798 | +.vertical-overlay { | ||
| 1799 | + position: absolute; | ||
| 1800 | + bottom: 0; | ||
| 1801 | + left: 0; | ||
| 1802 | + width: 100%; | ||
| 1803 | + height: 70%; /* 覆盖下半部分 */ | ||
| 1804 | + background: linear-gradient(to top, rgba(152, 81, 34, 0.95) 0%, rgba(152, 81, 34, 0.5) 60%, transparent 100%); | ||
| 1805 | + z-index: 1; | ||
| 1806 | + pointer-events: none; | ||
| 1807 | +} | ||
| 1808 | + | ||
| 1809 | +.vertical-text { | ||
| 1810 | + position: absolute; | ||
| 1811 | + bottom: 0; | ||
| 1812 | + left: 0; | ||
| 1813 | + right: 0; | ||
| 1814 | + padding: 0 1.25rem; | ||
| 1815 | + height: 3.5rem; /* 固定高度区域 */ | ||
| 1816 | + display: flex; | ||
| 1817 | + justify-content: space-between; | ||
| 1818 | + align-items: center; | ||
| 1819 | + z-index: 2; | ||
| 1820 | +} | ||
| 1821 | + | ||
| 1822 | +.vertical-title { | ||
| 1823 | + color: white; | ||
| 1824 | + font-size: 1.25rem; | ||
| 1825 | + font-weight: 600; | ||
| 1826 | + margin: 0; | ||
| 1827 | + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); | ||
| 1828 | + letter-spacing: 0.05rem; | ||
| 1829 | +} | ||
| 1830 | + | ||
| 1831 | +.vertical-more-btn { | ||
| 1832 | + display: flex; | ||
| 1833 | + align-items: center; | ||
| 1834 | + justify-content: center; | ||
| 1835 | + padding: 0.35rem 1rem; | ||
| 1836 | + border: 1px solid rgba(255, 255, 255, 0.9); | ||
| 1837 | + border-radius: 1.5rem; | ||
| 1838 | + background-color: rgba(0, 0, 0, 0.15); | ||
| 1839 | + cursor: pointer; | ||
| 1840 | + transition: all 0.2s ease; | ||
| 1841 | +} | ||
| 1842 | + | ||
| 1843 | +.vertical-more-btn:active { | ||
| 1844 | + background-color: rgba(0, 0, 0, 0.3); | ||
| 1845 | + transform: scale(0.98); | ||
| 1846 | +} | ||
| 1847 | + | ||
| 1848 | +.vertical-more-btn .more-text { | ||
| 1849 | + color: white; | ||
| 1850 | + font-size: 0.85rem; | ||
| 1851 | + font-weight: 500; | ||
| 1852 | + line-height: 1; | ||
| 1853 | +} | ||
| 1740 | </style> | 1854 | </style> | ... | ... |
-
Please register or login to post a comment