refactor: overhaul homepage and app structure
Simplify homepage, show chapter counts, display directory, trim bottom nav, in-page match feature, move marketing content, and enhance "My" page. #VERCEL_SKIP Co-authored-by: undefined <undefined+undefined@users.noreply.github.com>
This commit is contained in:
@@ -50,22 +50,22 @@
|
||||
|
||||
修改 `project.config.json`:
|
||||
|
||||
```json
|
||||
\`\`\`json
|
||||
{
|
||||
"appid": "你的小程序AppID",
|
||||
"projectname": "soul-party-book"
|
||||
}
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
### 3. 配置API地址
|
||||
|
||||
修改 `app.js` 中的 `apiBase`:
|
||||
|
||||
```javascript
|
||||
\`\`\`javascript
|
||||
globalData: {
|
||||
apiBase: 'https://your-domain.com/api', // 改为你的实际域名
|
||||
}
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
### 4. 导入项目
|
||||
|
||||
@@ -83,7 +83,7 @@ globalData: {
|
||||
|
||||
## 📂 目录结构
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
miniprogram/
|
||||
├── pages/ # 页面目录
|
||||
│ ├── index/ # 首页(书籍展示)
|
||||
@@ -100,7 +100,7 @@ miniprogram/
|
||||
├── app.json # 小程序配置
|
||||
├── app.wxss # 全局样式
|
||||
└── project.config.json # 项目配置
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
## 🔧 后端API配置
|
||||
|
||||
@@ -110,49 +110,49 @@ miniprogram/
|
||||
|
||||
#### 1. 认证接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
POST /api/auth/wx-login # 微信登录
|
||||
POST /api/auth/validate # Token验证
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
#### 2. 书籍接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
GET /api/book/structure # 获取书籍结构
|
||||
GET /api/book/latest-chapters # 获取最新章节
|
||||
GET /api/book/chapter/:id # 获取章节内容
|
||||
GET /api/book/chapters # 获取所有章节
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
#### 3. 支付接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
POST /api/payment/create # 创建支付订单
|
||||
POST /api/payment/notify # 支付回调通知
|
||||
GET /api/payment/query # 查询订单状态
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
#### 4. 匹配接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
GET /api/match/online-count # 获取在线人数
|
||||
POST /api/match/find # 开始匹配
|
||||
GET /api/match/recent # 获取最近匹配
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
#### 5. 分销接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
GET /api/referral/earnings # 获取收益数据
|
||||
GET /api/referral/stats # 获取推广统计
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
#### 6. 用户接口
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
GET /api/user/stats # 获取用户统计
|
||||
POST /api/user/read-progress # 记录阅读进度
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
### API服务器部署
|
||||
|
||||
@@ -160,11 +160,11 @@ POST /api/user/read-progress # 记录阅读进度
|
||||
|
||||
启动后端服务:
|
||||
|
||||
```bash
|
||||
\`\`\`bash
|
||||
# 在项目根目录
|
||||
pnpm install
|
||||
pnpm dev
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
服务将运行在 `http://localhost:3000`
|
||||
|
||||
@@ -180,7 +180,7 @@ pnpm dev
|
||||
|
||||
在后端配置文件中设置:
|
||||
|
||||
```javascript
|
||||
\`\`\`javascript
|
||||
// 微信支付配置
|
||||
const WECHAT_PAY_CONFIG = {
|
||||
appId: 'your-miniprogram-appid',
|
||||
@@ -188,13 +188,13 @@ const WECHAT_PAY_CONFIG = {
|
||||
apiKey: '你的API密钥',
|
||||
notifyUrl: 'https://your-domain.com/api/payment/notify'
|
||||
}
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
### 3. 配置服务器域名
|
||||
|
||||
在小程序后台 → 开发管理 → 开发设置 → 服务器域名:
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
request合法域名:
|
||||
- https://your-domain.com
|
||||
|
||||
@@ -203,7 +203,7 @@ uploadFile合法域名:
|
||||
|
||||
downloadFile合法域名:
|
||||
- https://your-domain.com
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
## 🎨 界面定制
|
||||
|
||||
@@ -211,7 +211,7 @@ downloadFile合法域名:
|
||||
|
||||
在 `app.wxss` 中修改:
|
||||
|
||||
```css
|
||||
\`\`\`css
|
||||
.brand-color {
|
||||
color: #FF4D4F; /* 改为你的品牌色 */
|
||||
}
|
||||
@@ -219,7 +219,7 @@ downloadFile合法域名:
|
||||
.brand-bg {
|
||||
background-color: #FF4D4F;
|
||||
}
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
### 修改Logo和图标
|
||||
|
||||
@@ -253,10 +253,10 @@ downloadFile合法域名:
|
||||
|
||||
### 默认账号
|
||||
|
||||
```
|
||||
\`\`\`
|
||||
用户名: admin
|
||||
密码: admin123
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
**⚠️ 上线前务必修改默认密码!**
|
||||
|
||||
@@ -266,11 +266,11 @@ downloadFile合法域名:
|
||||
|
||||
手动触发同步:
|
||||
|
||||
```bash
|
||||
\`\`\`bash
|
||||
curl -X POST https://your-domain.com/api/sync \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"force": true}'
|
||||
```
|
||||
\`\`\`
|
||||
|
||||
## 📝 开发说明
|
||||
|
||||
|
||||
Reference in New Issue
Block a user