fix(mobile): highlight new-chat button and flex-center composer labels

- AskSourceHeader: solid brand-red new-chat button, flex-centered label
- replace padding+line-height centering with flex on chips, hold-talk,
  send, bubble-action, transcript-toggle, system-text, scope-note
- carries the in-flight AskSourceHeader extraction on sop/web-ai pages
  (parallel session work; its test updates intentionally left uncommitted)
This commit is contained in:
2026-07-19 23:21:24 +08:00
parent 61bc7191d1
commit 46a6156d8c
4 changed files with 210 additions and 222 deletions
@@ -0,0 +1,156 @@
<template>
<view class="ask-source-head">
<view class="head-row">
<text class="head-title">问 · 数字师傅</text>
<view class="head-actions">
<text class="head-context">{{ context }}</text>
<button class="new-chat-button" :disabled="loading" @click="emit('newConversation')">新对话</button>
</view>
</view>
<view class="source-switch" aria-label="问答来源">
<button
class="source-option"
:class="{ active: active === 'assistant' }"
:aria-current="active === 'assistant' ? 'page' : undefined"
@click="selectAssistant"
>
工作助手
</button>
<button
class="source-option"
:class="{ active: active === 'web' }"
:aria-current="active === 'web' ? 'page' : undefined"
@click="selectWeb"
>
查全网
</button>
</view>
</view>
</template>
<script setup lang="ts">
const props = withDefaults(defineProps<{
active: 'assistant' | 'web';
context: string;
loading?: boolean;
}>(), {
loading: false
});
const emit = defineEmits<{
selectAssistant: [];
selectWeb: [];
newConversation: [];
}>();
const selectAssistant = () => {
if (props.active !== 'assistant') emit('selectAssistant');
};
const selectWeb = () => {
if (props.active !== 'web') emit('selectWeb');
};
</script>
<style scoped>
.ask-source-head {
flex-shrink: 0;
padding: 8px 12px 6px;
border-bottom: 1px solid #ebedf0;
background: #ffffff;
}
.head-row {
display: flex;
min-height: 44px;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 6px;
}
.head-title {
flex-shrink: 0;
color: #18202b;
font-size: 16px;
font-weight: 800;
}
.head-actions {
display: flex;
min-width: 0;
align-items: center;
justify-content: flex-end;
gap: 6px;
}
.head-context {
min-width: 0;
overflow: hidden;
color: #7b8492;
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
}
.new-chat-button {
flex-shrink: 0;
display: flex;
min-height: 44px;
align-items: center;
justify-content: center;
margin: 0;
padding: 0 14px;
border: 1px solid var(--employee-primary, #e60012);
border-radius: 999px;
background: var(--employee-primary, #e60012);
color: #ffffff;
font-size: 12px;
font-weight: 600;
line-height: 1;
}
.new-chat-button[disabled] {
opacity: 0.6;
}
.new-chat-button::after,
.source-option::after {
border: none;
}
.source-switch {
display: flex;
gap: 0;
margin: 0;
padding: 3px;
border-radius: 999px;
background: #f2f3f5;
}
.source-option {
display: flex;
flex: 1;
box-sizing: border-box;
height: 44px;
min-height: 44px;
align-items: center;
justify-content: center;
margin: 0;
padding: 0;
border: none;
border-radius: 999px;
background: transparent;
color: #5a6270;
font-size: 13px;
font-weight: 500;
line-height: 1.2;
}
.source-option.active {
background: #ffffff;
color: #c8001a;
font-weight: 700;
box-shadow: 0 1px 4px rgba(20, 24, 31, 0.08);
}
</style>
@@ -271,14 +271,18 @@ defineExpose({ teardown, setDraft });
.chip {
flex-shrink: 0;
display: flex;
min-height: 30px;
align-items: center;
justify-content: center;
margin: 0;
padding: 5px 12px;
padding: 0 13px;
border: 1px solid #f0c0c5;
border-radius: 999px;
background: #ffffff;
color: #c8001a;
font-size: 13px;
line-height: 1.4;
line-height: 1;
}
.media-chip {
@@ -359,7 +363,6 @@ defineExpose({ teardown, setDraft });
color: #232a33;
font-size: 16px;
font-weight: 600;
line-height: 1.2;
user-select: none;
-webkit-user-select: none;
}
@@ -397,7 +400,6 @@ defineExpose({ teardown, setDraft });
color: #ffffff;
font-size: 15px;
font-weight: 600;
line-height: 1.2;
}
.composer-panel {