feat: 完善双端演示注册与红娘服务闭环

This commit is contained in:
WorkBuddy
2026-10-21 23:41:47 +08:00
parent afee993626
commit 39a18a50ee
63 changed files with 1298 additions and 217 deletions
+19
View File
@@ -0,0 +1,19 @@
const assert = require('node:assert/strict')
const fs = require('node:fs')
const path = require('node:path')
const root = path.resolve(__dirname, '..')
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8')
const workbench = read('src/pages/operator/OperatorWorkbenchPage.vue')
const notifications = read('src/pages/settings/NotificationsPage.vue')
assert.match(workbench, /待处理/)
assert.match(workbench, /进行中/)
assert.match(workbench, /已完成/)
assert.match(workbench, /active|assigned|in_service|completed/)
assert.match(workbench, /注册演示用户|创建演示用户/)
assert.match(notifications, /matchmaker|appointment|counseling|premarital|review|account|activity|match|system/)
assert.match(notifications, /businessId|businessType/)
assert.match(notifications, /router\.(push|replace)/)
console.log('PASS: demo flow UI contract')
+19
View File
@@ -0,0 +1,19 @@
const assert = require('node:assert/strict')
const fs = require('node:fs')
const path = require('node:path')
const root = path.resolve(__dirname, '..')
const routes = fs.readFileSync(path.join(root, 'src/router/routes.ts'), 'utf8')
const authPage = fs.readFileSync(path.join(root, 'src/pages/auth/DemoRegisterPage.vue'), 'utf8')
const operatorPage = fs.readFileSync(path.join(root, 'src/pages/operator/OperatorRegisterPage.vue'), 'utf8')
const authApi = fs.readFileSync(path.resolve(root, '../backend/src/main/java/com/danyang/match/platform/auth/controller/AuthController.java'), 'utf8')
const operatorApi = fs.readFileSync(path.resolve(root, '../backend/src/main/java/com/danyang/match/platform/auth/controller/OperatorAuthController.java'), 'utf8')
assert.match(routes, /path: '\/register'/)
assert.match(routes, /path: '\/operator\/register'/)
assert.match(authPage, /auth\.registerDemo\(/)
assert.match(operatorPage, /operatorService\.registerDemo\(/)
assert.match(authApi, /@PostMapping\("\/demo\/register"\)/)
assert.match(operatorApi, /@PostMapping\("\/demo\/register"\)/)
console.log('PASS: demo registration routes and APIs are wired')
+26 -1
View File
@@ -6,10 +6,35 @@ const root = path.resolve(__dirname, '..')
const tabLayout = fs.readFileSync(path.join(root, 'src/layouts/TabLayout.vue'), 'utf8')
const pageLayout = fs.readFileSync(path.join(root, 'src/layouts/PageLayout.vue'), 'utf8')
const home = fs.readFileSync(path.join(root, 'src/pages/home/HomePage.vue'), 'utf8')
const workbench = fs.readFileSync(path.join(root, 'src/pages/operator/OperatorWorkbenchPage.vue'), 'utf8')
const serviceDetail = fs.readFileSync(path.join(root, 'src/pages/operator/OperatorServiceDetailPage.vue'), 'utf8')
const matchmakerApi = fs.readFileSync(path.join(root, 'src/api/services/matchmaker.ts'), 'utf8')
const discover = fs.readFileSync(path.join(root, 'src/pages/discover/DiscoverPage.vue'), 'utf8')
const userCard = fs.readFileSync(path.join(root, 'src/components/UiUserCard.vue'), 'utf8')
const routes = fs.readFileSync(path.join(root, 'src/router/routes.ts'), 'utf8')
assert.match(tabLayout, /to="\/messages"[^>]*>消息<\/van-tabbar-item>/)
assert.doesNotMatch(tabLayout, /to="\/messages"[^>]*>消息<\/van-tabbar-item>/)
assert.match(tabLayout, /to="\/notifications"[^>]*>通知<\/van-tabbar-item>/)
assert.match(pageLayout, /class="page-layout__nav"/)
assert.match(home, /home-hero-v2\.jpg/)
assert.match(home, /home__notice[^\n]*notifications/)
assert.doesNotMatch(home, /home__banner-cover[^\n]*\{\{ \(b\.title \|\| '善'\)\.slice\(0, 1\) \}\}/)
assert.match(workbench, /服务工作台/)
assert.match(workbench, /v-for="item in filteredServices"/)
assert.match(workbench, /activeServiceTab/)
assert.match(workbench, /createDemoUser/)
assert.match(workbench, /assignToSelf/)
assert.match(workbench, /query: \{ id: serviceId, source \}/)
assert.match(serviceDetail, /route\.query\.source === 'management'[\s\S]*?managementServiceDetail\(serviceId\)/)
assert.match(matchmakerApi, /managementServiceDetail\(id: string\)[\s\S]*?\/operator\/matchmaker\/management\/services\//)
assert.match(discover, /class="discover__hero"/)
assert.match(discover, /placeholder="姓名、职业或地区"/)
assert.match(discover, />推荐<|>年龄<|>学历<|>婚姻</)
assert.match(discover, /van-slider/)
assert.match(discover, /:show-pass="false"/)
assert.match(userCard, /occupationLabel\(user\.occupationCode\)/)
assert.match(userCard, /maritalLabel\(user\.maritalStatus\)/)
assert.doesNotMatch(routes, /path: ['"]messages['"]|name: ['"]MessagesPage['"]|MessagesPage/)
assert.doesNotMatch(routes, /path: ['"]chat['"]|name: ['"]Chat/)
console.log('PASS: H5 UI contract')