|
|
4 months ago | |
|---|---|---|
| .. | ||
| api | 4 months ago | |
| pages | 4 months ago | |
| README.md | 4 months ago | |
基于 Lilishop UniApp fork 的小程序扩展项目。
本项目需要从 Lilishop UniApp fork 过来:
# 从 Lilishop fork
cp -r /mnt/e/workspace/uniapp/lilishop/* ./
# 然后添加 Enagic 页面
pages/enagic/
├── ai-chat/index.vue # AI 数字人对话
├── health-advisor/
│ ├── home.vue # 健康布施者中心
│ ├── customers.vue # 我的客户
│ └── medals.vue # 荣誉勋章
├── vip/
│ ├── index.vue # VIP 首页
│ └── my-vip.vue # 我的 VIP
├── deduction/index.vue # 抵扣金账户
└── operation/my-plans.vue # 我的运维计划
api/enagic.js - 包含所有 Enagic 扩展 API 调用函数
# 方式一:直接从源码复制
cp -r /mnt/e/workspace/uniapp/lilishop/* ./
# 方式二:Git fork
git clone https://github.com/pickmall/lilishop-uniapp.git enagic-uniapp
cd enagic-uniapp
git remote rename origin lilishop
git remote add origin http://git.iwintrue.com/liaoxg/enagic-uniapp.git
在 pages.json 的 subPackages 中添加:
{
"root": "pages/enagic",
"name": "Enagic",
"pages": [
{
"path": "ai-chat/index",
"style": { "navigationBarTitleText": "AI 健康顾问" }
},
{
"path": "health-advisor/home",
"style": { "navigationBarTitleText": "健康布施者" }
},
{
"path": "health-advisor/customers",
"style": { "navigationBarTitleText": "我的客户" }
},
{
"path": "health-advisor/medals",
"style": { "navigationBarTitleText": "荣誉勋章" }
},
{
"path": "vip/index",
"style": { "navigationBarTitleText": "VIP 会员" }
},
{
"path": "vip/my-vip",
"style": { "navigationBarTitleText": "我的 VIP" }
},
{
"path": "deduction/index",
"style": { "navigationBarTitleText": "抵扣金" }
},
{
"path": "operation/my-plans",
"style": { "navigationBarTitleText": "我的运维计划" }
}
]
}
在 manifest.json 的 uniStatistics 中添加:
"enagic": true
在 utils/api.js 或 utils/request.js 中确保 API 基础路径正确。
# 在 HBuilderX 中打开
# 运行 → 运行到小程序模拟器 → 微信开发者工具
| 页面 | 功能 | API |
|---|---|---|
| ai-chat/index | AI 对话 | /enagic/buyer/ai/chat |
| health-advisor/home | 布施者中心 | /enagic/buyer/advisor/info |
| health-advisor/customers | 客户列表 | /enagic/buyer/advisor/my-customers |
| health-advisor/medals | 勋章展示 | 从 home 获取 |
| vip/index | VIP 介绍 | /enagic/buyer/vip/config-list |
| vip/my-vip | 我的 VIP | /enagic/buyer/vip/info |
| deduction/index | 抵扣金 | /enagic/buyer/deduction/info |
| operation/my-plans | 运维计划 | /enagic/buyer/operation/my-plans |
api/enagic.js 中封装的函数