diff --git a/app/App.uvue b/app/App.uvue
deleted file mode 100644
index ebff13e..0000000
--- a/app/App.uvue
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
diff --git a/app/PACKAGING.md b/app/PACKAGING.md
deleted file mode 100644
index 7a5c9d8..0000000
--- a/app/PACKAGING.md
+++ /dev/null
@@ -1,176 +0,0 @@
-# 模拟所APP - 打包发布指南
-
-## 📋 完整流程
-
-### 第一步:部署后端到服务器
-
-1. **打包后端项目**
-```bash
-cd d:/workspace/project/com-rattan-spccloud
-mvn clean package -DskipTests
-```
-
-2. **上传JAR包到服务器**
-```bash
-# 生成的JAR包位置
-target/com-rattan-spccloud-1.0.jar
-
-# 使用scp上传到服务器
-scp target/com-rattan-spccloud-1.0.jar root@8.155.172.147:/opt/monisuo/
-```
-
-3. **在服务器上启动后端**
-```bash
-# SSH连接服务器
-ssh root@8.155.172.147
-
-# 启动服务
-cd /opt/monisuo
-nohup java -jar com-rattan-spccloud-1.0.jar --spring.profiles.active=dev > app.log 2>&1 &
-
-# 查看日志
-tail -f app.log
-```
-
-4. **确保服务器防火墙开放9010端口**
-```bash
-# 检查端口
-netstat -tlnp | grep 9010
-
-# 如果使用firewalld
-firewall-cmd --zone=public --add-port=9010/tcp --permanent
-firewall-cmd --reload
-```
-
----
-
-### 第二步:初始化数据库
-
-在服务器上执行SQL脚本:
-```bash
-mysql -u monisuo -pJPJ8wYicSGC8aRnk monisuo < /opt/monisuo/init.sql
-```
-
-或者使用Navicat等工具连接数据库执行 `sql/init.sql`
-
----
-
-### 第三步:打包前端APP
-
-#### 方式一:使用HBuilderX(推荐)
-
-1. **下载安装 HBuilderX Alpha版**
- - 下载地址:https://www.dcloud.io/hbuilderx.html
- - 选择 **Alpha版**(uni-app x需要Alpha版)
-
-2. **导入项目**
- - 打开HBuilderX
- - 文件 → 导入 → 从本地目录导入
- - 选择 `d:\workspace\project\com-rattan-spccloud\app` 目录
-
-3. **配置manifest.json**
- - 在HBuilderX中打开 `manifest.json`
- - 填写应用信息:
- - App名称:模拟所
- - App描述:虚拟货币模拟交易平台
- - 版本号:1.0.0
-
-4. **运行调试(可选)**
- - 连接Android手机(开启USB调试)
- - 运行 → 运行到手机或模拟器 → 运行到Android App基座
-
-5. **云端打包**
- - 发行 → 原生App-云打包
- - 选择平台:Android
- - 勾选"使用DCloud公用证书"(测试用)
- - 点击"打包"
- - 等待打包完成,下载APK
-
-#### 方式二:本地打包
-
-1. **生成本地打包资源**
- - 发行 → 原生App-本地打包 → 生成本地打包App资源
-
-2. **使用Android Studio打包**
- - 打开Android Studio
- - 导入生成的项目
- - Build → Build Bundle(s) / APK(s) → Build APK(s)
-
----
-
-### 第四步:安装APK到手机
-
-#### 方式一:直接安装
-1. 将APK文件传到手机
-2. 点击APK文件安装
-3. 允许安装未知来源应用
-
-#### 方式二:通过HBuilderX安装
-1. 手机连接电脑
-2. 运行 → 运行到手机或模拟器 → 运行到Android App基座
-3. 选择已连接的设备
-
----
-
-## 🔧 常见问题
-
-### 1. 网络请求失败
-- 检查服务器防火墙是否开放9010端口
-- 检查API地址是否正确(`app/api/request.uts`中的BASE_URL)
-- 确保手机和服务器网络连通
-
-### 2. 安装失败
-- 开启手机"允许安装未知来源应用"
-- 卸载旧版本后再安装新版本
-
-### 3. 登录失败
-- 检查数据库是否初始化成功
-- 检查后端服务是否正常运行
-- 查看后端日志:`tail -f /opt/monisuo/app.log`
-
----
-
-## 📱 API地址配置
-
-修改 `app/api/request.uts` 文件:
-
-```typescript
-// 开发环境(本地测试)
-const BASE_URL: string = 'http://localhost:9010'
-
-// 生产环境(服务器部署)
-const BASE_URL: string = 'http://8.155.172.147:9010'
-```
-
----
-
-## 🚀 快速测试
-
-如果暂时没有服务器,可以使用内网穿透工具:
-
-1. **使用ngrok**
-```bash
-ngrok http 9010
-```
-
-2. **修改API地址为ngrok提供的地址**
-```typescript
-const BASE_URL: string = 'https://xxxx.ngrok.io'
-```
-
----
-
-## 📦 预置账号
-
-| 类型 | 账号 | 密码 |
-|-----|------|------|
-| 管理员 | admin | admin123 |
-| 管理员 | superadmin | admin123 |
-
----
-
-## 🔗 相关链接
-
-- [uni-app x 文档](https://doc.dcloud.net.cn/uni-app-x/)
-- [HBuilderX 下载](https://www.dcloud.io/hbuilderx.html)
-- [云打包说明](https://ask.dcloud.net.cn/article/37979)
diff --git a/app/README.md b/app/README.md
deleted file mode 100644
index b306086..0000000
--- a/app/README.md
+++ /dev/null
@@ -1,203 +0,0 @@
-# 藤编企业移动端应用 (uni-app x)
-
-基于 **uni-app x** 开发的跨平台移动端应用,**原生支持 Android、iOS、鸿蒙系统**。
-
-## 🚀 技术栈
-
-- **uni-app x** - 下一代跨平台框架
-- **Vue 3** - 前端框架
-- **UTS** - Uni Type Script(类 TypeScript)
-- **Pinia** - 状态管理
-- **Vite** - 构建工具
-- **Sass** - CSS 预处理器
-
-## 📱 支持平台
-
-| 平台 | 支持状态 | 打包格式 |
-|------|---------|---------|
-| **Android** | ✅ 原生支持 | APK |
-| **iOS** | ✅ 原生支持 | IPA |
-| **鸿蒙 (HarmonyOS)** | ✅ 原生支持 | HAP |
-| **H5** | ✅ 支持 | - |
-| **微信小程序** | ✅ 支持 | - |
-
-## 📁 项目结构
-
-```
-app/
-├── api/ # API 接口封装 (UTS)
-│ ├── index.uts # 接口统一导出
-│ ├── request.uts # 请求封装
-│ └── user.uts # 用户相关接口
-├── components/ # 公共组件 (.uvue)
-├── pages/ # 页面 (.uvue)
-│ ├── index/ # 首页
-│ ├── login/ # 登录页
-│ └── mine/ # 我的页面
-├── static/ # 静态资源
-│ └── tabbar/ # 底部导航图标
-├── store/ # 状态管理 (Pinia)
-├── utils/ # 工具函数
-├── App.uvue # 应用入口
-├── main.uts # 入口文件
-├── manifest.json # 应用配置(含鸿蒙配置)
-├── pages.json # 页面路由配置
-├── uni.scss # 全局样式变量
-├── vite.config.ts # Vite 配置
-├── index.html # H5 入口页面
-└── package.json # 依赖配置
-```
-
-## 🛠️ 开发环境
-
-### 环境要求
-
-- **Node.js** >= 18.0
-- **HBuilderX** Alpha 版本(用于打包)
-- **Android Studio**(Android 打包)
-- **Xcode**(iOS 打包,仅 macOS)
-- **DevEco Studio**(鸿蒙打包)
-
-### 安装依赖
-
-```bash
-cd app
-npm install
-```
-
-### 开发运行
-
-```bash
-# H5 开发
-npm run dev:h5
-
-# Android 开发
-npm run dev:app-android
-
-# iOS 开发
-npm run dev:app-ios
-
-# 鸿蒙开发
-npm run dev:app-harmony
-```
-
-### 构建打包
-
-```bash
-# H5 构建
-npm run build:h5
-
-# Android APK 构建
-npm run build:app-android
-
-# iOS IPA 构建
-npm run build:app-ios
-
-# 鸿蒙 HAP 构建
-npm run build:app-harmony
-```
-
-## 📦 使用 HBuilderX 打包
-
-### 1. 安装 HBuilderX Alpha
-
-下载地址:https://www.dcloud.io/hbuilderx.html
-
-> **注意:uni-app x 需要使用 Alpha 版本的 HBuilderX**
-
-### 2. 导入项目
-
-1. 打开 HBuilderX Alpha
-2. 选择「文件」->「导入」->「从本地目录导入」
-3. 选择 `app` 目录
-
-### 3. 运行调试
-
-- **Android**: 连接手机,选择「运行」->「运行到手机或模拟器」
-- **iOS**: 连接 iPhone,选择「运行」->「运行到手机或模拟器」
-- **鸿蒙**: 连接鸿蒙设备,选择「运行」->「运行到手机或模拟器」
-
-### 4. 云端打包
-
-1. 选择「发行」->「原生App-云打包」
-2. 选择打包平台(Android/iOS/鸿蒙)
-3. 填写证书信息
-4. 点击「打包」
-
-### 5. 本地打包
-
-#### Android
-1. 选择「发行」->「原生App-本地打包」->「生成本地打包App资源」
-2. 使用 Android Studio 打开生成的项目
-3. 构建 APK
-
-#### iOS
-1. 选择「发行」->「原生App-本地打包」->「生成本地打包App资源」
-2. 使用 Xcode 打开生成的项目
-3. 构建 IPA
-
-#### 鸿蒙
-1. 选择「发行」->「原生App-本地打包」->「生成本地打包App资源」
-2. 使用 DevEco Studio 打开生成的项目
-3. 构建 HAP
-
-## 🔧 API 配置
-
-修改 `api/request.uts` 中的 `BASE_URL`:
-
-```typescript
-const BASE_URL: string = 'http://your-server:9010'
-```
-
-## 🆕 UTS 语法说明
-
-UTS (Uni Type Script) 是 uni-app x 的开发语言,语法类似 TypeScript:
-
-```typescript
-// 变量声明
-const name: string = '藤编企业'
-const count: number = 100
-
-// 函数定义
-func add(a: number, b: number): number {
- return a + b
-}
-
-// 类型定义
-type User = {
- id: number
- name: string
-}
-
-// 响应式数据
-const userName = ref('')
-const isLoading = ref(false)
-
-// 计算属性
-const fullName = computed((): string => {
- return `${firstName.value} ${lastName.value}`
-})
-```
-
-## 📝 开发注意事项
-
-1. **文件后缀**:
- - 页面文件使用 `.uvue`
- - 脚本文件使用 `.uts`
-
-2. **静态资源**:请替换 `static/` 目录下的占位图片
-
-3. **鸿蒙开发**:需要安装 DevEco Studio 和鸿蒙 SDK
-
-4. **调试**:推荐使用真机调试,模拟器可能有性能差异
-
-## 🔗 相关链接
-
-- [uni-app x 官方文档](https://doc.dcloud.net.cn/uni-app-x/)
-- [UTS 语法指南](https://doc.dcloud.net.cn/uni-app-x/uts/)
-- [HBuilderX Alpha 下载](https://www.dcloud.io/hbuilderx.html)
-- [鸿蒙开发者中心](https://developer.harmonyos.com/)
-
-## 📄 License
-
-MIT License
diff --git a/app/api/asset.uts b/app/api/asset.uts
deleted file mode 100644
index c46f014..0000000
--- a/app/api/asset.uts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 资产API
- */
-import { get, post } from './request.uts'
-
-/**
- * 获取资产总览
- */
-export func getAssetOverview (): Promise {
- return get('/api/asset/overview', null)
-}
-
-/**
- * 获取资金账户
- */
-export func getFundAccount (): Promise {
- return get('/api/asset/fund', null)
-}
-
-/**
- * 获取交易账户
- */
-export func getTradeAccounts (): Promise {
- return get('/api/asset/trade', null)
-}
-
-/**
- * 资金划转
- */
-export func transfer (direction: number, amount: string): Promise {
- return post('/api/asset/transfer', { direction, amount } as UTSJSONObject)
-}
-
-/**
- * 获取资金流水
- */
-export func getFlows (flowType: number | null, pageNum: number, pageSize: number): Promise {
- const params: UTSJSONObject = { pageNum: pageNum, pageSize: pageSize }
- if (flowType !== null) {
- params['flowType'] = flowType
- }
- return get('/api/asset/flow', params)
-}
diff --git a/app/api/fund.uts b/app/api/fund.uts
deleted file mode 100644
index 95ce0f0..0000000
--- a/app/api/fund.uts
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 充提API
- */
-import { get, post } from './request.uts'
-
-/**
- * 申请充值
- */
-export func deposit (amount: string, remark: string | null): Promise {
- return post('/api/fund/deposit', { amount, remark } as UTSJSONObject)
-}
-
-/**
- * 申请提现
- */
-export func withdraw (amount: string, remark: string | null): Promise {
- return post('/api/fund/withdraw', { amount, remark } as UTSJSONObject)
-}
-
-/**
- * 取消订单
- */
-export func cancelOrder (orderNo: string): Promise {
- return post('/api/fund/cancel', { orderNo } as UTSJSONObject)
-}
-
-/**
- * 获取充提记录
- */
-export func getOrders (type: number | null, pageNum: number, pageSize: number): Promise {
- const params: UTSJSONObject = { pageNum: pageNum, pageSize: pageSize }
- if (type !== null) {
- params['type'] = type
- }
- return get('/api/fund/orders', params)
-}
diff --git a/app/api/index.uts b/app/api/index.uts
deleted file mode 100644
index 7c6b222..0000000
--- a/app/api/index.uts
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * API 统一导出
- */
-export * from './request.uts'
-export * from './user.uts'
-export * from './market.uts'
-export * from './asset.uts'
-export * from './trade.uts'
-export * from './fund.uts'
diff --git a/app/api/market.uts b/app/api/market.uts
deleted file mode 100644
index e16d6b4..0000000
--- a/app/api/market.uts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 行情API
- */
-import { get } from './request.uts'
-
-/**
- * 获取币种列表
- */
-export func getCoinList (): Promise {
- return get('/api/market/list', null)
-}
-
-/**
- * 获取币种详情
- */
-export func getCoinDetail (code: string): Promise {
- return get('/api/market/detail', { code } as UTSJSONObject)
-}
-
-/**
- * 搜索币种
- */
-export func searchCoins (keyword: string): Promise {
- return get('/api/market/search', { keyword } as UTSJSONObject)
-}
diff --git a/app/api/request.uts b/app/api/request.uts
deleted file mode 100644
index 07021bd..0000000
--- a/app/api/request.uts
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * 网络请求封装 - 模拟所APP
- */
-
-// API 基础地址(生产环境服务器地址)
-const BASE_URL: string = 'http://8.155.172.147:5010'
-
-// 请求超时时间
-const TIMEOUT: number = 30000
-
-// 响应数据类型
-type ResponseData = {
- code: string
- msg: string
- data: any
-}
-
-// 请求配置类型
-type RequestOptions = {
- url: string
- method?: string
- data?: UTSJSONObject | null
- header?: UTSJSONObject | null
- timeout?: number
- loading?: boolean
- loadingText?: string
-}
-
-/**
- * 请求拦截器
- */
-func requestInterceptor (config: RequestOptions): RequestOptions {
- const token = uni.getStorageSync('token') as string
- if (token !== null && token !== '') {
- config.header = {
- ...config.header,
- 'Authorization': `Bearer ${token}`
- } as UTSJSONObject
- }
-
- config.header = {
- 'Content-Type': 'application/json',
- ...config.header
- } as UTSJSONObject
-
- return config
-}
-
-/**
- * 响应拦截器
- */
-func responseInterceptor (response: UniRequestSuccessCallbackResult): Promise {
- const statusCode: number = response.statusCode
- const data = response.data as ResponseData
-
- if (statusCode === 200) {
- if (data.code === '0000') {
- return Promise.resolve(data)
- } else if (data.code === '0002') {
- uni.removeStorageSync('token')
- uni.reLaunch({ url: '/pages/login/login' })
- return Promise.reject(new Error(data.msg || '请重新登录'))
- } else {
- uni.showToast({ title: data.msg || '请求失败', icon: 'none', duration: 2000 })
- return Promise.reject(new Error(data.msg))
- }
- } else if (statusCode === 401) {
- uni.removeStorageSync('token')
- uni.reLaunch({ url: '/pages/login/login' })
- return Promise.reject(new Error('未授权'))
- } else {
- return Promise.reject(new Error(`网络错误: ${statusCode}`))
- }
-}
-
-/**
- * 通用请求方法
- */
-func request (options: RequestOptions): Promise {
- let config: RequestOptions = {
- url: options.url.startsWith('http') ? options.url : BASE_URL + options.url,
- method: options.method || 'GET',
- data: options.data || null,
- header: options.header || null,
- timeout: options.timeout || TIMEOUT
- }
-
- config = requestInterceptor(config)
-
- const showLoading = options.loading !== false
- if (showLoading) {
- uni.showLoading({ title: options.loadingText || '加载中...', mask: true })
- }
-
- return new Promise((resolve, reject) => {
- uni.request({
- url: config.url,
- method: config.method as UniRequestMethod,
- data: config.data,
- header: config.header,
- timeout: config.timeout,
- success: (response: UniRequestSuccessCallbackResult) => {
- responseInterceptor(response).then(resolve).catch(reject)
- },
- fail: (error: UniRequestFailCallbackResult) => {
- uni.showToast({ title: error.errMsg || '网络请求失败', icon: 'none', duration: 2000 })
- reject(new Error(error.errMsg))
- },
- complete: () => {
- if (showLoading) uni.hideLoading()
- }
- })
- })
-}
-
-/**
- * GET 请求
- */
-export func get (url: string, params: UTSJSONObject | null = null): Promise {
- return request({ url, method: 'GET', data: params })
-}
-
-/**
- * POST 请求
- */
-export func post (url: string, data: UTSJSONObject | null = null): Promise {
- return request({ url, method: 'POST', data: data })
-}
-
-export const config = { BASE_URL, TIMEOUT }
diff --git a/app/api/trade.uts b/app/api/trade.uts
deleted file mode 100644
index cdb6b42..0000000
--- a/app/api/trade.uts
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 交易API
- */
-import { get, post } from './request.uts'
-
-/**
- * 买入
- */
-export func buy (coinCode: string, price: string, quantity: string): Promise {
- return post('/api/trade/buy', { coinCode, price, quantity } as UTSJSONObject)
-}
-
-/**
- * 卖出
- */
-export func sell (coinCode: string, price: string, quantity: string): Promise {
- return post('/api/trade/sell', { coinCode, price, quantity } as UTSJSONObject)
-}
-
-/**
- * 获取交易记录
- */
-export func getOrders (coinCode: string | null, direction: number | null, pageNum: number, pageSize: number): Promise {
- const params: UTSJSONObject = { pageNum: pageNum, pageSize: pageSize }
- if (coinCode !== null) {
- params['coinCode'] = coinCode
- }
- if (direction !== null) {
- params['direction'] = direction
- }
- return get('/api/trade/orders', params)
-}
-
-/**
- * 获取订单详情
- */
-export func getOrderDetail (orderNo: string): Promise {
- return get('/api/trade/order/detail', { orderNo } as UTSJSONObject)
-}
diff --git a/app/api/user.uts b/app/api/user.uts
deleted file mode 100644
index 4589b7a..0000000
--- a/app/api/user.uts
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 用户API
- */
-import { get, post } from './request.uts'
-
-/**
- * 用户登录
- */
-export func login (username: string, password: string): Promise {
- return post('/api/user/login', { username, password } as UTSJSONObject)
-}
-
-/**
- * 用户注册
- */
-export func register (username: string, password: string): Promise {
- return post('/api/user/register', { username, password } as UTSJSONObject)
-}
-
-/**
- * 获取用户信息
- */
-export func getUserInfo (): Promise {
- return get('/api/user/info', null)
-}
-
-/**
- * 上传KYC资料
- */
-export func uploadKyc (idCardFront: string, idCardBack: string): Promise {
- return post('/api/user/kyc', { idCardFront, idCardBack } as UTSJSONObject)
-}
-
-/**
- * 退出登录
- */
-export func logout (): Promise {
- return post('/api/user/logout', null)
-}
diff --git a/app/index.html b/app/index.html
deleted file mode 100644
index 58581cc..0000000
--- a/app/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 藤编企业
-
-
-
-
-
-
-
-
-
-
diff --git a/app/main.uts b/app/main.uts
deleted file mode 100644
index 6ead2ea..0000000
--- a/app/main.uts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createSSRApp } from 'vue'
-import App from './App.vue'
-import { createPinia } from 'pinia'
-
-export function createApp(): UTSJSONObject {
- const app = createSSRApp(App)
- const pinia = createPinia()
-
- app.use(pinia)
-
- return {
- app,
- pinia
- }
-}
diff --git a/app/manifest.json b/app/manifest.json
deleted file mode 100644
index a3dc3fb..0000000
--- a/app/manifest.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "模拟所",
- "appid": "__UNI__MONISUO01",
- "description": "虚拟货币模拟交易平台,支持Android、iOS、鸿蒙系统",
- "versionName": "1.0.0",
- "versionCode": "100",
- "transformPx": false,
- "app-plus": {
- "usingComponents": true,
- "nvueStyleCompiler": "uni-app",
- "compilerVersion": 3,
- "splashscreen": {
- "alwaysShowBeforeRender": true,
- "waiting": true,
- "autoclose": true,
- "delay": 0
- },
- "distribute": {
- "android": {
- "permissions": [
- "",
- "",
- ""
- ],
- "minSdkVersion": 21,
- "targetSdkVersion": 34
- },
- "ios": {
- "dSYMs": false
- }
- }
- },
- "quickapp": {},
- "mp-weixin": {
- "appid": "",
- "setting": { "urlCheck": false },
- "usingComponents": true
- },
- "h5": {
- "title": "模拟所",
- "router": { "mode": "hash", "base": "./" }
- },
- "uni-app-x": {},
- "app-harmony": {
- "minSDKVersion": 11,
- "targetSDKVersion": 12,
- "compileSDKVersion": 12,
- "package": "com.monisuo.app",
- "projectName": "MonisuoApp"
- },
- "vueVersion": "3"
-}
diff --git a/app/package.json b/app/package.json
deleted file mode 100644
index 8b5fa9e..0000000
--- a/app/package.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "rattan-app",
- "version": "1.0.0",
- "description": "藤编企业移动端应用 - 支持Android、iOS、鸿蒙",
- "main": "main.js",
- "scripts": {
- "dev:app": "uni -p app",
- "dev:app-android": "uni -p app-android",
- "dev:app-ios": "uni -p app-ios",
- "dev:app-harmony": "uni -p app-harmony",
- "dev:h5": "uni",
- "dev:mp-weixin": "uni -p mp-weixin",
- "build:app": "uni build -p app",
- "build:app-android": "uni build -p app-android",
- "build:app-ios": "uni build -p app-ios",
- "build:app-harmony": "uni build -p app-harmony",
- "build:h5": "uni build",
- "build:mp-weixin": "uni build -p mp-weixin"
- },
- "dependencies": {
- "@dcloudio/uni-app": "3.0.0-4020920250116001",
- "@dcloudio/uni-app-harmony": "3.0.0-4020920250116001",
- "@dcloudio/uni-app-plus": "3.0.0-4020920250116001",
- "@dcloudio/uni-components": "3.0.0-4020920250116001",
- "@dcloudio/uni-h5": "3.0.0-4020920250116001",
- "@dcloudio/uni-mp-weixin": "3.0.0-4020920250116001",
- "vue": "^3.5.13",
- "pinia": "^2.3.0"
- },
- "devDependencies": {
- "@dcloudio/types": "^3.4.14",
- "@dcloudio/uni-automator": "3.0.0-4020920250116001",
- "@dcloudio/uni-cli-shared": "3.0.0-4020920250116001",
- "@dcloudio/uni-stacktracey": "3.0.0-4020920250116001",
- "@dcloudio/vite-plugin-uni": "3.0.0-4020920250116001",
- "sass": "^1.83.0",
- "vite": "^6.0.6"
- }
-}
diff --git a/app/pages.json b/app/pages.json
deleted file mode 100644
index 06b202d..0000000
--- a/app/pages.json
+++ /dev/null
@@ -1,106 +0,0 @@
-{
- "pages": [
- {
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "模拟所",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white"
- }
- },
- {
- "path": "pages/market/market",
- "style": {
- "navigationBarTitleText": "行情",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white"
- }
- },
- {
- "path": "pages/trade/trade",
- "style": {
- "navigationBarTitleText": "交易",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white"
- }
- },
- {
- "path": "pages/asset/asset",
- "style": {
- "navigationBarTitleText": "资产",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white"
- }
- },
- {
- "path": "pages/mine/mine",
- "style": {
- "navigationBarTitleText": "我的",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white"
- }
- },
- {
- "path": "pages/login/login",
- "style": {
- "navigationBarTitleText": "登录",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/register/register",
- "style": {
- "navigationBarTitleText": "注册",
- "navigationBarBackgroundColor": "#1A1A2E",
- "navigationBarTextStyle": "white",
- "navigationStyle": "custom"
- }
- }
- ],
- "globalStyle": {
- "navigationBarTextStyle": "white",
- "navigationBarTitleText": "模拟所",
- "navigationBarBackgroundColor": "#1A1A2E",
- "backgroundColor": "#1A1A2E"
- },
- "tabBar": {
- "color": "#666666",
- "selectedColor": "#00D4AA",
- "borderStyle": "black",
- "backgroundColor": "#16213E",
- "list": [
- {
- "pagePath": "pages/index/index",
- "text": "首页",
- "iconPath": "static/tabbar/home.png",
- "selectedIconPath": "static/tabbar/home-active.png"
- },
- {
- "pagePath": "pages/market/market",
- "text": "行情",
- "iconPath": "static/tabbar/market.png",
- "selectedIconPath": "static/tabbar/market-active.png"
- },
- {
- "pagePath": "pages/trade/trade",
- "text": "交易",
- "iconPath": "static/tabbar/trade.png",
- "selectedIconPath": "static/tabbar/trade-active.png"
- },
- {
- "pagePath": "pages/asset/asset",
- "text": "资产",
- "iconPath": "static/tabbar/asset.png",
- "selectedIconPath": "static/tabbar/asset-active.png"
- },
- {
- "pagePath": "pages/mine/mine",
- "text": "我的",
- "iconPath": "static/tabbar/mine.png",
- "selectedIconPath": "static/tabbar/mine-active.png"
- }
- ]
- }
-}
diff --git a/app/pages/asset/asset.uvue b/app/pages/asset/asset.uvue
deleted file mode 100644
index 8da72f2..0000000
--- a/app/pages/asset/asset.uvue
+++ /dev/null
@@ -1,448 +0,0 @@
-
-
-
-
- 总资产估值(USDT)
- ${{ totalAssets }}
-
-
-
-
- 资金账户
- 交易账户
-
-
-
-
-
- USDT余额
- {{ fundBalance }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ pos.icon }}
-
- {{ pos.coinCode }}
- {{ pos.coinName }}
-
-
-
- {{ pos.quantity }}
- ≈ ${{ pos.value }}
-
-
-
-
-
-
-
-
- 充值
-
- 充值金额(USDT)
-
-
-
-
-
-
-
-
-
-
-
-
- 提现
-
- 提现金额(USDT)
-
-
-
-
-
-
-
-
-
-
-
-
- 资金划转
-
- 资金→交易
- 交易→资金
-
-
- 划转金额(USDT)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/pages/index/index.uvue b/app/pages/index/index.uvue
deleted file mode 100644
index d4ec591..0000000
--- a/app/pages/index/index.uvue
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
-
-
- 总资产(USDT)
- {{ totalAsset }}
-
-
- 资金账户
- {{ fundBalance }}
-
-
- 交易账户
- {{ tradeBalance }}
-
-
-
-
-
-
-
- 充
- 充值
-
-
- 提
- 提现
-
-
- 转
- 划转
-
-
- 币
- 交易
-
-
-
-
-
- 我的持仓
-
-
-
- {{ item.coinCode }}
- {{ item.quantity }}
-
-
- {{ item.value }} USDT
-
- {{ item.profit >= 0 ? '+' : '' }}{{ item.profit }}%
-
-
-
-
- 暂无持仓
-
-
-
-
-
-
-
-
-
diff --git a/app/pages/login/login.uvue b/app/pages/login/login.uvue
deleted file mode 100644
index 15a1a68..0000000
--- a/app/pages/login/login.uvue
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 还没有账号?立即注册
-
-
-
-
-
-
-
-
diff --git a/app/pages/market/market.uvue b/app/pages/market/market.uvue
deleted file mode 100644
index 005ebfd..0000000
--- a/app/pages/market/market.uvue
+++ /dev/null
@@ -1,300 +0,0 @@
-
-
-
-
-
-
-
-
-
- 全部
- 实时
- 热门
-
-
-
-
-
-
-
-
- {{ coin.icon }}
-
- {{ coin.code }}/USDT
- {{ coin.name }}
-
-
-
- ${{ coin.price }}
-
-
-
- {{ coin.change >= 0 ? '+' : '' }}{{ coin.change }}%
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/pages/mine/mine.uvue b/app/pages/mine/mine.uvue
deleted file mode 100644
index 7281fd5..0000000
--- a/app/pages/mine/mine.uvue
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
- {{ avatarText }}
-
-
- {{ username }}
- 普通用户
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/pages/register/register.uvue b/app/pages/register/register.uvue
deleted file mode 100644
index 38cebb9..0000000
--- a/app/pages/register/register.uvue
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
- ₿
- 注册账号
-
-
-
-
-
- 账号
-
-
-
-
- 密码
-
-
-
-
- 确认密码
-
-
-
-
-
-
-
-
- 已有账号?
- 立即登录
-
-
-
-
-
-
-
-
diff --git a/app/pages/trade/trade.uvue b/app/pages/trade/trade.uvue
deleted file mode 100644
index f4bc833..0000000
--- a/app/pages/trade/trade.uvue
+++ /dev/null
@@ -1,361 +0,0 @@
-
-
-
-
- {{ selectedPair }}
- ▼
-
-
-
-
- ${{ currentPrice }}
-
- {{ priceChange >= 0 ? '+' : '' }}{{ priceChange }}%
-
-
-
-
-
- 买入
- 卖出
-
-
-
-
-
- 价格(USDT)
-
-
- USDT
-
-
-
-
- 数量
-
-
- {{ coinCode }}
-
-
-
-
- 交易金额
- {{ totalAmount }} USDT
-
-
-
- 可用
- {{ availableBalance }} USDT
-
-
-
-
-
-
-
-
- 当前持仓
-
- {{ coinCode }}
- {{ positionQuantity }}
-
-
-
-
-
-
-
-
diff --git a/app/static/default-avatar.png b/app/static/default-avatar.png
deleted file mode 100644
index 53d8a50..0000000
--- a/app/static/default-avatar.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/logo.png b/app/static/logo.png
deleted file mode 100644
index 4c02d3e..0000000
--- a/app/static/logo.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/asset-active.png b/app/static/tabbar/asset-active.png
deleted file mode 100644
index ba3ecd0..0000000
--- a/app/static/tabbar/asset-active.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/asset.png b/app/static/tabbar/asset.png
deleted file mode 100644
index f527a21..0000000
--- a/app/static/tabbar/asset.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/home-active.png b/app/static/tabbar/home-active.png
deleted file mode 100644
index ba3ecd0..0000000
--- a/app/static/tabbar/home-active.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/home.png b/app/static/tabbar/home.png
deleted file mode 100644
index f527a21..0000000
--- a/app/static/tabbar/home.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/market-active.png b/app/static/tabbar/market-active.png
deleted file mode 100644
index ba3ecd0..0000000
--- a/app/static/tabbar/market-active.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/market.png b/app/static/tabbar/market.png
deleted file mode 100644
index f527a21..0000000
--- a/app/static/tabbar/market.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/mine-active.png b/app/static/tabbar/mine-active.png
deleted file mode 100644
index 2a9ae54..0000000
--- a/app/static/tabbar/mine-active.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/mine.png b/app/static/tabbar/mine.png
deleted file mode 100644
index 2e9387d..0000000
--- a/app/static/tabbar/mine.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/trade-active.png b/app/static/tabbar/trade-active.png
deleted file mode 100644
index ba3ecd0..0000000
--- a/app/static/tabbar/trade-active.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/static/tabbar/trade.png b/app/static/tabbar/trade.png
deleted file mode 100644
index f527a21..0000000
--- a/app/static/tabbar/trade.png
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/app/uni.scss b/app/uni.scss
deleted file mode 100644
index 57d958e..0000000
--- a/app/uni.scss
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * uni-app 全局样式变量 - 模拟所APP
- */
-
-/* 主题色 */
-$primary-color: #00D4AA;
-$primary-color-light: #00E6B8;
-$primary-color-dark: #00B894;
-
-/* 状态色 */
-$success-color: #00C853;
-$warning-color: #FF9800;
-$error-color: #FF5252;
-$info-color: #2196F3;
-
-/* 深色主题 */
-$bg-color-dark: #1A1A2E;
-$bg-color-card: #16213E;
-$text-color: #FFFFFF;
-$text-color-secondary: rgba(255, 255, 255, 0.6);
-$text-color-placeholder: rgba(255, 255, 255, 0.3);
-$border-color: rgba(255, 255, 255, 0.1);
-
-/* 涨跌色 */
-$up-color: #00C853;
-$down-color: #FF5252;
-
-/* 字体大小 */
-$font-size-xs: 22rpx;
-$font-size-sm: 24rpx;
-$font-size-base: 28rpx;
-$font-size-md: 30rpx;
-$font-size-lg: 32rpx;
-$font-size-xl: 36rpx;
-$font-size-xxl: 48rpx;
-
-/* 间距 */
-$spacing-xs: 8rpx;
-$spacing-sm: 16rpx;
-$spacing-base: 24rpx;
-$spacing-md: 32rpx;
-$spacing-lg: 48rpx;
-$spacing-xl: 64rpx;
-
-/* 圆角 */
-$border-radius-sm: 8rpx;
-$border-radius-base: 12rpx;
-$border-radius-lg: 20rpx;
-$border-radius-xl: 24rpx;
-$border-radius-round: 999rpx;
-
-/* 阴影 */
-$box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.3);
-$box-shadow-lg: 0 4rpx 24rpx rgba(0, 0, 0, 0.4);
diff --git a/app/vite.config.ts b/app/vite.config.ts
deleted file mode 100644
index 644529c..0000000
--- a/app/vite.config.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { defineConfig } from 'vite'
-import uni from '@dcloudio/vite-plugin-uni'
-import { resolve } from 'path'
-
-export default defineConfig({
- plugins: [uni()],
- resolve: {
- alias: {
- '@': resolve(__dirname, './')
- }
- },
- server: {
- port: 5173,
- host: '0.0.0.0',
- proxy: {
- '/api': {
- target: 'http://localhost:9010',
- changeOrigin: true
- }
- }
- },
- build: {
- minify: 'terser',
- terserOptions: {
- compress: {
- drop_console: true,
- drop_debugger: true
- }
- }
- }
-})
diff --git a/deploy/bt_webhook.sh b/deploy/bt_webhook.sh
new file mode 100644
index 0000000..a96ba00
--- /dev/null
+++ b/deploy/bt_webhook.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# ============================================
+# 宝塔 Webhook 自动部署脚本 - Monisuo
+# ============================================
+
+# 配置项 - 请根据实际情况修改
+PROJECT_PATH="/opt/monisuo" # 项目部署路径
+GIT_REPO="http://sion:woshisaw.@8.155.172.147:3001/sion/monisuo.git" # Git仓库地址
+JAR_NAME="monisuo-1.0.jar" # JAR包名称
+LOG_FILE="/opt/monisuo/deploy.log" # 部署日志文件
+
+# 记录日志函数
+log() {
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >> $LOG_FILE
+}
+
+log "========== 开始部署 =========="
+
+# 进入项目目录
+cd $PROJECT_PATH || {
+ log "错误: 无法进入目录 $PROJECT_PATH"
+ exit 1
+}
+
+# 拉取最新代码
+log "正在拉取最新代码..."
+git pull origin main >> $LOG_FILE 2>&1
+
+if [ $? -ne 0 ]; then
+ log "错误: Git pull 失败"
+ exit 1
+fi
+
+log "代码拉取成功"
+
+# 检查是否有更新
+CHANGED=$(git diff --name-only HEAD~1 HEAD)
+log "变更文件: $CHANGED"
+
+# 如果有Java代码变更,重新打包
+if echo "$CHANGED" | grep -q "src/"; then
+ log "检测到Java代码变更,开始重新打包..."
+
+ # Maven打包
+ mvn clean package -DskipTests >> $LOG_FILE 2>&1
+
+ if [ $? -ne 0 ]; then
+ log "错误: Maven打包失败"
+ exit 1
+ fi
+
+ log "Maven打包成功"
+fi
+
+# 重启后端服务
+log "正在重启后端服务..."
+
+# 停止旧服务
+pkill -f $JAR_NAME
+sleep 2
+
+# 启动新服务
+nohup java -jar $PROJECT_PATH/target/$JAR_NAME --spring.profiles.active=dev > $PROJECT_PATH/app.log 2>&1 &
+
+if [ $? -eq 0 ]; then
+ log "后端服务启动成功"
+else
+ log "错误: 后端服务启动失败"
+ exit 1
+fi
+
+# 检查服务是否启动成功
+sleep 5
+if pgrep -f $JAR_NAME > /dev/null; then
+ log "服务运行正常"
+else
+ log "错误: 服务启动后未运行"
+ exit 1
+fi
+
+log "========== 部署完成 =========="
+echo "Deploy Success!"
diff --git a/deploy/deploy_h5.sh b/deploy/deploy_h5.sh
new file mode 100644
index 0000000..bb523a9
--- /dev/null
+++ b/deploy/deploy_h5.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# H5前端部署脚本
+
+PROJECT_PATH="/opt/monisuo/h5"
+GIT_REPO="http://sion:woshisaw.@8.155.172.147:3001/sion/monisuo.git"
+
+echo "开始部署H5前端..."
+
+# 创建目录
+mkdir -p $PROJECT_PATH
+
+# 拉取代码(如果已存在)
+if [ -d "$PROJECT_PATH/.git" ]; then
+ cd $PROJECT_PATH
+ git pull origin main
+else
+ git clone $GIT_REPO $PROJECT_PATH
+ cd $PROJECT_PATH/app
+fi
+
+# 注意:H5需要通过HBuilderX构建
+# 构建后的文件在 dist/build/h5 目录
+# 将构建好的文件上传到服务器即可
+
+echo "请先在本地使用HBuilderX构建H5:"
+echo "1. 发行 → 网站-H5手机版"
+echo "2. 构建完成后将 dist/build/h5 目录上传到服务器"
+echo "3. Nginx配置指向该目录"
diff --git a/flutter_monisuo/README.md b/flutter_monisuo/README.md
new file mode 100644
index 0000000..dc2b6cf
--- /dev/null
+++ b/flutter_monisuo/README.md
@@ -0,0 +1,106 @@
+# Flutter Monisuo - 虚拟货币模拟交易平台
+
+## 项目概述
+
+Flutter 版本的模拟所 APP,支持 Android、iOS 平台。
+
+## 项目结构
+
+```
+flutter_monisuo/
+├── lib/
+│ ├── main.dart # 应用入口
+│ ├── core/ # 核心模块
+│ │ ├── constants/ # 颜色、API端点常量
+│ │ ├── theme/ # 主题配置
+│ │ ├── network/ # Dio 网络封装
+│ │ └── storage/ # SharedPreferences
+│ ├── data/
+│ │ ├── models/ # 数据模型
+│ │ └── services/ # API 服务
+│ ├── providers/ # 状态管理
+│ └── ui/
+│ ├── common/ # 公共组件
+│ └── pages/ # 页面
+│ ├── auth/ # 登录/注册
+│ ├── home/ # 首页
+│ ├── market/ # 行情
+│ ├── trade/ # 交易
+│ ├── asset/ # 资产
+│ └── mine/ # 我的
+├── assets/ # 资源文件
+└── pubspec.yaml # 依赖配置
+```
+
+## 功能模块
+
+### 用户模块
+- 用户登录
+- 用户注册
+- 用户信息
+- 退出登录
+
+### 行情模块
+- 币种列表
+- 币种搜索
+- 实时价格
+
+### 交易模块
+- 买入/卖出
+- 交易记录
+- 持仓管理
+
+### 资产模块
+- 资产总览
+- 资金账户
+- 交易账户
+- 充值/提现/划转
+
+## 技术栈
+
+- Flutter 3.x
+- Provider (状态管理)
+- Dio (网络请求)
+- SharedPreferences (本地存储)
+
+## 运行项目
+
+### 前置条件
+- Flutter SDK 已安装
+- Android Studio / VS Code
+
+### 运行步骤
+
+```bash
+# 1. 进入项目目录
+cd flutter_monisuo
+
+# 2. 获取依赖
+flutter pub get
+
+# 3. 运行项目
+flutter run
+
+# 或者指定平台
+flutter run -d android # Android
+flutter run -d chrome # Chrome (Web)
+```
+
+## API 配置
+
+API 基础地址配置在 `lib/core/constants/api_endpoints.dart`:
+
+```dart
+static const String baseUrl = 'http://8.155.172.147:5010';
+```
+
+## 主题色
+
+- 主色: `#00D4AA`
+- 涨色: `#00C853`
+- 跌色: `#FF5252`
+- 背景: `#1A1A2E`
+
+## 作者
+
+Monisuo Team
diff --git a/flutter_monisuo/lib/core/constants/api_endpoints.dart b/flutter_monisuo/lib/core/constants/api_endpoints.dart
new file mode 100644
index 0000000..dbb34fd
--- /dev/null
+++ b/flutter_monisuo/lib/core/constants/api_endpoints.dart
@@ -0,0 +1,80 @@
+/// API 端点配置
+class ApiEndpoints {
+ ApiEndpoints._();
+
+ /// 基础URL
+ static const String baseUrl = 'http://8.155.172.147:5010';
+
+ // ==================== 用户模块 ====================
+
+ /// 用户登录
+ static const String login = '/api/user/login';
+
+ /// 用户注册
+ static const String register = '/api/user/register';
+
+ /// 获取用户信息
+ static const String userInfo = '/api/user/info';
+
+ /// 上传KYC资料
+ static const String kyc = '/api/user/kyc';
+
+ /// 退出登录
+ static const String logout = '/api/user/logout';
+
+ // ==================== 行情模块 ====================
+
+ /// 获取币种列表
+ static const String coinList = '/api/market/list';
+
+ /// 获取币种详情
+ static const String coinDetail = '/api/market/detail';
+
+ /// 搜索币种
+ static const String coinSearch = '/api/market/search';
+
+ // ==================== 交易模块 ====================
+
+ /// 买入
+ static const String buy = '/api/trade/buy';
+
+ /// 卖出
+ static const String sell = '/api/trade/sell';
+
+ /// 获取交易记录
+ static const String tradeOrders = '/api/trade/orders';
+
+ /// 获取订单详情
+ static const String tradeOrderDetail = '/api/trade/order/detail';
+
+ // ==================== 资产模块 ====================
+
+ /// 获取资产总览
+ static const String assetOverview = '/api/asset/overview';
+
+ /// 获取资金账户
+ static const String fundAccount = '/api/asset/fund';
+
+ /// 获取交易账户
+ static const String tradeAccount = '/api/asset/trade';
+
+ /// 资金划转
+ static const String transfer = '/api/asset/transfer';
+
+ /// 获取资金流水
+ static const String assetFlow = '/api/asset/flow';
+
+ // ==================== 充提模块 ====================
+
+ /// 申请充值
+ static const String deposit = '/api/fund/deposit';
+
+ /// 申请提现
+ static const String withdraw = '/api/fund/withdraw';
+
+ /// 取消订单
+ static const String cancelOrder = '/api/fund/cancel';
+
+ /// 获取充提记录
+ static const String fundOrders = '/api/fund/orders';
+}
diff --git a/flutter_monisuo/lib/core/constants/app_colors.dart b/flutter_monisuo/lib/core/constants/app_colors.dart
new file mode 100644
index 0000000..ae21080
--- /dev/null
+++ b/flutter_monisuo/lib/core/constants/app_colors.dart
@@ -0,0 +1,62 @@
+import 'package:flutter/material.dart';
+
+/// 应用颜色常量
+class AppColors {
+ AppColors._();
+
+ // 主题色
+ static const Color primary = Color(0xFF00D4AA);
+ static const Color primaryLight = Color(0xFF00E6B8);
+ static const Color primaryDark = Color(0xFF00B894);
+
+ // 状态色
+ static const Color success = Color(0xFF00C853);
+ static const Color warning = Color(0xFFFF9800);
+ static const Color error = Color(0xFFFF5252);
+ static const Color info = Color(0xFF2196F3);
+
+ // 涨跌色
+ static const Color up = Color(0xFF00C853);
+ static const Color down = Color(0xFFFF5252);
+
+ // 深色主题背景
+ static const Color background = Color(0xFF1A1A2E);
+ static const Color cardBackground = Color(0xFF16213E);
+ static const Color scaffoldBackground = Color(0xFF1A1A2E);
+
+ // 文字颜色
+ static const Color textPrimary = Colors.white;
+ static const Color textSecondary = Color(0x99FFFFFF);
+ static const Color textHint = Color(0x4DFFFFFF);
+ static const Color textDisabled = Color(0x33FFFFFF);
+
+ // 边框和分割线
+ static const Color border = Color(0x1AFFFFFF);
+ static const Color divider = Color(0x1AFFFFFF);
+
+ // 输入框
+ static const Color inputBackground = Color(0xFF16213E);
+ static const Color inputBorder = Color(0x33FFFFFF);
+ static const Color inputFocusBorder = Color(0xFF00D4AA);
+
+ // 按钮渐变
+ static const LinearGradient primaryGradient = LinearGradient(
+ colors: [primary, primaryDark],
+ begin: Alignment.topLeft,
+ end: Alignment.bottomRight,
+ );
+
+ // 买入按钮渐变
+ static const LinearGradient buyGradient = LinearGradient(
+ colors: [Color(0xFF00C853), Color(0xFF00A844)],
+ begin: Alignment.topLeft,
+ end: Alignment.bottomRight,
+ );
+
+ // 卖出按钮渐变
+ static const LinearGradient sellGradient = LinearGradient(
+ colors: [Color(0xFFFF5252), Color(0xFFD32F2F)],
+ begin: Alignment.topLeft,
+ end: Alignment.bottomRight,
+ );
+}
diff --git a/flutter_monisuo/lib/core/network/dio_client.dart b/flutter_monisuo/lib/core/network/dio_client.dart
new file mode 100644
index 0000000..9146407
--- /dev/null
+++ b/flutter_monisuo/lib/core/network/dio_client.dart
@@ -0,0 +1,155 @@
+import 'package:dio/dio.dart';
+import '../storage/local_storage.dart';
+import 'api_exception.dart';
+
+/// API 响应模型
+class ApiResponse {
+ final bool success;
+ final String? message;
+ final T? data;
+ final String? code;
+
+ ApiResponse({
+ required this.success,
+ this.message,
+ this.data,
+ this.code,
+ });
+
+ factory ApiResponse.success(T data, [String? message]) {
+ return ApiResponse(
+ success: true,
+ data: data,
+ message: message,
+ code: '0000',
+ );
+ }
+
+ factory ApiResponse.fail(String message, [String? code]) {
+ return ApiResponse(
+ success: false,
+ message: message,
+ code: code,
+ );
+ }
+
+ factory ApiResponse.unauthorized(String message) {
+ return ApiResponse(
+ success: false,
+ message: message,
+ code: '0002',
+ );
+ }
+
+ factory ApiResponse.fromJson(
+ Map json,
+ T Function(dynamic)? fromJsonT,
+ ) {
+ final code = json['code'] as String? ?? '';
+ final msg = json['msg'] as String? ?? '';
+
+ if (code == '0000') {
+ final data = json['data'];
+ if (fromJsonT != null && data != null) {
+ return ApiResponse.success(fromJsonT(data), msg);
+ }
+ return ApiResponse.success(data as T?, msg);
+ } else if (code == '0002') {
+ return ApiResponse.unauthorized(msg);
+ } else {
+ return ApiResponse.fail(msg, code);
+ }
+ }
+}
+
+/// Dio 网络客户端
+class DioClient {
+ late final Dio _dio;
+
+ DioClient() {
+ _dio = Dio(BaseOptions(
+ baseUrl: 'http://8.155.172.147:5010',
+ connectTimeout: const Duration(seconds: 30),
+ receiveTimeout: const Duration(seconds: 30),
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ ));
+
+ _dio.interceptors.add(_AuthInterceptor());
+ _dio.interceptors.add(LogInterceptor(
+ requestHeader: false,
+ responseHeader: false,
+ error: true,
+ ));
+ }
+
+ /// GET 请求
+ Future> get(
+ String path, {
+ Map? queryParameters,
+ T Function(dynamic)? fromJson,
+ }) async {
+ try {
+ final response = await _dio.get(path, queryParameters: queryParameters);
+ return _handleResponse(response, fromJson);
+ } on DioException catch (e) {
+ return _handleError(e);
+ }
+ }
+
+ /// POST 请求
+ Future> post(
+ String path, {
+ dynamic data,
+ T Function(dynamic)? fromJson,
+ }) async {
+ try {
+ final response = await _dio.post(path, data: data);
+ return _handleResponse(response, fromJson);
+ } on DioException catch (e) {
+ return _handleError(e);
+ }
+ }
+
+ /// 处理响应
+ ApiResponse _handleResponse(
+ Response response,
+ T Function(dynamic)? fromJson,
+ ) {
+ final data = response.data;
+ if (data is Map) {
+ return ApiResponse.fromJson(data, fromJson);
+ }
+ return ApiResponse.fail('响应数据格式错误');
+ }
+
+ /// 处理错误
+ ApiResponse _handleError(DioException e) {
+ if (e.response?.statusCode == 401) {
+ LocalStorage.clearUserData();
+ return ApiResponse.unauthorized('登录已过期,请重新登录');
+ }
+ return ApiResponse.fail(e.message ?? '网络请求失败');
+ }
+}
+
+/// 认证拦截器
+class _AuthInterceptor extends Interceptor {
+ @override
+ void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
+ final token = LocalStorage.getToken();
+ if (token != null && token.isNotEmpty) {
+ options.headers['Authorization'] = 'Bearer $token';
+ }
+ super.onRequest(options, handler);
+ }
+
+ @override
+ void onError(DioException err, ErrorInterceptorHandler handler) {
+ if (err.response?.statusCode == 401) {
+ LocalStorage.clearUserData();
+ }
+ super.onError(err, handler);
+ }
+}
diff --git a/flutter_monisuo/lib/core/storage/local_storage.dart b/flutter_monisuo/lib/core/storage/local_storage.dart
new file mode 100644
index 0000000..dd19060
--- /dev/null
+++ b/flutter_monisuo/lib/core/storage/local_storage.dart
@@ -0,0 +1,101 @@
+import 'dart:convert';
+import 'package:shared_preferences/shared_preferences.dart';
+
+/// 本地存储服务
+class LocalStorage {
+ LocalStorage._();
+
+ static const String _tokenKey = 'token';
+ static const String _userInfoKey = 'userInfo';
+
+ static SharedPreferences? _prefs;
+
+ /// 初始化
+ static Future init() async {
+ _prefs = await SharedPreferences.getInstance();
+ }
+
+ /// 获取实例
+ static SharedPreferences get prefs {
+ if (_prefs == null) {
+ throw Exception('LocalStorage not initialized. Call init() first.');
+ }
+ return _prefs!;
+ }
+
+ // ==================== Token 管理 ====================
+
+ /// 保存 Token
+ static Future saveToken(String token) async {
+ await prefs.setString(_tokenKey, token);
+ }
+
+ /// 获取 Token
+ static String? getToken() {
+ return prefs.getString(_tokenKey);
+ }
+
+ /// 移除 Token
+ static Future removeToken() async {
+ await prefs.remove(_tokenKey);
+ }
+
+ /// 是否已登录
+ static bool get isLoggedIn => getToken() != null && getToken()!.isNotEmpty;
+
+ // ==================== 用户信息管理 ====================
+
+ /// 保存用户信息
+ static Future saveUserInfo(Map userInfo) async {
+ await prefs.setString(_userInfoKey, jsonEncode(userInfo));
+ }
+
+ /// 获取用户信息
+ static Map? getUserInfo() {
+ final str = prefs.getString(_userInfoKey);
+ if (str == null) return null;
+ try {
+ return jsonDecode(str) as Map;
+ } catch (e) {
+ return null;
+ }
+ }
+
+ /// 移除用户信息
+ static Future removeUserInfo() async {
+ await prefs.remove(_userInfoKey);
+ }
+
+ // ==================== 通用方法 ====================
+
+ /// 保存字符串
+ static Future setString(String key, String value) async {
+ await prefs.setString(key, value);
+ }
+
+ /// 获取字符串
+ static String? getString(String key) {
+ return prefs.getString(key);
+ }
+
+ /// 保存布尔值
+ static Future setBool(String key, bool value) async {
+ await prefs.setBool(key, value);
+ }
+
+ /// 获取布尔值
+ static bool? getBool(String key) {
+ return prefs.getBool(key);
+ }
+
+ /// 清除所有数据
+ static Future clearAll() async {
+ await prefs.clear();
+ }
+
+ /// 清除用户数据(退出登录时调用)
+ static Future clearUserData() async {
+ await removeToken();
+ await removeUserInfo();
+ }
+}
diff --git a/flutter_monisuo/lib/core/theme/app_theme.dart b/flutter_monisuo/lib/core/theme/app_theme.dart
new file mode 100644
index 0000000..445332a
--- /dev/null
+++ b/flutter_monisuo/lib/core/theme/app_theme.dart
@@ -0,0 +1,149 @@
+import 'package:flutter/material.dart';
+import '../constants/app_colors.dart';
+
+/// 应用主题配置
+class AppTheme {
+ AppTheme._();
+
+ /// 深色主题
+ static ThemeData get darkTheme {
+ return ThemeData(
+ useMaterial3: true,
+ brightness: Brightness.dark,
+ scaffoldBackgroundColor: AppColors.background,
+ primaryColor: AppColors.primary,
+ colorScheme: const ColorScheme.dark(
+ primary: AppColors.primary,
+ secondary: AppColors.primaryLight,
+ error: AppColors.error,
+ surface: AppColors.cardBackground,
+ ),
+ appBarTheme: const AppBarTheme(
+ backgroundColor: AppColors.background,
+ foregroundColor: AppColors.textPrimary,
+ elevation: 0,
+ centerTitle: true,
+ titleTextStyle: TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.w600,
+ color: AppColors.textPrimary,
+ ),
+ ),
+ inputDecorationTheme: InputDecorationTheme(
+ filled: true,
+ fillColor: AppColors.cardBackground,
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(12),
+ borderSide: const BorderSide(color: AppColors.border),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(12),
+ borderSide: const BorderSide(color: AppColors.border),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(12),
+ borderSide: const BorderSide(color: AppColors.primary),
+ ),
+ hintStyle: const TextStyle(color: AppColors.textHint),
+ contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
+ ),
+ elevatedButtonTheme: ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: AppColors.primary,
+ foregroundColor: Colors.white,
+ minimumSize: const Size(double.infinity, 48),
+ padding: const EdgeInsets.symmetric(vertical: 14),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ textStyle: const TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ textButtonTheme: TextButtonThemeData(
+ style: TextButton.styleFrom(
+ foregroundColor: AppColors.primary,
+ ),
+ ),
+ dividerTheme: const DividerThemeData(
+ color: AppColors.border,
+ thickness: 1,
+ ),
+ cardTheme: CardTheme(
+ color: AppColors.cardBackground,
+ elevation: 0,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(16),
+ ),
+ ),
+ );
+ }
+}
+
+/// 文本样式
+class AppTextStyles {
+ AppTextStyles._();
+
+ static const TextStyle heading1 = TextStyle(
+ fontSize: 28,
+ fontWeight: FontWeight.bold,
+ color: AppColors.textPrimary,
+ );
+
+ static const TextStyle heading2 = TextStyle(
+ fontSize: 24,
+ fontWeight: FontWeight.bold,
+ color: AppColors.textPrimary,
+ );
+
+ static const TextStyle heading3 = TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.w600,
+ color: AppColors.textPrimary,
+ );
+
+ static const TextStyle body1 = TextStyle(
+ fontSize: 16,
+ color: AppColors.textPrimary,
+ );
+
+ static const TextStyle body2 = TextStyle(
+ fontSize: 14,
+ color: AppColors.textPrimary,
+ );
+
+ static const TextStyle caption = TextStyle(
+ fontSize: 12,
+ color: AppColors.textSecondary,
+ );
+
+ static const TextStyle hint = TextStyle(
+ fontSize: 14,
+ color: AppColors.textHint,
+ );
+}
+
+/// 间距常量
+class AppSpacing {
+ AppSpacing._();
+
+ static const double xs = 4.0;
+ static const double sm = 8.0;
+ static const double md = 16.0;
+ static const double lg = 24.0;
+ static const double xl = 32.0;
+ static const double xxl = 48.0;
+}
+
+/// 圆角常量
+class AppRadius {
+ AppRadius._();
+
+ static const double sm = 8.0;
+ static const double md = 12.0;
+ static const double lg = 16.0;
+ static const double xl = 24.0;
+ static const double full = 999.0;
+}
diff --git a/flutter_monisuo/lib/data/models/account_models.dart b/flutter_monisuo/lib/data/models/account_models.dart
new file mode 100644
index 0000000..cf418fe
--- /dev/null
+++ b/flutter_monisuo/lib/data/models/account_models.dart
@@ -0,0 +1,166 @@
+/// 资产总览模型
+class AssetOverview {
+ final String totalAsset;
+ final String fundBalance;
+ final String tradeBalance;
+ final String totalProfit;
+
+ AssetOverview({
+ required this.totalAsset,
+ required this.fundBalance,
+ required this.tradeBalance,
+ required this.totalProfit,
+ });
+
+ factory AssetOverview.fromJson(Map json) {
+ return AssetOverview(
+ totalAsset: json['totalAsset']?.toString() ?? '0.00',
+ fundBalance: json['fundBalance']?.toString() ?? '0.00',
+ tradeBalance: json['tradeBalance']?.toString() ?? '0.00',
+ totalProfit: json['totalProfit']?.toString() ?? '0.00',
+ );
+ }
+}
+
+/// 资金账户模型
+class AccountFund {
+ final int id;
+ final int userId;
+ final String balance;
+ final String frozenBalance;
+ final DateTime? updateTime;
+
+ AccountFund({
+ required this.id,
+ required this.userId,
+ required this.balance,
+ required this.frozenBalance,
+ this.updateTime,
+ });
+
+ factory AccountFund.fromJson(Map json) {
+ return AccountFund(
+ id: json['id'] as int? ?? 0,
+ userId: json['userId'] as int? ?? 0,
+ balance: json['balance']?.toString() ?? '0.00',
+ frozenBalance: json['frozenBalance']?.toString() ?? '0.00',
+ updateTime: json['updateTime'] != null
+ ? DateTime.tryParse(json['updateTime'])
+ : null,
+ );
+ }
+}
+
+/// 交易账户模型(持仓)
+class AccountTrade {
+ final int id;
+ final int userId;
+ final String coinCode;
+ final String quantity;
+ final String avgPrice;
+ final String totalCost;
+ final String currentValue;
+ final String profit;
+ final double profitRate;
+ final DateTime? updateTime;
+
+ AccountTrade({
+ required this.id,
+ required this.userId,
+ required this.coinCode,
+ required this.quantity,
+ required this.avgPrice,
+ required this.totalCost,
+ required this.currentValue,
+ required this.profit,
+ required this.profitRate,
+ this.updateTime,
+ });
+
+ factory AccountTrade.fromJson(Map json) {
+ return AccountTrade(
+ id: json['id'] as int? ?? 0,
+ userId: json['userId'] as int? ?? 0,
+ coinCode: json['coinCode'] as String? ?? '',
+ quantity: json['quantity']?.toString() ?? '0',
+ avgPrice: json['avgPrice']?.toString() ?? '0.00',
+ totalCost: json['totalCost']?.toString() ?? '0.00',
+ currentValue: json['currentValue']?.toString() ?? '0.00',
+ profit: json['profit']?.toString() ?? '0.00',
+ profitRate: (json['profitRate'] as num?)?.toDouble() ?? 0,
+ updateTime: json['updateTime'] != null
+ ? DateTime.tryParse(json['updateTime'])
+ : null,
+ );
+ }
+
+ /// 格式化盈亏率
+ String get formattedProfitRate {
+ final prefix = profitRate >= 0 ? '+' : '';
+ return '$prefix${profitRate.toStringAsFixed(2)}%';
+ }
+
+ /// 是否盈利
+ bool get isProfit => profitRate >= 0;
+}
+
+/// 资金流水模型
+class AccountFlow {
+ final int id;
+ final int userId;
+ final String flowType;
+ final String amount;
+ final String balanceBefore;
+ final String balanceAfter;
+ final String remark;
+ final DateTime? createTime;
+
+ AccountFlow({
+ required this.id,
+ required this.userId,
+ required this.flowType,
+ required this.amount,
+ required this.balanceBefore,
+ required this.balanceAfter,
+ required this.remark,
+ this.createTime,
+ });
+
+ factory AccountFlow.fromJson(Map json) {
+ return AccountFlow(
+ id: json['id'] as int? ?? 0,
+ userId: json['userId'] as int? ?? 0,
+ flowType: json['flowType']?.toString() ?? '',
+ amount: json['amount']?.toString() ?? '0.00',
+ balanceBefore: json['balanceBefore']?.toString() ?? '0.00',
+ balanceAfter: json['balanceAfter']?.toString() ?? '0.00',
+ remark: json['remark']?.toString() ?? '',
+ createTime: json['createTime'] != null
+ ? DateTime.tryParse(json['createTime'])
+ : null,
+ );
+ }
+
+ /// 流水类型文字
+ String get flowTypeText {
+ switch (flowType) {
+ case '1':
+ return '充值';
+ case '2':
+ return '提现';
+ case '3':
+ return '转入交易账户';
+ case '4':
+ return '从交易账户转出';
+ case '5':
+ return '卖出收入';
+ case '6':
+ return '买入支出';
+ default:
+ return '未知';
+ }
+ }
+
+ /// 是否为收入
+ bool get isIncome => ['1', '3', '5'].contains(flowType);
+}
diff --git a/flutter_monisuo/lib/data/models/coin.dart b/flutter_monisuo/lib/data/models/coin.dart
new file mode 100644
index 0000000..935b0cf
--- /dev/null
+++ b/flutter_monisuo/lib/data/models/coin.dart
@@ -0,0 +1,106 @@
+/// 币种模型
+class Coin {
+ final int id;
+ final String code;
+ final String name;
+ final String? icon;
+ final double price;
+ final double? priceUsd;
+ final double? priceCny;
+ final int priceType; // 1=实时价格, 2=管理员设置
+ final double change24h;
+ final double? high24h;
+ final double? low24h;
+ final double? volume24h;
+ final int status;
+ final int sort;
+
+ Coin({
+ required this.id,
+ required this.code,
+ required this.name,
+ this.icon,
+ required this.price,
+ this.priceUsd,
+ this.priceCny,
+ required this.priceType,
+ required this.change24h,
+ this.high24h,
+ this.low24h,
+ this.volume24h,
+ required this.status,
+ this.sort = 0,
+ });
+
+ factory Coin.fromJson(Map json) {
+ return Coin(
+ id: json['id'] as int? ?? 0,
+ code: json['code'] as String? ?? '',
+ name: json['name'] as String? ?? '',
+ icon: json['icon'] as String?,
+ price: (json['price'] as num?)?.toDouble() ?? 0,
+ priceUsd: (json['priceUsd'] as num?)?.toDouble(),
+ priceCny: (json['priceCny'] as num?)?.toDouble(),
+ priceType: json['priceType'] as int? ?? 1,
+ change24h: (json['change24h'] as num?)?.toDouble() ?? 0,
+ high24h: (json['high24h'] as num?)?.toDouble(),
+ low24h: (json['low24h'] as num?)?.toDouble(),
+ volume24h: (json['volume24h'] as num?)?.toDouble(),
+ status: json['status'] as int? ?? 1,
+ sort: json['sort'] as int? ?? 0,
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'code': code,
+ 'name': name,
+ 'icon': icon,
+ 'price': price,
+ 'priceUsd': priceUsd,
+ 'priceCny': priceCny,
+ 'priceType': priceType,
+ 'change24h': change24h,
+ 'high24h': high24h,
+ 'low24h': low24h,
+ 'volume24h': volume24h,
+ 'status': status,
+ 'sort': sort,
+ };
+ }
+
+ /// 显示图标(Unicode 符号)
+ String get displayIcon {
+ const icons = {
+ 'BTC': '\u20BF',
+ 'ETH': '\u039E',
+ 'SOL': '\u25CD',
+ 'USDT': '\u20AE',
+ 'DOGE': '\uD83D\uDC15',
+ 'XRP': '\u2715',
+ 'BNB': '\u25B3',
+ 'ADA': '\u25C6',
+ };
+ return icons[code] ?? '\u25CF';
+ }
+
+ /// 格式化价格显示
+ String get formattedPrice {
+ if (price >= 1000) return price.toStringAsFixed(2);
+ if (price >= 1) return price.toStringAsFixed(4);
+ return price.toStringAsFixed(6);
+ }
+
+ /// 格式化涨跌幅
+ String get formattedChange {
+ final prefix = change24h >= 0 ? '+' : '';
+ return '$prefix${change24h.toStringAsFixed(2)}%';
+ }
+
+ /// 是否上涨
+ bool get isUp => change24h >= 0;
+
+ /// 是否为实时价格
+ bool get isRealtime => priceType == 1;
+}
diff --git a/flutter_monisuo/lib/data/models/order_models.dart b/flutter_monisuo/lib/data/models/order_models.dart
new file mode 100644
index 0000000..d9b64e1
--- /dev/null
+++ b/flutter_monisuo/lib/data/models/order_models.dart
@@ -0,0 +1,139 @@
+/// 交易订单模型
+class OrderTrade {
+ final int id;
+ final String orderNo;
+ final int userId;
+ final String coinCode;
+ final int direction; // 1=买入, 2=卖出
+ final String price;
+ final String quantity;
+ final String amount;
+ final int status; // 1=待处理, 2=已完成, 3=已取消
+ final DateTime? createTime;
+ final DateTime? updateTime;
+
+ OrderTrade({
+ required this.id,
+ required this.orderNo,
+ required this.userId,
+ required this.coinCode,
+ required this.direction,
+ required this.price,
+ required this.quantity,
+ required this.amount,
+ required this.status,
+ this.createTime,
+ this.updateTime,
+ });
+
+ factory OrderTrade.fromJson(Map json) {
+ return OrderTrade(
+ id: json['id'] as int? ?? 0,
+ orderNo: json['orderNo'] as String? ?? '',
+ userId: json['userId'] as int? ?? 0,
+ coinCode: json['coinCode'] as String? ?? '',
+ direction: json['direction'] as int? ?? 1,
+ price: json['price']?.toString() ?? '0.00',
+ quantity: json['quantity']?.toString() ?? '0',
+ amount: json['amount']?.toString() ?? '0.00',
+ status: json['status'] as int? ?? 1,
+ createTime: json['createTime'] != null
+ ? DateTime.tryParse(json['createTime'])
+ : null,
+ updateTime: json['updateTime'] != null
+ ? DateTime.tryParse(json['updateTime'])
+ : null,
+ );
+ }
+
+ /// 方向文字
+ String get directionText => direction == 1 ? '买入' : '卖出';
+
+ /// 状态文字
+ String get statusText {
+ switch (status) {
+ case 1:
+ return '待处理';
+ case 2:
+ return '已完成';
+ case 3:
+ return '已取消';
+ default:
+ return '未知';
+ }
+ }
+
+ /// 是否为买入
+ bool get isBuy => direction == 1;
+}
+
+/// 充提订单模型
+class OrderFund {
+ final int id;
+ final String orderNo;
+ final int userId;
+ final int orderType; // 1=充值, 2=提现
+ final String amount;
+ final int status; // 1=待审核, 2=已通过, 3=已拒绝, 4=已取消
+ final String remark;
+ final String? auditRemark;
+ final DateTime? createTime;
+ final DateTime? auditTime;
+
+ OrderFund({
+ required this.id,
+ required this.orderNo,
+ required this.userId,
+ required this.orderType,
+ required this.amount,
+ required this.status,
+ required this.remark,
+ this.auditRemark,
+ this.createTime,
+ this.auditTime,
+ });
+
+ factory OrderFund.fromJson(Map json) {
+ return OrderFund(
+ id: json['id'] as int? ?? 0,
+ orderNo: json['orderNo'] as String? ?? '',
+ userId: json['userId'] as int? ?? 0,
+ orderType: json['orderType'] as int? ?? 1,
+ amount: json['amount']?.toString() ?? '0.00',
+ status: json['status'] as int? ?? 1,
+ remark: json['remark']?.toString() ?? '',
+ auditRemark: json['auditRemark']?.toString(),
+ createTime: json['createTime'] != null
+ ? DateTime.tryParse(json['createTime'])
+ : null,
+ auditTime: json['auditTime'] != null
+ ? DateTime.tryParse(json['auditTime'])
+ : null,
+ );
+ }
+
+ /// 订单类型文字
+ String get orderTypeText => orderType == 1 ? '充值' : '提现';
+
+ /// 状态文字
+ String get statusText {
+ switch (status) {
+ case 1:
+ return '待审核';
+ case 2:
+ return '已通过';
+ case 3:
+ return '已拒绝';
+ case 4:
+ return '已取消';
+ default:
+ return '未知';
+ }
+ }
+
+ /// 是否为充值
+ bool get isDeposit => orderType == 1;
+
+ /// 是否可取消
+ bool get canCancel => status == 1;
+}
diff --git a/flutter_monisuo/lib/data/models/user.dart b/flutter_monisuo/lib/data/models/user.dart
new file mode 100644
index 0000000..f25c71e
--- /dev/null
+++ b/flutter_monisuo/lib/data/models/user.dart
@@ -0,0 +1,80 @@
+/// 用户模型
+class User {
+ final int id;
+ final String username;
+ final String? nickname;
+ final String? avatar;
+ final String? phone;
+ final String? email;
+ final int kycStatus;
+ final int status;
+ final DateTime? lastLoginTime;
+ final DateTime? createTime;
+
+ User({
+ required this.id,
+ required this.username,
+ this.nickname,
+ this.avatar,
+ this.phone,
+ this.email,
+ required this.kycStatus,
+ required this.status,
+ this.lastLoginTime,
+ this.createTime,
+ });
+
+ factory User.fromJson(Map json) {
+ return User(
+ id: json['id'] as int? ?? 0,
+ username: json['username'] as String? ?? '',
+ nickname: json['nickname'] as String?,
+ avatar: json['avatar'] as String?,
+ phone: json['phone'] as String?,
+ email: json['email'] as String?,
+ kycStatus: json['kycStatus'] as int? ?? 0,
+ status: json['status'] as int? ?? 1,
+ lastLoginTime: json['lastLoginTime'] != null
+ ? DateTime.tryParse(json['lastLoginTime'])
+ : null,
+ createTime: json['createTime'] != null
+ ? DateTime.tryParse(json['createTime'])
+ : null,
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'username': username,
+ 'nickname': nickname,
+ 'avatar': avatar,
+ 'phone': phone,
+ 'email': email,
+ 'kycStatus': kycStatus,
+ 'status': status,
+ 'lastLoginTime': lastLoginTime?.toIso8601String(),
+ 'createTime': createTime?.toIso8601String(),
+ };
+ }
+
+ /// 获取头像显示文字(用户名首字母)
+ String get avatarText =>
+ username.isNotEmpty ? username.substring(0, 1).toUpperCase() : 'U';
+
+ /// KYC 状态文字
+ String get kycStatusText {
+ switch (kycStatus) {
+ case 0:
+ return '未认证';
+ case 1:
+ return '审核中';
+ case 2:
+ return '已认证';
+ case 3:
+ return '认证失败';
+ default:
+ return '未知';
+ }
+ }
+}
diff --git a/flutter_monisuo/lib/data/services/asset_service.dart b/flutter_monisuo/lib/data/services/asset_service.dart
new file mode 100644
index 0000000..53e6dfe
--- /dev/null
+++ b/flutter_monisuo/lib/data/services/asset_service.dart
@@ -0,0 +1,86 @@
+import '../../core/constants/api_endpoints.dart';
+import '../../core/network/dio_client.dart';
+import '../models/account_models.dart';
+
+/// 资产服务
+class AssetService {
+ final DioClient _client;
+
+ AssetService(this._client);
+
+ /// 获取资产总览
+ Future> getOverview() async {
+ final response = await _client.get