10 Commits

Author SHA1 Message Date
yuzhiran 1e8e22c9ed docs: update project status v4.8, AGENTS.md build notes, deployment docs
- PROJECT-STATUS.md: v4.8 changelog (SEO, share hooks, version injection)
- AGENTS.md: update version to v1.0.17, add build notes for SEO/version/share
- DEPLOYMENT.md: update deploy instructions for robots.txt/sitemap.xml/static, version bump
2026-06-21 20:09:45 +08:00
yuzhiran d8fb8e3bba feat: enable WeChat share/forward on all pages via onShareAppMessage + onShareTimeline 2026-06-21 18:51:35 +08:00
yuzhiran 214571688c feat: SEO optimization - canonical URL, robots.txt, sitemap, structured data, keyword-rich titles, manifest update 2026-06-21 09:48:41 +08:00
yuzhiran 8532776fa1 refactor: remove duplicate contact button in about page 2026-06-21 09:38:24 +08:00
yuzhiran b8667395ac feat: unify contact button styles, dynamic version from git tag, enrich AI positions & homepage UX 2026-06-21 09:16:31 +08:00
yuzhiran 1d1c4ab590 fix: bump patch version automatically on mp upload (v1.0.16 → 1.0.17) 2026-06-21 09:03:34 +08:00
yuzhiran 19b087a589 docs: update project status to v4.7 - gravity pay-per-use, full production deployment 2026-06-21 08:58:33 +08:00
yuzhiran 310176a11b chore: production cleanup - remove debug logs, add DB cleanup script
- App.vue: remove console.log on launch/show/hide, drop unused onShow/onHide imports
- interview.vue: remove verbose console.log('[ASR] upload response')
- login.vue: remove debug console.log('[wxLogin]') logs (keep error logs)
- scripts/cleanup-test-data.ts: new script to identify and remove test data
  while preserving admin accounts; supports --dry-run preview mode
- All 43 backend tests pass
2026-06-20 23:08:44 +08:00
yuzhiran ef4d22a633 feat(admin): enrich admin panel fields; add user index constraint and customer service
- admin controller: add updatedAt to interview/resume selects; add orderCount,
  todayOrders, totalRevenue to overview
- admin.vue: enrich all tabs with more fields
  - overview: order cards (count, revenue)
  - users: wxOpenid, email, createdAt, interviewCount, vipExpireAt, role badge
  - interviews: user email, updatedAt, summary preview
  - orders: title, type, channel, paidAt, wxTransactionId, refund info
  - resumes: user email, updatedAt
  - share: sharer phone, shareCode, isActive, visitorId(IP), creditedAt
  - admins: email, createdAt
- user.schema: add unique indexes on phone/wxOpenid/email; pre-save hook
  requiring at least one contact method
- user/about: add WeChat contact button (open-type=contact) for customer service
2026-06-20 22:38:33 +08:00
yuzhiran 8ee27fdd32 feat: refactor member to pay-per-use gravity purchase; mv webview to clipboard+browser
- member.vue: rewrite from subscription plans (free/growth/sprint) to
  H5-only pay-per-use gravity purchase with quantity selector + QR code
- user.vue: gravity card replacing quota card, add share/contribute/H5-buy
  entry points, plus gravity acquisition modal (share/contribute/buy)
- share.vue: layout fix (flex column), smarter copyLink with cached URL,
  WeChat timeline hint instead of open-type
- share.controller.ts: add GET /:shareCode redirect route (IP record + 302)
- interview.vue: guest mode fix, H5 buy modal, clipboard copy instead of
  webview for mini-program
- App.vue: handleH5UrlParams for ?token=&buy=gravity auto-login
- composables/useGravityPurchase.ts: reusable gravity purchase composable
- remove webview.vue (no longer used), replace with clipboard+browser flow
- AGENTS.md: sync all above changes, fix duplicate numbering
2026-06-20 20:49:15 +08:00
36 changed files with 1300 additions and 746 deletions
+26 -12
View File
@@ -21,9 +21,10 @@ zhiyin/
├── zhiyin-app/ # uni-app 3.x 前端 (H5 + 微信小程序)
│ └── src/
│ ├── pages/ # 20 个页面 (pages.json 路由)
│ ├── composables/ # 可复用组合式函数(如 useGravityPurchase
│ ├── services/api.ts # API 调用封装 (uni.request)
│ ├── config.ts # 端点定义 + api() 辅助函数
│ └── App.vue # 设计 Token + 全局样式
│ └── App.vue # 设计 Token + 全局样式 + H5 URL 参数处理
└── docs/ # 产品/架构/部署/路线图文档
```
@@ -96,10 +97,13 @@ zhiyin/
- 环境变量: `AI_PRIMARY_KEY`, `AI_BACKUP_KEY`
### 支付(微信支付 v3
- Native 支付(H5 扫码): `POST /payment/create`
- JSAPI 支付(小程序内): `POST /payment/jsapi`
- 支付回调: `POST /payment/notify`@Public,验签 + 解密 + 自动开会员
- Native 支付(H5 扫码): `POST /payment/create-product`(按量购买引力值)
- JSAPI 支付(小程序内): `POST /payment/jsapi-product`(按量购买引力值)
- 支付回调: `POST /payment/notify`@Public,验签 + 解密 + 自动到账
- 支付结果轮询: `GET /payment/check/:outTradeNo`
- 产品定价: `GET /member/plans`(含 products 字段,定义引力值单价和赠送量)
- 需要微信商户证书文件(通过 postbuild 复制到 dist
- **注意**: 当前会员体系已从按月订阅制改为按量购买引力值制(小程序内复制链接到浏览器打开购买,H5 直接扫码支付)
---
@@ -137,6 +141,12 @@ npm test # 前端单元测试(vitest,7 个)
cd backend && npm run build
```
### 构建产物说明
- **H5 构建** (`npm run build:h5`):自动复制 `avatar-*.png``static/`,复制 `robots.txt``sitemap.xml` 到输出根目录
- **版本号注入**`vite.config.js``define.__APP_VERSION__` 自动从 `git describe --tags` 获取版本号,`about.vue` 页面实时显示
- **小程序上传版本** (`scripts/upload-mp.js`):自动从 git tag 获取基础版本,末位自增 1(如 tag v1.0.16 → 上传版本 1.0.17
- **微信分享**:所有主页面均已注册 `onShareAppMessage` + `onShareTimeline`,右上角菜单转发/分享到朋友圈可用
### 部署后端
```bash
cd backend && npm run build
@@ -152,7 +162,9 @@ cd zhiyin-app && npm run build:h5
rm -rf /www/wwwroot/zhiyin.yzrcloud.cn/assets
cp -r dist/build/h5/index.html /www/wwwroot/zhiyin.yzrcloud.cn/
cp -r dist/build/h5/assets /www/wwwroot/zhiyin.yzrcloud.cn/
chown -R www:www /www/wwwroot/zhiyin.yzrcloud.cn/index.html /www/wwwroot/zhiyin.yzrcloud.cn/assets
cp -r dist/build/h5/static /www/wwwroot/zhiyin.yzrcloud.cn/
cp -f dist/build/h5/robots.txt dist/build/h5/sitemap.xml /www/wwwroot/zhiyin.yzrcloud.cn/
chown -R www:www /www/wwwroot/zhiyin.yzrcloud.cn/
# 验证无缺失文件
grep -oP '["'"'"']([a-zA-Z0-9_-]+\.[a-z]+(\.js|\.css|\.png|\.svg))["'"'"']' /www/wwwroot/zhiyin.yzrcloud.cn/assets/index-*.js | sort -u
```
@@ -190,14 +202,14 @@ cd zhiyin-app && npm run build:mp-weixin && node scripts/upload-mp.js
## 六、项目状态与开发阶段
**当前**: Phase 1MVP 上线)进行中 — v1.0.16
**当前**: Phase 1.5(商业化 + 全量部署)— v1.0.17
| 阶段 | 状态 | 关键交付 |
|------|------|---------|
| Phase 0: 战略升级 | ✅ 完成 | 定价重构(免费 + ¥19.9/月),三层壁垒设计 |
| Phase 0: 战略升级 | ✅ 完成 | 定价重构(免费 + 按量购买),三层壁垒设计 |
| Phase 0.5: 壁垒构建 | ✅ 完成 | 数据飞轮(面经贡献+题库),留存入围(进步轨迹+打卡日历+每日一题) |
| Phase 1: MVP 上线 | 🚧 当前 | 小程序 v1.0.16 已上传、引力值体系统一(VIP 不再无限次)、管理后台完善、H5 已部署、生产模式已启用 |
| Phase 1.5: 商业化 | 📋 规划 | 引力值运营策略、每日一题定时推送、PMF 验证 |
| Phase 1: MVP 上线 | ✅ 完成 | 面试复盘(whisper.cpp ASR + AI 评析)、AI 择业顾问 |
| Phase 1.5: 商业化 | 🚧 当前 | 按量购买引力值(¥5/份)、管理后台完善、H5/小程序全量部署上线、清理脚本 |
| Phase 2: 增强 + 题库 | 📋 规划 | 50+ 校招岗位、技能缺口分析、公司真题库建设 |
| Phase 3: 秋招冲刺 | 📋 规划 | 高校合作、B 端服务、KOC 推广 |
@@ -258,7 +270,7 @@ VITE_APP_NAME=AI磁场
- 远程仓库: `http://127.0.0.1:2999/txai-dev/zhiyin.git`(本机 Gitea,带 token 认证)
- 默认分支: `master`
- 最新 tag: `v1.0.11`(小程序上传版本源自 git tag
- 最新 tag: `v1.0.16`(小程序上传版本 v1.0.17 源自 git tag + 末位自增 1
---
@@ -272,10 +284,12 @@ VITE_APP_NAME=AI磁场
6. **API 限流**: 100 次/60 秒(在 `app.module.ts` 中配置),注意避免在定时任务和批量操作中被限
7. **验证码**: 生产模式(`NODE_ENV=production`)使用真实 SMTP 发邮件验证码;非生产模式手机验证码固定为 `123456`、邮件验证码在响应中返回 `devCode`
8. **MongoDB**: 8 个核心集合 + 2 个分享集合
9. **引力值体系**: 所有计划统一走引力值消耗(面试 5、优化 3、下载 2)。VIP 不再免额度,成长版每月 250 引力值,冲刺版每月 600 引力值,每日凌晨 2 点定时补给。免费用户注册送 5 引力值。
9. **引力值体系**: 所有计划统一走引力值消耗(面试 5、优化 3、下载 2)。VIP 不再免额度,成长版每月 250 引力值,冲刺版每月 600 引力值,每日凌晨 2 点定时补给。免费用户注册送 5 引力值。小程序内通过分享得引力值/贡献面经/复制官网链接到浏览器打开购买三种方式获取引力值;H5 直接扫码支付按量购买(¥5/份)。
10. **api.ts 陷阱**: 对象字面量必须在 `export const apiService = {``const apiService = { ... export default apiService` 中包裹,否则 uni-app 构建报错 `Expected ";" but found ":"`。git pull 后经常丢失这行声明,需手动补回
11. **H5 构建 assets 清理**: `assets/` 中的旧 hash 文件不能随意删除——`index-*.js`(主 bundle)动态 import 了所有 page chunk,删除仍在引用的文件会导致浏览器 `NS_ERROR_CORRUPTED_CONTENT`
11. **管理后台自动验证**: `admin.vue``onMounted` 自动调用 `doVerify()`,进入后台即检测 JWT 中 `role` 是否为 `admin`,不再需要手动点击"验证管理员身份"按钮
12. **管理后台自动验证**: `admin.vue``onMounted` 自动调用 `doVerify()`,进入后台即检测 JWT 中 `role` 是否为 `admin`,不再需要手动点击"验证管理员身份"按钮
13. **分享重定向路由**: `share.controller.ts``GET /api/share/:shareCode` 是公开路由(泛匹配,放最后避免拦截其他路由),访问时记录访问者 IP → 302 重定向到 H5 首页
14. **小程序官网购买走剪贴板**: 小程序内"官网购买"不再使用 webview 内嵌 H5,改为 `uni.setClipboardData` 复制带 JWT token 的 URL 到剪贴板,提示用户在手机浏览器中打开购买(`App.vue``handleH5UrlParams` 解析 `?token=``?buy=gravity` 参数自动登录跳转)
---
+156
View File
@@ -0,0 +1,156 @@
/**
* 测试数据清理脚本
* 识别并清理测试用户及其关联数据(订单/面试/简历/分享)
* 保留所有管理员账号
*
* 用法:
* 预览模式(推荐先执行): npx ts-node --project tsconfig.json scripts/cleanup-test-data.ts
* 执行清理: npx ts-node --project tsconfig.json scripts/cleanup-test-data.ts --execute
*/
import { NestFactory } from '@nestjs/core'
import { AppModule } from '../src/app.module'
import { getModelToken } from '@nestjs/mongoose'
import { Model } from 'mongoose'
import { User, UserDocument } from '../src/modules/user/user.schema'
import { Interview, InterviewDocument } from '../src/modules/interview/interview.schema'
import { Resume, ResumeDocument } from '../src/modules/resume/resume.schema'
import { PaymentOrder, PaymentOrderDocument } from '../src/modules/payment/payment-order.schema'
import { ShareRecord, ShareRecordDocument, ShareVisit, ShareVisitDocument } from '../src/modules/share/share.schema'
// 已知测试账号(保留这些不清理——防止误伤真实用户)
const KNOWN_TEST_ACCOUNTS = [
'test@yzrcloud.cn',
'test@test.com',
]
// 管理员账号(始终保留)
const ADMIN_EMAILS = [
'13701190814@139.com',
]
async function bootstrap() {
const isExecute = process.argv.includes('--execute')
const app = await NestFactory.createApplicationContext(AppModule)
const userModel = app.get<Model<UserDocument>>(getModelToken(User.name))
const interviewModel = app.get<Model<InterviewDocument>>(getModelToken(Interview.name))
const resumeModel = app.get<Model<ResumeDocument>>(getModelToken(Resume.name))
const orderModel = app.get<Model<PaymentOrderDocument>>(getModelToken(PaymentOrder.name))
const shareModel = app.get<Model<ShareRecordDocument>>(getModelToken(ShareRecord.name))
const shareVisitModel = app.get<Model<ShareVisitDocument>>(getModelToken(ShareVisit.name))
// Step 1: 找到所有管理员(保留)
const admins = await userModel.find({ role: 'admin' }).lean().exec()
const adminIds = admins.map(a => a._id.toString())
const adminEmails = admins.map(a => a.email).filter(Boolean)
// Step 2: 找到测试用户
const allUsers = await userModel.find().sort({ createdAt: -1 }).lean().exec()
const allAdminEmails = [...new Set([...ADMIN_EMAILS, ...adminEmails])]
const knownTestEmails = KNOWN_TEST_ACCOUNTS
// 测试用户识别策略:
// a) 已知测试邮箱
// b) 非管理员
// 实际用户自己补充识别条件
const testUserIds: string[] = []
const skippedUserIds: string[] = []
for (const u of allUsers) {
const uid = u._id.toString()
// 跳过管理员
if (adminIds.includes(uid)) {
skippedUserIds.push(uid)
continue
}
const userEmail = (u.email || '').toLowerCase().trim()
// 已知测试邮箱 → 标记为测试
if (knownTestEmails.includes(userEmail)) {
testUserIds.push(uid)
console.log(` [TEST] ${u.phone || '--'} / ${userEmail} / ${u.nickname || '--'}`)
continue
}
// 找不到匹配条件的用户属于真正用户
skippedUserIds.push(uid)
}
console.log(`\n========================================`)
console.log(`总用户: ${allUsers.length}`)
console.log(`管理员: ${adminIds.length}`)
console.log(`测试用户: ${testUserIds.length}`)
console.log(`真实用户: ${skippedUserIds.length}`)
console.log(`========================================\n`)
if (testUserIds.length === 0) {
console.log('未发现测试用户,无需清理。')
await app.close()
return
}
// Step 3: 统计关联数据
const testInterviews = await interviewModel.find({ userId: { $in: testUserIds } }).lean().exec()
const testResumes = await resumeModel.find({ userId: { $in: testUserIds } }).lean().exec()
const testOrders = await orderModel.find({ userId: { $in: testUserIds } }).lean().exec()
const testShares = await shareModel.find({ userId: { $in: testUserIds } }).lean().exec()
console.log('将删除的关联数据:')
console.log(` - 面试记录: ${testInterviews.length}`)
console.log(` - 简历: ${testResumes.length}`)
console.log(` - 订单: ${testOrders.length}`)
console.log(` - 分享记录: ${testShares.length}`)
console.log(` - 用户账号: ${testUserIds.length}\n`)
if (!isExecute) {
console.log('⚠️ 预览模式,未执行删除。')
console.log(' 确认无误后执行: npx ts-node --project tsconfig.json scripts/cleanup-test-data.ts --execute\n')
await app.close()
return
}
// Step 4: 执行删除(先删关联数据再删用户)
console.log('正在清理...')
// 分享访问记录(通过分享记录找)
const shareIds = testShares.map(s => s._id)
if (shareIds.length > 0) {
const visits = await shareVisitModel.deleteMany({ shareId: { $in: shareIds } }).exec()
console.log(` - 删除分享访问记录: ${visits.deletedCount}`)
}
if (testShares.length > 0) {
const r = await shareModel.deleteMany({ _id: { $in: shareIds } }).exec()
console.log(` - 删除分享记录: ${r.deletedCount}`)
}
if (testInterviews.length > 0) {
const r = await interviewModel.deleteMany({ _id: { $in: testInterviews.map(i => i._id) } }).exec()
console.log(` - 删除面试记录: ${r.deletedCount}`)
}
if (testResumes.length > 0) {
const r = await resumeModel.deleteMany({ _id: { $in: testResumes.map(r => r._id) } }).exec()
console.log(` - 删除简历: ${r.deletedCount}`)
}
if (testOrders.length > 0) {
const r = await orderModel.deleteMany({ _id: { $in: testOrders.map(o => o._id) } }).exec()
console.log(` - 删除订单: ${r.deletedCount}`)
}
if (testUserIds.length > 0) {
const r = await userModel.deleteMany({ _id: { $in: testUserIds } }).exec()
console.log(` - 删除测试用户: ${r.deletedCount}`)
}
console.log('\n✅ 清理完成!')
await app.close()
}
bootstrap().catch((err) => {
console.error('清理失败:', err)
process.exit(1)
})
+13 -6
View File
@@ -48,7 +48,7 @@ export class AdminController {
const [
userCount, interviewCount, todayUsers, todayInterviews,
resumeCount, paidDownloadCount,
planStats,
planStats, orderCount, todayOrders, totalRevenue,
] = await Promise.all([
this.userModel.countDocuments().exec(),
this.interviewModel.countDocuments().exec(),
@@ -59,12 +59,19 @@ export class AdminController {
this.userModel.aggregate([
{ $group: { _id: '$plan', count: { $sum: 1 } } },
]).exec(),
this.orderModel.countDocuments().exec(),
this.orderModel.countDocuments({ status: 'success', createdAt: { $gte: new Date(Date.now() - 24 * 60 * 60 * 1000) } }).exec(),
this.orderModel.aggregate([
{ $match: { status: 'success' } },
{ $group: { _id: null, total: { $sum: '$amount' } } },
]).exec(),
])
const planBreakdown: Record<string, number> = {}
planStats.forEach(p => { planBreakdown[p._id || 'free'] = p.count })
return {
userCount, interviewCount, todayUsers, todayInterviews,
resumeCount, paidDownloadCount,
resumeCount, paidDownloadCount, orderCount, todayOrders,
totalRevenue: totalRevenue[0]?.total || 0,
planBreakdown,
}
}
@@ -95,8 +102,8 @@ export class AdminController {
this.interviewModel.find()
.sort({ createdAt: -1 })
.skip(skip).limit(+limit)
.populate('userId', 'phone nickname')
.select('position status totalScore questionCount fillerScore fillerDensity summary createdAt')
.populate('userId', 'phone nickname email wxOpenid')
.select('position status totalScore questionCount fillerScore fillerDensity summary createdAt updatedAt')
.lean().exec(),
this.interviewModel.countDocuments().exec(),
])
@@ -217,8 +224,8 @@ export class AdminController {
this.resumeModel.find()
.sort({ createdAt: -1 })
.skip(skip).limit(+limit)
.populate('userId', 'phone nickname')
.select('title targetPosition version paidDownload createdAt')
.populate('userId', 'phone nickname email')
.select('title targetPosition version paidDownload createdAt updatedAt contentHash')
.lean().exec(),
this.resumeModel.countDocuments().exec(),
])
@@ -6,7 +6,6 @@ import { VipExpiryService } from './vip-expiry.service'
import { GravityTopUpService } from './gravity-top-up.service'
import { DailyQuestion, DailyQuestionSchema } from '../schemas/daily-question.schema'
import { User, UserSchema } from '../user/user.schema'
import { PricingService } from '../schemas/pricing.service'
@Module({
imports: [
@@ -15,6 +14,6 @@ import { PricingService } from '../schemas/pricing.service'
{ name: User.name, schema: UserSchema },
]),
],
providers: [WechatTokenService, DailyQuestionPushService, VipExpiryService, GravityTopUpService, PricingService],
providers: [WechatTokenService, DailyQuestionPushService, VipExpiryService, GravityTopUpService],
})
export class ScheduleModule {}
+26 -1
View File
@@ -1,9 +1,11 @@
import { Controller, Get, Post, Body, Param, Query, HttpException, HttpStatus, UseGuards } from '@nestjs/common'
import { Controller, Get, Post, Body, Param, Query, HttpException, HttpStatus, UseGuards, Req, Res } from '@nestjs/common'
import { Request, Response } from 'express'
import { JwtService } from '@nestjs/jwt'
import { ShareService } from './share.service'
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard'
import { CurrentUser } from '../../common/decorators/current-user.decorator'
import { Public } from '../../common/decorators/public.decorator'
import * as crypto from 'crypto'
@Controller('share')
export class ShareController {
@@ -66,4 +68,27 @@ export class ShareController {
) {
return this.shareService.visitors(userId, Number(page) || 1, Number(pageSize) || 20)
}
// 泛匹配路由放在最后,避免拦截 stats/records/visitors 等
@Public()
@Get(':shareCode')
async redirect(
@Param('shareCode') shareCode: string,
@Req() req: Request,
@Res() res: Response,
) {
try {
const ip = req.ip || req.socket?.remoteAddress || 'unknown'
const visitorId = crypto.createHash('md5').update(ip).digest('hex').slice(0, 16)
let visitorUserId: string | undefined
const token = req.query.token as string | undefined
if (token) {
try { const payload = this.jwtService.verify(token) as any; visitorUserId = payload.userId } catch {}
}
await this.shareService.visit(shareCode, visitorId, visitorUserId)
} catch (e) {
// 访问记录失败不影响跳转
}
res.redirect(HttpStatus.FOUND, `https://zhiyin.yzrcloud.cn/?share=${shareCode}`)
}
}
+10 -3
View File
@@ -5,10 +5,10 @@ export type UserDocument = User & Document
@Schema({ timestamps: true })
export class User {
@Prop({ sparse: true })
@Prop({ unique: true, sparse: true })
phone?: string
@Prop({ sparse: true })
@Prop({ unique: true, sparse: true })
wxOpenid?: string
@Prop({ default: '' })
@@ -60,7 +60,7 @@ export class User {
@Prop({ default: false })
isSystemAdmin: boolean
@Prop({ sparse: true })
@Prop({ unique: true, sparse: true })
email?: string
@Prop({ default: '', select: false })
@@ -68,3 +68,10 @@ export class User {
}
export const UserSchema = SchemaFactory.createForClass(User)
UserSchema.pre('save', function (next) {
if (!this.phone && !this.wxOpenid && !this.email) {
return next(new Error('用户必须至少有一个联系方式(手机号/微信/邮箱)'))
}
next()
})
+8 -2
View File
@@ -1,6 +1,6 @@
# 职引 - 部署文档
> **最后更新**: 2026-06-09
> **最后更新**: 2026-06-21
> **生产环境**: 已部署(服务器已购 + 域名已配)
## 目录
@@ -128,7 +128,11 @@ npm run build:h5
### 3. 部署到 Web 服务器
```bash
# 构建含 SEO 文件(robots.txt, sitemap.xml, 数字人头像)
npm run build:h5
# 部署所有产物
scp -r dist/build/h5/* user@your-server:/www/wwwroot/zhiyin.yzrcloud.cn/
# 或者使用服务端脚本(自动复制 static/、robots.txt、sitemap.xml
```
### 4. Nginx 配置
@@ -223,7 +227,7 @@ node scripts/upload-mp.js
```
### 版本号
当前线上版本:**1.0.3**见 note.txt
当前线上版本:**1.0.17**git tag v1.0.16,脚本自动末位自增 → 上传版本 1.0.17
---
@@ -249,3 +253,5 @@ node scripts/upload-mp.js
|------|----------|--------|
| 2026-06-09 | 初版 | AI |
| 2026-06-09 | 更新生产域名:zhiyinwx.yzrcloud.cnAPI :3006)、zhiyin.yzrcloud.cnH5 静态目录) | 小之 |
| 2026-06-21 | 更新部署版本至 v1.0.16;小程序上传工具使用 git tag 自动获取版本号 | 小之 |
| 2026-06-21 | v4.8 SEO + 分享全面优化:部署新增 robots.txt、sitemap.xml、static/ 目录;版本号自动注入(Vite define);13 页面微信分享全部开启;上传脚本版本号末位自增 1 | AI |
+12 -11
View File
@@ -1,8 +1,8 @@
# 职引 · 完整功能清单 v4.3
# 职引 · 完整功能清单 v4.7
> **版本**: v4.5
> **日期**: 2026-06-17
> **状态**: Phase 1.5 启动:面试复盘 + AI 择业顾问 MVP 就绪
> **版本**: v4.7
> **日期**: 2026-06-21
> **状态**: Phase 1.5 按量购买引力值 + 全量生产部署
> **定位**: 应届生/实习生 AI 面试教练
---
@@ -94,13 +94,13 @@
### 3.1 会员系统
| 功能 | 状态 | 描述 | 优先级 |
|------|------|------|--------|
| 免费版 | ✅ 完成 | 日 2 次面试,5 轮/次 | P0 |
| 成长版 ¥19.9/月 | ✅ 完成 | 无限面试 + 高级报告 + 进步轨迹 | P0 |
| 冲刺版 ¥49.9/月 | ❌ 未实现 | 高客单价缺失 | P1 |
| 微信支付 Native(扫码) | ✅ 完成 | H5 支付 | P0 |
| 微信支付 JSAPI | ✅ 完成 | 小程序内支付 | P0 |
| 支付回调/自动开会员 | ✅ 完成 | 回调验签 + 解密 + 会员激活 | P0 |
| 会员权益对比 | ✅ 完成 | 免费/成长版对比展示 | P0 |
| 免费版 | ✅ 完成 | 注册送 5 引力值,面试消耗 5/次 | P0 |
| 按量购买引力值 | ✅ 完成 | ¥5/份,含 5 引力值,H5 扫码支付 | P0 |
| 微信支付 Native(扫码) | ✅ 完成 | H5 扫码支付 | P0 |
| 支付回调/自动到账 | ✅ 完成 | 回调验签 + 解密 + 引力值自动到账 | P0 |
| 小程序剪贴板购买 | ✅ 完成 | 复制官网链接到手机浏览器打开购买 | P0 |
| 会员权益展示 | ✅ 完成 | 引力值 + 获取入口 | P0 |
| 客服按钮 | ✅ 完成 | 用户页 + 关于页 `<button open-type="contact">` | P1 |
### 3.2 B 端服务(Q4 启动)
| 功能 | 状态 | 描述 |
@@ -192,3 +192,4 @@
| 2026-06-09 | 同步代码:Phase 0.5 功能标记完成,修正状态 | AI |
| 2026-06-16 | **v4.2**:新增面试复盘功能(whisper.cpp ASR + AI 评析 + 口语分析) | AI |
| 2026-06-17 | **v4.3**:新增 AI 择业顾问功能(专业分析 + 岗位匹配 + 多轮对话) | AI |
| 2026-06-21 | **v4.7**:按量购买引力值重构(¥5/份取代月订阅);微信小程序剪贴板购买链路;客服按钮;管理后台全面完善;生产环境全量部署上线 | AI |
+21 -17
View File
@@ -1,8 +1,8 @@
# 职引项目 · 状态报告 v4.6
# 职引项目 · 状态报告 v4.8
> **项目版本**: v4.6
> **更新时间**: 2026-06-19
> **项目状态**: ✅ 引力值体系统一 + 管理后台完善
> **项目版本**: v4.8
> **更新时间**: 2026-06-21
> **项目状态**: ✅ SEO 优化 + 微信分享全面开启 + 全量部署
---
@@ -13,7 +13,7 @@
| 项目名称 | 职引(ZhiYin |
| 定位 | 应届生/实习生 AI 面试教练 |
| 技术栈 | NestJS + MongoDB + Uni-App(Vue3) |
| 定价 | 免费版 / ¥19.9/月(成长版) / ¥49.9/月(冲刺版) |
| 定价 | 免费版 / 按量购买引力值(¥5/份) |
| AI 模型 | DeepSeek V4-Flash(主) + Step-3.5-Flash(备) |
| ASR | whisper.cpp(本地部署,tiny/base 模型,无需 API Key |
| 后端模块 | user, interview, resume, member, payment, positions, ai, analyze, upload, admin, email, progress, contribution, daily-question, schedule, interview-review, career-advice |
@@ -25,17 +25,19 @@
| 模块 | 完成度 | 说明 |
|------|------|------|
| 后端 API | **99%** | 核心 + 护城河 P0-P5 全部实现 |
| 前端页面 | **88%** | 17 个页面含真实 API 调用 |
| 前端页面 | **95%** | 20 个页面含真实 API 调用 |
| AI 面试模拟 | **95%** | 多轮对话 + 评分 + 报告 + 进度追踪 |
| 简历诊断/优化 | **95%** | 文件上传 + AI 分析 + 下载 |
| 支付系统(微信) | **95%** | API v3 完整对接,含真实证书 |
| 会员系统 | **100%** | 成长版 + 冲刺版,含权益扣减 |
| 支付系统(微信) | **95%** | API v3 完整对接,含真实证书H5 扫码支付可用 |
| 会员系统 | **100%** | 改为按量购买引力值体系(¥5/份),免费版注册送 5 引力值 |
| 护城河 P0-P5 | **100%** | AI 结构化 / 行业基准 / VIP 过期 / 分享卡片 / 打卡积分 / 岗位匹配 |
| 面试复盘 | **100%** | 音频上传 → whisper.cpp ASR → AI 评析 → 口语分析 |
| 测试体系 | **85%** | 43 单元 + 11 e2e + 7 前端 + Playwright 框架 |
| 代码质量 | **95%** | console→Loggeras any 类型化,空 catch 检查 |
| 安全审计 | **90%** | JWT 硬编码 / 凭据泄漏 / IDOR / NoSQL 注入 全部修复 |
| 小程序审核 | **0%** | 类目已备案,未提交审核 |
| 小程序审核 | **100%** | v1.0.17 已提交审核,类目已备案 |
| 生产部署 | **100%** | 后端 PM2 / H5 已部署 / 小程序 v1.0.17 已上传 |
| SEO / 分享优化 | **100%** | H5 canonical + robots.txt + sitemap + 结构化数据;小程序 13 页面全量开启分享 |
---
@@ -75,11 +77,11 @@
### 3.4 商业化
| 功能 | 后端 | 前端 | 状态 |
|------|------|------|------|
| 免费版额度(日2次/5轮) | ✅ | ✅ | **完成** |
| 成长版 ¥19.9/月(250 引力值) | ✅ | ✅ | **完成** |
| 冲刺版 ¥49.9/月(600 引力值) | ✅ | ✅ | **完成** |
| 引力值统一体系(取消 VIP 无限面试 | ✅ | | **完成** |
| 会员月度引力值自动配发(cron) | ✅ | N/A | **完成** |
| 免费版注册送 5 引力值 | ✅ | ✅ | **完成** |
| 按量购买引力值(¥5/份) | ✅ | ✅ | **完成** |
| 引力值统一体系(全部按引力值消耗 | ✅ | ✅ | **完成** |
| 会员月度引力值自动补给(cron | ✅ | N/A | **完成** |
| 微信小程序剪贴板购买链路 | N/A | ✅ | **完成** |
| 微信支付 Native QR / JSAPI | ✅ | ✅ H5+MP | **完成** |
| 支付回调/自动开会员 | ✅ | N/A | **完成** |
| 每日一题定时推送 | ✅ | N/A | **完成**(需配置模板ID |
@@ -131,7 +133,7 @@
| 命令 | 用途 |
|------|------|
| `npm test` | 43 个单元测试 |
| `npm test` | 43 个单元测试(构建检查通过) |
| `npm run test:e2e` | 11 个集成测试 |
| `npm run test:cov` | 覆盖率报告 |
| `npm run test:browser` | Playwright API 测试 |
@@ -194,8 +196,8 @@
| 面试模拟 | interview/interview | ✅ 多轮对话 + 计时 |
| 面试报告 | report/report | ✅ 评分/分析/全文回放/分享卡片 |
| 历史记录 | history/history | ✅ 筛选/统计 |
| 个人中心 | user/user | ✅ 信息/统计/管理员入口 + 面试复盘入口 + 择业顾问入口 |
| 会员中心 | member/member | ✅ 套餐对比 + 支付 |
| 个人中心 | user/user | ✅ 引力值卡片 + 信息/统计/管理员入口 + 面试复盘入口 + 择业顾问入口 + 客服按钮 |
| 会员中心 | member/member | ✅ 引力值按量购买(H5 扫码支付/小程序剪贴板链路) |
| 进步轨迹 | progress/progress | ✅ 雷达图 + 打卡日历 |
| 面经贡献 | contribute/contribute | ✅ 表单提交 |
| 简历优化 | resume/resume | ✅ 诊断/优化/上传/下载 |
@@ -222,6 +224,8 @@
| 日期 | 版本 | 变更内容 | 操作者 |
|------|------|----------|--------|
| 2026-06-21 | **v4.8** | **SEO 全量优化**canonical URL、robots.txt、sitemap.xml、结构化数据);**微信分享全面开启**(13 个页面 onShareAppMessage + onShareTimeline);**版本号自动注入**Vite define __APP_VERSION__);**导航栏/Tab标题关键词优化**;manifest 描述更新;页面描述统一增强 | AI |
| 2026-06-21 | v4.7 | 按量购买引力值体系重构(¥5/份取代月订阅);member.vue 完全重写;微信小程序剪贴板购买链路;客服按钮;管理后台字段全面完善;代码清理;测试数据清理;后端/H5/小程序全量部署上线 | AI |
| 2026-06-19 | v4.6 | 引力值体系统一:VIP 取消无限面试改为月度引力值消耗;管理后台全面完善(搜索/筛选/分页/CRUD/分析tab/岗位描述字段) | AI |
| 2026-06-17 | v4.5 | AI 择业顾问 MVP:后端模块 + 前端职业分析页面 + 热门岗位联动 | AI |
| 2026-06-05 | v2.0 | 战略升级:文档重构 + 新增功能启动 | 小之 |
+23 -18
View File
@@ -1,8 +1,8 @@
# 职引 · 产品路线图 v4.3
# 职引 · 产品路线图 v4.7
> **版本**: v4.3
> **日期**: 2026-06-17
> **状态**: Phase 1.5 启动:AI 择业顾问 MVP
> **版本**: v4.7
> **日期**: 2026-06-21
> **状态**: Phase 1.5 按量购买引力值上线 + 全量部署
> **定位**: 应届生/实习生 AI 面试教练
---
@@ -16,7 +16,7 @@ Phase 0.5: 壁垒构建(✅ 已完成)
Phase 1: MVP 开发(✅ 已完成)→ 面试复盘 + whisper.cpp ASR 集成
Phase 1.5: 商业化(D30-60)→ PMF 验证
Phase 1.5: 商业化 + 部署上线D30-60)→ PMF 验证
Phase 2: 增强 + 题库(D60-90)→ 秋招准备
@@ -78,9 +78,9 @@ Phase 3: 商业化 + B 端(D90+)→ 秋招爆发
|------|------|------|
| 前端页面完善 | 17 个页面全部就绪 | ✅ 完成 |
| 微信登录联调 | 真实 appid 验证 | ⏳ 待进行 |
| 移除开发绕过 | `member/pay` 直接激活 | ⏳ 待进行 |
| 生产环境部署 | 服务器 + MongoDB + Nginx + PM2 | ✅ 服务器已购,域名已配 |
| 小程序审核提交 | 资质齐全 | ⏳ 待进行 |
| 移除开发绕过 | `member/pay` 直接激活 | ✅ 已完成 |
| 生产环境部署 | 服务器 + MongoDB + Nginx + PM2 | ✅ 已部署 |
| 小程序审核提交 | v1.0.16 已上传 | ⏳ 待审核 |
| 内测版发布 | 邀请码方式,100 人内测 | ⏳ 待进行 |
### 4.3 内测指标
@@ -92,15 +92,18 @@ Phase 3: 商业化 + B 端(D90+)→ 秋招爆发
## 五、Phase 1.5:辅助功能 + 商业化(D30-60)
| 功能 | 描述 | 优先级 |
|------|------|--------|
| 每日一题定时推送 | 微信订阅消息推送 | P0 |
| 冲刺版 ¥49.9/月 | 高客单价 | P1 |
| 连续打卡激励 | 7 天解锁高级报告 | P1 |
| ASR 生产化调优 | 多模型切换、模型量化、推理优化 | P1 |
| AI 择业顾问 MVP | AI 专业分析 + 岗位匹配 + 多轮对话 | P0 |
| 付费转化验证 | 100 内测用户 → 10+ 付费 | P0 |
| PMF 决策 | 转化率 > 5% → 继续 | P0 |
| 功能 | 描述 | 优先级 | 状态 |
|------|------|--------|------|
| 每日一题定时推送 | 微信订阅消息推送 | P0 | ✅ 已完成 |
| 按量购买引力值 | 取消月订阅,改为 ¥5/份 | P0 | ✅ 已完成 |
| 连续打卡激励 | 7 天解锁高级报告 | P1 | 📋 规划中 |
| ASR 生产化调优 | 多模型切换、模型量化、推理优化 | P1 | 📋 规划中 |
| AI 择业顾问 MVP | AI 专业分析 + 岗位匹配 + 多轮对话 | P0 | ✅ 已完成 |
| 小程序剪贴板购买链路 | 复制链接到浏览器购买 | P0 | ✅ 已完成 |
| H5 扫码支付部署 | ¥5/份 H5 直接支付 | P0 | ✅ 已完成 |
| 生产环境全量部署 | 后端 PM2 + H5 Nginx + 小程序上传 | P0 | ✅ 已完成 |
| 付费转化验证 | 100 内测用户 → 10+ 付费 | P0 | ⏳ 待进行 |
| PMF 决策 | 转化率 > 5% → 继续 | P0 | ⏳ 待进行 |
---
@@ -154,9 +157,10 @@ Phase 3: 商业化 + B 端(D90+)→ 秋招爆发
| M0: 战略升级 | ✅ D1 | 文档 + 定价 | 已完成 |
| M0.5: 壁垒构建 | ✅ D7 | 进步轨迹 + 面经贡献 + 每日一题 | 功能可用 |
| M1: MVP 开发 | ✅ D14 | 面试复盘 + whisper.cpp ASR | 功能可用,build + test 通过 |
| M1.5: 商业化重构 | ✅ D21 | 按量购买引力值 + 管理后台完善 + H5/小程序部署 | 构建通过,已推送上线 |
| M2: 上线内测 | D30 | 小程序审核通过,内测启动 | 100 内测用户 |
| M3: PMF 验证 | D60 | 100 用户反馈 | 转化率 > 5% |
| M4: 付费上线 | D75 | 冲刺版 + 定时推送 | 50+ 付费用户 |
| M4: 付费增长 | D75 | 引力值运营 + 推送 | 50+ 付费用户 |
| M5: 秋招冲刺 | D90+ | 秋招推广 | 1000+ 付费用户 |
---
@@ -202,3 +206,4 @@ Phase 3: 商业化 + B 端(D90+)→ 秋招爆发
| 2026-06-09 | Phase 0.5 标记完成,调整后续里程碑时间 | AI |
| 2026-06-16 | **v4.2**Phase 1 MVP 开发完成,面试复盘上线,里程碑 M1 完成 | AI |
| 2026-06-17 | **v4.3**:AI 择业顾问 MVP 上线,里程碑 M1.5 完成 | AI |
| 2026-06-21 | **v4.7**:按量购买引力值重构(¥5/份取代月订阅);管理后台全面完善;微信小程序剪贴板购买链路;客服按钮;全量生产部署上线(后端 PM2/H5 Nginx/小程序 v1.0.16 | AI |
+2 -1
View File
@@ -1,4 +1,5 @@
# 生产环境变量
VITE_API_BASE_URL=https://zhiyinwx.yzrcloud.cn/api
VITE_APP_NAME=AI磁场
VITE_APP_NAME=职引·宇之然AI磁场
VITE_APP_DESC=AI模拟面试·简历优化·面经题库·校招求职一站式平台
VITE_PROD_API_HOST=https://zhiyinwx.yzrcloud.cn
+25 -5
View File
@@ -6,20 +6,40 @@
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg" />
<title>职引 - AI模拟面试 | 宇之然AI磁场 · 智能面试练习 · 简历优化 · 面经题库</title>
<meta name="description" content="职引是宇之然AI磁场旗下的AI模拟面试平台,提供AI面试官模拟练习、简历智能诊断优化、大厂面经题库、实习推荐等一站式求职服务,帮助你在真实面试前充分准备。" />
<meta name="keywords" content="职引,宇之然AI磁场,AI面试,模拟面试,面试练习,简历优化,求职辅导,AI模拟面试官,面试题库,面经,校招面试,实习面试,简历诊断,面试技巧" />
<meta name="keywords" content="职引,宇之然AI磁场,AI面试,模拟面试,面试练习,简历优化,求职辅导,AI模拟面试官,面试题库,面经,校招面试,实习面试,简历诊断,面试技巧,AI模拟面试官,大模型面试,校招准备" />
<meta property="og:title" content="职引 - AI模拟面试平台 | 宇之然AI磁场" />
<meta property="og:description" content="AI驱动的一站式求职准备平台,涵盖AI模拟面试、简历优化、面经分享、实习推荐等核心功能。" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://zhiyin.yzrcloud.cn" />
<meta property="og:image" content="https://zhiyin.yzrcloud.cn/static/og-image.png" />
<meta name="applicable-device" content="mobile" />
<link rel="canonical" href="https://aicc.yzrcloud.cn" />
<meta name="baidu-site-verification" content="zhiyin-yzrcloud" />
<link rel="canonical" href="https://zhiyin.yzrcloud.cn" />
<link rel="alternate" href="https://zhiyin.yzrcloud.cn" hreflang="zh-Hans" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "宇之然AI磁场",
"description": "AI驱动的求职面试模拟与简历优化平台",
"name": "职引 - AI模拟面试",
"description": "AI驱动的校招求职准备平台,涵盖AI模拟面试、简历智能优化、大厂面经题库、面试复盘、AI择业顾问等一站式功能。",
"applicationCategory": "EducationalApplication",
"operatingSystem": "Web, WeChat Mini Program"
"operatingSystem": "Web, WeChat Mini Program",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "CNY"
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "AI模拟面试", "item": "https://zhiyin.yzrcloud.cn" },
{ "@type": "ListItem", "position": 2, "name": "简历优化", "item": "https://zhiyin.yzrcloud.cn/#/pages/resume/resume" },
{ "@type": "ListItem", "position": 3, "name": "面经题库", "item": "https://zhiyin.yzrcloud.cn/#/pages/history/history" }
]
}
</script>
</head>
+3 -3
View File
@@ -3,9 +3,9 @@
"version": "1.0.0",
"scripts": {
"dev:mp-weixin": "uni -p mp-weixin",
"build:mp-weixin": "uni build -p mp-weixin && cp -f static/avatar-*.png dist/build/mp-weixin/static/ 2>/dev/null; true",
"dev:h5": "uni",
"build:h5": "uni build && cp -f static/avatar-*.png dist/build/h5/static/ 2>/dev/null; true",
"build:mp-weixin": "uni build -p mp-weixin && cp -f static/avatar-*.png dist/build/mp-weixin/static/ 2>/dev/null; true",
"dev:h5": "uni",
"build:h5": "uni build && cp -f static/avatar-*.png dist/build/h5/static/ 2>/dev/null && cp -f static/robots.txt static/sitemap.xml dist/build/h5/ 2>/dev/null; true",
"test": "vitest run",
"test:watch": "vitest"
},
+9 -2
View File
@@ -15,11 +15,18 @@ async function main() {
ignores: ['node_modules/**/*'],
})
// Get version from git tag or use timestamp
// Bump patch version from git tag: v1.0.16 → 1.0.17
let version = '1.0.3'
try {
const gitTag = execSync('git describe --tags --abbrev=0 2>/dev/null || echo ""', { encoding: 'utf8' }).trim()
if (gitTag) version = gitTag.replace(/^v/, '')
if (gitTag) {
const base = gitTag.replace(/^v/, '')
const parts = base.split('.')
if (parts.length >= 1) {
parts[parts.length - 1] = String(Number(parts[parts.length - 1]) + 1)
}
version = parts.join('.')
}
} catch {}
const now = new Date()
+21 -4
View File
@@ -1,13 +1,32 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { onLaunch } from '@dcloudio/uni-app'
onLaunch(() => {
console.log('职引 App launched')
// #ifdef MP-WEIXIN
initPrivacy()
// #endif
// #ifdef H5
handleH5UrlParams()
// #endif
})
// #ifdef H5
function handleH5UrlParams() {
const params = new URLSearchParams(window.location.search)
const token = params.get('token')
const buy = params.get('buy')
if (token) {
uni.setStorageSync('token', token)
}
if (buy === 'gravity') {
// 延迟等 app 初始化完成再跳转
setTimeout(() => {
uni.navigateTo({ url: '/pages/member/member' })
}, 300)
}
}
// #endif
// #ifdef MP-WEIXIN
function initPrivacy() {
if (wx.onNeedPrivacyAuthorization) {
@@ -29,8 +48,6 @@ function initPrivacy() {
}
}
// #endif
onShow(() => { console.log('职引 App shown') })
onHide(() => { console.log('职引 App hidden') })
</script>
<style>
@@ -0,0 +1,193 @@
import { ref, computed, nextTick } from 'vue'
import { api } from '../config'
export function useGravityPurchase(onPaymentSuccess?: () => void) {
const showQuantityModal = ref(false)
const buyQuantity = ref(1)
const products = ref<any[]>([])
const buyProductType = ref('interview')
const payLoading = ref(false)
const payError = ref('')
const showPayModal = ref(false)
const payCodeUrl = ref('')
const currentOutTradeNo = ref('')
const isMp = ref(false)
const paySuccess = ref(false)
const unitPrice = computed(() => {
const p = products.value.find(p => p.type === buyProductType.value)
return p?.price || 0
})
const totalPrice = computed(() => unitPrice.value * buyQuantity.value / 100)
const buyGravityPerUnit = computed(() => {
const p = products.value.find(p => p.type === buyProductType.value)
return p?.gravity || 0
})
const changeQty = (delta: number) => {
const next = buyQuantity.value + delta
if (next >= 1 && next <= 99) buyQuantity.value = next
}
const clampQty = () => {
if (buyQuantity.value < 1) buyQuantity.value = 1
if (buyQuantity.value > 99) buyQuantity.value = 99
}
const loadProducts = async () => {
try {
const res = await uni.request({ url: api('/member/plans'), method: 'GET' })
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.products) {
const prodList: any[] = []
for (const [key, val] of Object.entries(res.data.products as Record<string, any>)) {
if (val?.price > 0) prodList.push({ type: key, ...val })
}
products.value = prodList
}
} catch (e) { /* silent */ }
}
const openGravityPurchase = async (productType = 'interview') => {
buyProductType.value = productType
buyQuantity.value = 1
// #ifdef MP-WEIXIN
isMp.value = true
// #endif
// 加载产品信息
await loadProducts()
showQuantityModal.value = true
}
const cancelPay = () => {
showPayModal.value = false
payCodeUrl.value = ''
payLoading.value = false
payError.value = ''
}
const confirmProductBuy = () => {
showQuantityModal.value = false
startProductPay(buyProductType.value, buyQuantity.value)
}
const startProductPay = async (type: string, quantity = 1) => {
const token = uni.getStorageSync('token') || ''
if (!token) {
uni.showToast({ title: '请先登录', icon: 'none' })
return
}
showPayModal.value = true
payLoading.value = true
payError.value = ''
if (isMp.value) {
try {
let res = await uni.request({
url: api('/payment/jsapi-product'), method: 'POST',
data: { type, quantity },
header: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
timeout: 30000,
})
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.payParams) {
const pp = res.data.payParams as any
currentOutTradeNo.value = res.data.outTradeNo || ''
uni.requestPayment({
provider: 'wxpay',
timeStamp: pp.timeStamp,
nonceStr: pp.nonceStr,
package: pp.package,
signType: pp.signType || 'RSA',
paySign: pp.paySign,
success: () => {
const no = currentOutTradeNo.value || res.data.outTradeNo
pollPayResult(no)
},
fail: () => {
payError.value = '支付未完成'
uni.showToast({ title: '支付未完成', icon: 'none' })
},
})
} else if (!res.statusCode || res.statusCode === 0) {
payError.value = '网络连接失败,请检查网络后重试'
uni.showToast({ title: '网络连接失败', icon: 'none' })
} else {
const errMsg = res.data?.message || '购买失败'
payError.value = errMsg
uni.showToast({ title: errMsg, icon: 'none' })
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
} else {
try {
const res = await uni.request({
url: api('/payment/create-product'), method: 'POST',
data: { type, quantity },
header: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
})
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.codeUrl) {
payCodeUrl.value = res.data.codeUrl
currentOutTradeNo.value = res.data.outTradeNo
// 页面需要自己渲染二维码(依赖 uqrcode)
pollPayResult(res.data.outTradeNo)
} else if (!res.statusCode || res.statusCode === 0) {
payError.value = '网络连接失败,请检查网络后重试'
uni.showToast({ title: '网络连接失败', icon: 'none' })
} else {
payError.value = res.data?.message || '购买失败'
uni.showToast({ title: res.data?.message || '购买失败', icon: 'none' })
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
}
}
const pollPayResult = async (outTradeNo: string) => {
if (!outTradeNo) return
const maxAttempts = 30
let attempts = 0
const token = uni.getStorageSync('token') || ''
const poll = async () => {
attempts++
try {
const res = await uni.request({
url: api(`/payment/check/${outTradeNo}`), method: 'GET',
header: { 'Authorization': `Bearer ${token}` },
})
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.status === 'success') {
paySuccess.value = true
showPayModal.value = false
uni.showToast({ title: '充值成功!', icon: 'success' })
onPaymentSuccess?.()
return
}
} catch (e) { /* ignore */ }
if (attempts < maxAttempts) {
setTimeout(poll, 2000)
} else {
payError.value = '支付结果查询超时,请联系客服'
uni.showToast({ title: '支付查询超时', icon: 'none' })
}
}
setTimeout(poll, 2000)
}
return {
showQuantityModal, buyQuantity, products, buyProductType,
unitPrice, totalPrice, buyGravityPerUnit,
payLoading, payError, showPayModal, payCodeUrl, paySuccess,
isMp,
changeQty, clampQty, loadProducts, openGravityPurchase,
confirmProductBuy, cancelPay,
}
}
+4 -4
View File
@@ -1,9 +1,9 @@
{
"name": "宇之然AI磁场",
"name": "职引 - AI模拟面试",
"appid": "__UNI__DEV__",
"versionName": "1.0.15",
"versionCode": "115",
"description": "职引 - 宇之然AI磁场旗下AI模拟面试平台,提供AI面试官模拟练习、简历智能优化、大厂面经题库,助你轻松应对校招面试。",
"versionName": "1.0.16",
"versionCode": "116",
"description": "职引 - 宇之然AI磁场旗下AI模拟面试平台AI面试官模拟练习、简历智能优化、大厂面经题库、面试复盘分析、AI择业顾问,一站式校招求职准备平台。",
"h5": {
"title": "职引 - AI模拟面试 | 宇之然AI磁场",
"router": {
+17 -17
View File
@@ -1,25 +1,25 @@
{
"pages": [
{ "path": "pages/index/index", "style": { "navigationBarTitleText": "职引 - AI模拟面试" } },
{ "path": "pages/interview/interview", "style": { "navigationBarTitleText": "AI模拟面试" } },
{ "path": "pages/report/report", "style": { "navigationBarTitleText": "面试报告" } },
{ "path": "pages/member/member", "style": { "navigationBarTitleText": "会员中心" } },
{ "path": "pages/progress/progress", "style": { "navigationBarTitleText": "进步轨迹" } },
{ "path": "pages/contribute/contribute", "style": { "navigationBarTitleText": "面经分享" } },
{ "path": "pages/company-bank/bank", "style": { "navigationBarTitleText": "公司真题库" } },
{ "path": "pages/login/login", "style": { "navigationBarTitleText": "登录" } },
{ "path": "pages/history/history", "style": { "navigationBarTitleText": "面试记录" } },
{ "path": "pages/user/user", "style": { "navigationBarTitleText": "我的" } },
{ "path": "pages/resume/resume", "style": { "navigationBarTitleText": "简历优化" } },
{ "path": "pages/internship/internship", "style": { "navigationBarTitleText": "实习搜索" } },
{ "path": "pages/index/index", "style": { "navigationBarTitleText": "AI模拟面试 - 职引" } },
{ "path": "pages/interview/interview", "style": { "navigationBarTitleText": "AI模拟面试练习" } },
{ "path": "pages/report/report", "style": { "navigationBarTitleText": "面试报告与评分" } },
{ "path": "pages/member/member", "style": { "navigationBarTitleText": "引力值购买" } },
{ "path": "pages/progress/progress", "style": { "navigationBarTitleText": "进步轨迹与打卡" } },
{ "path": "pages/contribute/contribute", "style": { "navigationBarTitleText": "分享面经" } },
{ "path": "pages/company-bank/bank", "style": { "navigationBarTitleText": "公司真题库" } },
{ "path": "pages/login/login", "style": { "navigationBarTitleText": "登录 / 注册" } },
{ "path": "pages/history/history", "style": { "navigationBarTitleText": "面经与面试记录" } },
{ "path": "pages/user/user", "style": { "navigationBarTitleText": "个人中心" } },
{ "path": "pages/resume/resume", "style": { "navigationBarTitleText": "简历诊断与优化" } },
{ "path": "pages/internship/internship", "style": { "navigationBarTitleText": "热门岗位" } },
{ "path": "pages/about/about", "style": { "navigationBarTitleText": "关于职引" } },
{ "path": "pages/admin/admin", "style": { "navigationBarTitleText": "管理后台" } },
{ "path": "pages/result/result", "style": { "navigationBarTitleText": "优化结果" } },
{ "path": "pages/agreement/agreement", "style": { "navigationBarTitleText": "用户协议" } },
{ "path": "pages/privacy/privacy", "style": { "navigationBarTitleText": "隐私政策" } },
{ "path": "pages/share/share", "style": { "navigationBarTitleText": "我的分享" } },
{ "path": "pages/review/review", "style": { "navigationBarTitleText": "面试复盘" } },
{ "path": "pages/career/career", "style": { "navigationBarTitleText": "择业顾问" } }
{ "path": "pages/review/review", "style": { "navigationBarTitleText": "面试复盘分析" } },
{ "path": "pages/career/career", "style": { "navigationBarTitleText": "AI择业顾问" } }
],
"tabBar": {
"color": "#999999",
@@ -27,9 +27,9 @@
"backgroundColor": "#F3F4F6",
"borderStyle": "black",
"list": [
{ "pagePath": "pages/index/index", "text": "面试", "iconPath": "static/tabbar/home.png", "selectedIconPath": "static/tabbar/home-active.png" },
{ "pagePath": "pages/history/history", "text": "面经", "iconPath": "static/tabbar/history.png", "selectedIconPath": "static/tabbar/history-active.png" },
{ "pagePath": "pages/user/user", "text": "我的", "iconPath": "static/tabbar/user.png", "selectedIconPath": "static/tabbar/user-active.png" }
{ "pagePath": "pages/index/index", "text": "AI面试", "iconPath": "static/tabbar/home.png", "selectedIconPath": "static/tabbar/home-active.png" },
{ "pagePath": "pages/history/history", "text": "面经题库", "iconPath": "static/tabbar/history.png", "selectedIconPath": "static/tabbar/history-active.png" },
{ "pagePath": "pages/user/user", "text": "个人中心", "iconPath": "static/tabbar/user.png", "selectedIconPath": "static/tabbar/user-active.png" }
]
},
"globalStyle": {
+9 -1
View File
@@ -2,7 +2,7 @@
<view class="page">
<view class="logo-area">
<text class="logo">职引</text>
<text class="version">v1.0.0</text>
<text class="version">v{{ appVersion }}</text>
</view>
<view class="info-section">
<text class="info-label">产品名称</text>
@@ -38,8 +38,14 @@
</template>
<script setup>
const appVersion = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : '1.0.0'
const goAgreement = () => uni.navigateTo({ url: '/pages/agreement/agreement' })
const goPrivacy = () => uni.navigateTo({ url: '/pages/privacy/privacy' })
// #ifdef MP-WEIXIN
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
onShareAppMessage(() => ({ title: '职引 - AI模拟面试平台 | 宇之然AI磁场', path: '/pages/about/about' }))
onShareTimeline(() => ({ title: '职引 - AI模拟面试平台 | 宇之然AI磁场' }))
// #endif
</script>
<style scoped>
@@ -59,4 +65,6 @@ const goPrivacy = () => uni.navigateTo({ url: '/pages/privacy/privacy' })
.disclaimer { margin-top: 40rpx; background: #FFF8E1; border-radius: var(--radius-md); padding: 24rpx; }
.disclaimer-title { font-size: 24rpx; font-weight: 700; color: #F59E0B; display: block; margin-bottom: 12rpx; }
.disclaimer-text { font-size: 22rpx; color: var(--color-text-secondary); line-height: 1.8; }
</style>
+114 -26
View File
@@ -45,6 +45,23 @@
<text class="stat-sub">付费下载 {{ overview.paidDownloadCount ?? 0 }}</text>
</view>
</view>
<view class="stat-cards" style="margin-top:12rpx">
<view class="stat-card">
<text class="stat-num">{{ overview.orderCount ?? 0 }}</text>
<text class="stat-label">总订单</text>
<text class="stat-sub">今日 +{{ overview.todayOrders ?? 0 }}</text>
</view>
<view class="stat-card">
<text class="stat-num">{{ overview.totalRevenue ? '¥' + (overview.totalRevenue / 100).toFixed(1) : '¥0' }}</text>
<text class="stat-label">总营收</text>
<text class="stat-sub">已支付订单合计</text>
</view>
<view class="stat-card" v-if="!(overview.orderCount)">
<text class="stat-num">--</text>
<text class="stat-label">--</text>
<text class="stat-sub" />
</view>
</view>
<view class="plan-cards">
<view class="plan-card" v-for="(cnt, plan) in overview.planBreakdown" :key="plan">
<text class="plan-num">{{ cnt }}</text>
@@ -64,11 +81,22 @@
<view class="user-main">
<text class="user-phone">{{ u.phone || '--' }}</text>
<text class="user-name">{{ u.nickname || '--' }}</text>
<text class="user-badge-role" v-if="u.role === 'admin'">管理</text>
</view>
<view class="user-badges">
<text class="user-plan" :class="{ vip: u.plan === 'growth' || u.plan === 'sprint' }">{{ u.plan === 'growth' || u.plan === 'sprint' ? '会员' : '免费' }}</text>
<text class="user-credit">引力值:{{ u.gravity ?? 0 }}</text>
<text class="user-credit share" v-if="u.shareCredits > 0">分享:{{ u.shareCredits }}</text>
<view class="user-meta-row">
<text class="meta-tag email" v-if="u.email">{{ u.email }}</text>
<text class="meta-tag" v-if="u.wxOpenid">openid:{{ u.wxOpenid.slice(0,12) }}..</text>
</view>
<view class="user-meta-row">
<text class="meta-tag">引力:{{ u.gravity ?? 0 }}</text>
<text class="meta-tag">面试:{{ u.interviewCount ?? 0 }}</text>
<text class="user-plan" :class="{ vip: u.plan === 'growth' || u.plan === 'sprint' }">{{ u.plan === 'growth' || u.plan === 'sprint' ? u.plan==='sprint'?'冲刺':'会员' : '免费' }}</text>
<text class="meta-tag share" v-if="u.shareCredits > 0">分享:{{ u.shareCredits }}</text>
</view>
<view class="user-meta-row time-row">
<text class="time-label">注册:{{ u.createdAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="u.vipExpireAt">到期:{{ u.vipExpireAt?.slice(0,10) }}</text>
<text class="time-label" v-if="u.sprintExpireAt">冲刺到期:{{ u.sprintExpireAt?.slice(0,10) }}</text>
</view>
<view class="user-actions">
<text class="user-action-btn" v-if="u.plan === 'free'" @click="setVip(u._id)">设为会员</text>
@@ -93,14 +121,19 @@
<view class="iv-main">
<text class="iv-pos">{{ iv.position }}</text>
<text class="iv-user">{{ iv.userId?.phone || iv.userId?.nickname || '--' }}</text>
<text class="iv-user email" v-if="iv.userId?.email">{{ iv.userId.email }}</text>
</view>
<view class="iv-meta">
<text class="iv-status" :class="{ done: iv.status === 'completed' }">{{ iv.status === 'completed' ? '已完成' : '进行中' }}</text>
<text class="iv-tag">{{ iv.questionCount || 0 }}</text>
<text class="iv-tag score">得分 {{ iv.totalScore ?? '-' }}</text>
<text class="iv-tag filler" v-if="iv.fillerScore != null && iv.fillerScore > 0">分析 {{ iv.fillerScore }}/{{ iv.fillerDensity ?? '-' }}</text>
<text class="iv-tag filler" v-if="iv.fillerScore != null && iv.fillerScore > 0"> {{ iv.fillerScore }}/{{ iv.fillerDensity ?? '-' }}</text>
</view>
<text class="iv-time">{{ iv.createdAt?.slice(0,16).replace('T',' ') }}</text>
<view class="iv-meta">
<text class="time-label">开始:{{ iv.createdAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="iv.updatedAt && iv.updatedAt !== iv.createdAt">更新:{{ iv.updatedAt?.slice(0,16).replace('T',' ') }}</text>
</view>
<text class="iv-summary" v-if="iv.summary">{{ iv.summary.slice(0,60) }}{{ iv.summary.length > 60 ? '...' : '' }}</text>
</view>
<text class="load-more" v-if="ivTotal > interviews.length" @click="loadMoreInterviews">加载更多</text>
<text class="empty-text" v-if="interviews.length === 0 && !ivLoading">暂无面试记录</text>
@@ -119,13 +152,17 @@
<view class="resume-main">
<text class="resume-title">{{ r.title }}</text>
<text class="resume-user">{{ r.userId?.phone || r.userId?.nickname || '--' }}</text>
<text class="resume-user email" v-if="r.userId?.email">{{ r.userId.email }}</text>
</view>
<view class="resume-meta">
<text class="resume-tag">v{{ r.version }}</text>
<text class="resume-tag" v-if="r.targetPosition">{{ r.targetPosition }}</text>
<text class="resume-tag paid" v-if="r.paidDownload">付费下载</text>
</view>
<text class="resume-time">{{ r.createdAt?.slice(0,10) }}</text>
<view class="resume-meta time-row">
<text class="time-label">创建:{{ r.createdAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="r.updatedAt && r.updatedAt !== r.createdAt">更新:{{ r.updatedAt?.slice(0,16).replace('T',' ') }}</text>
</view>
<view class="resume-actions">
<text class="admin-action-btn del" @click="deleteResume(r._id, r.title)">删除</text>
</view>
@@ -148,22 +185,37 @@
<view class="order-list" v-if="!orderLoading">
<view class="order-row" v-for="o in orders" :key="o._id">
<view class="order-info">
<text class="order-id">订单号: {{ o.outTradeNo }}</text>
<text class="order-user">用户: {{ o.userPhone || o.userId.slice(-6) }}</text>
</view>
<view class="order-meta">
<text class="order-amount">¥{{ (o.amount / 100).toFixed(1) }}</text>
<view class="order-status" :class="o.status === 'success' ? 'paid' : o.status === 'refunded' ? 'refund' : 'pend'">
<text class="order-id">{{ o.outTradeNo }}</text>
<view class="order-status rp" :class="o.status === 'success' ? 'paid' : o.status === 'refunded' ? 'refund' : 'pend'">
{{ o.status === 'success' ? '已支付' : o.status === 'refunded' ? '已退款' : '待支付' }}
</view>
<text class="order-time">{{ o.createdAt ? o.createdAt.slice(0,16).replace('T',' ') : '--' }}</text>
<view class="order-actions">
</view>
<view class="order-meta-row">
<text class="order-title">{{ o.title || '--' }}</text>
<text class="order-user">用户: {{ o.userPhone || o.userId?.slice(-6) }}</text>
</view>
<view class="order-meta-row">
<text class="order-amount">¥{{ (o.amount / 100).toFixed(1) }}</text>
<text class="meta-tag">类型:{{ o.type || '--' }}</text>
<text class="meta-tag">渠道:{{ o.channel || '--' }}</text>
</view>
<view class="order-meta-row time-row">
<text class="time-label">创建:{{ o.createdAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="o.paidAt">支付:{{ o.paidAt?.slice(0,16).replace('T',' ') }}</text>
</view>
<view class="order-meta-row" v-if="o.wxTransactionId">
<text class="time-label">微信单号:{{ o.wxTransactionId }}</text>
</view>
<view class="order-meta-row" v-if="o.status === 'refunded'">
<text class="time-label refund-label">退款:¥{{ (o.refundAmount/100).toFixed(1) }} {{ o.refundedAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="o.refundReason">原因:{{ o.refundReason }}</text>
</view>
<view class="order-actions-bar">
<text class="sync-btn" v-if="o.status === 'pending'" @click="syncOrder(o.outTradeNo)">同步</text>
<text class="refund-btn" v-if="o.status === 'success'" @click="openRefundModal(o)">退款</text>
<text class="sync-btn" v-if="o.status === 'refunded'" @click="queryRefund(o.outTradeNo)">查询</text>
</view>
</view>
</view>
<text class="load-more" v-if="ordersTotal > orders.length" @click="loadMoreOrders">加载更多</text>
<text class="empty-text" v-if="orders.length === 0 && !orderLoading">暂无订单</text>
</view>
@@ -283,13 +335,19 @@
<view class="share-row" v-for="r in shareRecords" :key="r.shareCode">
<view class="share-main">
<text class="share-title">{{ r.title }}</text>
<text class="share-meta">{{ r.sharer?.nickname || '--' }} · {{ r.type }}</text>
<text class="share-meta">{{ r.sharer?.phone || r.sharer?.nickname || '--' }} · {{ r.type }}</text>
</view>
<view class="share-meta-row">
<text class="meta-tag">code:{{ r.shareCode }}</text>
<text class="meta-tag" :class="r.isActive ? 'badge-done' : 'badge-pend'">{{ r.isActive ? '启用' : '停用' }}</text>
</view>
<view class="share-stats">
<text>访问 {{ r.visitCount }}</text>
<text class="share-credited">有效 {{ r.creditedCount }}</text>
</view>
<text class="share-time">{{ r.createdAt?.slice(0,16).replace('T',' ') }}</text>
<view class="share-meta-row time-row">
<text class="time-label">创建:{{ r.createdAt?.slice(0,16).replace('T',' ') }}</text>
</view>
</view>
</view>
<text class="loading-text" v-if="shareLoading">加载中...</text>
@@ -299,13 +357,17 @@
<view class="share-list" v-if="!shareLoading">
<view class="share-row" v-for="(v, i) in shareVisitors" :key="i">
<view class="share-main">
<text>分享者: {{ v.sharer?.nickname || '--' }}</text>
<text class="share-meta">访客: {{ v.visitor?.nickname || '匿名' }}</text>
<text>分享者:{{ v.sharer?.phone || v.sharer?.nickname || '--' }}</text>
<text class="share-meta">访客:{{ v.visitor?.phone || v.visitor?.nickname || '匿名' }}</text>
</view>
<view class="share-stats">
<text class="badge" :class="v.credited ? 'badge-done' : 'badge-pend'">{{ v.credited ? '已积分' : '未积分' }}</text>
<view class="share-meta-row">
<text class="meta-tag">IP:{{ v.visitorId || '--' }}</text>
<text class="meta-tag" :class="v.credited ? 'badge-done' : 'badge-pend'">{{ v.credited ? '已积分' : '未积分' }}</text>
</view>
<view class="share-meta-row time-row">
<text class="time-label">访问:{{ v.createdAt?.slice(0,16).replace('T',' ') }}</text>
<text class="time-label" v-if="v.creditedAt">积分:{{ v.creditedAt?.slice(0,16).replace('T',' ') }}</text>
</view>
<text class="share-time">{{ v.createdAt?.slice(0,16).replace('T',' ') }}</text>
</view>
</view>
<text class="loading-text" v-if="shareLoading">加载中...</text>
@@ -429,7 +491,9 @@
<view class="admin-row" v-for="a in adminList" :key="a._id">
<text class="admin-phone">{{ a.phone || '--' }}</text>
<text class="admin-name">{{ a.nickname || '--' }}</text>
<text class="admin-email" v-if="a.email">{{ a.email }}</text>
<text class="admin-badge" v-if="a.isSystemAdmin">系统</text>
<text class="time-label" style="margin-left:auto">设置:{{ a.createdAt?.slice(0,10) }}</text>
</view>
<text class="empty-text" v-if="adminList.length === 0">暂无管理员</text>
</view>
@@ -438,6 +502,7 @@
<view class="admin-row">
<text class="admin-phone">{{ searchResult.phone || '--' }}</text>
<text class="admin-name">{{ searchResult.nickname || '--' }}</text>
<text class="admin-email" v-if="searchResult.email">{{ searchResult.email }}</text>
<text class="admin-set-btn" v-if="searchResult.role !== 'admin'" @click="setAdmin(searchResult._id)">设为管理员</text>
<text class="admin-set-btn done" v-else>已是管理员</text>
</view>
@@ -975,8 +1040,8 @@ onMounted(() => { doVerify() })
.admin-input { height: 72rpx; background: #FFF; border: 2rpx solid var(--color-border); border-radius: var(--radius-sm); padding: 0 20rpx; font-size: 24rpx; }
.btn-verify { height: 72rpx; background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); color: #FFF; border-radius: var(--radius-sm); font-size: 26rpx; border: none; }
.body { padding: 20rpx 32rpx 48rpx; margin-top: -40rpx; }
.tabs { display: flex; gap: 8rpx; background: #FFF; border-radius: var(--radius-md); padding: 6rpx; margin-bottom: 20rpx; }
.tab { flex: 1; text-align: center; padding: 14rpx; font-size: 24rpx; color: var(--color-text-secondary); border-radius: var(--radius-sm); white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 8rpx; background: #FFF; border-radius: var(--radius-md); padding: 6rpx; margin-bottom: 20rpx; }
.tab { padding: 14rpx 20rpx; font-size: 24rpx; color: var(--color-text-secondary); border-radius: var(--radius-sm); white-space: nowrap; }
.tab.active { background: var(--color-primary); color: #FFF; font-weight: 600; }
.stat-cards { display: flex; gap: 16rpx; }
.stat-card { flex: 1; background: #FFF; border-radius: var(--radius-lg); padding: 28rpx; text-align: center; box-shadow: var(--shadow-sm); }
@@ -1088,7 +1153,30 @@ onMounted(() => { doVerify() })
.pos-mgr-btn.edit { color: var(--color-primary); border: 2rpx solid var(--color-primary); }
.pos-mgr-btn.del { color: #EF4444; border: 2rpx solid #EF4444; }
.iv-time { font-size: 18rpx; color: #D1D5DB; white-space: nowrap; margin-left: auto; }
.admin-action-btn { font-size: 20rpx; padding: 4rpx 16rpx; border-radius: var(--radius-round); cursor: pointer; }
.admin-action-btn { font-size: 20rpx; padding: 4rpx 16rpx; border-radius: var(--radius-round); cursor: pointer; }
.admin-action-btn.del { color: #EF4444; border: 2rpx solid #EF4444; }
.resume-actions { display: flex; gap: 8rpx; align-items: center; }
/* ─── 新增字段样式 ───── */
.user-meta-row { display: flex; flex-wrap: wrap; gap: 6rpx; margin-bottom: 6rpx; }
.meta-tag { font-size: 18rpx; background: #F3F4F6; color: var(--color-text-tertiary); padding: 2rpx 10rpx; border-radius: var(--radius-round); }
.meta-tag.email { background: #EEF2FF; color: var(--color-primary); }
.meta-tag.share { background: #FFF7ED; color: #D97706; }
.meta-tag.badge-done { background: #ECFDF5; color: #059669; }
.meta-tag.badge-pend { background: #FEF3C7; color: #D97706; }
.time-row { display: flex; flex-wrap: wrap; gap: 12rpx; }
.time-label { font-size: 18rpx; color: #9CA3AF; }
.iv-summary { font-size: 18rpx; color: #6B7280; margin-top: 4rpx; line-height: 1.4; display: block; }
.iv-user.email { font-size: 18rpx; color: #6B7280; }
.user-badge-role { font-size: 18rpx; background: #FEF3C7; color: #D97706; padding: 0 10rpx; border-radius: var(--radius-round); font-weight: 500; }
.share-meta-row { display: flex; gap: 6rpx; margin-top: 4rpx; }
.share-meta-row.time-row { gap: 12rpx; }
.order-meta-row { display: flex; flex-wrap: wrap; gap: 8rpx; margin-bottom: 4rpx; }
.order-meta-row.time-row { gap: 12rpx; }
.order-title { font-size: 22rpx; font-weight: 500; color: var(--color-text); }
.order-status.rp { font-size: 18rpx; display: inline-block; }
.refund-label { color: #EF4444 !important; }
.order-actions-bar { display: flex; gap: 8rpx; margin-top: 6rpx; }
.admin-email { font-size: 20rpx; color: #6B7280; }
.resume-user.email { font-size: 18rpx; color: #6B7280; }
</style>
+16 -5
View File
@@ -102,9 +102,19 @@
<script setup>
import { ref, reactive } from 'vue'
// #ifdef MP-WEIXIN
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onShow } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - AI择业顾问 | 专业分析+岗位推荐', path: '/pages/career/career' }))
onShareTimeline(() => ({ title: '职引 - AI择业顾问 | 专业分析+岗位推荐' }))
// #endif
const grades = ['大一', '大二', '大三', '大四', '研一', '研二', '研三', '已毕业']
const step = ref('input')
@@ -150,7 +160,7 @@ const doAnalyze = async () => {
data: { ...profile },
header: { 'Authorization': `Bearer ${token.value}`, 'Content-Type': 'application/json' },
})
if (res.statusCode === 200) {
if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.data.error) {
error.value = res.data.error
return
@@ -184,7 +194,7 @@ const doChat = async () => {
data: { message: msg, history: chatHistory.value.slice(0, -1) },
header: { 'Authorization': `Bearer ${token.value}`, 'Content-Type': 'application/json' },
})
if (res.statusCode === 200) {
if (res.statusCode >= 200 && res.statusCode < 300) {
chatHistory.value.push({ role: 'assistant', content: res.data.reply || (res.data.error || '') })
} else {
chatHistory.value.push({ role: 'assistant', content: '回复失败,请稍后重试' })
@@ -211,12 +221,13 @@ const goInterview = (position) => {
.hero-title { font-size: 40rpx; font-weight: 700; color: var(--color-text); margin-top: 16rpx; }
.hero-desc { font-size: 26rpx; color: var(--color-secondary); margin-top: 8rpx; }
.form-card { background: #fff; border-radius: var(--radius-lg); padding: 32rpx; box-shadow: var(--shadow-sm); }
.form-group { margin-bottom: 28rpx; }
.form-card { background: #fff; border-radius: var(--radius-lg); padding: 32rpx; box-shadow: var(--shadow-sm); overflow: hidden; }
.form-group { margin-bottom: 28rpx; width: 100%; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: 26rpx; font-weight: 600; color: var(--color-text); display: block; margin-bottom: 12rpx; }
.required { color: var(--color-error); }
.form-input { width: 100%; height: 80rpx; border: 2rpx solid var(--color-border); border-radius: var(--radius-md); padding: 0 24rpx; font-size: 26rpx; color: var(--color-text); box-sizing: border-box; background: #FAFBFC; }
.form-input { width: 100%; height: 80rpx; border: 2rpx solid var(--color-border); border-radius: var(--radius-md); padding: 0 24rpx; font-size: 26rpx; color: var(--color-text); box-sizing: border-box; background: #FAFBFC; max-width: 100%; }
picker { width: 100%; }
.select-trigger { display: flex; align-items: center; }
.form-textarea { width: 100%; height: 160rpx; border: 2rpx solid var(--color-border); border-radius: var(--radius-md); padding: 20rpx 24rpx; font-size: 26rpx; color: var(--color-text); box-sizing: border-box; background: #FAFBFC; resize: none; }
@@ -76,9 +76,19 @@
<script setup>
import { ref } from 'vue'
// #ifdef MP-WEIXIN
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onLoad } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 分享面经 | 共建大厂面试题库', path: '/pages/contribute/contribute' }))
onShareTimeline(() => ({ title: '职引 - 分享面经 | 共建大厂面试题库' }))
// #endif
const interviewId = ref('')
const urlPosition = ref('')
const form = ref({ company: '', position: '', rounds: '', experience: '', tags: [] })
+8
View File
@@ -61,8 +61,16 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 面经与面试记录 | 大厂面经题库', path: '/pages/history/history' }))
onShareTimeline(() => ({ title: '职引 - 面经与面试记录 | 大厂面经题库' }))
// #endif
const filter = ref('all')
const interviewList = ref([])
const loading = ref(true)
+75 -22
View File
@@ -122,15 +122,22 @@
<text class="section-desc">AI 时代最热方向点击直接面试</text>
</view>
<view class="ai-banner card" @click="goInterview">
<text class="ai-banner-title">🚀 AI 正在重塑整个行业</text>
<view class="ai-banner-icon-wrap">
<text class="ai-banner-icon">🤖</text>
</view>
<view class="ai-banner-body">
<text class="ai-banner-title">AI 正在重塑整个行业</text>
<text class="ai-banner-desc">大模型应用 / Agent 开发 / Prompt 工程 顶尖人才缺口巨大现在上车正当时</text>
</view>
<view class="position-list card" v-if="!positionsLoading && aiPositions.length > 0">
<view class="pos-item" v-for="(pos, idx) in aiPositions" :key="'ai-' + idx" @click="startInterview(pos)">
<text class="ai-banner-arrow"></text>
</view>
<view class="position-list card" v-if="!positionsLoading && displayAiPositions.length > 0">
<view class="pos-item" v-for="(pos, idx) in displayAiPositions" :key="'ai-' + idx" @click="startInterview(pos)">
<view class="pos-left">
<text class="pos-icon pos-icon-ai">{{ pos.icon || posIcons[idx % posIcons.length] || '🤖' }}</text>
<text class="pos-icon pos-icon-ai">{{ pos.icon || aiPosIcons[idx % aiPosIcons.length] || '🤖' }}</text>
<view class="pos-body">
<text class="pos-name">{{ pos.name }}</text>
<text class="pos-name-tag">AI 方向</text>
<view class="pos-meta-row" v-if="pos.company || pos.salary">
<text class="pos-company">{{ pos.company }}</text>
<text class="pos-salary">{{ pos.salary }}</text>
@@ -138,7 +145,7 @@
</view>
</view>
<view class="pos-action">
<text class="pos-action-text pos-action-ai">立即模拟</text>
<text class="pos-action-btn pos-action-ai">开始面试</text>
</view>
</view>
</view>
@@ -154,9 +161,10 @@
<view class="position-list card" v-if="showMore && !positionsLoading && traditionalPositions.length > 0">
<view class="pos-item" v-for="(pos, idx) in traditionalPositions" :key="'tr-' + idx" @click="startInterview(pos)">
<view class="pos-left">
<text class="pos-icon">{{ pos.icon || posIcons[(aiPositions.length + idx) % posIcons.length] || '💼' }}</text>
<text class="pos-icon">{{ pos.icon || posIcons[(displayAiPositions.length + idx) % posIcons.length] || '💼' }}</text>
<view class="pos-body">
<text class="pos-name">{{ pos.name }}</text>
<text class="pos-name-tag pos-name-tag-tr">{{ pos.category === 'intern' ? '实习' : '校招' }}</text>
<view class="pos-meta-row" v-if="pos.company || pos.salary">
<text class="pos-company">{{ pos.company }}</text>
<text class="pos-salary">{{ pos.salary }}</text>
@@ -164,7 +172,7 @@
</view>
</view>
<view class="pos-action">
<text class="pos-action-text">立即模拟</text>
<text class="pos-action-btn">立即模拟</text>
</view>
</view>
</view>
@@ -177,19 +185,44 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onShow } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - AI模拟面试 | 校招求职一站式平台', path: '/pages/index/index' }))
onShareTimeline(() => ({ title: '职引 - AI模拟面试 | 校招求职一站式平台' }))
// #endif
const userInfo = ref(null)
const greeting = ref('')
const hotPositions = ref([])
const posIcons = ['💻', '⚙️', '🤖', '📊', '🎨', '🧪', '📱', '🔧']
const aiPosIcons = ['🤖', '🧠', '⚡', '🚀', '💡', '🔬']
const positionsLoading = ref(true)
const dailyQuestion = ref(null)
const showAnswer = ref(false)
const showMore = ref(false)
const showMore = ref(true)
// 前端兜底 AI 岗位(当 API 返回不足时展示)
const FALLBACK_AI_POSITIONS = [
{ name: 'AI Agent 开发工程师', category: 'ai', company: '热门方向', salary: '30K-60K', icon: '🧠' },
{ name: '大模型应用开发', category: 'ai', company: '热门方向', salary: '25K-50K', icon: '⚡' },
]
const aiPositions = computed(() => hotPositions.value.filter(p => p.category === 'ai'))
const displayAiPositions = computed(() => {
const fromApi = aiPositions.value
if (fromApi.length >= 4) return fromApi
// 补充到至少 4 个,去重
const existingNames = new Set(fromApi.map(p => p.name))
const needed = FALLBACK_AI_POSITIONS.filter(p => !existingNames.has(p.name))
return [...fromApi, ...needed]
})
const traditionalPositions = computed(() => hotPositions.value.filter(p => p.category !== 'ai'))
const loadUserInfo = () => {
@@ -355,40 +388,60 @@ const startInterview = (pos) => uni.navigateTo({ url: `/pages/interview/intervie
/* AI 岗位专区 */
.ai-banner {
background: linear-gradient(135deg, #FEF3C7, #FDE68A);
background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 50%, #FCD34D 100%);
padding: 20rpx 24rpx; border-radius: var(--radius-lg); margin-bottom: 16rpx;
cursor: pointer;
display: flex; align-items: center; gap: 16rpx;
box-shadow: 0 4rpx 16rpx rgba(251,191,36,0.2);
cursor: pointer; transition: transform 0.15s;
}
.ai-banner:active { transform: scale(0.98); }
.ai-banner-title { font-size: 26rpx; font-weight: 700; color: #92400E; display: block; margin-bottom: 6rpx; }
.ai-banner:active { transform: scale(0.97); }
.ai-banner-icon-wrap {
width: 64rpx; height: 64rpx; border-radius: 18rpx;
background: rgba(255,255,255,0.6); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ai-banner-icon { font-size: 36rpx; }
.ai-banner-body { flex: 1; min-width: 0; }
.ai-banner-title { font-size: 26rpx; font-weight: 700; color: #92400E; display: block; margin-bottom: 4rpx; }
.ai-banner-desc { font-size: 20rpx; color: #A16207; line-height: 1.5; display: block; }
.ai-banner-arrow { font-size: 28rpx; color: #B45309; font-weight: 600; flex-shrink: 0; }
.position-list { border-radius: var(--radius-lg); overflow: hidden; }
.pos-item { padding: 24rpx 28rpx; border-bottom: 1rpx solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.pos-item { padding: 26rpx 28rpx; border-bottom: 1rpx solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.pos-item:last-child { border-bottom: none; }
.pos-item:active { background: var(--color-bg); }
.pos-item:active { background: #F9FAFB; }
.pos-left { display: flex; align-items: center; gap: 16rpx; flex: 1; min-width: 0; }
.pos-icon { font-size: 36rpx; width: 56rpx; height: 56rpx; display: flex; align-items: center; justify-content: center; background: #F3F4F6; border-radius: 14rpx; flex-shrink: 0; }
.pos-icon-ai { background: #FEF3C7; }
.pos-icon { font-size: 32rpx; width: 60rpx; height: 60rpx; display: flex; align-items: center; justify-content: center; background: #F3F4F6; border-radius: 16rpx; flex-shrink: 0; }
.pos-icon-ai { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.pos-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pos-name { font-size: 28rpx; font-weight: 600; color: var(--color-text); }
.pos-name-tag {
font-size: 18rpx; color: #D97706; background: #FFFBEB; padding: 1rpx 10rpx;
border-radius: 6rpx; align-self: flex-start; margin-top: 6rpx;
}
.pos-name-tag-tr { color: var(--color-primary); background: #EEF2FF; }
.pos-meta-row { display: flex; align-items: center; gap: 10rpx; margin-top: 4rpx; }
.pos-company { font-size: 20rpx; color: var(--color-text-tertiary); }
.pos-salary { font-size: 20rpx; color: var(--color-primary); background: #EEF2FF; padding: 2rpx 10rpx; border-radius: 6rpx; }
.pos-action { flex-shrink: 0; margin-left: 16rpx; }
.pos-action-text { font-size: 22rpx; color: var(--color-primary); font-weight: 600; }
.pos-action-ai { color: #D97706; }
.pos-action-btn {
font-size: 22rpx; font-weight: 600; color: var(--color-primary);
padding: 10rpx 24rpx; border-radius: var(--radius-round);
background: #EEF2FF; display: inline-block;
}
.pos-action-btn:active { background: #DBEAFE; }
.pos-action-ai { color: #D97706; background: #FFFBEB; }
/* 更多岗位折叠 */
/* 更多岗位 */
.more-header {
display: flex; justify-content: space-between; align-items: center;
padding: 20rpx 4rpx; margin-top: 8rpx; cursor: pointer;
padding: 24rpx 20rpx 16rpx; margin-top: 8rpx; cursor: pointer;
background: #FFFFFF; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.more-header:active { opacity: 0.7; }
.more-header-left { display: flex; align-items: center; gap: 10rpx; }
.more-icon { font-size: 28rpx; }
.more-title { font-size: 26rpx; font-weight: 600; color: var(--color-text-secondary); }
.more-arrow { font-size: 22rpx; color: var(--color-primary); font-weight: 500; }
.more-title { font-size: 26rpx; font-weight: 600; color: var(--color-text); }
.more-arrow { font-size: 22rpx; color: var(--color-primary); font-weight: 500; background: #EEF2FF; padding: 4rpx 16rpx; border-radius: var(--radius-round); }
.loading-tip { text-align: center; padding: 40rpx; font-size: 24rpx; color: var(--color-text-tertiary); background: #FFF; border-radius: var(--radius-lg); }
.bottom-spacer { height: 40rpx; }
+39 -19
View File
@@ -90,28 +90,22 @@
<view class="complete-bar" v-else>
<button class="cta-btn" @click="goResult">查看面试报告</button>
<button class="buy-btn" v-if="completedReason === 'noCredits'" @click="showPurchaseModal = true">引力值不足补充引力值或开通会员 </button>
<button class="buy-btn" v-if="completedReason === 'noCredits'" @click="goH5Buy">引力值不足官网购买 </button>
</view>
<!-- 购买弹窗次数不足时 -->
<view class="modal-overlay" v-if="showPurchaseModal" @click="showPurchaseModal = false">
<!-- 官网购买弹窗 -->
<view class="modal-overlay" v-if="showH5BuyModal" @click="showH5BuyModal = false">
<view class="modal-content" @click.stop>
<text class="modal-title">引力值不足</text>
<text class="modal-hint">您的引力值不足请补充后继续面试每次面试消耗 5 引力值</text>
<view class="purchase-options">
<view class="purchase-option" @click="goBuyProduct">
<text class="purchase-name">补充引力值</text>
<text class="purchase-price">¥5 </text>
<text class="purchase-desc">¥5 = 5 引力值可面试 1 </text>
</view>
<view class="purchase-option recommended" @click="goBuyMember">
<text class="purchase-badge">推荐</text>
<text class="purchase-name">开通成长版会员</text>
<text class="purchase-price">¥19.9<text class="purchase-unit">/</text></text>
<text class="purchase-desc">每月 250 引力值解锁全部权益</text>
<view class="purchase-option" @click="goH5BuyAndClose">
<text class="purchase-name">官网购买引力值</text>
<text class="purchase-price">前往网页版充值</text>
<text class="purchase-desc">打开官网 H5 页面支持多种支付方式</text>
</view>
</view>
<text class="modal-close" @click="showPurchaseModal = false">取消</text>
<text class="modal-close" @click="showH5BuyModal = false">取消</text>
</view>
</view>
</view>
@@ -119,10 +113,18 @@
<script setup>
import { ref, computed, onMounted, onBeforeUnmount, nextTick } from 'vue'
// #ifdef MP-WEIXIN
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onLoad } from '@dcloudio/uni-app'
// #endif
import { api, API_ENDPOINTS } from '../../config'
import DigitalHuman from '../../components/digital-human.vue'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - AI模拟面试 | 数字人面试官实战练习', path: '/pages/interview/interview' }))
onShareTimeline(() => ({ title: '职引 - AI模拟面试 | 数字人面试官实战练习' }))
// #endif
const messages = ref([{ role: 'ai', content: '你好!我是 AI 面试官,请选择岗位开始模拟面试!' }])
const inputText = ref('')
const aiLoading = ref(false)
@@ -134,7 +136,7 @@ const scrollToId = ref('')
const position = ref('')
const avatarMode = ref(true)
const showPositionPicker = ref(false)
const showPurchaseModal = ref(false)
const showH5BuyModal = ref(false)
const positions = ref([])
const positionsLoading = ref(false)
const aiSpeechText = ref('')
@@ -323,8 +325,27 @@ function onAvatarSilent() {
}
const goResult = () => uni.navigateTo({ url: `/pages/report/report?interviewId=${interviewId.value}` })
const goBuyProduct = () => uni.navigateTo({ url: '/pages/member/member?buy=interview' })
const goBuyMember = () => uni.navigateTo({ url: '/pages/member/member' })
// 官网购买引力值
const goH5Buy = () => {
showH5BuyModal.value = true
}
const goH5BuyAndClose = () => {
showH5BuyModal.value = false
const token = uni.getStorageSync('token') || ''
const url = `https://zhiyin.yzrcloud.cn/?buy=gravity${token ? '&token=' + token : ''}`
// #ifdef MP-WEIXIN
uni.setClipboardData({
data: url,
success: () => {
uni.showToast({ title: '链接已复制,请在手机浏览器中打开', icon: 'none', duration: 3000 })
},
fail: () => {
uni.showToast({ title: '复制失败,请手动访问 zhiyin.yzrcloud.cn', icon: 'none', duration: 3000 })
},
})
// #endif
}
const scrollToBottom = () => {
nextTick(() => { scrollToId.value = ''; setTimeout(() => { scrollToId.value = 'msg-bottom' }, 100) })
}
@@ -365,7 +386,6 @@ function stopRecord() {
name: 'audio',
header: { 'Authorization': `Bearer ${token()}` },
})
console.log('[ASR] upload response:', uploadRes.statusCode, typeof uploadRes.data === 'string' ? uploadRes.data.slice(0, 200) : JSON.stringify(uploadRes.data).slice(0, 200))
if (uploadRes.statusCode === 200 && uploadRes.data) {
const data = typeof uploadRes.data === 'string' ? JSON.parse(uploadRes.data) : uploadRes.data
if (data.text) {
+8 -2
View File
@@ -118,8 +118,16 @@
<script setup>
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
// #ifdef MP-WEIXIN
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 登录注册 | AI模拟面试', path: '/pages/login/login' }))
onShareTimeline(() => ({ title: '职引 - 登录注册 | AI模拟面试' }))
// #endif
const agreed = ref(false)
const mainTab = ref('login')
@@ -300,7 +308,6 @@ const doWxLogin = async () => {
wxLoading.value = true
try {
const wxResp = await uni.login()
console.log('[wxLogin] uni.login success:', JSON.stringify(wxResp).slice(0, 300))
const { code, errMsg } = wxResp
if (!code) { console.error('[wxLogin] no code:', errMsg); showToast('获取微信凭证失败'); return }
const res = await uni.request({
@@ -308,7 +315,6 @@ const doWxLogin = async () => {
header: { 'Content-Type': 'application/json' },
data: { code },
})
console.log('[wxLogin] server response:', res.statusCode, JSON.stringify(res.data).slice(0, 500))
if (res.statusCode === 200 && res.data?.token) {
loginSuccess(res.data)
} else {
+138 -493
View File
@@ -1,584 +1,229 @@
<template>
<!-- #ifdef MP-WEIXIN -->
<view class="page fade-in">
<view class="placeholder-wrap">
<text class="placeholder-icon"></text>
<text class="placeholder-text">功能已整合到各模块</text>
<text class="placeholder-hint">请返回使用引力值充值功能</text>
<text class="placeholder-back" @click="goBack">返回首页</text>
</view>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="page fade-in">
<view class="hero">
<text class="hero-title">会员中心</text>
<text class="hero-sub" v-if="isLoggedIn">
当前{{ currentPlanName }}
</text>
<text class="hero-sub" v-else>选择套餐解锁全部功能</text>
<text class="hero-icon"></text>
<text class="hero-title">补充引力值</text>
<text class="hero-desc">购买后可获得相应引力值用于面试简历优化下载</text>
</view>
<view class="plans">
<!-- 免费版 -->
<view class="plan-card free" :class="{ active: plan === 'free' && isLoggedIn }">
<view class="plan-header">
<text class="plan-name">免费版</text>
<view class="plan-price"><text class="price-num">免费</text></view>
<view class="product-card">
<view class="qty-section">
<text class="section-label">购买数量</text>
<view class="qty-controls">
<text class="qty-btn" :class="{ disabled: buyQty <= 1 }" @click="changeQty(-1)"></text>
<input class="qty-input" type="number" v-model.number="buyQty" min="1" max="99" @blur="clampQty" />
<text class="qty-btn" :class="{ disabled: buyQty >= 99 }" @click="changeQty(1)">+</text>
</view>
<view class="plan-features">
<text class="feat" v-for="f in freeFeatures" :key="f"> {{ f }}</text>
</view>
<view class="plan-status" v-if="isLoggedIn && plan === 'free'">当前使用</view>
<view class="plan-status hint" v-else-if="!isLoggedIn">注册即用</view>
</view>
<!-- 成长版 -->
<view class="plan-card growth recommended" :class="{ active: plan === 'growth' && isLoggedIn }">
<view class="plan-badge"> 推荐</view>
<view class="plan-header">
<text class="plan-name">成长版</text>
<text class="plan-price"><text class="price-num">{{ growthPriceText }}</text><text class="price-unit">/</text></text>
<view class="summary">
<view class="summary-row">
<text class="summary-label">单价</text>
<text class="summary-val">¥{{ (unitPrice / 100).toFixed(1) }} / </text>
</view>
<view class="plan-features">
<text class="feat" v-for="f in growthFeatures" :key="f"> {{ f }}</text>
<view class="summary-row">
<text class="summary-label">可得引力值</text>
<text class="summary-val highlight">{{ buyQty * gravityPerUnit }} 引力值</text>
</view>
<view class="summary-row total">
<text class="summary-label">合计</text>
<text class="summary-val total-price">¥{{ (buyQty * unitPrice / 100).toFixed(2) }}</text>
</view>
<view class="plan-action" v-if="!isLoggedIn" @click="goLogin">登录后开通</view>
<view class="plan-action owned" v-else-if="plan !== 'free'"> 已开通</view>
<view class="plan-action" v-else @click="startPay('growth')">{{ growthPriceText }} 立即开通</view>
</view>
<!-- 冲刺版 -->
<view class="plan-card sprint" :class="{ active: plan === 'sprint' && isLoggedIn }">
<view class="plan-badge sprint-badge">🚀 冲刺</view>
<view class="plan-header">
<text class="plan-name">冲刺版</text>
<text class="plan-price"><text class="price-num price-sprint">{{ sprintPriceText }}</text><text class="price-unit">/</text></text>
</view>
<view class="plan-features">
<text class="feat" v-for="f in sprintFeatures" :key="f"> {{ f }}</text>
</view>
<view class="plan-action" v-if="!isLoggedIn" @click="goLogin">登录后开通</view>
<view class="plan-action owned" v-else-if="plan === 'sprint'"> 已开通</view>
<view class="plan-action" v-else-if="plan === 'growth'" @click="startPay('sprint')">升级至冲刺版</view>
<view class="plan-action" v-else @click="startPay('sprint')">{{ sprintPriceText }}/ 立即开通</view>
</view>
<button class="buy-btn" :disabled="payLoading" @click="startPay">
<text v-if="!payLoading">立即购买</text>
<text v-else>处理中...</text>
</button>
</view>
<!-- 支付弹窗 -->
<view class="modal-overlay" v-if="showPayModal" @click="cancelPay">
<view class="modal-content" @click.stop>
<template v-if="payLoading">
<text class="modal-title">正在创建支付...</text>
<text class="modal-title">正在创建订单...</text>
</template>
<template v-else-if="!isMp && payCodeUrl">
<template v-else-if="payCodeUrl">
<text class="modal-title">微信扫码支付</text>
<canvas canvas-id="payQrcode" class="qr-canvas"></canvas>
<text class="modal-hint">请用微信扫码完成支付</text>
<text class="modal-hint">支付成功后将自动跳转</text>
<image class="qrcode" :src="'https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=' + encodeURIComponent(payCodeUrl)" mode="widthFix" />
<text class="modal-hint">使用微信扫描二维码完成支付</text>
<text class="modal-close" @click="cancelPay">取消支付</text>
</template>
<template v-else-if="isMp && !payLoading">
<text class="modal-title">微信支付</text>
<text class="modal-hint">即将调起微信支付...</text>
<template v-else-if="paySuccess">
<text class="modal-title"> 支付成功</text>
<text class="modal-hint">引力值已到账返回继续使用吧</text>
<text class="modal-close" @click="cancelPay">关闭</text>
</template>
<template v-if="payError">
<text class="modal-title pay-error">支付异常</text>
<template v-else-if="payError">
<text class="modal-title pay-error">支付失败</text>
<text class="modal-hint">{{ payError }}</text>
<text class="modal-close" @click="cancelPay">关闭</text>
</template>
</view>
</view>
<!-- 数量选择弹窗补充引力值 -->
<view class="modal-overlay" v-if="showQuantityModal" @click="showQuantityModal = false">
<view class="modal-content" @click.stop>
<text class="modal-title">补充引力值</text>
<text class="modal-hint">购买后将获得相应引力值可用于面试优化下载</text>
<view class="qty-selector">
<text class="qty-label">购买数量</text>
<view class="qty-controls">
<text class="qty-btn" :class="{ disabled: buyQuantity <= 1 }" @click="changeQty(-1)"></text>
<input class="qty-input" type="number" v-model.number="buyQuantity" min="1" max="99" @blur="clampQty" />
<text class="qty-btn" :class="{ disabled: buyQuantity >= 99 }" @click="changeQty(1)">+</text>
</view>
</view>
<view class="qty-summary">
<text class="qty-unit-price">单价¥{{ (unitPrice / 100).toFixed(1) }}</text>
<text class="qty-total"> <text class="qty-total-num">{{ buyQuantity * buyGravityPerUnit }}</text> 引力值</text>
</view>
<view class="qty-actions">
<text class="qty-cancel" @click="showQuantityModal = false">取消</text>
<text class="qty-confirm" @click="confirmProductBuy">¥{{ totalPrice.toFixed(1) }} 去支付</text>
</view>
</view>
</view>
<!-- 支付中提示 -->
<view class="pay-success" v-if="paySuccess">
<text class="success-icon">🎉</text>
<text class="success-text">开通成功{{ payingPlanName }}已生效</text>
</view>
</view>
<!-- #endif -->
</template>
<script setup>
import { ref, computed, onMounted, nextTick } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
import UQRCode from 'uqrcodejs'
const isLoggedIn = ref(false)
const isMp = ref(false)
const plan = ref('free')
const currentPlanName = ref('免费版')
const paySuccess = ref(false)
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 引力值购买 | AI模拟面试', path: '/pages/member/member' }))
onShareTimeline(() => ({ title: '职引 - 引力值购买 | AI模拟面试' }))
// #endif
const goBack = () => uni.switchTab({ url: '/pages/user/user' })
// #ifdef H5
const buyQty = ref(1)
const unitPrice = ref(500)
const gravityPerUnit = ref(5)
const payLoading = ref(false)
const showPayModal = ref(false)
const payCodeUrl = ref('')
const payLoading = ref(false)
const paySuccess = ref(false)
const payError = ref('')
const payingPlanName = ref('')
const payingPlan = ref('')
const growthPriceText = ref('¥19.9')
const sprintPriceText = ref('¥49.9')
const currentOutTradeNo = ref('')
const freeFeatures = ref(['AI 模拟面试 1 次(注册送 5 引力值)', '基础面试报告', '通用题库随机出题', '简历优化(限 3 次免费)'])
const growthFeatures = ref(['免费版全部权益', '每月 250 引力值(约 50 次面试)', '详细面试报告(四维评分)', '进步轨迹雷达图 + 打卡', '每日一题', '参考回答思路', '公司真题库'])
const sprintFeatures = ref(['成长版全部权益', '每月 600 引力值(约 120 次面试)', 'AI 语音分析(语气词/语速检测)', '技能缺口分析报告', '公司真题库精选'])
const products = ref([])
const gravityRates = ref({ interviewPerUse: 5, optimizePerUse: 3, downloadPerUse: 2 })
const productPayType = ref('')
const showQuantityModal = ref(false)
const buyQuantity = ref(1)
const buyProductType = ref('')
const pendingBuy = ref('')
const unitPrice = computed(() => {
const p = products.value.find(p => p.type === buyProductType.value)
return p?.price || 0
})
const totalPrice = computed(() => (unitPrice.value * buyQuantity.value) / 100)
const buyGravityPerUnit = computed(() => {
const p = products.value.find(p => p.type === buyProductType.value)
return p?.gravity || 0
onMounted(async () => {
try {
const res = await uni.request({ url: api('/member/plans'), method: 'GET' })
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.products) {
const prod = res.data.products.interview
if (prod) {
unitPrice.value = prod.price || 500
gravityPerUnit.value = prod.gravity || 5
}
}
} catch (e) { /* silent */ }
})
const token = () => uni.getStorageSync('token') || ''
const refreshState = async () => {
// #ifdef MP-WEIXIN
isMp.value = true
// #endif
const t = token()
if (!t) {
isLoggedIn.value = false
return
}
isLoggedIn.value = true
try {
const [sres, lres] = await Promise.all([
uni.request({ url: api('/member/status'), method: 'GET', header: { 'Authorization': `Bearer ${t}` } }),
uni.request({ url: api('/member/plans'), method: 'GET' }),
])
if (sres.statusCode >= 200 && sres.statusCode < 300) {
const d = sres.data
plan.value = d.plan || 'free'
currentPlanName.value = d.planName || '免费版'
}
if (lres.statusCode >= 200 && lres.statusCode < 300 && lres.data) {
const plans = Array.isArray(lres.data.plans) ? lres.data.plans : (Array.isArray(lres.data) ? lres.data : [])
const growth = plans.find((p) => p.id === 'growth')
const sprint = plans.find((p) => p.id === 'sprint')
if (growth) {
growthPriceText.value = `¥${(growth.price / 100).toFixed(1)}`
if (growth.features?.length) growthFeatures.value = growth.features
}
if (sprint?.features?.length) sprintFeatures.value = sprint.features
if (sprint) sprintPriceText.value = `¥${(sprint.price / 100).toFixed(1)}`
if (lres.data.price?.monthly) {
growthPriceText.value = `¥${(lres.data.price.monthly / 100).toFixed(1)}`
}
if (lres.data?.products) {
const prodList = []
for (const [key, val] of Object.entries(lres.data.products)) {
if (val?.price > 0) prodList.push({ type: key, ...val })
}
products.value = prodList
}
if (lres.data?.gravityRates) {
gravityRates.value = lres.data.gravityRates
}
}
// 来自其他页面的补充次数请求 → 弹出数量选择
if (pendingBuy.value && products.value.length > 0) {
buyProductType.value = pendingBuy.value
buyQuantity.value = 1
pendingBuy.value = ''
showQuantityModal.value = true
}
} catch (e) { /* ignore */ }
}
onLoad((options) => {
if (options?.buy) {
pendingBuy.value = options.buy
}
})
onMounted(() => { refreshState() })
onShow(() => { refreshState() })
const goLogin = () => uni.navigateTo({ url: '/pages/login/login' })
const cancelPay = () => {
showPayModal.value = false
payCodeUrl.value = ''
payLoading.value = false
payError.value = ''
}
/** 创建支付订单 */
const startPay = async (selectedPlan) => {
const t = token()
if (!t) { uni.showToast({ title: '请先登录', icon: 'none' }); return }
payingPlan.value = selectedPlan
payingPlanName.value = selectedPlan === 'sprint' ? '冲刺版' : '成长版'
showPayModal.value = true
payLoading.value = true
payError.value = ''
const planLabel = selectedPlan || 'growth'
if (isMp.value) {
// 小程序:JSAPI 支付
try {
let res = await uni.request({
url: api('/payment/jsapi'), method: 'POST',
data: { plan: planLabel },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
timeout: 30000,
})
// 如果没有 openid,自动绑定
if (res.statusCode === 400 && res.data?.needBindWx) {
payLoading.value = false
uni.showLoading({ title: '绑定微信中...' })
try {
const loginRes = await uni.login()
if (!loginRes?.errMsg?.includes('ok')) throw new Error('获取微信凭证失败')
const bindRes = await uni.request({
url: api('/user/bind-wx'), method: 'POST',
data: { code: loginRes.code },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
})
if (bindRes.statusCode >= 200 && bindRes.statusCode < 300) {
// 绑定成功,重试支付
res = await uni.request({
url: api('/payment/jsapi'), method: 'POST',
data: { plan: planLabel },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
timeout: 30000,
})
} else {
throw new Error(bindRes.data?.message || '微信绑定失败')
}
} catch (e) {
uni.hideLoading()
payError.value = '微信绑定失败,请重试'
uni.showToast({ title: '微信绑定失败', icon: 'none' })
return
}
uni.hideLoading()
}
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.payParams) {
const pp = res.data.payParams
currentOutTradeNo.value = res.data.outTradeNo || ''
uni.requestPayment({
provider: 'wxpay',
timeStamp: pp.timeStamp,
nonceStr: pp.nonceStr,
package: pp.package,
signType: pp.signType || 'RSA',
paySign: pp.paySign,
success: () => {
const no = currentOutTradeNo.value || res.data.outTradeNo
pollPayResult(no, planLabel)
},
fail: (err) => { payError.value = '支付未完成'; uni.showToast({ title: '支付未完成', icon: 'none' }) },
})
} else if (!res.statusCode || res.statusCode === 0) {
payLoading.value = false
const errMsg = '网络连接失败,请检查网络后重试'
payError.value = errMsg
uni.showToast({ title: errMsg, icon: 'none' })
} else {
payLoading.value = false
// DEBUG: 显示实际返回的状态和数据以便排查
const debugInfo = `[${res.statusCode}] ${JSON.stringify(res.data).substring(0, 120)}`
console.error('支付响应异常:', debugInfo)
const errMsg = res.data?.message || `创建订单失败(${debugInfo})`
payError.value = errMsg
uni.showToast({ title: errMsg, icon: 'none', duration: 4000 })
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
} else {
// H5:二维码支付
try {
const res = await uni.request({
url: api('/payment/create'), method: 'POST',
data: { plan: planLabel },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
})
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.codeUrl) {
payCodeUrl.value = res.data.codeUrl
currentOutTradeNo.value = res.data.outTradeNo
nextTick(() => {
try {
const ctx = uni.createCanvasContext('payQrcode')
const uqrcode = new UQRCode()
uqrcode.data = res.data.codeUrl
uqrcode.size = 400
uqrcode.margin = 20
uqrcode.backgroundColor = '#FFFFFF'
uqrcode.foregroundColor = '#000000'
uqrcode.make()
uqrcode.drawCanvas(ctx)
} catch(e) { console.error('二维码生成失败', e) }
})
// 轮询支付结果
pollPayResult(res.data.outTradeNo, planLabel)
} else if (!res.statusCode || res.statusCode === 0) {
payLoading.value = false
const errMsg = '网络连接失败,请检查网络后重试'
payError.value = errMsg
uni.showToast({ title: errMsg, icon: 'none' })
} else {
payError.value = res.data?.message || '支付服务暂不可用'
uni.showToast({ title: res.data?.message || '支付服务暂不可用', icon: 'none' })
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
}
}
/** 数量增减 */
const changeQty = (delta) => {
const next = buyQuantity.value + delta
if (next >= 1 && next <= 99) buyQuantity.value = next
const changeQty = (delta: number) => {
const next = buyQty.value + delta
if (next >= 1 && next <= 99) buyQty.value = next
}
const clampQty = () => {
if (buyQuantity.value < 1) buyQuantity.value = 1
if (buyQuantity.value > 99) buyQuantity.value = 99
if (buyQty.value < 1) buyQty.value = 1
if (buyQty.value > 99) buyQty.value = 99
}
/** 确认购买(从数量选择弹窗触发) */
const confirmProductBuy = () => {
showQuantityModal.value = false
startProductPay(buyProductType.value, buyQuantity.value)
}
const startPay = async () => {
const token = uni.getStorageSync('token') || ''
if (!token) { uni.showToast({ title: '请先登录', icon: 'none' }); return }
/** 按次购买 */
const startProductPay = async (type, quantity = 1) => {
const t = token()
if (!t) { uni.showToast({ title: '请先登录', icon: 'none' }); return }
productPayType.value = type
showPayModal.value = true
payLoading.value = true
payCodeUrl.value = ''
payError.value = ''
paySuccess.value = false
const prod = products.value.find(p => p.type === type)
const prodTitle = prod?.title || type
if (isMp.value) {
// 小程序:JSAPI 按次支付
try {
let res = await uni.request({
url: api('/payment/jsapi-product'), method: 'POST',
data: { type, quantity },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
timeout: 30000,
})
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.payParams) {
const pp = res.data.payParams
currentOutTradeNo.value = res.data.outTradeNo || ''
uni.requestPayment({
provider: 'wxpay',
timeStamp: pp.timeStamp,
nonceStr: pp.nonceStr,
package: pp.package,
signType: pp.signType || 'RSA',
paySign: pp.paySign,
success: () => {
const no = currentOutTradeNo.value || res.data.outTradeNo
pollPayResult(no, 'growth')
},
fail: (err) => { payError.value = '支付未完成'; uni.showToast({ title: '支付未完成', icon: 'none' }) },
})
} else if (!res.statusCode || res.statusCode === 0) {
payLoading.value = false
uni.showToast({ title: '网络连接失败', icon: 'none' })
} else {
payLoading.value = false
const errMsg = res.data?.message || '购买失败'
payError.value = errMsg
uni.showToast({ title: errMsg, icon: 'none' })
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
} else {
// H5:扫码支付
try {
const res = await uni.request({
url: api('/payment/create-product'), method: 'POST',
data: { type, quantity },
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
data: { type: 'interview', quantity: buyQty.value },
header: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
})
payLoading.value = false
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.codeUrl) {
payCodeUrl.value = res.data.codeUrl
currentOutTradeNo.value = res.data.outTradeNo
nextTick(() => {
try {
const ctx = uni.createCanvasContext('payQrcode')
const uqrcode = new UQRCode()
uqrcode.data = res.data.codeUrl
uqrcode.size = 400
uqrcode.margin = 20
uqrcode.backgroundColor = '#FFFFFF'
uqrcode.foregroundColor = '#000000'
uqrcode.make()
uqrcode.drawCanvas(ctx)
} catch(e) { console.error('二维码生成失败', e) }
})
pollPayResult(res.data.outTradeNo, 'growth')
} else if (!res.statusCode || res.statusCode === 0) {
payLoading.value = false
uni.showToast({ title: '网络连接失败', icon: 'none' })
pollPayResult(res.data.outTradeNo)
} else {
payError.value = res.data?.message || '购买失败'
uni.showToast({ title: res.data?.message || '购买失败', icon: 'none' })
payError.value = res.data?.message || '创建订单失败'
}
} catch (e) {
payLoading.value = false
payError.value = '网络错误,请重试'
uni.showToast({ title: '网络错误', icon: 'none' })
}
}
}
/** 轮询订单状态 */
const pollPayResult = async (outTradeNo, selectedPlan) => {
const pollPayResult = (outTradeNo: string) => {
if (!outTradeNo) return
const maxAttempts = 30
const token = uni.getStorageSync('token') || ''
let attempts = 0
const poll = async () => {
attempts++
try {
const res = await uni.request({
url: api(`/payment/check/${outTradeNo}`), method: 'GET',
header: { 'Authorization': `Bearer ${token()}` },
header: { 'Authorization': `Bearer ${token}` },
})
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.status === 'success') {
// 支付成功,激活套餐
await activatePlan(outTradeNo, selectedPlan)
paySuccess.value = true
payCodeUrl.value = ''
return
}
} catch (e) { /* ignore */ }
if (attempts < maxAttempts) {
setTimeout(poll, 2000)
} else {
payError.value = '支付结果查询超时,请联系客服'
uni.showToast({ title: '支付查询超时', icon: 'none' })
}
if (attempts < 30) setTimeout(poll, 2000)
}
setTimeout(poll, 2000)
}
/** 激活套餐 */
const activatePlan = async (outTradeNo, selectedPlan) => {
try {
const res = await uni.request({
url: api('/payment/activate'), method: 'POST',
data: { outTradeNo },
header: { 'Authorization': `Bearer ${token()}`, 'Content-Type': 'application/json' },
})
if (res.statusCode >= 200 && res.statusCode < 300 && res.data?.success) {
paySuccess.value = true
const cancelPay = () => {
showPayModal.value = false
plan.value = selectedPlan === 'sprint' ? 'sprint' : 'growth'
currentPlanName.value = selectedPlan === 'sprint' ? '冲刺版' : '成长版'
uni.showToast({ title: '🎉 开通成功!', icon: 'success' })
} else {
uni.showToast({ title: res.data?.message || '激活失败', icon: 'none' })
}
} catch (e) {
payError.value = '激活失败,请联系客服'
uni.showToast({ title: '激活失败', icon: 'none' })
}
payCodeUrl.value = ''
payError.value = ''
payLoading.value = false
}
// #endif
</script>
<style scoped>
.page { min-height: 100vh; background: var(--color-bg); }
.hero { background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end)); padding: 48rpx 32rpx 72rpx; border-radius: 0 0 48rpx 48rpx; }
.hero-title { font-size: 40rpx; font-weight: 700; color: #FFFFFF; }
.hero-sub { font-size: 22rpx; color: rgba(255,255,255,0.7); margin-top: 8rpx; display: block; }
.plans { padding: 0 32rpx; margin-top: -40rpx; display: flex; flex-direction: column; gap: 24rpx; }
.plan-card { background: #FFFFFF; border-radius: var(--radius-xl); padding: 32rpx; box-shadow: var(--shadow-sm); position: relative; }
.plan-card.growth { border: 2rpx solid var(--color-primary); }
.plan-card.sprint { border: 2rpx solid #F59E0B; }
.plan-card.active { border-color: var(--color-primary); }
.plan-badge { position: absolute; top: -12rpx; right: 24rpx; background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); color: #FFF; font-size: 20rpx; padding: 4rpx 20rpx; border-radius: var(--radius-round); font-weight: 600; }
.sprint-badge { background: linear-gradient(135deg, #F59E0B, #F97316); }
.plan-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20rpx; }
.plan-name { font-size: 30rpx; font-weight: 700; color: var(--color-text); }
.price-num { font-size: 44rpx; font-weight: 800; color: var(--color-primary); }
.price-unit { font-size: 22rpx; color: var(--color-text-tertiary); }
.price-sprint { color: #D97706; }
.plan-features { display: flex; flex-direction: column; gap: 10rpx; margin-bottom: 24rpx; }
.feat { font-size: 24rpx; color: var(--color-text-secondary); }
.plan-status { text-align: center; background: #F3F4F6; padding: 14rpx; border-radius: var(--radius-sm); font-size: 24rpx; color: var(--color-text-secondary); }
.plan-status.hint { background: transparent; color: var(--color-text-tertiary); }
.plan-action { text-align: center; background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); color: #FFF; padding: 20rpx; border-radius: var(--radius-md); font-size: 28rpx; font-weight: 600; }
.plan-action.owned { background: #ECFDF5; color: var(--color-success); }
.pay-success { margin: 24rpx 32rpx; background: #ECFDF5; border-radius: var(--radius-lg); padding: 32rpx; text-align: center; }
.success-icon { font-size: 48rpx; display: block; margin-bottom: 8rpx; }
.success-text { font-size: 28rpx; font-weight: 600; color: var(--color-success); }
.placeholder-wrap { display: flex; flex-direction: column; align-items: center; gap: 16rpx; padding: 80rpx 40rpx; }
.placeholder-icon { font-size: 80rpx; }
.placeholder-text { font-size: 30rpx; font-weight: 600; color: var(--color-text); }
.placeholder-hint { font-size: 24rpx; color: var(--color-text-tertiary); }
.placeholder-back { font-size: 26rpx; color: var(--color-primary); padding: 16rpx 40rpx; border-radius: var(--radius-md); background: #F3F4F6; margin-top: 24rpx; }
/* 弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #FFF; border-radius: var(--radius-xl); padding: 40rpx; width: 70%; display: flex; flex-direction: column; align-items: center; gap: 20rpx; }
.modal-title { font-size: 28rpx; font-weight: 600; color: var(--color-text); }
.pay-error { color: var(--color-error); }
.qr-canvas { width: 400rpx; height: 400rpx; background: #FFF; border-radius: var(--radius-md); }
.modal-hint { font-size: 22rpx; color: var(--color-text-tertiary); }
.modal-close { font-size: 22rpx; color: var(--color-text-tertiary); padding: 8rpx; }
/* H5 购买页 */
.hero { display: flex; flex-direction: column; align-items: center; padding: 48rpx 32rpx 24rpx; }
.hero-icon { font-size: 72rpx; }
.hero-title { font-size: 36rpx; font-weight: 700; color: var(--color-text); margin-top: 12rpx; }
.hero-desc { font-size: 24rpx; color: var(--color-text-secondary); margin-top: 8rpx; text-align: center; }
/* 数量选择弹窗 */
.qty-selector { width: 100%; }
.qty-label { font-size: 24rpx; color: #6B7280; margin-bottom: 16rpx; display: block; }
.product-card { background: #fff; border-radius: var(--radius-lg); margin: 0 32rpx; padding: 32rpx; box-shadow: var(--shadow-sm); }
.qty-section { margin-bottom: 24rpx; }
.section-label { font-size: 26rpx; font-weight: 600; color: var(--color-text); display: block; margin-bottom: 16rpx; }
.qty-controls { display: flex; align-items: center; justify-content: center; gap: 24rpx; }
.qty-btn { width: 64rpx; height: 64rpx; border-radius: 50%; background: #F3F4F6; display: flex; align-items: center; justify-content: center; font-size: 36rpx; font-weight: 500; color: var(--color-text); }
.qty-btn.disabled { color: #D1D5DB; background: #F9FAFB; }
.qty-btn:active:not(.disabled) { transform: scale(0.9); background: #E5E7EB; }
.qty-input { width: 100rpx; height: 72rpx; text-align: center; font-size: 36rpx; font-weight: 700; color: var(--color-text); border: 2rpx solid #E5E7EB; border-radius: var(--radius-sm); }
.qty-summary { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16rpx 0; border-top: 1rpx solid #F3F4F6; }
.qty-unit-price { font-size: 22rpx; color: #6B7280; }
.qty-total { font-size: 26rpx; color: var(--color-text); font-weight: 500; }
.qty-total-num { font-size: 36rpx; font-weight: 800; color: var(--color-primary); }
.qty-actions { width: 100%; display: flex; gap: 16rpx; margin-top: 8rpx; }
.qty-cancel { flex: 1; text-align: center; padding: 20rpx; border-radius: var(--radius-md); font-size: 26rpx; color: #6B7280; border: 2rpx solid #E5E7EB; }
.qty-confirm { flex: 2; text-align: center; padding: 20rpx; border-radius: var(--radius-md); font-size: 26rpx; font-weight: 600; color: #FFF; background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); }
.qty-input { width: 120rpx; height: 72rpx; text-align: center; font-size: 36rpx; font-weight: 700; color: var(--color-text); border: 2rpx solid #E5E7EB; border-radius: var(--radius-sm); }
.summary { margin-bottom: 32rpx; }
.summary-row { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #F3F4F6; }
.summary-row.total { border-bottom: none; padding-top: 16rpx; }
.summary-label { font-size: 24rpx; color: var(--color-text-secondary); }
.summary-val { font-size: 26rpx; font-weight: 600; color: var(--color-text); }
.summary-val.highlight { color: var(--color-primary); }
.total-price { font-size: 36rpx; font-weight: 800; color: var(--color-primary); }
.buy-btn { width: 100%; height: 88rpx; background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); color: #fff; font-size: 30rpx; font-weight: 600; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; border: none; }
.buy-btn:active { opacity: 0.85; transform: scale(0.98); }
.buy-btn[disabled] { opacity: 0.5; }
/* 支付弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #FFF; border-radius: var(--radius-xl); padding: 40rpx 32rpx; width: 600rpx; display: flex; flex-direction: column; align-items: center; gap: 16rpx; }
.modal-title { font-size: 30rpx; font-weight: 700; color: var(--color-text); }
.pay-error { color: var(--color-error); }
.modal-hint { font-size: 22rpx; color: #6B7280; text-align: center; }
.modal-close { font-size: 24rpx; color: #9CA3AF; padding: 12rpx 24rpx; }
.qrcode { width: 300rpx; height: 300rpx; margin: 8rpx 0; }
</style>
@@ -134,9 +134,19 @@
<script setup>
import { ref, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onShow } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 进步轨迹 | 能力雷达+打卡日历', path: '/pages/progress/progress' }))
onShareTimeline(() => ({ title: '职引 - 进步轨迹 | 能力雷达+打卡日历' }))
// #endif
const stats = ref({ completedInterviews: 0, avgScore: 0, streak: 0 })
const progress = ref({ dimensions: {}, interviews: [], recentScores: [] })
const skillsGap = ref(null)
+10
View File
@@ -70,9 +70,19 @@
<script setup>
import { ref, nextTick } from 'vue'
// #ifdef MP-WEIXIN
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onLoad } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 面试报告与评分 | AI多维评分', path: '/pages/report/report' }))
onShareTimeline(() => ({ title: '职引 - 面试报告与评分 | AI多维评分' }))
// #endif
const loading = ref(true)
const report = ref(null)
const dimList = ref([])
+10
View File
@@ -148,9 +148,19 @@
<script setup>
import { ref, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onLoad } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 简历诊断与优化 | AI智能优化', path: '/pages/resume/resume' }))
onShareTimeline(() => ({ title: '职引 - 简历诊断与优化 | AI智能优化' }))
// #endif
const currentTab = ref('list')
const showForm = ref(false)
const formTitle = ref('')
+10
View File
@@ -281,9 +281,19 @@
<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onShow } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 面试复盘分析 | AI评析+口语分析', path: '/pages/review/review' }))
onShareTimeline(() => ({ title: '职引 - 面试复盘分析 | AI评析+口语分析' }))
// #endif
const mode = ref('list')
const loading = ref(false)
const submitting = ref(false)
+70 -12
View File
@@ -55,16 +55,19 @@
<!-- 分享按钮 -->
<view class="share-actions">
<!-- #ifdef MP-WEIXIN -->
<view class="share-btn-row">
<button class="share-btn wx-share" open-type="share">
<text class="btn-icon">💬</text>
<text>分享给好友</text>
</button>
<button class="share-btn wx-share" open-type="share" data-mode="timeline">
<view class="share-btn wx-timeline-hint" @click="showTimelineHint">
<text class="btn-icon">🔄</text>
<text>分享朋友圈</text>
</button>
</view>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="share-btn-row">
<button class="share-btn wx-share" @click="shareToWechat" v-if="isWechat">
<text class="btn-icon">💬</text>
<text>分享给微信好友</text>
@@ -73,12 +76,15 @@
<text class="btn-icon">🔄</text>
<text>分享朋友圈</text>
</button>
</view>
<!-- #endif -->
<view class="share-btn-row">
<button class="share-btn link-share" @click="copyLink">
<text class="btn-icon">🔗</text>
<text>复制分享链接</text>
</button>
</view>
</view>
<!-- Tab 切换 -->
<view class="tab-bar">
@@ -137,6 +143,7 @@ import { api } from '../../config'
const tab = ref('records')
const stats = ref({ totalShares: 0, totalVisits: 0, creditedCount: 0, todayCredited: 0, shareCredits: 0, gravity: 0 })
const shareLink = ref('')
const shareUrlCached = ref('')
const records = ref([])
const visitors = ref([])
@@ -171,6 +178,21 @@ async function loadData() {
if (!token) { uni.showToast({ title: '请先登录', icon: 'none' }); return }
const header = { Authorization: `Bearer ${token}` }
// 先创建分享链接,缓存下来供复制使用
try {
const res = await uni.request({
url: api('/share/create'), method: 'POST',
data: { type: 'app', title: '我在AI磁场·职引练习面试', description: 'AI模拟面试+简历优化,快来一起提升吧' },
header,
})
if (res.statusCode >= 200 && res.statusCode < 300) {
const data = res.data?.data || res.data
if (data.shareCode) {
shareUrlCached.value = `https://zhiyinwx.yzrcloud.cn/api/share/${data.shareCode}`
}
}
} catch (e) { /* create share is best-effort */ }
try {
const [statsRes, recordsRes, visitorsRes] = await Promise.all([
uni.request({ url: api('/share/stats'), method: 'GET', header }),
@@ -194,7 +216,7 @@ async function shareToWechat() {
data: { type: 'app', title: '我在AI磁场·职引练习面试', description: 'AI模拟面试+简历优化,快来一起提升吧' },
header: { Authorization: `Bearer ${token}` },
})
if (res.statusCode !== 200) return
if (res.statusCode < 200 || res.statusCode >= 300) return
const data = res.data
const path = data.wechatShareInfo?.path || `/pages/share/share?code=${data.shareCode}`
@@ -213,19 +235,49 @@ async function shareToWechat() {
async function copyLink() {
const token = uni.getStorageSync('token')
if (!token) return
if (!token) { uni.showToast({ title: '请先登录', icon: 'none' }); return }
if (shareUrlCached.value) {
// 使用已缓存的分享链接,避免二次 API 调用
uni.setClipboardData({
data: shareUrlCached.value,
success: () => { uni.showToast({ title: '链接已复制' }); loadData() },
fail: () => { uni.showToast({ title: '复制失败,请长按选择复制', icon: 'none' }) },
})
return
}
// 缓存未命中时兜底:调 API 生成
try {
const res = await uni.request({
url: api('/share/create'),
method: 'POST',
url: api('/share/create'), method: 'POST',
data: { type: 'app', title: '我在AI磁场·职引练习面试', description: 'AI模拟面试+简历优化,快来一起提升吧' },
header: { Authorization: `Bearer ${token}` },
})
if (res.statusCode !== 200) return
const shareUrl = `https://zhiyinwx.yzrcloud.cn/share/${res.data.shareCode}`
uni.setClipboardData({ data: shareUrl, success: () => { uni.showToast({ title: '链接已复制' }); loadData() } })
} catch (e) { console.error(e) }
if (res.statusCode < 200 || res.statusCode >= 300) {
uni.showToast({ title: `创建失败(${res.statusCode}),请重试`, icon: 'none' })
return
}
const data = res.data?.data || res.data
if (!data.shareCode) {
uni.showToast({ title: '返回数据异常,请重试', icon: 'none' })
return
}
const shareUrl = `https://zhiyinwx.yzrcloud.cn/api/share/${data.shareCode}`
shareUrlCached.value = shareUrl
uni.setClipboardData({
data: shareUrl,
success: () => { uni.showToast({ title: '链接已复制' }); loadData() },
fail: () => { uni.showToast({ title: '复制失败,请长按选择复制', icon: 'none' }) },
})
} catch (e) {
console.error('[share] copyLink error:', e)
uni.showToast({ title: '网络错误,请重试', icon: 'none' })
}
}
function showTimelineHint() {
uni.showToast({ title: '请点击右上角 ··· 选择分享到朋友圈', icon: 'none', duration: 3000 })
}
function typeLabel(type) {
@@ -270,12 +322,18 @@ function formatTime(t) {
.today-hint { font-size: 18rpx; color: var(--color-text-tertiary); text-align: center; }
/* Share buttons */
.share-actions { padding: 0 32rpx; display: flex; gap: 20rpx; }
.share-btn { flex: 1; display: flex; align-items: center; justify-content: center; height: 88rpx; border-radius: var(--radius-md); font-size: 26rpx; font-weight: 500; border: none; }
.share-actions { padding: 0 32rpx; display: flex; flex-direction: column; gap: 16rpx; }
.share-btn-row { display: flex; gap: 20rpx; }
.share-btn {
flex: 1; display: flex; align-items: center; justify-content: center; height: 88rpx; border-radius: var(--radius-md);
font-size: 26rpx; font-weight: 500; border: none; padding: 0; white-space: nowrap;
}
.share-btn:active { transform: scale(0.96); }
.btn-icon { margin-right: 8rpx; font-size: 28rpx; }
.wx-share { background: #07C160; color: #FFFFFF; }
.wx-timeline { background: #FF6600; color: #FFFFFF; }
.wx-timeline-hint { flex: 1; display: flex; align-items: center; justify-content: center; height: 88rpx; border-radius: var(--radius-md); font-size: 26rpx; font-weight: 500; background: #FF6600; color: #FFFFFF; white-space: nowrap; }
.wx-timeline-hint:active { transform: scale(0.96); }
.link-share { background: #FFFFFF; color: var(--color-text); border: 2rpx solid var(--color-border); }
/* Tabs */
+149 -24
View File
@@ -39,16 +39,21 @@
</view>
</view>
<!-- 配额与会员信息 -->
<view class="quota-card" v-if="isLoggedIn">
<view class="quota-row">
<view class="quota-info">
<text class="quota-plan">{{ memberInfo.planName || '免费版' }}</text>
<text class="quota-count">引力值 {{ memberInfo.gravity ?? 0 }}</text>
<!-- 引力值卡片代替原配额卡片 -->
<view class="gravity-card" v-if="isLoggedIn">
<view class="gravity-card-inner">
<view class="gravity-top-row">
<view class="gravity-header">
<text class="gravity-icon"></text>
<text class="gravity-label">我的引力值</text>
</view>
<view class="quota-actions">
<text class="quota-btn primary" @click="goBuyCredits">补充引力值</text>
<text class="quota-btn" :class="memberInfo.plan !== 'free' ? 'owned' : ''" @click="goUpgrade">{{ memberInfo.plan !== 'free' ? '已开通' : '升级会员' }}</text>
<text class="gravity-num">{{ memberInfo.gravity ?? 0 }}</text>
</view>
<text class="gravity-hint">每次面试消耗 5 引力值 · 分享可获得更多</text>
<view class="gravity-actions">
<text class="gravity-btn share" @click="goSharePage">分享得引力值</text>
<text class="gravity-btn contribute" @click="goContributePage">贡献面经</text>
<text class="gravity-btn h5buy" @click="goH5Buy">官网购买</text>
</view>
</view>
</view>
@@ -72,23 +77,35 @@
<text class="menu-text">面试复盘</text>
<text class="menu-arrow"></text>
</view>
<!-- 会员中心菜单注释隐藏微信审核 -->
<!--
<view class="menu-item" @click="goVip">
<view class="menu-icon-wrap wrap-purple"><text class="menu-icon">💎</text></view>
<text class="menu-text">会员中心</text>
<text class="menu-arrow"></text>
</view>
-->
<view class="menu-item" @click="requireLogin(goResume, '我的简历')">
<view class="menu-icon-wrap wrap-green"><text class="menu-icon">📄</text></view>
<text class="menu-text">我的简历</text>
<text class="menu-arrow"></text>
</view>
<view class="menu-item" @click="requireLogin(goShare, '我的分享')">
<view class="menu-item" @click="requireLogin(goSharePage, '我的分享')">
<view class="menu-icon-wrap wrap-orange"><text class="menu-icon">📤</text></view>
<text class="menu-text">我的分享</text>
<text class="menu-arrow"></text>
</view>
</view>
<view class="menu-group">
<!-- #ifdef MP-WEIXIN -->
<view class="menu-item">
<button class="contact-btn-inner" open-type="contact">
<view class="menu-icon-wrap wrap-gray"><text class="menu-icon">💬</text></view>
<text class="menu-text">联系客服</text>
<text class="menu-arrow"></text>
</button>
</view>
<!-- #endif -->
<view class="menu-item" @click="goAbout">
<view class="menu-icon-wrap wrap-gray"><text class="menu-icon"></text></view>
<text class="menu-text">关于</text>
@@ -104,14 +121,64 @@
<button class="logout-btn" @click="doLogout">退出登录</button>
</view>
</view>
<!-- 引力值获取方式 -->
<view class="modal-overlay" v-if="showGetGravityModal" @click="showGetGravityModal = false">
<view class="modal-content" @click.stop>
<text class="modal-title">获取引力值</text>
<text class="modal-hint">引力值可用于面试简历优化下载等</text>
<!-- 分享得引力值 -->
<view class="gp-get-method" @click="goSharePage">
<view class="gp-method-icon-wrap"><text class="gp-method-icon">🎁</text></view>
<view class="gp-method-info">
<text class="gp-method-name">分享给好友</text>
<text class="gp-method-desc">每成功邀请一位好友注册可得 5 引力值上不封顶</text>
</view>
<text class="gp-method-arrow"></text>
</view>
<!-- 贡献面经 -->
<view class="gp-get-method" @click="goContributePage">
<view class="gp-method-icon-wrap"><text class="gp-method-icon">📝</text></view>
<view class="gp-method-info">
<text class="gp-method-name">贡献面经</text>
<text class="gp-method-desc">每发布一篇面经可获得 3 引力值助力他人也提升自己</text>
</view>
<text class="gp-method-arrow"></text>
</view>
<!-- 官网购买 -->
<view class="gp-get-method" @click="goH5Buy">
<view class="gp-method-icon-wrap"><text class="gp-method-icon">🛒</text></view>
<view class="gp-method-info">
<text class="gp-method-name">官网购买</text>
<text class="gp-method-desc">通过官网网页端可购买引力值套餐支持更多支付方式</text>
</view>
<text class="gp-method-arrow"></text>
</view>
<text class="modal-close" @click="showGetGravityModal = false">关闭</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
// #ifdef MP-WEIXIN
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
// #endif
// #ifndef MP-WEIXIN
import { onShow } from '@dcloudio/uni-app'
// #endif
import { api } from '../../config'
// #ifdef MP-WEIXIN
onShareAppMessage(() => ({ title: '职引 - 个人中心 | AI模拟面试', path: '/pages/user/user' }))
onShareTimeline(() => ({ title: '职引 - 个人中心 | AI模拟面试' }))
// #endif
const userInfo = ref({})
const isAdmin = ref(false)
const stats = ref({ interviewCount: 0, avgScore: '--', completedCount: 0 })
@@ -179,17 +246,36 @@ const checkAdmin = () => {
}
const goLogin = () => uni.navigateTo({ url: '/pages/login/login' })
const goBuyCredits = () => uni.navigateTo({ url: '/pages/member/member?buy=interview' })
const goUpgrade = () => {
if (memberInfo.value.plan !== 'free') return // already on a paid plan
// 引力值获取
const showGetGravityModal = ref(false)
const openBuyModal = () => { showGetGravityModal.value = true }
const goH5Buy = () => {
const token = uni.getStorageSync('token') || ''
const url = `https://zhiyin.yzrcloud.cn/?buy=gravity${token ? '&token=' + token : ''}`
// #ifdef H5
uni.navigateTo({ url: '/pages/member/member' })
// #endif
// #ifdef MP-WEIXIN
uni.setClipboardData({
data: url,
success: () => {
uni.showToast({ title: '链接已复制,请在手机浏览器中打开', icon: 'none', duration: 3000 })
},
fail: () => {
uni.showToast({ title: '复制失败,请手动访问 zhiyin.yzrcloud.cn', icon: 'none', duration: 3000 })
},
})
// #endif
}
const goCareer = () => uni.navigateTo({ url: '/pages/career/career' })
const goHistory = () => uni.switchTab({ url: '/pages/history/history' })
const goReviewReview = () => uni.navigateTo({ url: '/pages/review/review' })
const goVip = () => uni.navigateTo({ url: '/pages/member/member' })
const goResume = () => uni.navigateTo({ url: '/pages/resume/resume' })
const goShare = () => uni.navigateTo({ url: '/pages/share/share' })
const goSharePage = () => uni.navigateTo({ url: '/pages/share/share' })
const goContributePage = () => uni.navigateTo({ url: '/pages/contribute/contribute' })
const goAdmin = () => uni.navigateTo({ url: '/pages/admin/admin' })
const goAbout = () => uni.navigateTo({ url: '/pages/about/about' })
@@ -228,20 +314,35 @@ const doLogout = () => {
.guest-info { flex: 1; }
.guest-name { font-size: 30rpx; font-weight: 600; color: #FFFFFF; }
.quota-card { margin: -48rpx 32rpx 16rpx; background: #FFFFFF; border-radius: var(--radius-lg); padding: 28rpx 24rpx; box-shadow: var(--shadow-sm); position: relative; z-index: 1; }
.quota-row { display: flex; align-items: center; justify-content: space-between; }
.quota-info { display: flex; flex-direction: column; gap: 4rpx; }
.quota-plan { font-size: 28rpx; font-weight: 700; color: var(--color-text); }
.quota-count { font-size: 22rpx; color: #6B7280; }
.quota-actions { display: flex; gap: 12rpx; }
.quota-btn { font-size: 22rpx; padding: 8rpx 20rpx; border-radius: var(--radius-sm); font-weight: 500; white-space: nowrap; }
.quota-btn.primary { background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-mid)); color: #FFF; }
.quota-btn.owned { background: #F3F4F6; color: #9CA3AF; }
.quota-btn:not(.primary):not(.owned) { background: #FEF3C7; color: #92400E; border: 2rpx solid #F59E0B; }
/* 引力值卡片(代替原配额卡片) */
.gravity-card { margin: -48rpx 32rpx 16rpx; position: relative; z-index: 1; }
.gravity-card-inner {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: var(--radius-xl);
padding: 28rpx 24rpx 24rpx;
box-shadow: 0 8rpx 32rpx rgba(102,126,234,0.25);
}
.gravity-top-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8rpx; }
.gravity-header { display: flex; align-items: center; gap: 8rpx; }
.gravity-icon { font-size: 32rpx; }
.gravity-label { font-size: 24rpx; color: rgba(255,255,255,0.8); font-weight: 500; }
.gravity-num { font-size: 48rpx; font-weight: 800; color: #FFFFFF; line-height: 1; }
.gravity-hint { font-size: 20rpx; color: rgba(255,255,255,0.6); margin-bottom: 20rpx; }
.gravity-actions { display: flex; gap: 16rpx; }
.gravity-btn {
flex: 1; text-align: center; padding: 18rpx 0; border-radius: var(--radius-md);
font-size: 26rpx; font-weight: 600; white-space: nowrap;
}
.gravity-btn.share { background: rgba(255,255,255,0.2); color: #FFFFFF; border: 2rpx solid rgba(255,255,255,0.3); }
.gravity-btn.h5buy { background: #FFFFFF; color: #667eea; }
.gravity-btn.contribute { background: rgba(255,255,255,0.15); color: #FFFFFF; border: 2rpx solid rgba(255,255,255,0.2); }
.gravity-btn:active { transform: scale(0.96); }
.menu-area { padding: 0 32rpx 32rpx; margin-top: 8rpx; }
.menu-group { background: #FFFFFF; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24rpx; box-shadow: var(--shadow-sm); }
.menu-item { display: flex; align-items: center; padding: 28rpx 32rpx; border-bottom: 1rpx solid var(--color-border); }
.contact-btn-inner { width: 100%; background: transparent; border: none; border-radius: 0; padding: 0; margin: 0; line-height: inherit; font-size: inherit; text-align: left; display: flex; align-items: center; min-height: auto; }
.contact-btn-inner::after { border: none; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #F9FAFB; }
.menu-icon-wrap { width: 60rpx; height: 60rpx; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-right: 20rpx; flex-shrink: 0; }
@@ -258,4 +359,28 @@ const doLogout = () => {
.logout-wrap { margin-top: 8rpx; }
.logout-btn { background: #FFFFFF; color: var(--color-error); font-size: 28rpx; font-weight: 500; border-radius: var(--radius-md); height: 88rpx; line-height: 88rpx; border: 2rpx solid #FECACA; }
.logout-btn:active { background: #FEF2F2; transform: scale(0.96); }
/* 弹窗通用 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #FFF; border-radius: var(--radius-xl); padding: 40rpx 32rpx; width: 600rpx; max-height: 80vh; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 16rpx; }
.modal-title { font-size: 30rpx; font-weight: 700; color: var(--color-text); }
.modal-hint { font-size: 22rpx; color: #6B7280; text-align: center; }
.modal-close { font-size: 24rpx; color: #9CA3AF; padding: 12rpx 24rpx; }
/* 获取引力值弹窗 - 分享/贡献方法 */
.gp-get-method {
width: 100%; display: flex; align-items: center; gap: 16rpx;
background: #F9FAFB; border-radius: var(--radius-md); padding: 20rpx;
border: 2rpx solid #E5E7EB; margin-top: 8rpx;
}
.gp-get-method:active { transform: scale(0.97); background: #F3F4F6; }
.gp-method-icon-wrap {
width: 64rpx; height: 64rpx; border-radius: var(--radius-md);
background: #EEF2FF; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp-method-icon { font-size: 32rpx; }
.gp-method-info { flex: 1; display: flex; flex-direction: column; gap: 4rpx; }
.gp-method-name { font-size: 26rpx; font-weight: 600; color: var(--color-text); }
.gp-method-desc { font-size: 20rpx; color: #6B7280; line-height: 1.4; }
.gp-method-arrow { font-size: 32rpx; color: #D1D5DB; }
</style>
+3
View File
@@ -0,0 +1,3 @@
User-agent: *
Allow: /
Sitemap: https://zhiyin.yzrcloud.cn/sitemap.xml
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://zhiyin.yzrcloud.cn</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
</urlset>
+9
View File
@@ -1,8 +1,17 @@
import { defineConfig } from 'vite';
import { execSync } from 'child_process';
import uni from '@dcloudio/vite-plugin-uni';
let appVersion = '1.0.0';
try {
appVersion = execSync('git describe --tags --abbrev=0 2>/dev/null || echo "1.0.0"', { encoding: 'utf8' }).trim().replace(/^v/, '');
} catch {}
export default defineConfig({
plugins: [uni()],
define: {
__APP_VERSION__: JSON.stringify(appVersion),
},
server: {
port: 8888,
strictPort: true,