From e5e3ad3d8b04e6ce1b08050f5ebc2b068b3e2e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Sat, 12 Sep 2026 22:33:50 +0800 Subject: [PATCH] =?UTF-8?q?feat&refactor:=20=E5=AE=8C=E6=88=90=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=A4=9A=E8=BD=AE=E4=BC=98=E5=8C=96=E4=B8=8E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整开发环境与生产环境接口地址为局域网地址 2. 新增页面滚动监听hook、版权组件与小尺寸阴影工具类 3. 优化多处组件样式、导航栏与tabbar配置 4. 重构恋爱模块配置类型与移除冗余接口 5. 修复多处代码细节与优化用户体验 --- env/.env | 13 +- env/.env.development | 3 +- src/App.ku.vue | 7 +- src/api/types/uni-halo.ts | 68 ++- src/api/uni-halo.ts | 14 - .../uh-article-card/uh-article-card.vue | 12 +- src/components/uh-button/uh-button.vue | 16 +- .../uh-comment-list/uh-comment-list.vue | 9 +- .../uh-data-loading/uh-data-loading.vue | 2 +- .../uh-data-loadmore/uh-data-loadmore.vue | 2 +- .../uh-glass-picker/uh-glass-picker.vue | 196 ++++---- .../uh-glass-popup/uh-glass-popup.vue | 438 +++++++++++++++--- .../uh-glass-popup/uh-glass-popup.vue.bak | 113 +++++ .../uh-global-actions/uh-global-actions.vue | 6 +- .../uh-home-banner/uh-home-banner.vue | 11 +- .../uh-home-category/uh-home-category.vue | 12 +- .../uh-home-quick-nav/uh-home-quick-nav.vue | 94 +--- .../uh-links-actions/uh-links-actions.vue | 74 +-- .../uh-links-mini-apply.vue | 6 + .../uh-links-mini-info/uh-links-mini-info.vue | 364 +++++++-------- .../uh-links-site-apply.vue | 336 +++++++------- .../uh-links-site-info/uh-links-site-info.vue | 206 ++++---- .../uh-maintenance-detail.vue | 12 +- src/components/uh-navbar/uh-navbar.vue | 101 ++-- .../uh-notify-dialog/uh-notify-dialog.vue | 2 +- .../uh-page-copyright/uh-page-copyright.vue | 14 + .../uh-restrict-read-skeleton.vue | 7 +- .../uh-section-title/uh-section-title.vue | 32 +- .../uh-settings-button/uh-settings-button.vue | 11 +- .../uh-settings-popup/uh-settings-popup.vue | 67 ++- .../uh-text-underline/uh-text-underline.vue | 10 +- src/hooks/useDataLoadingStatus.ts | 52 +-- src/hooks/usePageScroll.ts | 13 + src/hooks/useSettingsPopup.ts | 1 - src/locale/en.json | 4 +- src/locale/zh-Hans.json | 4 +- src/pages-blog/about/about.vue | 19 +- src/pages-blog/archives/archives.vue | 4 +- .../article-detail/article-detail.vue | 64 ++- src/pages-blog/articles/articles.vue | 4 +- .../banner-detail/banner-detail.vue | 4 +- .../category-articles/category-articles.vue | 4 +- src/pages-blog/contact/contact.vue | 305 ++++++------ src/pages-blog/data-visual/data-visual.vue | 4 +- src/pages-blog/disclaimers/disclaimers.vue | 4 +- src/pages-blog/favorites/favorites.vue | 4 +- src/pages-blog/friend-links/friend-links.vue | 4 +- src/pages-blog/love/album.vue | 4 +- src/pages-blog/love/list.vue | 5 +- src/pages-blog/love/love.vue | 262 +++++------ src/pages-blog/love/stories.vue | 4 +- .../moment-detail/moment-detail.vue | 41 +- .../moment-detail/moment-detail.vue.glass.bak | 337 -------------- src/pages-blog/notice/detail.vue | 4 +- src/pages-blog/notice/notice.vue | 4 +- src/pages-blog/search/search.vue | 4 +- src/pages-blog/setting/setting.vue | 4 +- src/pages-blog/test/test.vue | 4 +- src/pages-blog/vote-detail/vote-detail.vue | 4 +- src/pages-blog/votes/votes.vue | 4 +- src/pages/maintenance/maintenance.vue | 60 ++- src/pages/tabbar/about/about.vue | 266 ----------- src/pages/tabbar/category/category.vue | 8 +- src/pages/tabbar/gallery/gallery.vue | 13 +- src/pages/tabbar/home/home.vue | 40 +- src/pages/tabbar/mine/mine.vue | 271 +++++++++++ src/pages/tabbar/moments/moments.vue | 23 +- src/store/appConfig.ts | 53 +-- src/style/index.scss | 4 + src/tabbar/TabbarItem.test.ts | 69 --- src/tabbar/TabbarItem.vue | 12 +- src/tabbar/config.ts | 8 +- src/tabbar/index.vue | 12 +- uno.config.ts | 228 +++++---- 74 files changed, 2262 insertions(+), 2238 deletions(-) create mode 100644 src/components/uh-glass-popup/uh-glass-popup.vue.bak create mode 100644 src/components/uh-page-copyright/uh-page-copyright.vue create mode 100644 src/hooks/usePageScroll.ts delete mode 100644 src/pages-blog/moment-detail/moment-detail.vue.glass.bak delete mode 100644 src/pages/tabbar/about/about.vue create mode 100644 src/pages/tabbar/mine/mine.vue delete mode 100644 src/tabbar/TabbarItem.test.ts diff --git a/env/.env b/env/.env index 5637574..0da34da 100644 --- a/env/.env +++ b/env/.env @@ -1,5 +1,5 @@ VITE_APP_TITLE = 'uni-halo' -VITE_APP_PORT = 9520 +VITE_APP_PORT = 5200 VITE_UNI_APPID = '__UNI__5748B6E' VITE_WX_APPID = 'wx1bb161867082c72f' @@ -8,7 +8,7 @@ VITE_WX_APPID = 'wx1bb161867082c72f' # macOS 示例: # WECHAT_DEVTOOLS_CLI_PATH = '/Applications/wechatwebdevtools.app/Contents/MacOS/cli' # Windows 示例: -# WECHAT_DEVTOOLS_CLI_PATH = 'C:\Program Files (x86)\Tencent\微信web开发者工具\cli.bat' +WECHAT_DEVTOOLS_CLI_PATH = 'D:\DevUtils\Tencent\微信web开发者工具\cli.bat' # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base # https://uniapp.dcloud.net.cn/collocation/manifest.html#h5-router @@ -21,13 +21,14 @@ VITE_APP_HALO_TOKEN = '' # 默认后台请求地址 # 不同命令会按 mode 叠加读取 .env.development / .env.test / .env.production。 # 微信小程序如果没有配置下面的专用地址,也会回退使用这个值。 -VITE_SERVER_BASEURL = 'http://localhost:8090' +# VITE_SERVER_BASEURL = 'http://localhost:8090' +VITE_SERVER_BASEURL = 'http://192.168.1.2:8090' # 微信小程序专用后台请求地址,按微信开发者工具 envVersion 区分。 # 不配置时会回退使用 VITE_SERVER_BASEURL。 -VITE_SERVER_BASEURL__WEIXIN_DEVELOP = '' -VITE_SERVER_BASEURL__WEIXIN_TRIAL = '' -VITE_SERVER_BASEURL__WEIXIN_RELEASE = '' +VITE_SERVER_BASEURL__WEIXIN_DEVELOP = 'http://192.168.1.2:8090' +VITE_SERVER_BASEURL__WEIXIN_TRIAL = 'http://192.168.1.2:8090' +VITE_SERVER_BASEURL__WEIXIN_RELEASE = 'http://192.168.1.2:8090' # h5是否需要配置代理 VITE_APP_PROXY_ENABLE = false diff --git a/env/.env.development b/env/.env.development index 866b6e6..01db420 100644 --- a/env/.env.development +++ b/env/.env.development @@ -9,4 +9,5 @@ VITE_SHOW_SOURCEMAP = false VITE_APP_HALO_TOKEN = '' # development mode 后台请求地址 -VITE_SERVER_BASEURL = 'http://localhost:8090' +# VITE_SERVER_BASEURL = 'http://localhost:8090' +VITE_SERVER_BASEURL = 'http://192.168.1.2:8090' diff --git a/src/App.ku.vue b/src/App.ku.vue index 8285888..60d3ee7 100644 --- a/src/App.ku.vue +++ b/src/App.ku.vue @@ -2,10 +2,13 @@ import { ref } from 'vue' import { isPageTabbar } from './tabbar/store' import { currRoute } from './utils' + import { useSettingsPopup } from '@/hooks/useSettingsPopup' import CustomTabbar from '@/tabbar/index.vue' const isCurrentPageTabbar = ref(true) const globalSettingsVisible = ref(false) + + const { settingsPopupVisible, openSettingsPopup } = useSettingsPopup() onShow(() => { const { path } = currRoute() if (path === '/') { @@ -21,10 +24,10 @@ - + - + diff --git a/src/api/types/uni-halo.ts b/src/api/types/uni-halo.ts index b18eda6..08b2033 100644 --- a/src/api/types/uni-halo.ts +++ b/src/api/types/uni-halo.ts @@ -112,8 +112,7 @@ export interface IPageConfig { categoryConfig?: { type?: string } momentConfig?: { useTagRandomColor?: boolean } galleryConfig?: { pageTitle?: string } - /** 恋爱日记页(插件端「通用配置 → 页面设置 → 恋爱日记」配置; - * 2026-09-11 起恋爱页背景图由 loveConfig.pageImages 迁入此处) */ + /** 恋爱日记页(插件端「通用配置 → 页面设置 → 恋爱日记」配置) */ loveDiaryConfig?: { pageTitle?: string /** 恋爱页背景图(留空客户端内置回退) */ @@ -188,10 +187,11 @@ export interface IAppConfig { } } /** - * 恋爱配置(入口显隐由模块入口开关 - * (ourStory/lovePhoto/loveDaily.enabled)与 navList 统一管理,客户端按模块开关判定) + * 恋爱配置(恋爱日记入口仅密码状态无开关;三模块入口自身即 app 端入口列表数据: + * title/subTitle/颜色(hex8)/iconBgColor/path/priority,按 priority 降序下发; + * app 端按模块 key 直接渲染入口列表,locked=passwordEnabled 且本地无有效 token) */ - loveConfig?: Record + loveConfig?: ILoveConfigGroup imagesConfig?: IImagesConfig /** * 博主与社交(blogger 含 @@ -482,13 +482,57 @@ export interface INoticeDetail { /* ---------- 恋爱模块(plugin-uni-halo love) ---------- */ -export interface ILoveConfig { - /** 纪念日 */ - anniversary?: string - /** 恋人信息 */ - lovers?: { - name?: string - avatar?: string +/** 恋爱模块入口(三模块共用;loveDiary 仅使用密码相关字段) */ +export interface ILoveModuleConfig { + /** 是否在恋爱页展示该模块入口(loveDiary 不使用:入口显隐由快捷导航/功能入口注册表控制) */ + enabled?: boolean + /** 入口名称(app 端入口列表标题) */ + title?: string + /** 入口副标题(app 端入口列表副标题) */ + subTitle?: string + /** 标题颜色(hex8 #rrggbbaa) */ + titleColor?: string + /** 副标题颜色(hex8 #rrggbbaa) */ + subTitleColor?: string + /** 图标背景色(hex8 #rrggbbaa) */ + iconBgColor?: string + /** 图标字体前缀(如 uhlove-icon,app 端渲染入口图标) */ + iconPrefix?: string + /** 图标名(app 端渲染入口图标) */ + icon?: string + /** app 端跳转路径 */ + path?: string + /** 排序字段(越大越靠前,插件端按 priority 降序输出) */ + priority?: number + /** 是否已设置密码(app 端据此显示锁定态:passwordEnabled && 本地无有效 token) */ + passwordEnabled?: boolean + [key: string]: unknown +} + +/** getConfigs loveConfig 组(恋爱日记仅密码状态;三模块入口即 app 端入口列表数据) */ +export interface ILoveConfigGroup { + /** 恋爱日记入口(恋爱页本身,仅密码状态,无 enabled 开关) */ + loveDiary?: Pick + /** 恋爱故事模块入口 */ + ourStory?: ILoveModuleConfig + /** 恋爱相册模块入口 */ + lovePhoto?: ILoveModuleConfig + /** 恋爱清单模块入口 */ + loveDaily?: ILoveModuleConfig + /** 恋爱信息(纪念日 + 恋人信息;经 getConfigs loveConfig.loveInfo 下发) */ + loveInfo?: { + /** 纪念日标题(默认「这是我们一起走过的」) */ + loveDateTitle?: string + /** 恋爱纪念日(yyyy-MM-dd),用于计算恋爱天数 */ + loveDate?: string + /** 男生昵称 */ + boyNickname?: string + /** 男生头像 */ + boyAvatar?: string + /** 女生昵称 */ + girlNickname?: string + /** 女生头像 */ + girlAvatar?: string [key: string]: unknown } [key: string]: unknown diff --git a/src/api/uni-halo.ts b/src/api/uni-halo.ts index a1e30d2..f250042 100644 --- a/src/api/uni-halo.ts +++ b/src/api/uni-halo.ts @@ -19,7 +19,6 @@ import type { ILoveAlbum, ILoveAlbumListReq, ILoveAlbumListRes, - ILoveConfig, ILoveDailyItem, ILoveDailyItemListReq, ILoveDailyItemListRes, @@ -201,19 +200,6 @@ export function getNoticeDetail(name: string) { /* ==================== 恋爱模块 ==================== */ -/** - * 获取恋爱配置(纪念日 + 恋人信息;恋爱日记入口 loveDiary 设密码时 - * 需携带模块解锁 token,未解锁返回 401 locked) - */ -export function getLoveConfig() { - const token = getLoveModuleToken('loveDiary') - return http.Get>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/love-config', { - params: token ? { token } : {}, - cacheFor: 0, - meta: { requestFrom: RequestFrom.Halo }, - }) -} - /** * 获取恋爱相册列表(lovePhoto 模块设密码时需携带模块解锁 token) */ diff --git a/src/components/uh-article-card/uh-article-card.vue b/src/components/uh-article-card/uh-article-card.vue index fe15ec0..1a600cb 100644 --- a/src/components/uh-article-card/uh-article-card.vue +++ b/src/components/uh-article-card/uh-article-card.vue @@ -38,11 +38,10 @@ const isGrid = computed(() => props.variant === 'grid') - /** 单一事实源:每种布局的完整形态,模板不再有任何 order / 条件分支 */ const CARD_LAYOUTS = computed(()=> ({ image_top: { container: `flex flex-col gap-y-2 ${isGrid.value ? '!p-0' : ''}`, - cover: `${isGrid.value ? 'rounded-lb-0 rounded-rb-0' : ''}`, + cover: `mb-1 ${isGrid.value ? 'rounded-lb-0 rounded-rb-0' : ''}`, contentWrapper: `box-border w-full ${isGrid.value ? 'p-2 pt-0' : ''}`, footer: 'flex items-center', authorGroup: 'flex-1 items-center justify-start gap-x-1', @@ -159,17 +158,16 @@ - - - + + {{ article.spec.title }} - + {{ article.status?.excerpt }} - + \ No newline at end of file diff --git a/src/components/uh-comment-list/uh-comment-list.vue b/src/components/uh-comment-list/uh-comment-list.vue index 75bfc2c..a22de15 100644 --- a/src/components/uh-comment-list/uh-comment-list.vue +++ b/src/components/uh-comment-list/uh-comment-list.vue @@ -146,13 +146,8 @@ - - Ծ‸Ծ 博主已设置该文章禁止评论! - - - - + + 暂无评论 diff --git a/src/components/uh-data-loading/uh-data-loading.vue b/src/components/uh-data-loading/uh-data-loading.vue index fd2aade..ad42a6f 100644 --- a/src/components/uh-data-loading/uh-data-loading.vue +++ b/src/components/uh-data-loading/uh-data-loading.vue @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/components/uh-glass-picker/uh-glass-picker.vue b/src/components/uh-glass-picker/uh-glass-picker.vue index f419974..ed9bfc4 100644 --- a/src/components/uh-glass-picker/uh-glass-picker.vue +++ b/src/components/uh-glass-picker/uh-glass-picker.vue @@ -1,118 +1,118 @@ + :deep(.wd-popup--bottom) { + left: 24rpx; + bottom: 24rpx; + right: 24rpx; + } + \ No newline at end of file diff --git a/src/components/uh-glass-popup/uh-glass-popup.vue b/src/components/uh-glass-popup/uh-glass-popup.vue index c69626f..2092050 100644 --- a/src/components/uh-glass-popup/uh-glass-popup.vue +++ b/src/components/uh-glass-popup/uh-glass-popup.vue @@ -1,9 +1,30 @@ + + .uh-glass-popup-panel--top { + top: 0; + left: 0; + right: 0; + } + + .uh-glass-popup-panel--bottom { + left: 24rpx; + bottom: 24rpx; + right: 24rpx; + } + + .uh-glass-popup-panel--left { + left: 0; + top: 0; + bottom: 0; + } + + .uh-glass-popup-panel--right { + right: 0; + top: 0; + bottom: 0; + } + + /* 位置自适应圆角(round) */ + .uh-glass-popup-panel--bottom.is-round { + border-radius: 16rpx 16rpx 0 0; + } + + .uh-glass-popup-panel--top.is-round { + border-radius: 0 0 16rpx 16rpx; + } + + .uh-glass-popup-panel--left.is-round { + border-radius: 0 16rpx 16rpx 0; + } + + .uh-glass-popup-panel--right.is-round { + border-radius: 16rpx 0 0 16rpx; + } + + .uh-glass-popup-panel--center.is-round { + border-radius: 16rpx; + } + + /* 动画帧(enter 与 leave-to) */ + .uh-glass-popup-anim--slide-up-enter, + .uh-glass-popup-anim--slide-up-leave-to { + transform: translate3d(0, 100%, 0); + } + + .uh-glass-popup-anim--slide-down-enter, + .uh-glass-popup-anim--slide-down-leave-to { + transform: translate3d(0, -100%, 0); + } + + .uh-glass-popup-anim--slide-left-enter, + .uh-glass-popup-anim--slide-left-leave-to { + transform: translate3d(-100%, 0, 0); + } + + .uh-glass-popup-anim--slide-right-enter, + .uh-glass-popup-anim--slide-right-leave-to { + transform: translate3d(100%, 0, 0); + } + + .uh-glass-popup-anim--zoom-in-enter, + .uh-glass-popup-anim--zoom-in-leave-to { + opacity: 0; + transform: scale(0.8); + } + + .uh-glass-popup-anim--fade-enter, + .uh-glass-popup-anim--fade-leave-to { + opacity: 0; + } + + /* 动画激活态(transition-property) */ + .uh-glass-popup-anim--slide-up-enter-active, + .uh-glass-popup-anim--slide-up-leave-active, + .uh-glass-popup-anim--slide-down-enter-active, + .uh-glass-popup-anim--slide-down-leave-active, + .uh-glass-popup-anim--slide-left-enter-active, + .uh-glass-popup-anim--slide-left-leave-active, + .uh-glass-popup-anim--slide-right-enter-active, + .uh-glass-popup-anim--slide-right-leave-active { + transition-property: transform; + } + + .uh-glass-popup-anim--zoom-in-enter-active, + .uh-glass-popup-anim--zoom-in-leave-active, + .uh-glass-popup-anim--fade-enter-active, + .uh-glass-popup-anim--fade-leave-active { + transition-property: opacity, transform; + } + + /* center 缩放需叠加居中位移 */ + .uh-glass-popup-panel--center.uh-glass-popup-anim--zoom-in-enter, + .uh-glass-popup-panel--center.uh-glass-popup-anim--zoom-in-leave-to { + transform: scale(0.8) translate3d(-50%, -50%, 0); + } + + /* 右上角关闭按钮 */ + .uh-glass-popup__close { + position: absolute; + top: 32rpx; + right: 32rpx; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + width: 48rpx; + height: 48rpx; + } + + .uh-glass-popup__close-icon { + font-size: 48rpx; + line-height: 1; + color: rgb(0 0 0 / 45%); + } + \ No newline at end of file diff --git a/src/components/uh-glass-popup/uh-glass-popup.vue.bak b/src/components/uh-glass-popup/uh-glass-popup.vue.bak new file mode 100644 index 0000000..fd75e00 --- /dev/null +++ b/src/components/uh-glass-popup/uh-glass-popup.vue.bak @@ -0,0 +1,113 @@ + + + + + diff --git a/src/components/uh-global-actions/uh-global-actions.vue b/src/components/uh-global-actions/uh-global-actions.vue index 868a09b..25ff94f 100644 --- a/src/components/uh-global-actions/uh-global-actions.vue +++ b/src/components/uh-global-actions/uh-global-actions.vue @@ -1,5 +1,9 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/components/uh-home-category/uh-home-category.vue b/src/components/uh-home-category/uh-home-category.vue index 197486d..f1818e2 100644 --- a/src/components/uh-home-category/uh-home-category.vue +++ b/src/components/uh-home-category/uh-home-category.vue @@ -75,8 +75,8 @@ \ No newline at end of file diff --git a/src/components/uh-links-site-apply/uh-links-site-apply.vue b/src/components/uh-links-site-apply/uh-links-site-apply.vue index 910344e..61b11ed 100644 --- a/src/components/uh-links-site-apply/uh-links-site-apply.vue +++ b/src/components/uh-links-site-apply/uh-links-site-apply.vue @@ -1,202 +1,186 @@