平台配置系统是一个基于FastAdmin框架的多平台电商配置管理系统,支持以下平台:
application/
├── admin/
│ ├── controller/shop/
│ │ └── Platform.php # 平台配置控制器
│ └── view/shop/platform/
│ ├── index.html # 平台列表页面
│ └── config.html # 平台配置页面
├── common/
│ ├── model/
│ │ └── ShopConfig.php # 配置模型
│ └── Service/
│ └── ShopConfigService.php # 配置服务类
public/assets/js/backend/shop/
└── platform.js # 前端JS逻辑
在FastAdmin后台导航至:商城管理
-> 平台配置
使用FastAdmin的动态显示功能,根据选择的配置项自动显示/隐藏相关配置。
GET /admin/shop/platform/index
GET /admin/shop/platform/platform/{platform}
POST /admin/shop/platform/platform/{platform}
配置数据以JSON格式存储,主要包含:
{
"status": "1",
"app_id": "your_app_id",
"secret": "your_app_secret",
"auto_login": "1",
"bind_mobile": "1",
"payment": {
"methods": ["wechat", "alipay", "money"],
"wechat": "1",
"alipay": "2"
},
"share": {
"methods": ["poster", "link"],
"linkAddress": "https://your-domain.com",
"forwardInfo": {
"title": "分享标题",
"subtitle": "分享副标题",
"image": "/uploads/share.png"
},
"posterInfo": {
"user_bg": "/uploads/user_bg.png",
"goods_bg": "/uploads/goods_bg.png",
"groupon_bg": "/uploads/groupon_bg.png"
}
},
"download": {
"android": "https://download.com/app.apk",
"ios": "https://apps.apple.com/app/id123456",
"local": "https://your-domain.com/download"
}
}
fa_shop_config
表,请确保已正确创建$supportedPlatforms
数组中添加新平台代码config.html
中添加平台特定的配置项platform.js
中添加相应的逻辑处理config.html
中添加表单项platform.js
中添加相应的显示/隐藏逻辑在Platform.php
控制器中添加自定义验证逻辑。