merge(douyu): 合入客户领取与直播账号履约

- 合入斗鱼客户资料收集、角色绑定和半自动履约工作台
- 合入事务 Outbox、签名 Webhook 与低频对账链路
- 合入双角色识别、绑定重置、取消释放账号和已分配状态修复
- 将斗鱼履约数据库变更合并为单个 171 迁移文件
- 更新拆分后的客户样式测试入口并适配最新 main 客户页样式
This commit is contained in:
yml
2026-11-18 11:10:04 +08:00
67 changed files with 8854 additions and 3980 deletions
@@ -9,7 +9,7 @@ const source = readFileSync(
join(root, '../src/pages/customer-fulfillment/CustomerFulfillmentPage.tsx'),
'utf8',
)
const styles = readFileSync(join(root, '../src/styles/client.css'), 'utf8')
const styles = readFileSync(join(root, '../src/styles/customer/binding.css'), 'utf8')
test('资料不一致时不自动弹核对框,由页面两个按钮处理', () => {
assert.ok(source.includes("if (bindingInfo.comparison.verdict !== 'match') return"))
@@ -3,8 +3,10 @@ import { readFile } from 'node:fs/promises'
import test from 'node:test'
import {
buildDouyuFulfillmentPath,
buildCustomerFulfillmentPath,
isCustomerFulfillmentPath,
isDouyuFulfillmentPath,
resolveCustomerPlatformRedirect,
} from '../src/utils/customer-fulfillment-link.ts'
@@ -29,6 +31,15 @@ test('客户半自动履约入口不误伤相似前缀和其他路径', () => {
assert.equal(isCustomerFulfillmentPath('d/1'), false)
})
test('斗鱼领取入口固定为 /coll/d/订单号', () => {
assert.equal(buildDouyuFulfillmentPath('DY-001'), '/coll/d/DY-001')
assert.equal(buildDouyuFulfillmentPath(''), '')
assert.equal(isDouyuFulfillmentPath('/coll/d/DY-001'), true)
assert.equal(isDouyuFulfillmentPath('/coll/d/DY-001?from=chat'), true)
assert.equal(isDouyuFulfillmentPath('/coll/other/DY-001'), false)
assert.equal(isDouyuFulfillmentPath('/admin/coll/d/DY-001'), false)
})
test('按平台生成客户链接:虎牙 /c、微博 /d', () => {
assert.equal(
buildCustomerFulfillmentPath('INTSA1794902905684_360848', 'huya'),
@@ -80,6 +91,7 @@ test('客户页路由与严格绑定接线', async () => {
assert.match(page, /resolveCustomerPlatformRedirect/)
assert.match(page, /buildCustomerFulfillmentPath/)
assert.match(page, /task\.platform === expectedPlatform/)
assert.match(app, /path="\/coll\/d\/:orderNo"/)
})
test('开发 Mock 页按平台重新生成客户路径', async () => {
@@ -15,7 +15,7 @@ function source(relativePath: string) {
test('客户履约页必须覆盖 body 320px 最小宽度并使用 480px 移动端壳', async () => {
const [app, css] = await Promise.all([
readFile(source('App.tsx'), 'utf8'),
readFile(source('styles/client.css'), 'utf8'),
readFile(source('styles/customer/mobile.css'), 'utf8'),
])
assert.match(app, /customer-mobile-html/)
@@ -38,7 +38,7 @@ test('客户履约页固定宽度弹窗必须收进手机视口', async () => {
const [page, huya, css] = await Promise.all([
readFile(source('pages/customer-fulfillment/CustomerFulfillmentPage.tsx'), 'utf8'),
readFile(source('pages/customer-fulfillment/HuyaChallengeModal.tsx'), 'utf8'),
readFile(source('styles/client.css'), 'utf8'),
readFile(source('styles/customer/mobile.css'), 'utf8'),
])
assert.match(page, /className="customer-binding-modal"/)
@@ -11,8 +11,12 @@ const source = readFileSync(
),
'utf8',
)
const styles = readFileSync(
join(dirname(fileURLToPath(import.meta.url)), '../src/styles/client.css'),
const layoutStyles = readFileSync(
join(dirname(fileURLToPath(import.meta.url)), '../src/styles/customer/layout.css'),
'utf8',
)
const weiboStyles = readFileSync(
join(dirname(fileURLToPath(import.meta.url)), '../src/styles/customer/platform/weibo.css'),
'utf8',
)
@@ -53,10 +57,10 @@ test('微博订单卡只展示订单号/商品/平台/状态,不含游戏和
test('客户登录/绑定页顶部统一显示 inside-kv 背景,不再按平台区分', () => {
assert.match(
styles,
layoutStyles,
/\.customer-auth-hero \{[^}]*url\('\/images\/customer\/inside-kv\.jpg'\)[^}]*\}/s,
)
assert.ok(!styles.includes('.customer-auth-page.is-weibo .customer-auth-hero'))
assert.ok(!styles.includes('.customer-auth-page.is-huya .customer-auth-hero'))
assert.ok(styles.includes('.customer-auth-page.is-weibo .customer-auth-brand'))
assert.ok(!weiboStyles.includes('.customer-auth-page.is-weibo .customer-auth-hero'))
assert.ok(!layoutStyles.includes('.customer-auth-page.is-huya .customer-auth-hero'))
assert.ok(weiboStyles.includes('.customer-auth-page.is-weibo .customer-auth-brand'))
})