commit c767d35d320fa424158ece9d0ab9f860143217d7 Author: ni ziyi <310925901@qq.com> Date: Mon Dec 29 13:29:07 2025 +0800 feat(项目初始化 by claude code) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5f186f --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# uni-app +node_modules/ +unpackage/ +dist/ +.hbuilderx/ + +# npm +package-lock.json +yarn.lock +pnpm-lock.yaml + +# IDE +.vscode/ +.idea/ +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..14c2ef8 --- /dev/null +++ b/App.vue @@ -0,0 +1,168 @@ + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b90a7e --- /dev/null +++ b/README.md @@ -0,0 +1,230 @@ +# 🎮 游戏服务交易平台 - 电竞赛博朋克风格 + +> 基于 uni-app 开发的游戏服务交易平台微信小程序,采用电竞赛博朋克视觉风格,融合游戏元素、科技感和竞技感。 + +## ✨ 项目特色 + +### 🎨 视觉设计 +- **电竞赛博朋克风格**: 霓虹色、数字雨效果、科技光效 +- **游戏化UI**: 游戏主题图标、竞技感配色、等级系统 +- **动效丰富**: 扫描线动画、霓虹发光、粒子效果 +- **深色主题**: 深蓝黑背景,青色霓虹主色调 + +### 🛠️ 技术亮点 +- **Vue 3 Composition API**: 最新的Vue3语法 +- **静态数据Mock**: 完整的Mock数据支持,无需后端即可运行 +- **组件化开发**: 高度复用的公共组件 +- **响应式设计**: 适配各种屏幕尺寸 + +## 📁 项目结构 + +``` +game-service-miniapp/ +├── pages/ # 页面 +│ ├── index/ # 首页 +│ │ └── index.vue # 游戏分类、热门推荐 +│ ├── category/ # 分类 +│ │ └── list.vue # 服务列表(筛选、排序) +│ ├── service/ # 服务 +│ │ └── detail.vue # 服务详情 +│ ├── order/ # 订单 +│ │ ├── create.vue # 创建订单 +│ │ ├── list.vue # 订单列表 +│ │ └── detail.vue # 订单详情 +│ └── user/ # 用户 +│ └── index.vue # 个人中心 +│ +├── components/ # 公共组件 +│ ├── service-card/ # 服务卡片组件 +│ ├── order-card/ # 订单卡片组件 +│ └── game-category/ # 游戏分类组件 +│ +├── mock/ # Mock数据 +│ ├── categories.js # 游戏分类数据 +│ ├── services.js # 服务数据 +│ ├── orders.js # 订单数据 +│ ├── user.js # 用户数据 +│ ├── players.js # 选手数据 +│ ├── evaluations.js # 评价数据 +│ └── index.js # 统一导出 +│ +├── static/ # 静态资源 +│ ├── images/ # 图片 +│ └── icons/ # 图标 +│ +├── App.vue # 应用入口 +├── main.js # 主入口 +├── uni.scss # 全局样式变量 +├── pages.json # 页面配置 +├── manifest.json # 应用配置 +└── package.json # 项目配置 +``` + +## 🎯 核心功能 + +### 1. 首页 +- ✅ 搜索功能入口 +- ✅ 游戏分类横向滚动 +- ✅ 服务类型快捷入口 +- ✅ 热门服务推荐 + +### 2. 服务列表 +- ✅ 按分类筛选 +- ✅ 多种排序方式(价格/销量/评分) +- ✅ 服务卡片展示 + +### 3. 服务详情 +- ✅ 服务信息展示 +- ✅ 商家信息 +- ✅ 用户评价 +- ✅ 一键下单 + +### 4. 订单管理 +- ✅ 创建订单(表单填写) +- ✅ 订单列表(Tab分类) +- ✅ 订单详情(状态流转) +- ✅ 订单操作(支付/取消/确认/评价) + +### 5. 个人中心 +- ✅ 用户信息展示 +- ✅ 资产信息(余额/积分/优惠券) +- ✅ 订单统计 +- ✅ 功能菜单 + +## 🎨 设计系统 + +### 配色方案 +```scss +// 主色调 +$neon-cyan: #00ffff // 青色霓虹(主色) +$neon-magenta: #ff00ff // 洋红霓虹 +$neon-blue: #0099ff // 蓝色霓虹 +$neon-pink: #ff1493 // 粉色霓虹 + +// 背景色 +$bg-primary: #0a0e27 // 主背景 +$bg-secondary: #0f1229 // 次背景 +$bg-tertiary: #1a1d3a // 三级背景 + +// 文字颜色 +$text-primary: #ffffff // 主文字 +$text-secondary: #a0a4c4 // 次文字 +$text-tertiary: #7a7e9d // 三级文字 +``` + +### 视觉元素 +- **霓虹边框**: 青色发光边框 +- **渐变背景**: 深色渐变卡片背景 +- **扫描线**: 赛博朋克扫描动画 +- **光效**: 霓虹光晕效果 +- **粒子**: 数字雨背景(可选) + +## 🚀 快速开始 + +### 环境要求 +- Node.js >= 14.x +- HBuilderX (推荐) 或 微信开发者工具 + +### 方式一:使用 HBuilderX (推荐) + +1. **安装 HBuilderX** + - 下载地址: https://www.dcloud.io/hbuilderx.html + +2. **导入项目** + ``` + HBuilderX > 文件 > 导入 > 从本地目录导入 + 选择 game-service-miniapp 文件夹 + ``` + +3. **运行到微信开发者工具** + ``` + 运行 > 运行到小程序模拟器 > 微信开发者工具 + ``` + +### 方式二:使用命令行 + +1. **安装依赖** + ```bash + cd game-service-miniapp + npm install + ``` + +2. **运行开发环境** + ```bash + npm run dev:mp-weixin + ``` + +3. **用微信开发者工具打开** + ``` + 打开微信开发者工具 + 导入项目 > 选择 dist/dev/mp-weixin 目录 + ``` + +## 📱 功能演示 + +### 首页 +- 顶部搜索栏 + 通知按钮 +- 游戏分类滑动选择 +- 服务类型网格 +- 热门服务瀑布流 + +### 服务详情 +- 大图封面展示 +- 价格、评分、销量统计 +- 商家信息卡片 +- 用户评价列表 +- 底部下单按钮 + +### 订单流程 +``` +浏览服务 → 查看详情 → 填写订单 → 确认下单 → +待支付 → 待接单 → 进行中 → 待确认 → 已完成 → 评价 +``` + +## 📊 Mock数据说明 + +项目包含完整的Mock数据,无需后端即可运行: + +- **8种游戏分类**: 王者荣耀、英雄联盟、VALORANT等 +- **10+服务套餐**: 代练、陪玩、教学等 +- **5个订单示例**: 覆盖各种订单状态 +- **4位选手数据**: 包含头像、评分、接单数 +- **5条用户评价**: 展示评价系统 + +所有数据位于 `/mock` 目录,可根据需求自行修改。 + +## 🎯 下一步计划 + +- [ ] 接入真实后端API +- [ ] 支付功能集成 +- [ ] IM聊天系统 +- [ ] 分享功能 +- [ ] 更多动效优化 +- [ ] 性能优化 + +## 📝 注意事项 + +1. **图片资源**: 项目使用 picsum.photos 占位图,实际使用时需替换为真实图片 +2. **AppID配置**: manifest.json 中的 appid 需替换为你的小程序appid +3. **API接口**: 当前使用Mock数据,接入后端时需修改 `/api` 目录 +4. **支付功能**: 支付相关功能为演示,实际使用需接入微信支付 + +## 💡 技术栈 + +- **框架**: uni-app (Vue 3) +- **语言**: JavaScript ES6+ +- **样式**: SCSS +- **状态管理**: Pinia (可选) +- **构建工具**: Vue CLI + +## 📄 License + +MIT License + +## 🙏 致谢 + +感谢 uni-app 团队提供的优秀跨端框架! + +--- + +**🎮 Powered by Cyber Tech - 让游戏服务更智能** diff --git a/components/game-category/index.vue b/components/game-category/index.vue new file mode 100644 index 0000000..a60109a --- /dev/null +++ b/components/game-category/index.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/components/order-card/index.vue b/components/order-card/index.vue new file mode 100644 index 0000000..92176fb --- /dev/null +++ b/components/order-card/index.vue @@ -0,0 +1,327 @@ + + + + + diff --git a/components/service-card/index.vue b/components/service-card/index.vue new file mode 100644 index 0000000..403f471 --- /dev/null +++ b/components/service-card/index.vue @@ -0,0 +1,304 @@ + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..7518928 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + 电竞服务平台 + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..fa26e8e --- /dev/null +++ b/main.js @@ -0,0 +1,15 @@ +import { createSSRApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' + +export function createApp() { + const app = createSSRApp(App) + const pinia = createPinia() + + app.use(pinia) + + return { + app, + pinia + } +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..c784966 --- /dev/null +++ b/manifest.json @@ -0,0 +1,27 @@ +{ + "name": "电竞服务平台", + "appid": "__UNI__GAME_SERVICE", + "description": "游戏服务交易平台 - 电竞赛博朋克风格", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, + "mp-weixin": { + "appid": "", + "setting": { + "urlCheck": false, + "es6": true, + "postcss": true, + "minified": true + }, + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "用于查找附近的游戏服务" + } + } + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "3" +} diff --git a/mock/categories.js b/mock/categories.js new file mode 100644 index 0000000..ed197f9 --- /dev/null +++ b/mock/categories.js @@ -0,0 +1,79 @@ +/** + * 游戏分类数据 + */ +export const gameCategories = [ + { + id: 1, + name: '王者荣耀', + icon: '🎮', + color: '#ff6b6b', + hot: true, + serviceCount: 156 + }, + { + id: 2, + name: '英雄联盟', + icon: '⚔️', + color: '#4ecdc4', + hot: true, + serviceCount: 98 + }, + { + id: 3, + name: 'VALORANT', + icon: '🔫', + color: '#a8dadc', + hot: false, + serviceCount: 45 + }, + { + id: 4, + name: 'CSGO', + icon: '🎯', + color: '#f4a261', + hot: true, + serviceCount: 67 + }, + { + id: 5, + name: 'DOTA2', + icon: '🛡️', + color: '#e76f51', + hot: false, + serviceCount: 34 + }, + { + id: 6, + name: '原神', + icon: '✨', + color: '#2a9d8f', + hot: true, + serviceCount: 89 + }, + { + id: 7, + name: '和平精英', + icon: '🔥', + color: '#e63946', + hot: false, + serviceCount: 112 + }, + { + id: 8, + name: '永劫无间', + icon: '⚡', + color: '#457b9d', + hot: false, + serviceCount: 23 + } +] + +/** + * 服务类型 + */ +export const serviceTypes = [ + { id: 1, name: '上分代练', icon: '📈' }, + { id: 2, name: '娱乐陪玩', icon: '🎵' }, + { id: 3, name: '技术教学', icon: '📚' }, + { id: 4, name: '账号租赁', icon: '🎭' } +] diff --git a/mock/evaluations.js b/mock/evaluations.js new file mode 100644 index 0000000..8b87d61 --- /dev/null +++ b/mock/evaluations.js @@ -0,0 +1,144 @@ +/** + * 评价数据 + */ +export const evaluations = [ + { + id: 1, + orderId: 100003, + serviceId: 2002, + serviceName: 'LOL 娱乐陪玩 御姐音', + playerId: 30018, + playerName: '冰霜女王', + customerId: 20001, + customerName: '电竞少年', + customerAvatar: 'https://picsum.photos/100/100?random=301', + rating: 5, + content: '小姐姐声音真的超好听!技术也很好,打得很开心!五星好评!', + images: [], + isAnonymous: false, + reply: '谢谢小哥哥的好评~下次继续约我哦💕', + replyTime: '2025-01-26 21:00:00', + createTime: '2025-01-26 20:35:00' + }, + { + id: 2, + orderId: 100006, + serviceId: 1002, + serviceName: '王者荣耀 娱乐陪玩 甜美女声', + playerId: 30005, + playerName: '甜心小鹿', + customerId: 20002, + customerName: '匿名用户', + customerAvatar: 'https://picsum.photos/100/100?random=302', + rating: 5, + content: '甜心小姐姐真的太温柔了,声音超甜,还教我玩法师,超级耐心!强烈推荐!', + images: [ + 'https://picsum.photos/400/300?random=61', + 'https://picsum.photos/400/300?random=62' + ], + isAnonymous: true, + reply: '谢谢支持呀~很开心能帮到你🦌', + replyTime: '2025-01-25 19:30:00', + createTime: '2025-01-25 18:45:00' + }, + { + id: 3, + orderId: 100007, + serviceId: 1003, + serviceName: '王者荣耀 一对一教学 国服射手', + playerId: 30012, + playerName: '狙击之王', + customerId: 20003, + customerName: '游戏新手', + customerAvatar: 'https://picsum.photos/100/100?random=303', + rating: 5, + content: '教练真的专业!我的后羿从青铜打法变成了钻石水平,讲解很细致,物超所值!', + images: [ + 'https://picsum.photos/400/300?random=63' + ], + isAnonymous: false, + reply: '加油!继续努力,下个赛季冲王者!', + replyTime: '2025-01-24 16:20:00', + createTime: '2025-01-24 15:55:00' + }, + { + id: 4, + orderId: 100008, + serviceId: 6001, + serviceName: '原神 深渊12层满星代打', + playerId: 30025, + playerName: '璃月大佬', + customerId: 20004, + customerName: '旅行者', + customerAvatar: 'https://picsum.photos/100/100?random=304', + rating: 4, + content: '代打很快,半小时就满星了,就是没看到过程有点遗憾', + images: [], + isAnonymous: false, + reply: '下次可以提前说要录屏哦~', + replyTime: '2025-01-23 14:30:00', + createTime: '2025-01-23 14:15:00' + }, + { + id: 5, + orderId: 100009, + serviceId: 2002, + serviceName: 'LOL 娱乐陪玩 御姐音', + playerId: 30018, + playerName: '冰霜女王', + customerId: 20005, + customerName: '召唤师', + customerAvatar: 'https://picsum.photos/100/100?random=305', + rating: 5, + content: '御姐音太棒了!而且辅助玩得真好,这局躺赢!', + images: [], + isAnonymous: false, + reply: '谢谢夸奖~继续努力💪', + replyTime: '2025-01-22 21:45:00', + createTime: '2025-01-22 21:30:00' + } +] + +/** + * 根据服务ID获取评价列表 + */ +export function getEvaluationsByServiceId(serviceId) { + return evaluations.filter(e => e.serviceId === serviceId) +} + +/** + * 根据选手ID获取评价列表 + */ +export function getEvaluationsByPlayerId(playerId) { + return evaluations.filter(e => e.playerId === playerId) +} + +/** + * 评价统计 + */ +export function getEvaluationStats(serviceId) { + const evals = getEvaluationsByServiceId(serviceId) + const total = evals.length + + if (total === 0) { + return { + total: 0, + avgRating: 5.0, + distribution: { 5: 0, 4: 0, 3: 0, 2: 0, 1: 0 } + } + } + + const distribution = { 5: 0, 4: 0, 3: 0, 2: 0, 1: 0 } + let sum = 0 + + evals.forEach(e => { + distribution[e.rating]++ + sum += e.rating + }) + + return { + total, + avgRating: (sum / total).toFixed(2), + distribution + } +} diff --git a/mock/index.js b/mock/index.js new file mode 100644 index 0000000..1844954 --- /dev/null +++ b/mock/index.js @@ -0,0 +1,29 @@ +/** + * Mock数据统一导出 + */ + +export * from './categories' +export * from './services' +export * from './orders' +export * from './user' +export * from './players' +export * from './evaluations' + +/** + * 模拟API延迟 + */ +export function mockDelay(ms = 500) { + return new Promise(resolve => setTimeout(resolve, ms)) +} + +/** + * 模拟API响应 + */ +export async function mockApiResponse(data, delay = 500) { + await mockDelay(delay) + return { + code: 200, + msg: 'success', + data + } +} diff --git a/mock/orders.js b/mock/orders.js new file mode 100644 index 0000000..8ecebe6 --- /dev/null +++ b/mock/orders.js @@ -0,0 +1,222 @@ +/** + * 订单数据 + */ + +// 订单状态枚举 +export const OrderStatus = { + WAIT_PAY: { code: 0, text: '待支付', color: '#ffaa00' }, + WAIT_ACCEPT: { code: 1, text: '待接单', color: '#00ffff' }, + ACCEPTED: { code: 2, text: '已接单', color: '#00ff88' }, + IN_PROGRESS: { code: 3, text: '进行中', color: '#0099ff' }, + WAIT_CONFIRM: { code: 4, text: '待确认', color: '#9d00ff' }, + COMPLETED: { code: 5, text: '已完成', color: '#00ff88' }, + EVALUATED: { code: 6, text: '已评价', color: '#7a7e9d' }, + CANCELLED: { code: 9, text: '已取消', color: '#ff3366' } +} + +/** + * 订单列表 + */ +export const orders = [ + { + id: 100001, + orderNo: 'ORD202501281234567', + tenantId: 10001, + customerId: 20001, + serviceId: 1002, + serviceName: '王者荣耀 娱乐陪玩 甜美女声', + serviceCover: 'https://picsum.photos/400/300?random=2', + categoryName: '王者荣耀', + price: 35.00, + actualPrice: 35.00, + status: 3, // 进行中 + playerId: 30005, + playerName: '甜心小鹿', + playerAvatar: 'https://picsum.photos/100/100?random=201', + merchantName: '星光陪玩', + gameInfo: { + gameId: 'Sweet_Deer_123', + server: '微信区', + rank: '钻石II' + }, + contactInfo: { + qq: '123456789', + wechat: 'sweetdeer' + }, + remark: '希望小姐姐温柔一点~', + payType: 'wechat', + payTime: '2025-01-28 14:30:00', + acceptTime: '2025-01-28 14:32:00', + startTime: '2025-01-28 14:35:00', + createTime: '2025-01-28 14:28:00' + }, + { + id: 100002, + orderNo: 'ORD202501271234568', + tenantId: 10002, + customerId: 20001, + serviceId: 1003, + serviceName: '王者荣耀 一对一教学 国服射手', + serviceCover: 'https://picsum.photos/400/300?random=3', + categoryName: '王者荣耀', + price: 88.00, + actualPrice: 88.00, + status: 5, // 已完成 + playerId: 30012, + playerName: '狙击之王', + playerAvatar: 'https://picsum.photos/100/100?random=202', + merchantName: '巅峰电竞学院', + gameInfo: { + gameId: 'Sniper_King_Pro', + server: 'QQ区', + rank: '荣耀王者' + }, + remark: '想学后羿和公孙离', + payType: 'wechat', + payTime: '2025-01-27 10:15:00', + acceptTime: '2025-01-27 10:20:00', + startTime: '2025-01-27 10:30:00', + finishTime: '2025-01-27 12:30:00', + confirmTime: '2025-01-27 12:35:00', + createTime: '2025-01-27 10:10:00' + }, + { + id: 100003, + orderNo: 'ORD202501261234569', + tenantId: 10003, + customerId: 20001, + serviceId: 2002, + serviceName: 'LOL 娱乐陪玩 御姐音', + serviceCover: 'https://picsum.photos/400/300?random=5', + categoryName: '英雄联盟', + price: 45.00, + actualPrice: 45.00, + status: 6, // 已评价 + playerId: 30018, + playerName: '冰霜女王', + playerAvatar: 'https://picsum.photos/100/100?random=203', + merchantName: '梦幻陪玩', + gameInfo: { + gameId: 'FrostQueen', + server: '艾欧尼亚', + rank: '钻石I' + }, + remark: '想玩辅助', + evaluation: { + rating: 5, + content: '小姐姐声音真的超好听!技术也很好,打得很开心!', + images: [], + createTime: '2025-01-26 20:35:00' + }, + payType: 'wechat', + payTime: '2025-01-26 19:00:00', + acceptTime: '2025-01-26 19:05:00', + startTime: '2025-01-26 19:10:00', + finishTime: '2025-01-26 20:10:00', + confirmTime: '2025-01-26 20:15:00', + createTime: '2025-01-26 18:55:00' + }, + { + id: 100004, + orderNo: 'ORD202501251234570', + tenantId: 10005, + customerId: 20001, + serviceId: 6001, + serviceName: '原神 深渊12层满星代打', + serviceCover: 'https://picsum.photos/400/300?random=8', + categoryName: '原神', + price: 68.00, + actualPrice: 68.00, + status: 4, // 待确认 + playerId: 30025, + playerName: '璃月大佬', + playerAvatar: 'https://picsum.photos/100/100?random=204', + merchantName: '提瓦特工作室', + gameInfo: { + uid: '123456789', + server: '天空岛', + level: 60 + }, + serviceFiles: [ + 'https://picsum.photos/400/300?random=51', + 'https://picsum.photos/400/300?random=52' + ], + remark: '账号密码:test123', + payType: 'wechat', + payTime: '2025-01-25 15:20:00', + acceptTime: '2025-01-25 15:25:00', + startTime: '2025-01-25 15:30:00', + createTime: '2025-01-25 15:18:00' + }, + { + id: 100005, + orderNo: 'ORD202501241234571', + tenantId: 10001, + customerId: 20001, + serviceId: 1001, + serviceName: '王者荣耀 星耀→王者 上分', + serviceCover: 'https://picsum.photos/400/300?random=1', + categoryName: '王者荣耀', + price: 198.00, + actualPrice: 198.00, + status: 1, // 待接单 + merchantName: '电竞之星工作室', + gameInfo: { + gameId: 'Player_Pro_888', + server: '微信区', + currentRank: '星耀II', + targetRank: '王者' + }, + remark: '希望3天内完成', + payType: 'wechat', + payTime: '2025-01-24 09:30:00', + createTime: '2025-01-24 09:25:00' + } +] + +/** + * 根据状态获取订单数量 + */ +export function getOrderCountByStatus(status) { + if (status === 'all') return orders.length + return orders.filter(o => o.status === status).length +} + +/** + * 根据状态获取订单列表 + */ +export function getOrdersByStatus(status) { + if (status === 'all') return orders + return orders.filter(o => o.status === status) +} + +/** + * 根据ID获取订单详情 + */ +export function getOrderById(id) { + return orders.find(o => o.id === id) +} + +/** + * 订单流转记录 + */ +export function getOrderFlowById(orderId) { + // 模拟订单流转记录 + const flows = { + 100001: [ + { time: '2025-01-28 14:28:00', status: '创建订单', desc: '订单创建成功' }, + { time: '2025-01-28 14:30:00', status: '支付完成', desc: '微信支付成功' }, + { time: '2025-01-28 14:32:00', status: '选手接单', desc: '甜心小鹿 接单' }, + { time: '2025-01-28 14:35:00', status: '开始服务', desc: '服务进行中...' } + ], + 100002: [ + { time: '2025-01-27 10:10:00', status: '创建订单', desc: '订单创建成功' }, + { time: '2025-01-27 10:15:00', status: '支付完成', desc: '微信支付成功' }, + { time: '2025-01-27 10:20:00', status: '选手接单', desc: '狙击之王 接单' }, + { time: '2025-01-27 10:30:00', status: '开始服务', desc: '开始一对一教学' }, + { time: '2025-01-27 12:30:00', status: '服务完成', desc: '选手提交服务资料' }, + { time: '2025-01-27 12:35:00', status: '确认完成', desc: '顾客确认服务完成' } + ] + } + return flows[orderId] || [] +} diff --git a/mock/players.js b/mock/players.js new file mode 100644 index 0000000..2321085 --- /dev/null +++ b/mock/players.js @@ -0,0 +1,99 @@ +/** + * 选手数据 + */ +export const players = [ + { + id: 30005, + tenantId: 10001, + name: '甜心小鹿', + avatar: 'https://picsum.photos/100/100?random=201', + gender: 'female', + age: 22, + gameId: 'Sweet_Deer_123', + level: '钻石II', + rating: 4.96, + orderCount: 3456, + completeCount: 3234, + tags: ['甜美', '温柔', '技术好'], + intro: '温柔小姐姐,陪你开心玩游戏~', + voiceSample: '', + status: 'online', + games: [ + { name: '王者荣耀', rank: '钻石II', winRate: 65 }, + { name: '英雄联盟', rank: '黄金I', winRate: 58 } + ] + }, + { + id: 30012, + tenantId: 10002, + name: '狙击之王', + avatar: 'https://picsum.photos/100/100?random=202', + gender: 'male', + age: 25, + gameId: 'Sniper_King_Pro', + level: '荣耀王者', + rating: 5.0, + orderCount: 567, + completeCount: 556, + tags: ['国服', '射手', '教学'], + intro: '前职业选手,专注射手教学3年', + status: 'busy', + games: [ + { name: '王者荣耀', rank: '荣耀王者', winRate: 78 } + ] + }, + { + id: 30018, + tenantId: 10003, + name: '冰霜女王', + avatar: 'https://picsum.photos/100/100?random=203', + gender: 'female', + age: 24, + gameId: 'FrostQueen', + level: '钻石I', + rating: 4.92, + orderCount: 2234, + completeCount: 2156, + tags: ['御姐', '技术', 'LOL'], + intro: '成熟御姐音,带你轻松上分', + status: 'online', + games: [ + { name: '英雄联盟', rank: '钻石I', winRate: 68 }, + { name: 'VALORANT', rank: '白金III', winRate: 62 } + ] + }, + { + id: 30025, + tenantId: 10005, + name: '璃月大佬', + avatar: 'https://picsum.photos/100/100?random=204', + gender: 'male', + age: 23, + gameId: 'Liyue_Master', + level: '满级', + rating: 4.97, + orderCount: 1567, + completeCount: 1534, + tags: ['满命', '深渊', '快速'], + intro: '原神全角色满命,深渊专家', + status: 'online', + games: [ + { name: '原神', rank: '满级', winRate: 100 } + ] + } +] + +/** + * 根据ID获取选手信息 + */ +export function getPlayerById(id) { + return players.find(p => p.id === id) +} + +/** + * 根据服务ID获取可用选手列表 + */ +export function getPlayersByServiceId(serviceId) { + // 简化处理:返回前3个选手 + return players.slice(0, 3) +} diff --git a/mock/services.js b/mock/services.js new file mode 100644 index 0000000..8dc1552 --- /dev/null +++ b/mock/services.js @@ -0,0 +1,235 @@ +/** + * 服务/商品数据 + */ +export const services = [ + // 王者荣耀服务 + { + id: 1001, + tenantId: 10001, + categoryId: 1, + categoryName: '王者荣耀', + name: '王者荣耀 星耀→王者 上分', + coverImage: 'https://picsum.photos/400/300?random=1', + price: 198.00, + originalPrice: 298.00, + description: '专业代练,3天快速上分,保证胜率,安全可靠', + serviceTime: 180, + salesCount: 1245, + rating: 4.9, + reviewCount: 856, + tags: ['热门', '高胜率', '快速'], + merchantName: '电竞之星工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=101', + playerCount: 15, + status: 0 + }, + { + id: 1002, + tenantId: 10001, + categoryId: 1, + categoryName: '王者荣耀', + name: '王者荣耀 娱乐陪玩 甜美女声', + coverImage: 'https://picsum.photos/400/300?random=2', + price: 35.00, + originalPrice: 50.00, + description: '温柔小姐姐陪你开黑,声音甜美,技术在线', + serviceTime: 60, + salesCount: 3456, + rating: 4.95, + reviewCount: 2134, + tags: ['甜美', '高评分', '在线'], + merchantName: '星光陪玩', + merchantAvatar: 'https://picsum.photos/100/100?random=102', + playerCount: 28, + status: 0 + }, + { + id: 1003, + tenantId: 10002, + categoryId: 1, + categoryName: '王者荣耀', + name: '王者荣耀 一对一教学 国服射手', + coverImage: 'https://picsum.photos/400/300?random=3', + price: 88.00, + originalPrice: 120.00, + description: '前职业选手教学,射手专精,助你快速提升', + serviceTime: 120, + salesCount: 567, + rating: 5.0, + reviewCount: 445, + tags: ['专业', '国服', '教学'], + merchantName: '巅峰电竞学院', + merchantAvatar: 'https://picsum.photos/100/100?random=103', + playerCount: 8, + status: 0 + }, + + // 英雄联盟服务 + { + id: 2001, + tenantId: 10001, + categoryId: 2, + categoryName: '英雄联盟', + name: 'LOL 黄金→钻石 上分代练', + coverImage: 'https://picsum.photos/400/300?random=4', + price: 288.00, + originalPrice: 399.00, + description: '大师级代练,胜率保证75%+,安全稳定', + serviceTime: 240, + salesCount: 892, + rating: 4.8, + reviewCount: 678, + tags: ['高胜率', '大师', '稳定'], + merchantName: '电竞之星工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=101', + playerCount: 12, + status: 0 + }, + { + id: 2002, + tenantId: 10003, + categoryId: 2, + categoryName: '英雄联盟', + name: 'LOL 娱乐陪玩 御姐音', + coverImage: 'https://picsum.photos/400/300?random=5', + price: 45.00, + originalPrice: 60.00, + description: '成熟御姐音,实力钻石,陪你轻松上分', + serviceTime: 60, + salesCount: 2234, + rating: 4.92, + reviewCount: 1567, + tags: ['御姐', '钻石', '热门'], + merchantName: '梦幻陪玩', + merchantAvatar: 'https://picsum.photos/100/100?random=104', + playerCount: 35, + status: 0 + }, + + // VALORANT服务 + { + id: 3001, + tenantId: 10002, + categoryId: 3, + categoryName: 'VALORANT', + name: 'VALORANT 白金→钻石 快速上分', + coverImage: 'https://picsum.photos/400/300?random=6', + price: 328.00, + originalPrice: 450.00, + description: '职业战队选手,VALORANT国际赛经验', + serviceTime: 300, + salesCount: 234, + rating: 4.95, + reviewCount: 189, + tags: ['职业', '国际赛', '快速'], + merchantName: '巅峰电竞学院', + merchantAvatar: 'https://picsum.photos/100/100?random=103', + playerCount: 6, + status: 0 + }, + + // CSGO服务 + { + id: 4001, + tenantId: 10004, + categoryId: 4, + categoryName: 'CSGO', + name: 'CSGO 黄金→老鹰 代练', + coverImage: 'https://picsum.photos/400/300?random=7', + price: 258.00, + originalPrice: 350.00, + description: '前CNCS职业选手,枪法精准,意识一流', + serviceTime: 180, + salesCount: 445, + rating: 4.88, + reviewCount: 334, + tags: ['职业', 'CNCS', '精准'], + merchantName: 'FPS大师工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=105', + playerCount: 10, + status: 0 + }, + + // 原神服务 + { + id: 6001, + tenantId: 10005, + categoryId: 6, + categoryName: '原神', + name: '原神 深渊12层满星代打', + coverImage: 'https://picsum.photos/400/300?random=8', + price: 68.00, + originalPrice: 88.00, + description: '满命大佬,深渊12层一次性满星', + serviceTime: 90, + salesCount: 1567, + rating: 4.97, + reviewCount: 1234, + tags: ['满命', '深渊', '快速'], + merchantName: '提瓦特工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=106', + playerCount: 18, + status: 0 + }, + { + id: 6002, + tenantId: 10005, + categoryId: 6, + categoryName: '原神', + name: '原神 每日委托代做', + coverImage: 'https://picsum.photos/400/300?random=9', + price: 15.00, + originalPrice: 20.00, + description: '每日委托快速完成,解放双手', + serviceTime: 30, + salesCount: 3456, + rating: 4.85, + reviewCount: 2567, + tags: ['日常', '便宜', '快速'], + merchantName: '提瓦特工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=106', + playerCount: 25, + status: 0 + }, + + // 和平精英服务 + { + id: 7001, + tenantId: 10006, + categoryId: 7, + categoryName: '和平精英', + name: '和平精英 钻石→皇冠 上分', + coverImage: 'https://picsum.photos/400/300?random=10', + price: 188.00, + originalPrice: 258.00, + description: '职业战队退役选手,吃鸡率80%+', + serviceTime: 150, + salesCount: 789, + rating: 4.91, + reviewCount: 567, + tags: ['职业', '高吃鸡', '稳定'], + merchantName: '绝地求生工作室', + merchantAvatar: 'https://picsum.photos/100/100?random=107', + playerCount: 14, + status: 0 + } +] + +/** + * 热门推荐服务 + */ +export const hotServices = services.filter(s => s.salesCount > 1000).slice(0, 6) + +/** + * 根据分类获取服务 + */ +export function getServicesByCategory(categoryId) { + return services.filter(s => s.categoryId === categoryId) +} + +/** + * 根据ID获取服务详情 + */ +export function getServiceById(id) { + return services.find(s => s.id === id) +} diff --git a/mock/user.js b/mock/user.js new file mode 100644 index 0000000..541d12b --- /dev/null +++ b/mock/user.js @@ -0,0 +1,68 @@ +/** + * 用户数据 + */ +export const currentUser = { + id: 20001, + openid: 'oXYZ123456789', + nickname: '电竞少年', + avatar: 'https://picsum.photos/100/100?random=301', + phone: '138****8888', + vipLevel: 2, + vipName: '黄金会员', + points: 2580, + balance: 156.50, + orderCount: 28, + evaluateCount: 15, + createTime: '2024-08-15 10:30:00', + lastLoginTime: '2025-01-28 14:00:00' +} + +/** + * 用户统计数据 + */ +export const userStats = { + orderCount: { + all: 28, + waitPay: 0, + waitAccept: 1, + inProgress: 1, + waitConfirm: 1, + completed: 25 + }, + favoriteCount: 12, + couponCount: 3, + messageCount: 5 +} + +/** + * 我的优惠券 + */ +export const coupons = [ + { + id: 1, + name: '新人专享券', + type: 'discount', + value: 20, + minAmount: 50, + expireTime: '2025-02-28', + status: 'available' + }, + { + id: 2, + name: '满100减30', + type: 'cash', + value: 30, + minAmount: 100, + expireTime: '2025-03-15', + status: 'available' + }, + { + id: 3, + name: '8.8折优惠券', + type: 'discount', + value: 12, + minAmount: 80, + expireTime: '2025-01-20', + status: 'expired' + } +] diff --git a/package.json b/package.json new file mode 100644 index 0000000..02288b5 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "game-service-miniapp", + "version": "1.0.0", + "description": "游戏服务交易平台 - 电竞赛博朋克风格", + "main": "main.js", + "scripts": { + "dev:h5": "uni", + "build:h5": "uni build", + "dev:mp-weixin": "uni -p mp-weixin", + "build:mp-weixin": "uni build -p mp-weixin" + }, + "keywords": ["uni-app", "游戏服务", "赛博朋克"], + "author": "", + "license": "MIT", + "dependencies": { + "vue": "^3.2.47", + "pinia": "^2.1.3" + }, + "devDependencies": { + "@dcloudio/uni-app": "^3.0.0", + "@dcloudio/uni-h5": "^3.0.0", + "@dcloudio/uni-mp-weixin": "^3.0.0", + "@dcloudio/vite-plugin-uni": "^3.0.0", + "vite": "^4.3.9", + "sass": "^1.62.1", + "sass-loader": "^13.2.2" + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..3ea3963 --- /dev/null +++ b/pages.json @@ -0,0 +1,103 @@ +{ + "easycom": { + "autoscan": true, + "custom": { + "^service-card": "@/components/service-card/index.vue", + "^order-card": "@/components/order-card/index.vue", + "^game-category": "@/components/game-category/index.vue" + } + }, + "pages": [ + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "电竞服务", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/category/list", + "style": { + "navigationBarTitleText": "服务列表", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/service/detail", + "style": { + "navigationBarTitleText": "服务详情", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/order/create", + "style": { + "navigationBarTitleText": "下单确认", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/order/list", + "style": { + "navigationBarTitleText": "我的订单", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "订单详情", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/user/index", + "style": { + "navigationBarTitleText": "个人中心", + "navigationBarBackgroundColor": "#0a0e27", + "navigationBarTextStyle": "white" + } + } + ], + "tabBar": { + "color": "#7a7e9d", + "selectedColor": "#00ffff", + "backgroundColor": "#0a0e27", + "borderStyle": "black", + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页", + "iconPath": "static/icons/home.png", + "selectedIconPath": "static/icons/home-active.png" + }, + { + "pagePath": "pages/order/list", + "text": "订单", + "iconPath": "static/icons/order.png", + "selectedIconPath": "static/icons/order-active.png" + }, + { + "pagePath": "pages/user/index", + "text": "我的", + "iconPath": "static/icons/user.png", + "selectedIconPath": "static/icons/user-active.png" + } + ] + }, + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "电竞服务平台", + "navigationBarBackgroundColor": "#0a0e27", + "backgroundColor": "#0f1229", + "backgroundColorTop": "#0a0e27", + "backgroundColorBottom": "#0f1229" + } +} diff --git a/pages/category/list.vue b/pages/category/list.vue new file mode 100644 index 0000000..5b06fd1 --- /dev/null +++ b/pages/category/list.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..a0f7fb1 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,368 @@ + + + + + diff --git a/pages/order/create.vue b/pages/order/create.vue new file mode 100644 index 0000000..c0449a8 --- /dev/null +++ b/pages/order/create.vue @@ -0,0 +1,356 @@ +