feat(ECR-012): 星座对齐收口,并 Closed ECR-007/008
对齐 outlook/分享 type=star/报告页运势面板与测试;流程上关闭 Ops-B/C 两张 ECR。真支付仍后置。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
<template v-else>
|
||||
<div class="hero-block">
|
||||
<HomeToolIcon :name="payload.type === 'relation' ? 'relation' : 'portrait'" :size="64" />
|
||||
<HomeToolIcon :name="heroIcon" :size="64" />
|
||||
<h1 class="hero-title">{{ shareTitle }}</h1>
|
||||
<p class="hero-sub">{{ shareSub }}</p>
|
||||
</div>
|
||||
@@ -52,24 +52,35 @@ const payload = computed(() => parseShareQuery(route.query as Record<string, unk
|
||||
const shareTitle = computed(() => {
|
||||
const p = payload.value
|
||||
if (!p) return '分享'
|
||||
return p.type === 'relation' ? '关系理解分享' : '个人画像分享'
|
||||
if (p.type === 'relation') return '关系理解分享'
|
||||
if (p.type === 'star') return '星座分享'
|
||||
return '个人画像分享'
|
||||
})
|
||||
const shareSub = computed(() => {
|
||||
const p = payload.value
|
||||
if (!p) return ''
|
||||
return p.type === 'relation' ? '朋友分享了一段关系理解' : '朋友分享了一份个人画像'
|
||||
if (p.type === 'relation') return '朋友分享了一段关系理解'
|
||||
if (p.type === 'star') return '朋友分享了一份星座探索'
|
||||
return '朋友分享了一份个人画像'
|
||||
})
|
||||
|
||||
const heroIcon = computed(() => {
|
||||
const t = payload.value?.type
|
||||
if (t === 'relation') return 'relation'
|
||||
if (t === 'star') return 'star'
|
||||
return 'portrait'
|
||||
})
|
||||
|
||||
const cardProps = computed(() => {
|
||||
const p = payload.value
|
||||
if (!p) return {}
|
||||
if (p.type === 'portrait') {
|
||||
if (p.type === 'portrait' || p.type === 'star') {
|
||||
return {
|
||||
type: 'portrait' as const,
|
||||
type: p.type,
|
||||
title: p.title,
|
||||
line: p.line,
|
||||
keywords: p.keywords,
|
||||
ctaLabel: '查看完整成长报告',
|
||||
ctaLabel: p.type === 'star' ? '查看完整星座报告' : '查看完整成长报告',
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -81,10 +92,18 @@ const cardProps = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const ctaTo = computed(() => (payload.value?.type === 'relation' ? '/relation' : '/'))
|
||||
const ctaText = computed(() =>
|
||||
payload.value?.type === 'relation' ? '开始关系理解' : '生成我的个人画像',
|
||||
)
|
||||
const ctaTo = computed(() => {
|
||||
const t = payload.value?.type
|
||||
if (t === 'relation') return '/relation'
|
||||
if (t === 'star') return '/star'
|
||||
return '/'
|
||||
})
|
||||
const ctaText = computed(() => {
|
||||
const t = payload.value?.type
|
||||
if (t === 'relation') return '开始关系理解'
|
||||
if (t === 'star') return '生成我的星座'
|
||||
return '生成我的个人画像'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -4,8 +4,11 @@ import StarProfilePage from './StarProfilePage.vue'
|
||||
|
||||
const { api, routeQuery } = vi.hoisted(() => ({
|
||||
api: {
|
||||
authMe: vi.fn(),
|
||||
listProfiles: vi.fn(),
|
||||
createProfile: vi.fn(),
|
||||
createStar: vi.fn(),
|
||||
getLatestReport: vi.fn(),
|
||||
getReport: vi.fn(),
|
||||
createOrder: vi.fn(),
|
||||
payMock: vi.fn(),
|
||||
@@ -15,8 +18,8 @@ const { api, routeQuery } = vi.hoisted(() => ({
|
||||
|
||||
vi.mock('../api/client', () => ({ api }))
|
||||
vi.mock('vue-router', () => ({
|
||||
useRoute: () => ({ query: routeQuery }),
|
||||
useRouter: () => ({ back: vi.fn() }),
|
||||
useRoute: () => ({ query: routeQuery, fullPath: '/star?y=1990&m=5&d=12' }),
|
||||
useRouter: () => ({ back: vi.fn(), replace: vi.fn(), push: vi.fn() }),
|
||||
}))
|
||||
|
||||
const summary = {
|
||||
@@ -39,22 +42,29 @@ const summary = {
|
||||
keywords: ['金牛'],
|
||||
}
|
||||
|
||||
const starReport = {
|
||||
id: 'r1',
|
||||
type: 'star',
|
||||
has_deep_access: false,
|
||||
summary,
|
||||
detail: null,
|
||||
}
|
||||
|
||||
describe('StarProfilePage', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
api.authMe.mockResolvedValue({ id: 'u1' })
|
||||
api.listProfiles.mockResolvedValue({ items: [] })
|
||||
api.createProfile.mockResolvedValue({ id: 'p1' })
|
||||
api.createStar.mockResolvedValue({
|
||||
id: 'r1',
|
||||
has_deep_access: false,
|
||||
summary,
|
||||
detail: null,
|
||||
})
|
||||
api.getLatestReport.mockResolvedValue(starReport)
|
||||
api.createStar.mockResolvedValue(starReport)
|
||||
})
|
||||
|
||||
it('shows natal wheel and free chart content', async () => {
|
||||
const w = mount(StarProfilePage, { global: { stubs: { RouterLink: true } } })
|
||||
await flushPromises()
|
||||
expect(api.createStar).toHaveBeenCalled()
|
||||
expect(api.createProfile).toHaveBeenCalled()
|
||||
expect(api.getLatestReport).toHaveBeenCalledWith('p1', 'star')
|
||||
await w.findAll('button').find((b) => b.text() === '星盘')!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(w.find('svg.wheel').exists()).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user