commit d1b4e518f2300a5cbe67733494bd9bab97b32b50 Author: van Date: Wed Jun 10 17:05:54 2026 +0800 1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9751508 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +Thumbs.db +*.log +.idea/ +.vscode/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b70977 --- /dev/null +++ b/README.md @@ -0,0 +1,87 @@ +# open-jd-web + +京东跟团查询独立静态站点,部署在 `jd.van333.cn` 等专用域名。 + +不依赖 ruoyi-vue 整站打包,单 HTML + CDN,仅通过 API 连接 Jarvis 后端。 + +## 功能 + +- 订单跟团查询页 +- 接口:`GET /jarvis-api/open/jd/queryTkOrder?orderId=xxx&t=xxx` +- URL 参数 `t`:推广标识(可选,仅保留在链接中) + +## 目录 + +``` +open-jd-web/ + index.html # 主页面 + config.js # API 前缀配置 + config.example.js # 配置示例 + nginx.conf.example # Nginx 参考配置 + README.md +``` + +## 本地预览 + +直接用浏览器打开 `index.html` 无法调接口(跨域)。本地调试可: + +```bash +# Python 简易静态服务 +python -m http.server 8080 +``` + +同时需要 Nginx 或 dev 代理把 `/jarvis-api` 转到后端。 + +## 部署到新服务器(jd.van333.cn) + +### 1. 上传文件 + +将整个目录内容上传到服务器,例如: + +``` +/www/sites/jd.van333.cn/index/ + index.html + config.js +``` + +### 2. Nginx + +参考 `nginx.conf.example`: + +- 静态文件走本地 `root` +- `/jarvis-api/open/jd/` 反代到 `https://jarvis.van333.cn` + +### 3. 访问地址 + +``` +https://jd.van333.cn/?t=TBA224A9B6F +https://jd.van333.cn/open/jd/promoter?t=TBA224A9B6F +``` + +## 配置 + +编辑 `config.js`: + +```js +window.OPEN_JD_CONFIG = { + apiBase: '/jarvis-api' // 同域反代,推荐 +} +``` + +## Git 托管 + +```bash +cd open-jd-web +git init +git add . +git commit -m "init: 京东跟团查询独立静态站" +``` + +## 与 ruoyi-vue 的关系 + +| 项目 | 用途 | +|------|------| +| `open-jd-web` | 专用域名静态部署(本仓库) | +| `ruoyi-vue` `/open/jd/promoter` | 可选,jarvis 主站内嵌同功能 | + +专用域名请优先使用本仓库部署。 diff --git a/config.example.js b/config.example.js new file mode 100644 index 0000000..69e3f4a --- /dev/null +++ b/config.example.js @@ -0,0 +1,7 @@ +// 复制为 config.js 后按环境修改 +window.OPEN_JD_CONFIG = { + // 同域反代(推荐) + apiBase: '/jarvis-api' + // 直连后端(需后端开 CORS,一般不推荐): + // apiBase: 'https://jarvis.van333.cn/jarvis-api' +} diff --git a/config.js b/config.js new file mode 100644 index 0000000..d584c9b --- /dev/null +++ b/config.js @@ -0,0 +1,4 @@ +// 部署时可修改 API 前缀;默认同域反代 /jarvis-api +window.OPEN_JD_CONFIG = { + apiBase: '/jarvis-api' +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..4197608 --- /dev/null +++ b/index.html @@ -0,0 +1,279 @@ + + + + + + 跟团查询 + + + + +
+
+ + +
+ +
+
+
+ +
{{ item.shopName }}
+
+
+
+ {{ item.orderSource }} + {{ item.traceTypeStr }} +
+
+
+
父单编号:{{ item.parentId }}
+
+
+
订单编号:{{ item.orderId }}
+
{{ item.validCodeMsg }}
+
+
+ +
+
+
{{ item.skuName }}
+
商品单ID:{{ item.itemId }}
+
+ 共{{ item.skuNum }}件 + 实付 ¥{{ item.cosPrice }} +
+
+
+ +
+
+ +
{{ errText }}
+ + +
+ + + + + + diff --git a/nginx.conf.example b/nginx.conf.example new file mode 100644 index 0000000..2f2e594 --- /dev/null +++ b/nginx.conf.example @@ -0,0 +1,42 @@ +# jd.van333.cn 独立静态站 + API 反代到 jarvis 旧服 +# 将 root 改为实际部署目录 + +server { + listen 80; + server_name jd.van333.cn; + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name jd.van333.cn; + + root /www/sites/jd.van333.cn/index; + index index.html; + + ssl_certificate /opt/1panel/apps/openresty/openresty/www/common/ssl/jd.van333.cn/fullchain.cer; + ssl_certificate_key /opt/1panel/apps/openresty/openresty/www/common/ssl/jd.van333.cn.key; + + # 仅反代查询接口到旧服 + location ^~ /jarvis-api/open/jd/ { + proxy_pass https://jarvis.van333.cn/jarvis-api/open/jd/; + proxy_ssl_server_name on; + proxy_set_header Host jarvis.van333.cn; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # 兼容旧链接 /open/jd/promoter + location = /open/jd/promoter { + try_files /index.html =404; + } + + location = / { + try_files /index.html =404; + } + + location / { + try_files $uri $uri/ /index.html; + } +}