liaoxg 55198805af init: full project upload - Enagic Kangen water mini-program platform 4 months ago
..
api 55198805af init: full project upload - Enagic Kangen water mini-program platform 4 months ago
pages 55198805af init: full project upload - Enagic Kangen water mini-program platform 4 months ago
README.md 55198805af init: full project upload - Enagic Kangen water mini-program platform 4 months ago

README.md

Enagic UniApp 小程序

基于 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 层

api/enagic.js - 包含所有 Enagic 扩展 API 调用函数

集成步骤

1. Fork Lilishop UniApp

# 方式一:直接从源码复制
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

2. 修改 pages.json

在 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": "我的运维计划" }
    }
  ]
}

3. 修改 manifest.json

在 manifest.json 的 uniStatistics 中添加:

"enagic": true

4. 配置 API 基础路径

在 utils/api.js 或 utils/request.js 中确保 API 基础路径正确。

5. 运行

# 在 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

注意事项

  1. 使用 Vue 2 + uView v1(不是 Vue 3)
  2. 所有 API 调用使用 api/enagic.js 中封装的函数
  3. 页面路径在 subpackages 中配置,不是主包

相关文档