feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -383,7 +383,7 @@ describe('OmniCard AI 展会团队战报 (useOverview.uts)', () => {
|
||||
const fetchOwnerRadarPage = jest.fn(async () => buildPage([buildTrack()]));
|
||||
|
||||
const vibrateMock = jest.fn();
|
||||
(global as any).uni.vibrateShort = vibrateMock;
|
||||
(global as { uni?: Record<string, unknown> }).uni!.vibrateShort = vibrateMock;
|
||||
|
||||
await refreshOverview(state, { fetchOwnerLeadPage, fetchOwnerRadarPage });
|
||||
|
||||
@@ -391,6 +391,48 @@ describe('OmniCard AI 展会团队战报 (useOverview.uts)', () => {
|
||||
expect(state.loading).toBe(false);
|
||||
expect(state.leads.length).toBe(1);
|
||||
});
|
||||
|
||||
it('3.2 刷新失败写入错误态,不填迪拜示例数、不假装成功', async () => {
|
||||
const { refreshOverview, createOverviewState } = loadUseOverview();
|
||||
const state = createOverviewState();
|
||||
state.summary = {
|
||||
totalLeads: 99,
|
||||
hotCount: 9,
|
||||
totalTracks: 88,
|
||||
topCountry: 'United Arab Emirates',
|
||||
};
|
||||
state.leads = [buildLead()];
|
||||
state.tracks = [buildTrack()];
|
||||
state.errorMessage = '';
|
||||
|
||||
const fetchOwnerLeadPage = jest.fn(async (): Promise<OwnerPageData<LeadEntity>> => {
|
||||
throw new Error('network down');
|
||||
});
|
||||
const fetchOwnerRadarPage = jest.fn(
|
||||
async (): Promise<OwnerPageData<RadarTrack>> => buildPage([buildTrack()])
|
||||
);
|
||||
const vibrateMock = jest.fn();
|
||||
(global as { uni?: Record<string, unknown> }).uni!.vibrateShort = vibrateMock;
|
||||
|
||||
const result = await refreshOverview(state, {
|
||||
fetchOwnerLeadPage,
|
||||
fetchOwnerRadarPage,
|
||||
});
|
||||
|
||||
expect(fetchOwnerLeadPage).toHaveBeenCalledTimes(1);
|
||||
expect(fetchOwnerRadarPage).toHaveBeenCalledTimes(1);
|
||||
expect(result.errorMessage).toBe('network down');
|
||||
expect(state.errorMessage).toBe('network down');
|
||||
expect(state.leads).toEqual([]);
|
||||
expect(state.tracks).toEqual([]);
|
||||
expect(state.summary.totalLeads).toBe(0);
|
||||
expect(state.summary.hotCount).toBe(0);
|
||||
expect(state.summary.totalTracks).toBe(0);
|
||||
expect(state.summary.topCountry).toBe('');
|
||||
expect(state.summary.topCountry).not.toBe('United Arab Emirates');
|
||||
expect(vibrateMock).not.toHaveBeenCalled();
|
||||
expect(state.loading).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -440,6 +482,37 @@ describe('OmniCard AI 展会团队战报页契约 (overview.uvue)', () => {
|
||||
expect(pageSource.includes('#FFFFFF')).toBe(true);
|
||||
});
|
||||
|
||||
it('P47: 一屏仅一个 primary-cta-btn,点击走 refreshOverview,失败不填示例', () => {
|
||||
const pageSource = fs.readFileSync(OVERVIEW_PAGE, 'utf8');
|
||||
const logicSource = fs.readFileSync(OVERVIEW_UTS, 'utf8');
|
||||
const template = pageSource.split('<script')[0];
|
||||
const script = pageSource.includes('<script')
|
||||
? pageSource.split('<script')[1].split('</script>')[0]
|
||||
: '';
|
||||
|
||||
expect((pageSource.match(/primary-cta-btn/g) || []).length).toBeGreaterThanOrEqual(1);
|
||||
expect((template.match(/class="primary-cta-btn"/g) || []).length).toBe(1);
|
||||
expect((template.match(/<button/g) || []).length).toBe(1);
|
||||
expect(template.includes('@click="handleRefresh"')).toBe(true);
|
||||
expect(script.includes('refreshOverview(state)')).toBe(true);
|
||||
expect(script.includes('comingSoon')).toBe(false);
|
||||
expect(logicSource.includes('comingSoon')).toBe(false);
|
||||
expect(pageSource.includes('comingSoon')).toBe(false);
|
||||
expect(pageSource.includes('shareSuccess') || logicSource.includes('shareSuccess')).toBe(
|
||||
false
|
||||
);
|
||||
expect(logicSource.includes('refreshOverview')).toBe(true);
|
||||
expect(logicSource.includes('loadOverview')).toBe(true);
|
||||
expect(logicSource.includes('emptySummary')).toBe(true);
|
||||
expect(logicSource.includes("topCountry: 'United Arab Emirates'")).toBe(false);
|
||||
expect(logicSource.includes('topCountry: "United Arab Emirates"')).toBe(false);
|
||||
expect(logicSource.includes('Dubai')).toBe(false);
|
||||
expect(pageSource.includes('state.errorMessage')).toBe(true);
|
||||
expect(pageSource.includes("t('error')") || pageSource.includes('t("error")')).toBe(
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it('无 emoji、无 any,模板无硬编码中文主文案,长列表不用 view v-for', () => {
|
||||
const pageSource = fs.readFileSync(OVERVIEW_PAGE, 'utf8');
|
||||
const logicSource = fs.readFileSync(OVERVIEW_UTS, 'utf8');
|
||||
|
||||
在新工单中引用
屏蔽一个用户