见物于寻常处,
见生活。
+ 记下家里的东西,下次找它,知道从哪里找起。
+diff --git a/.drone.yml b/.drone.yml index 9d2c794..95f45eb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,6 +33,11 @@ steps: commands: - npm --prefix apps/pc ci --no-audit --no-fund - npm --prefix apps/pc run build + - name: build-h5 + image: node:24-alpine + commands: + - npm --prefix apps/h5 ci --no-audit --no-fund + - npm --prefix apps/h5 run build trigger: event: [push, pull_request, tag] diff --git a/apps/README.md b/apps/README.md index f7a6dd8..89acb50 100644 --- a/apps/README.md +++ b/apps/README.md @@ -2,7 +2,7 @@ | 路径 | 构建目标 | 制品名 | | --- | --- | --- | -| `h5/` | uni-app 移动网页 | `item-atlas-h5` | +| [h5/](h5/README.md) | uni-app 移动网页 | `item-atlas-h5` | | [pc/](pc/README.md) | 桌面浏览器网页 | `item-atlas-pc` | | [admin/](admin/README.md) | 管理后台 | `item-atlas-admin` | | [ios/](ios/README.md) | iOS 原生应用 | 见物 | diff --git a/apps/h5/.dockerignore b/apps/h5/.dockerignore new file mode 100644 index 0000000..79416de --- /dev/null +++ b/apps/h5/.dockerignore @@ -0,0 +1,4 @@ +node_modules +dist +.env* +.gitignore diff --git a/apps/h5/.gitignore b/apps/h5/.gitignore new file mode 100644 index 0000000..f4650bb --- /dev/null +++ b/apps/h5/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env.local +.env.*.local diff --git a/apps/h5/Dockerfile b/apps/h5/Dockerfile new file mode 100644 index 0000000..14f2e22 --- /dev/null +++ b/apps/h5/Dockerfile @@ -0,0 +1,11 @@ +FROM node:24-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY . . +RUN npm run build + +FROM nginx:1.31-alpine +ENV ATLAS_GATEWAY_URL=http://item-atlas-gateway:8080 +COPY nginx.conf.template /etc/nginx/templates/default.conf.template +COPY --from=build /app/dist/build/h5 /usr/share/nginx/html diff --git a/apps/h5/README.md b/apps/h5/README.md new file mode 100644 index 0000000..964a0e1 --- /dev/null +++ b/apps/h5/README.md @@ -0,0 +1,27 @@ +# 见物移动网页 + +在手机浏览器中使用现有见物账号,空间、位置和物品与 iOS 和 PC 共用。找物支持按名称、别名和位置搜。位置页可以逐层查看,已有下级时可汇总其中的物品。录入提供表单和文字批量草稿,存放位置可留空。 + +物品详情支持编辑、移位、收藏及照片。拍照和相册统一进入裁剪,输入上限 30 MiB,输出最长边 1440 像素、上限 5 MiB。上传后显示服务端的缩略图,点开读取原图。照片写入、删除和清理走现有物品接口。能否直接调起摄像头取决于浏览器和设备。 + +## 本地启动 + +使用 Node.js 24。工作目录为仓库根目录。 + +```sh +npm --prefix apps/h5 ci +npm --prefix apps/h5 run dev -- --port 4180 +``` + +打开 `http://127.0.0.1:4180`。开发代理默认为已开通的 PC 公网入口,也可以用 `ATLAS_GATEWAY_URL` 指定目标网关。会话保留在页面内存中,整页刷新后重新登录。 + +## 构建镜像 + +```sh +npm --prefix apps/h5 run build +docker build -t item-atlas-h5:0.1.0 apps/h5 +``` + +产物位于 `dist/build/h5`,路由使用 URL 的片段。Nginx 容器监听 8080,健康检查用 `/healthz`,通过同源 `/api` 访问内部网关。Drone 的 `build-h5` 步骤执行依赖锁定和构建检查。 + +[H5 工程模板](https://uniapp.dcloud.net.cn/quickstart-cli.html) · [客户端架构](../../docs/architecture/clients.md) diff --git a/apps/h5/index.html b/apps/h5/index.html new file mode 100644 index 0000000..ac93d5f --- /dev/null +++ b/apps/h5/index.html @@ -0,0 +1,14 @@ + + +
+ + + + +{{ error }}
+还没有照片
+
见物记下家里的东西,下次找它,知道从哪里找起。
+
见物{{ topError }}
+正在读取空间…
+ +{{ placesError }}
+正在读取位置…
+{{ listError }}
+正在读取物品…
+{{ activeSpace.name }} · {{ roleLabel(activeSpace) }}
正在读取物品…
+ +{{ error }}
+ + + +正在读取物品…
+{{ error }}
+ +数量 {{ info.item.quantity }}