diff --git a/.agents/skills/uni-halo/SKILL.md b/.agents/skills/uni-halo/SKILL.md new file mode 100644 index 0000000..a34d734 --- /dev/null +++ b/.agents/skills/uni-halo/SKILL.md @@ -0,0 +1,720 @@ +--- +name: uni-halo +description: 提供 uni-halo 项目开发规范,包括目录分层、类型定义、alova API 约定、页面/组件/样式规范、请求 hooks 与完整示例代码。 +license: Complete terms in LICENSE.txt +--- + +# uni-halo 开发规范 + +> 本技能是 uni-halo 项目的「开发手册」:所有规范均提炼自本仓库真实代码(`src/` 目录), +> 写代码前先读本文,能减少返工、保持全库风格统一。 + +## 什么时候使用这个技能 + +- 在本项目**新建或修改页面**(判断放 `src/pages/` 还是 `src/pages-blog/` 等分包、命名、`definePage` 写法) +- 在本项目**开发业务或通用组件**(`uh-` 前缀、组件内部结构、事件命名) +- **定义或修改 API**(约定使用 alova,格式、`meta` 传参、类型文件位置) +- **定义或修改类型**(`src/api/types/` 下的接口与请求/响应类型) +- **使用通用配置**(`src/config/` 的 appConfig / appSettings / haloGlobal / markdown) +- **页面数据请求**(`useDataLoading` / `useRequest` hooks + `uh-data-loading` 组件) +- **处理多平台差异**(H5 / 微信小程序 / APP,条件编译) + +## 三条铁律(先记住) + +1. **生成物不手改**:`src/pages.json`、`src/manifest.json`、`src/types/*.d.ts` 均由 + `*.config.ts` / `definePage` / 插件自动生成,手改会在下次构建被覆盖。 + 页面路由写在页面内 `definePage` 宏里,不写进 `pages.config.ts`。 +2. **平台差异只用条件编译**:`#ifdef H5 / #ifdef MP-WEIXIN / #ifdef APP-PLUS`, + 编译期能确定的不留到运行时;运行时判断仅用于编译期无法确定的场景。 +3. **UI 优先原子类**:先 UnoCSS 原子类,再自定义 CSS(` +``` + +**约定**: + +- `IProps` 接口定义 props,`withDefaults` 提供默认值;props 用 JSDoc 注释说明用途 +- 事件命名 `on-xxx`(如 `on-refresh`、`on-vote-success`),模板里 `@on-refresh` +- 通用样式优先 unocss 原子类;动画/复杂状态用 ` + /* 页脚 */ + .foot { + margin-top: 12rpx; + display: flex; + flex-direction: column; + align-items: center; + } + + .foot .sticker { + font-size: 44rpx; + padding: 14rpx 22rpx; + } + + .foot-text { + margin-top: 18rpx; + font-size: 21rpx; + color: $ink3; + font-weight: 500; + text-align: center; + line-height: 1.7; + } + + /* Toast */ + .toast { + position: fixed; + left: 50%; + bottom: calc(72rpx + env(safe-area-inset-bottom)); + transform: translateX(-50%); + padding: 18rpx 36rpx; + border-radius: 999rpx; + font-size: 24rpx; + font-weight: 700; + color: #fff; + background: linear-gradient(150deg, #3a3e44 0%, #1d1f22 55%, #151619 100%); + box-shadow: + 0 10rpx 28rpx -10rpx rgba(21, 23, 25, 0.4), + 0 12rpx 36rpx -10rpx $glow, + inset 0 2rpx 0 rgba(255, 255, 255, 0.16); + white-space: nowrap; + z-index: 60; + } + + :deep(img) { + max-width: 100%; + border-radius: 8rpx; + } + \ No newline at end of file diff --git a/src/pages/tabbar/home/home.vue b/src/pages/tabbar/home/home.vue index 49eba8d..98ef5f6 100644 --- a/src/pages/tabbar/home/home.vue +++ b/src/pages/tabbar/home/home.vue @@ -1,239 +1,236 @@ + + + + + + + + + {{ loadMoreText }} + + + + + + + + + \ No newline at end of file