From 2541f5a75e667c11e626d9bf879124dcfd7e1f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Tue, 8 Sep 2026 17:38:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=81=8B=E7=88=B1?= =?UTF-8?q?=E6=95=85=E4=BA=8B=E6=A8=A1=E5=9D=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增uhlove图标字体库与相关样式 2. 新增恋爱故事页面与恋爱主页 3. 修复投票组件多选限制逻辑bug 4. 优化导航栏组件自定义样式能力 5. 更新滚动置顶组件黑名单与样式 6. 开启本地开发调试模式 --- .../uh-article-vote-item.vue | 34 +- src/components/uh-navbar/uh-navbar.vue | 19 +- .../uh-scroll-top/uh-scroll-top.vue | 5 +- src/pages-blog/love/love.vue | 600 ++++++------- .../love/{journey.vue => stories.vue} | 5 +- src/pages-blog/vote-detail/vote-detail.vue | 841 +++++++++--------- src/pages/index/index.vue | 4 +- src/style/index.scss | 1 + src/style/uhlove-iconfont.css | 26 + uno.config.ts | 1 + 10 files changed, 770 insertions(+), 766 deletions(-) rename src/pages-blog/love/{journey.vue => stories.vue} (98%) create mode 100644 src/style/uhlove-iconfont.css diff --git a/src/components/uh-article-vote-item/uh-article-vote-item.vue b/src/components/uh-article-vote-item/uh-article-vote-item.vue index 5034223..5e0f3f5 100644 --- a/src/components/uh-article-vote-item/uh-article-vote-item.vue +++ b/src/components/uh-article-vote-item/uh-article-vote-item.vue @@ -104,8 +104,10 @@ function handleSelectCheckboxOption(option: IVoteOption) { return const checkedList = (spec.options || []).filter(x => x.checked && x.id !== option.id) - if (spec.type === 'multiple' && checkedList.length >= (spec.maxVotes || 0)) { - showToast(`最多选择 ${spec.maxVotes} 项`) + // maxVotes 缺失(0/undefined)时不限制多选数量,避免 0 >= 0 恒真导致无法选择 + const maxVotes = spec.maxVotes + if (spec.type === 'multiple' && maxVotes && maxVotes > 0 && checkedList.length >= maxVotes) { + showToast(`最多选择 ${maxVotes} 项`) return } @@ -225,7 +227,7 @@ defineExpose({ refresh: handleGetData }) 查看投票详情 > - + {{ voteData.spec?.title }} @@ -247,8 +249,12 @@ defineExpose({ refresh: handleGetData }) > - {{ option.title }} - {{ handleCalcPercent(option) }}% + + {{ option.title }} + + + {{ handleCalcPercent(option) }}% + @@ -278,8 +284,12 @@ defineExpose({ refresh: handleGetData }) > - {{ option.title }} - {{ handleCalcPercent(option) }}% + + {{ option.title }} + + + {{ handleCalcPercent(option) }}% + @@ -300,7 +310,7 @@ defineExpose({ refresh: handleGetData }) - + - 选项{{ optionIndex + 1 }}:{{ option.title }} - {{ handleCalcPercent(option) }}% + + 选项{{ optionIndex + 1 }}:{{ option.title }} + + + {{ handleCalcPercent(option) }}% + diff --git a/src/components/uh-navbar/uh-navbar.vue b/src/components/uh-navbar/uh-navbar.vue index 1b7ff8f..ad70e9a 100644 --- a/src/components/uh-navbar/uh-navbar.vue +++ b/src/components/uh-navbar/uh-navbar.vue @@ -10,12 +10,15 @@ titleColor ?: string; scrollTitle ?: string; needPlaceholder ?: boolean; + backClass ?: string; + backStyle ?: string; } const props = withDefaults(defineProps(), { useBack: true, useTitle: true, needPlaceholder: true, + backClass: 'text-gray-900' }) const slots = useSlots() @@ -35,10 +38,6 @@ const customCalss = computed(() => { const _class = [] - if (props.titleColor) { - _class.push(props.titleColor) - return - } if (scrollThreshold.value) { _class.push('text-white') } @@ -48,6 +47,10 @@ return _class; }) + const titleColorClass = computed(() => { + return [props.titleColor] + }) + const visibleTitle = computed(() => { if (!props.scrollTitle) { return props.defaultTitle; @@ -65,7 +68,7 @@ return [ homePage, 'pages/maintenance/maintenance', - ...tabbarList.map(item => item.pagePath), + ...tabbarList.map((item : any) => item.pagePath), ] as string[]; }) @@ -92,14 +95,16 @@ + class="uh-global-card-glass h-7 px-3 rounded-full border flex items-center gap-x-2 text-sm" + :class="props.backClass" :style="[props.backStyle]"> 返回 - + {{visibleTitle}} diff --git a/src/components/uh-scroll-top/uh-scroll-top.vue b/src/components/uh-scroll-top/uh-scroll-top.vue index 701ae4f..8f9a8f6 100644 --- a/src/components/uh-scroll-top/uh-scroll-top.vue +++ b/src/components/uh-scroll-top/uh-scroll-top.vue @@ -13,7 +13,7 @@ } // 获取当前页面,并且设置黑名单模式,因为有的页面可能不需要滚动到顶部 - const balckList = ['pages/maintenance/maintenance','pages-blog/setting/setting'] + const balckList = ['pages/maintenance/maintenance', 'pages-blog/setting/setting', 'pages-blog/love/love'] const pages = getCurrentPages() const currentPage = pages[pages.length - 1] const visible = computed(() => { @@ -23,8 +23,7 @@