commit d703ac357466da6aa88ea671f981127f80a36cdf Author: 绝尘 <237809796@qq.com> Date: Thu Jan 22 18:31:30 2026 +0800 . diff --git a/DEPLOY.md b/DEPLOY.md new file mode 100644 index 0000000..d9d285f --- /dev/null +++ b/DEPLOY.md @@ -0,0 +1,139 @@ +# flux-web 部署指南 + +本项目**无需编译**,可直接部署源码。 + +## 📝 部署前准备 + +### 1. 修改 API 地址 + +编辑 `src/js/config/api.config.js`: + +```javascript +BASE_URL: 'https://your-api-domain.com', // 改成你的API地址 +``` + +### 2. 关闭调试模式 + +编辑 `src/js/config/app.config.js`: + +```javascript +ENABLED: false, // 改成 false +``` + +--- + +## 🚀 三种部署方式 + +### 方式一:Nginx 部署(推荐) + +**第1步:上传文件** + +```bash +# 上传到服务器 +/var/www/flux-web/ +``` + +**第2步:创建配置文件** + +```bash +# 复制示例配置 +cp nginx.conf.example /etc/nginx/sites-available/flux-web + +# 修改配置中的域名和路径 +vim /etc/nginx/sites-available/flux-web +``` + +**第3步:启用站点** + +```bash +# 创建软链接 +ln -s /etc/nginx/sites-available/flux-web /etc/nginx/sites-enabled/ + +# 测试配置 +nginx -t + +# 重载 +systemctl reload nginx +``` + +**第4步:配置 HTTPS(可选)** + +```bash +# 安装 certbot +apt install certbot python3-certbot-nginx + +# 获取证书 +certbot --nginx -d your-domain.com +``` + +--- + +### 方式二:Node.js 服务器 + +```bash +# 安装 PM2 +npm install -g pm2 + +# 启动服务 +pm2 start server.js --name flux-web + +# 设置开机自启 +pm2 startup +pm2 save +``` + +--- + +### 方式三:对象存储 + CDN + +适合阿里云 OSS、腾讯云 COS 等: + +1. 在控制台上传整个 `flux-web` 目录 +2. 配置 CDN 加速 +3. 绑定自定义域名 + +--- + +## ✅ 部署后检查 + +访问你的域名,确认: + +- ✓ 页面正常显示 +- ✓ 样式加载正常 +- ✓ 浏览器控制台无报错 +- ✓ API 请求成功(F12 查看 Network) + +--- + +## 🔄 更新项目 + +```bash +# 备份 +cp -r /var/www/flux-web /var/www/flux-web.backup + +# 上传新文件覆盖即可 +``` + +--- + +## ❓ 常见问题 + +**Q: 页面空白?** +A: 检查浏览器控制台(F12)查看报错信息 + +**Q: API 请求失败?** +A: 检查 `src/js/config/api.config.js` 中的 API 地址是否正确 + +**Q: 静态资源 404?** +A: 确认 `static/` 和 `src/` 目录都已上传 + +**Q: 如何清除缓存?** +A: 修改 `index.html` 中 CSS/JS 引用,加版本号:`style.css?v=2` + +--- + +## 📞 需要帮助? + +- 查看详细配置:`nginx.conf.example` +- 项目说明:`README.md` +- 模块化文档:`src/js/README.md` diff --git a/README.md b/README.md new file mode 100644 index 0000000..053a881 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# flux-web + +薇钱包 H5 前端项目 - 纯前端,无需编译 + +## 🚀 快速开始 + +### 开发 + +```bash +node server.js +# 访问 http://localhost:3000 +``` + +### 部署 + +**无需编译**,直接部署源码即可。查看 [DEPLOY.md](./DEPLOY.md) + +## 📁 项目结构 + +``` +flux-web/ +├── index.html # 主页面 +├── basic-info.html # 基本信息页面 +├── style.css / basic-info.css # 样式文件 +├── src/js/ # JavaScript 模块 +│ ├── config/ # 配置 +│ ├── core/ # 核心 +│ ├── services/ # 业务服务 +│ ├── ui/ # UI 组件 +│ ├── utils/ # 工具 +│ └── pages/ # 页面逻辑 +└── static/ # 静态资源 +``` + +## ⚙️ 配置 + +### 修改 API 地址 + +`src/js/config/api.config.js`: + +```javascript +BASE_URL: 'http://localhost:8071', // 改成你的API地址 +``` + +### 关闭调试模式 + +`src/js/config/app.config.js`: + +```javascript +ENABLED: false, // 生产环境改为 false +``` + +## 📦 部署方式 + +- **Nginx** - 推荐,查看 `nginx.conf.example` +- **Node.js** - 使用 PM2:`pm2 start server.js` +- **对象存储** - 阿里云 OSS / 腾讯云 COS + +详细步骤:[DEPLOY.md](./DEPLOY.md) + +## 📖 文档 + +- [部署指南](./DEPLOY.md) +- [模块化说明](./src/js/README.md) +- [极光配置](./docs/jverify-configuration.md) + +--- + +北京百雅科技有限公司 © 2025 diff --git a/basic-info.css b/basic-info.css new file mode 100644 index 0000000..f2f600b --- /dev/null +++ b/basic-info.css @@ -0,0 +1,932 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; + background-color: #f5f5f5; + color: #333; + font-size: 14px; + line-height: 1.5; +} + +.basic-info-container { + min-height: 100vh; + padding: 16px; + padding-bottom: 100px; +} + +/* 顶部卡片 */ +.top-card { + width: 100%; + height: 142px; + background-image: url('./static/image/personalTop.png'); + background-size: 100% 100%; + background-position: center; + background-repeat: no-repeat; + border-radius: 12px; + padding: 16px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); + margin-bottom: -8px; + position: relative; + z-index: 1; +} + +.top-title { + font-size: 12px; + font-weight: 600; + color: #fff; + /*margin-bottom: 4px;*/ +} + +.top-money { + font-size: 42px; + color: #fff; + font-weight: 700; + margin: -5px 0; +} + +.top-text { + font-size: 12px; + font-weight: 400; + color: #fff; + margin-top: 2px; +} + +.progress-wrapper { + display: flex; + align-items: center; + margin-top: 4px; +} + +.progress-bar { + flex: 1; + height: 8px; + background-color: rgba(255, 255, 255, 0.3); + border-radius: 50px; + margin-right: 5px; + overflow: hidden; + position: relative; +} + +.progress-fill { + height: 100%; + background: linear-gradient(90deg, #19be6b, #1dd87a, #19be6b); + background-size: 200% 100%; + border-radius: 50px; + width: 0%; + transition: width 0.5s ease; + position: relative; + overflow: hidden; + -webkit-animation: progressPulse 2s ease-in-out infinite, progressGradient 3s ease infinite; + animation: progressPulse 2s ease-in-out infinite, progressGradient 3s ease infinite; +} + +.progress-fill::after { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.3), + transparent + ); + -webkit-animation: shimmer 2s infinite; + animation: shimmer 2s infinite; +} + +@-webkit-keyframes shimmer { + 0% { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } + 100% { + -webkit-transform: translateX(100%); + transform: translateX(100%); + } +} + +@keyframes shimmer { + 0% { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } + 100% { + -webkit-transform: translateX(100%); + transform: translateX(100%); + } +} + +@-webkit-keyframes progressPulse { + 0%, 100% { + -webkit-box-shadow: 0 0 0 0 rgba(25, 190, 107, 0.4); + box-shadow: 0 0 0 0 rgba(25, 190, 107, 0.4); + } + 50% { + -webkit-box-shadow: 0 0 0 4px rgba(25, 190, 107, 0); + box-shadow: 0 0 0 4px rgba(25, 190, 107, 0); + } +} + +@keyframes progressPulse { + 0%, 100% { + -webkit-box-shadow: 0 0 0 0 rgba(25, 190, 107, 0.4); + box-shadow: 0 0 0 0 rgba(25, 190, 107, 0.4); + } + 50% { + -webkit-box-shadow: 0 0 0 4px rgba(25, 190, 107, 0); + box-shadow: 0 0 0 4px rgba(25, 190, 107, 0); + } +} + +@-webkit-keyframes progressGradient { + 0% { + background-position: 0% 50%; + } + 50% { + background-position: 100% 50%; + } + 100% { + background-position: 0% 50%; + } +} + +@keyframes progressGradient { + 0% { + background-position: 0% 50%; + } + 50% { + background-position: 100% 50%; + } + 100% { + background-position: 0% 50%; + } +} + +.progress-text { + color: #fff; + font-size: 14px; + font-weight: 500; + min-width: 40px; + text-align: right; +} + +/* 资产信息区域 */ +.asset-section { + background-color: #fff; + border-radius: 8px; + margin-top: 0; + padding: 0; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); +} + +.asset-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px; + border-bottom: 1px solid #efefef; + cursor: pointer; +} + +.asset-title { + font-size: 16px; + color: #854a19; + font-weight: 500; + display: flex; + align-items: center; +} + +.asset-icon { + width: 22px; + height: 22px; + margin-right: 9px; + display: inline-block; + background-color: #fff; + border-radius: 4px; +} + +.asset-arrow { + width: 20px; + height: 20px; + color: #999; + font-size: 16px; + display: flex; + align-items: center; + justify-content: center; +} + +.section-arrow { + width: 20px; + height: 20px; + display: inline-block; + background-color: #fff; + border-radius: 4px; +} + +.asset-list { + padding: 0; +} + +.asset-item { + padding: 9px 16px; + font-size: 14px; + border-bottom: 1px solid #f5f5f5; + opacity: 0; + transform: translateY(10px); + transition: opacity 0.5s ease, transform 0.5s ease; + display: none; +} + +.asset-item.show { + display: block; + opacity: 1; + transform: translateY(0); +} + +.asset-item:last-child { + border-bottom: none; +} + +.item-top { + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; +} + +.item-name { + color: #333; + font-size: 14px; + font-weight: 500; + display: flex; + align-items: center; + margin-right: 7px; +} + +.item-value { + display: flex; + align-items: center; + color: #999; + font-size: 14px; +} + +.item-value.selected { + color: #333; +} + +.item-icon { + width: 20px; + height: 20px; + margin-left: 8px; + display: inline-block; + background-color: #fff; + border-radius: 4px; + flex-shrink: 0; +} + +.item-options { + margin-top: 12px; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + gap: 8px; + max-height: 100px; + overflow: hidden; + transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), + margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1), + opacity 0.3s ease, + padding 0.4s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 1; + padding: 0; +} + +.asset-item.collapsed .item-options { + max-height: 0 !important; + margin-top: 0 !important; + opacity: 0; + padding: 0 !important; +} + +.option-btn { + flex: 1; + min-width: 40%; + height: 30px; + line-height: 30px; + text-align: center; + background: #f5f5f5; + border-radius: 4px; + color: #777; + font-size: 12px; + font-weight: 500; + border: none; + cursor: pointer; + transition: all 0.3s ease; +} + +.option-btn:hover { + background: #e8e8e8; +} + +.option-btn.selected { + background: #3474fe; + color: #fff; +} + +.option-btn:active { + transform: scale(0.98); +} + +/* 基本信息区域 */ +.basic-info-section { + background-color: #fff; + border-radius: 8px; + margin-top: 16px; + padding: 0; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); + opacity: 0; + transform: translateY(20px); + transition: opacity 0.5s ease, transform 0.5s ease; +} + +.basic-info-section.show { + opacity: 1; + transform: translateY(0); +} + +.basic-info-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px; + border-bottom: 1px solid #efefef; + cursor: pointer; +} + +.basic-info-title { + font-size: 16px; + color: #854a19; + font-weight: 500; + display: flex; + align-items: center; +} + +.basic-info-icon { + width: 22px; + height: 22px; + margin-right: 9px; + display: inline-block; +} + +.basic-info-arrow { + width: 20px; + height: 20px; + color: #999; + font-size: 12px; + display: flex; + align-items: center; + justify-content: center; + transition: transform 0.3s ease; +} + +.basic-info-list { + padding: 0; +} + +/* 基本信息项行样式 */ +.basic-info-item-row { + padding: 12px 16px; + border-bottom: 1px solid #f5f5f5; +} + +.basic-info-item-row:last-child { + border-bottom: none; +} + +.basic-info-item-row .item-top { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0; +} + +.basic-info-item-row .item-name { + color: #333; + font-size: 14px; + font-weight: 500; +} + +.basic-info-item-row .item-value { + color: #999; + font-size: 14px; + display: flex; + align-items: center; + flex: 1; +} + +.basic-info-item-row .item-value-text { + flex: 1; + text-align: left; +} + +.basic-info-item-row .item-icon { + margin-left: auto; + flex-shrink: 0; +} + +.basic-info-item-row .item-value.selected { + color: #333; +} + +.basic-info-item-row .item-icon { + width: 20px; + height: 20px; + margin-left: 8px; + display: inline-block; + background-color: #fff; + border-radius: 4px; + flex-shrink: 0; +} + +/* 内联输入框样式 */ +.basic-input-inline { + flex: 1; + height: 32px; + padding: 0 8px; + font-size: 14px; + color: #333; + background-color: transparent; + border: none; + outline: none; + text-align: left; +} + +.basic-input-inline::placeholder { + color: #999; + text-align: left; +} + +.basic-input-inline:focus { + color: #333; +} + +.basic-info-item-row .item-top { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0; + min-height: 32px; +} + +/* 城市字段的值居左显示 */ +.basic-info-item-row#basic-info-city .item-top { + justify-content: flex-start; + gap: 8px; +} + +.basic-info-item-row#basic-info-city .item-value { + flex: 1; +} + +.basic-info-item-row#basic-info-city .item-value-text { + flex: 1; + text-align: left; +} + +.basic-info-item-row#basic-info-city .item-icon { + margin-left: auto; + flex-shrink: 0; +} + +/* 输入框样式 */ +.basic-input { + width: 100%; + height: 36px; + padding: 0 12px; + font-size: 14px; + color: #333; + background-color: #f5f5f5; + border: 1px solid transparent; + border-radius: 4px; + outline: none; + transition: all 0.3s ease; + margin-bottom: 8px; +} + +.basic-input:focus { + background-color: #fff; + border-color: #3474fe; +} + +.confirm-btn { + width: 100%; + height: 32px; + line-height: 32px; + text-align: center; + background: #3474fe; + border-radius: 4px; + color: #fff; + font-size: 12px; + font-weight: 500; + border: none; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn:hover { + background: #2563eb; +} + +.confirm-btn:active { + transform: scale(0.98); +} + +/* 底部按钮 */ +.button-section { + position: fixed; + bottom: 20px; + left: 0; + width: 100%; + padding: 16px; + padding-bottom: calc(8px + env(safe-area-inset-bottom)); + background-color: #fff; + box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, 0.08); + z-index: 100; +} + +/* 协议行 */ +.agreement-row { + display: flex; + align-items: center; + gap: 8px; + font-size: 12px; + color: #666; + margin-bottom: 10px; + line-height: 1.4; +} + +.agreement-checkbox { + display: flex; + align-items: center; + gap: 6px; + flex-shrink: 0; + cursor: pointer; +} + +.agreement-checkbox input[type="checkbox"] { + width: 12px; + height: 12px; + margin: 0; +} + +.agreement-links { + color: #2e6df6; + display: inline-block; +} + +.submit-btn { + width: 100%; + height: 48px; + line-height: 48px; + color: #fff; + font-size: 18px; + text-align: center; + background: #3474fe; + border: none; + border-radius: 25px; + cursor: pointer; + transition: all 0.3s ease; +} + +.submit-btn:disabled { + background: #c8c9cc; + cursor: not-allowed; +} + +.submit-btn:not(:disabled):active { + opacity: 0.9; + transform: scale(0.98); +} + +/* 动画效果 */ +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +.asset-item.show { + animation: fadeInUp 0.5s ease forwards; +} + +/* 城市选择器模态框 */ +.city-picker-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + display: none; +} + +.city-picker-modal.show { + display: block; +} + +.city-picker-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); +} + +.city-picker-content { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + background-color: #f5f5f5; + border-radius: 16px 16px 0 0; + max-height: 70vh; + display: flex; + flex-direction: column; + animation: slideUp 0.3s ease; +} + +@keyframes slideUp { + from { + transform: translateY(100%); + } + to { + transform: translateY(0); + } +} + +.city-picker-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px; + border-bottom: 1px solid #e5e5e5; + background-color: #fff; +} + +.city-picker-btn { + background: none; + border: none; + font-size: 16px; + padding: 8px 16px; + cursor: pointer; + transition: opacity 0.3s ease; +} + +.city-picker-btn:active { + opacity: 0.6; +} + +.city-picker-cancel { + color: #333; +} + +.city-picker-confirm { + color: #3474fe; + font-weight: 500; +} + +.city-picker-body { + display: flex; + flex: 1; + overflow: hidden; + background-color: #f5f5f5; +} + +.city-picker-column { + flex: 1; + overflow-y: auto; + background-color: #fff; +} + +.city-picker-column:first-child { + border-right: 1px solid #e5e5e5; +} + +.city-picker-item { + padding: 12px 16px; + font-size: 14px; + color: #333; + cursor: pointer; + transition: background-color 0.2s ease; + border-bottom: 1px solid #f5f5f5; +} + +.city-picker-item:active { + background-color: #f0f0f0; +} + +.city-picker-item.active { + background-color: #f5f5f5; + color: #333; + font-weight: 500; +} + +body.modal-open { + overflow: hidden; +} + +/* Toast 提示样式 */ +.toast { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: rgba(0, 0, 0, 0.8); + color: #fff; + padding: 12px 24px; + border-radius: 8px; + font-size: 14px; + z-index: 10000; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; + pointer-events: none; + max-width: 80%; + text-align: center; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); +} + +.toast.show { + opacity: 1; + visibility: visible; + transform: translate(-50%, -50%) scale(1); +} + +.toast-content { + line-height: 1.5; +} + +/* 基本信息错误提示 */ +.basic-info-error { + font-size: 12px; + color: #ff4444; + margin-top: 4px; + padding-left: 0; + text-align: right; +} + +.basic-input-inline.error { + color: #ff4444; + border-bottom: 1px solid #ff4444; + background-color: #fff5f5; +} + +/* 协议提示弹窗样式 */ +.modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + backdrop-filter: blur(4px); + display: none; + align-items: center; + justify-content: center; + z-index: 1000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.modal-overlay.show { + display: flex; + opacity: 1; +} + +.modal-overlay.showing { + display: flex; +} + +#agreementModal { + align-items: center; + justify-content: center; +} + +.agreement-modal { + width: 90%; + max-width: 320px; + background-color: #fff; + border-radius: 16px; + display: flex; + flex-direction: column; + transform: scale(0.8); + opacity: 0; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + position: relative; + z-index: 1001; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); + overflow: hidden; +} + +#agreementModal.show .agreement-modal { + transform: scale(1); + opacity: 1; +} + +.agreement-modal-header { + padding: 20px 20px 16px; + text-align: center; + border-bottom: 1px solid #eee; +} + +.agreement-modal-title { + font-size: 18px; + font-weight: 600; + color: #333; + margin: 0; +} + +.agreement-modal-body { + padding: 20px; + text-align: center; +} + +.agreement-modal-text { + font-size: 14px; + color: #333; + margin-bottom: 12px; + line-height: 1.5; +} + +.agreement-modal-links { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.agreement-modal-link { + color: #3474fe; + font-size: 14px; + text-decoration: none; + line-height: 1.5; +} + +.agreement-modal-link:active { + opacity: 0.7; +} + +.agreement-modal-footer { + display: flex; + border-top: 1px solid #eee; + padding: 0; +} + +.agreement-modal-btn { + flex: 1; + height: 48px; + line-height: 48px; + font-size: 16px; + text-align: center; + border: none; + cursor: pointer; + transition: all 0.2s ease; + background: transparent; +} + +.agreement-modal-btn-cancel { + color: #666; + border-right: 1px solid #eee; +} + +.agreement-modal-btn-cancel:active { + background-color: #f5f5f5; +} + +.agreement-modal-btn-confirm { + color: #fff; + background: linear-gradient(140deg, #3474fe, #3474fe); + font-weight: 500; +} + +.agreement-modal-btn-confirm:active { + opacity: 0.9; +} + +body.modal-open { + overflow: hidden; + position: fixed; + width: 100%; +} diff --git a/basic-info.html b/basic-info.html new file mode 100644 index 0000000..9d27403 --- /dev/null +++ b/basic-info.html @@ -0,0 +1,119 @@ + + +
+ + +
+ 资产信息(0/6)
+
+