d45e556c20cae76709e6bf3381d61819f6786866
项目说明
本项目是基于 Uni-App(Vue 3 + Vite)的多端前端应用,支持 H5 与多类小程序目标(如微信小程序)。项目采用 Pinia 管理状态,按“页面/组件/状态/工具”模块化组织,便于扩展与维护。
架构概览
- 技术栈:Vue 3、Pinia、Vite 5、Uni-App 3.x、vue-i18n。
- 路由与页面:通过
src/pages.json定义多端路由和 TabBar,页面文件位于src/pages/**。 - 状态管理:
src/stores/按领域拆分 Store(如useUserStore)。 - 样式与资源:全局样式
src/uni.scss,通用样式在src/styles/,静态资源在src/static/。 - 关键入口:
src/main.js(应用创建)、src/App.vue(全局生命周期与壳层)。 - 构建配置:
vite.config.js(插件/构建)、manifest.json(应用与平台配置)。
目录结构示例:
src/
pages/ ... # 业务页面(splash, index, mine, chat, recharge 等)
components/ ... # 复用组件
stores/ ... # Pinia stores
utils/ ... # 工具函数
styles/ ... # 通用样式
App.vue, main.js, pages.json, uni.scss
主要功能
- 启动与协议:
pages/splash/splash、pages/agreement/agreement。 - 首页与我的:
pages/index/index、pages/mine/mine。 - 创作与脚本编辑:
pages/create/create、pages/script/editor。 - 语音与聊天:
pages/voice/clone、pages/chat/chat。 - 充值与记录:
pages/recharge/recharge、pages/recharge/history。
本地开发与构建
- 安装依赖:
npm install
- 开发调试(H5):
npm run dev:h5
- 开发调试(微信小程序):
npm run dev:mp-weixin
- 生产构建(H5/微信小程序):
npm run build:h5
npm run build:mp-weixin
构建产物输出到 dist/。
配置与环境
- 平台与路由:
src/pages.json;应用配置:src/manifest.json。 - 环境变量:使用
import.meta.env(Vite),避免提交敏感信息。
如需更详细的接口与需求,可参考仓库中的 API接口文档.md 与 产品设计需求文档.md。
Description
Languages
Vue
79.1%
JavaScript
20%
SCSS
0.7%
HTML
0.2%