feat(mobile-uni): 彻底完成登录页、首页、学习中心与问答页UI/UX极简重构及单条消息追问功能
This commit is contained in:
@@ -59,3 +59,44 @@ test('项目选择面板避开底栏,普通消息滚底且确认卡从识别
|
||||
assert.match(page, /next\?\.role === 'master' && next\.result\.memoryCandidate/);
|
||||
assert.match(page, /scrollToMessageStart\(id\)/);
|
||||
});
|
||||
|
||||
test('问师傅在真正开始会话后收起首次使用引导,保留对话主体', async () => {
|
||||
const page = await read('../src/pages/user/sop/index.vue');
|
||||
|
||||
assert.match(page, /const conversationStarted = computed\(\(\) => messages\.value\.some/);
|
||||
assert.match(page, /v-if="loggedIn && !conversationStarted" class="project-context-bar"/);
|
||||
assert.match(page, /v-if="!conversationStarted" class="bubble-row left"/);
|
||||
assert.match(page, /:quick-questions="conversationStarted \? \[\] : quickQuestions"/);
|
||||
});
|
||||
|
||||
test('消息咨询只以消息 ID 作为受控上下文,并让每轮文字或语音请求携带它', async () => {
|
||||
const [page, service, types] = await Promise.all([
|
||||
read('../src/pages/user/sop/index.vue'),
|
||||
read('../src/services/knowledge.ts'),
|
||||
read('../src/types/api.ts')
|
||||
]);
|
||||
|
||||
assert.match(page, /getBroadcastMessage\(pending\.messageId\)/);
|
||||
assert.match(page, /messageId: message\.id,\s*title: message\.title,\s*publishedAt: message\.publishedAt/);
|
||||
assert.match(page, /broadcastMessageId \? undefined : currentProject\.value\?\.projectCode/);
|
||||
assert.match(page, /options\.voice \? 'mobile_uni_voice' : 'mobile_uni_sop',\s*broadcastMessageId/);
|
||||
assert.match(service, /broadcastMessageId\?: number/);
|
||||
assert.match(service, /\? \{ broadcastMessageId \}/);
|
||||
assert.match(service, /broadcastContext: response\.broadcastContext \|\| legacy\.broadcastContext \|\| null/);
|
||||
assert.match(types, /export interface BroadcastKnowledgeContext/);
|
||||
assert.match(types, /broadcastContext\?: BroadcastKnowledgeContext \| null/);
|
||||
});
|
||||
|
||||
test('消息咨询会新开会话,隐藏媒体和数据工具,并在撤回时清空对话', async () => {
|
||||
const page = await read('../src/pages/user/sop/index.vue');
|
||||
|
||||
assert.match(page, /error\.statusCode === 404 \|\| error\.bizCode === 404/);
|
||||
assert.match(page, /const pending = readBroadcastQuestionContext\(accountKey\);\s*if \(!pending\) \{\s*if \(broadcastContext\.value\) \{\s*clearBroadcastConsultation\(\);\s*resetConversation\(false\);/);
|
||||
assert.match(page, /const startNewConversation = \(\) => \{\s*clearBroadcastConsultation\(\);\s*resetConversation\(true\);/);
|
||||
assert.match(page, /clearBroadcastConsultation\(\);\s*resetConversation\(false\);\s*pushSystem\('这条消息已撤回,无法继续咨询。'\)/);
|
||||
assert.match(page, /const composerPanelItems = computed\(\(\) => broadcastContext\.value\s*\? \[\{ key: 'pick-audio'/);
|
||||
assert.match(page, /if \(broadcastContext\.value\) \{\s*uni\.showToast\(\{ title: '消息咨询不支持数据查询/);
|
||||
assert.match(page, /if \(broadcastContext\.value\) \{\s*uni\.showToast\(\{ title: '消息咨询暂不支持图片或视频/);
|
||||
assert.match(page, /@click="viewBroadcastMessage">查看原消息/);
|
||||
assert.match(page, /@click="endBroadcastConsultation">结束咨询/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user