feat: add discovery tool cards, refactor AiTabSwitch and update client configs

- Update xiaoqi client configuration: adjust clientId, sync appid across config files and switch to production build by setting developVersion to false
- Refactor AiTabSwitch component to use background images instead of inline image tags, clean up redundant SCSS styles and replace tab icon assets
- Add three new Discovery page tool components: audio guide, map guide and photo generator cards
- Clean up unused code in Discovery page and ChatMainList component, remove unused scroll view and computed property
- Fix regex pattern and formatting issues in update-appid.js script
- Comment out unused SpriteAnimator component in ChatMainList
This commit is contained in:
duanshuwen
2026-07-06 20:51:45 +08:00
parent 190793b156
commit aa07286010
18 changed files with 1013 additions and 326 deletions

View File

@@ -2,20 +2,13 @@
<view class="flex flex-col h-screen relative overflow-hidden">
<!-- 顶部自定义导航栏 -->
<view class="header absolute top-0 left-0 w-full z-10" :style="{ paddingTop: statusBarHeight + 'px' }">
<ChatTopNavBar
ref="topNavBarRef"
:mainPageDataModel="mainPageDataModel"
@showDrawer="handleShowDrawer"
/>
<ChatTopNavBar ref="topNavBarRef" :mainPageDataModel="mainPageDataModel" @showDrawer="handleShowDrawer" />
</view>
<view class="home-hero relative flex-shrink-0">
<image
class="home-hero-bg w-full block"
:src="mainPageDataModel?.initPageImages?.backgroundImageUrl"
mode="aspectFill"
/>
<SpriteAnimator
<image class="home-hero-bg w-full block" :src="mainPageDataModel?.initPageImages?.backgroundImageUrl"
mode="aspectFill" />
<!-- <SpriteAnimator
v-if="homeSpriteStyle.ipLargeImage"
class="home-hero-sprite"
:src="homeSpriteStyle.ipLargeImage"
@@ -25,7 +18,7 @@
:columns="homeSpriteStyle.columns"
:displayWidth="homeSpriteStyle.displayWidth"
:fps="16"
/>
/> -->
<view class="home-tabs-layer absolute bottom-0 left-0 right-0 flex-full">
<view style="margin-bottom: -1px;">
<AiTabSwitch v-model="tabIndex" :list="tabList" @change="handleChange" />
@@ -33,114 +26,60 @@
</view>
</view>
<view
v-show="tabIndex === 0"
class="main-scroll-area flex flex-col flex-full overflow-hidden min-height-0"
@touchstart.capture="handleScrollAreaTouchStart"
@touchstart="handleScrollAreaTouchStart"
@touchmove="handleScrollAreaTouchMove"
>
<HomeWelcome
class="flex-shrink-0"
:mainPageDataModel="mainPageDataModel"
/>
<view class="flex-full min-height-0 overflow-hidden">
<Discovery
@scroll-touch-start="handleScrollAreaTouchStart"
@scroll-touch="handleScrollAreaTouchMove"
/>
</view>
</view>
<scroll-view v-show="tabIndex === 0" class="main-scroll-area flex flex-col flex-full overflow-hidden" scroll-y
@touchstart.capture="handleScrollAreaTouchStart" @touchstart="handleScrollAreaTouchStart"
@touchmove="handleScrollAreaTouchMove">
<HomeWelcome class="flex-shrink-0" :mainPageDataModel="mainPageDataModel" />
<Discovery />
</scroll-view>
<!-- 消息列表可滚动区域 -->
<scroll-view
v-show="tabIndex === 1"
class="main main-scroll-area flex-full overflow-hidden min-height-0"
scroll-y
:scroll-top="scrollTop"
:scroll-with-animation="true"
@scroll="handleScroll"
@scrolltolower="handleScrollToLower"
@touchstart.capture="handleScrollAreaTouchStart"
@touchstart="handleScrollAreaTouchStart"
@touchmove="handleScrollAreaTouchMove"
>
<view
class="area-msg-list-content"
v-for="item in chatMsgList"
:key="item.msgId"
:id="item.msgId"
>
<scroll-view v-show="tabIndex === 1" class="main main-scroll-area flex-full overflow-hidden min-height-0" scroll-y
:scroll-top="scrollTop" :scroll-with-animation="true" @scroll="handleScroll" @scrolltolower="handleScrollToLower"
@touchstart.capture="handleScrollAreaTouchStart" @touchstart="handleScrollAreaTouchStart"
@touchmove="handleScrollAreaTouchMove">
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
<template v-if="item.msgType === MessageRole.AI">
<ChatCardAI
class="flex flex-justify-start"
:key="`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`"
:text="
item.componentName && isLongTextCard(item.componentName)
? ''
: item.msg || ''
"
:isLoading="item.isLoading"
>
<template
#content
v-if="
item.toolCall ||
(item.componentName && isLongTextCard(item.componentName))
"
>
<AnswerComponent
v-if="isLongTextCard(item.componentName) && !isLongTextCardPreView(item.componentName)"
:content="item.componentMsg || ''"
:longTextData="item.longTextData"
:finish="item.finish"
/>
<ChatCardAI class="flex flex-justify-start" :key="`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`" :text="item.componentName && isLongTextCard(item.componentName)
? ''
: item.msg || ''
" :isLoading="item.isLoading">
<template #content v-if="
item.toolCall ||
(item.componentName && isLongTextCard(item.componentName))
">
<AnswerComponent v-if="isLongTextCard(item.componentName) && !isLongTextCardPreView(item.componentName)"
:content="item.componentMsg || ''" :longTextData="item.longTextData" :finish="item.finish" />
<LongTextGuideCardPreview
v-if="item.toolCall && isLongTextCardPreView(item.toolCall.componentName)"
:componentName="item.toolCall.componentName"
/>
<LongTextGuideCardPreview v-if="item.toolCall && isLongTextCardPreView(item.toolCall.componentName)"
:componentName="item.toolCall.componentName" />
<QuickBookingComponent
v-if="
item.toolCall &&
item.toolCall.componentName === CompName.quickBookingCard
"
/>
<DiscoveryCardComponent
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.discoveryCard
"
/>
<CreateServiceOrder
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.callServiceCard
"
:toolCall="item.toolCall"
/>
<OpenMapComponent
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.mapCard
"
/>
<GeneratorPhotoComponent
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.aigcPhotoGeneratorCard
"
:toolCall="item.toolCall"
/>
<AigcPhotoCard
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.videoCard
"
:toolCall="item.toolCall"
/>
<QuickBookingComponent v-if="
item.toolCall &&
item.toolCall.componentName === CompName.quickBookingCard
" />
<DiscoveryCardComponent v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.discoveryCard
" />
<CreateServiceOrder v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.callServiceCard
" :toolCall="item.toolCall" />
<OpenMapComponent v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.mapCard
" />
<GeneratorPhotoComponent v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.aigcPhotoGeneratorCard
" :toolCall="item.toolCall" />
<AigcPhotoCard v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.videoCard
" :toolCall="item.toolCall" />
<!-- <ZModuleC01
v-else-if="
@@ -148,45 +87,30 @@
item.toolCall.componentName === CompName.aigcPhotoGeneratorCard
"
/> -->
<Feedback
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.feedbackCard
"
:toolCall="item.toolCall"
/>
<DetailCardCompontent
v-else-if="
item.toolCall &&
item.toolCall.componentName ===
CompName.pictureAndCommodityCard
"
:toolCall="item.toolCall"
/>
<AddCarCrad
v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.enterLicensePlateCard
"
:toolCall="item.toolCall"
/>
<SurveyQuestionnaire
v-else-if="
item.toolCall &&
item.toolCall.componentName ===
CompName.callSurveyQuestionnaire
"
:toolCall="item.toolCall"
/>
<Feedback v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.feedbackCard
" :toolCall="item.toolCall" />
<DetailCardCompontent v-else-if="
item.toolCall &&
item.toolCall.componentName ===
CompName.pictureAndCommodityCard
" :toolCall="item.toolCall" />
<AddCarCrad v-else-if="
item.toolCall &&
item.toolCall.componentName === CompName.enterLicensePlateCard
" :toolCall="item.toolCall" />
<SurveyQuestionnaire v-else-if="
item.toolCall &&
item.toolCall.componentName ===
CompName.callSurveyQuestionnaire
" :toolCall="item.toolCall" />
</template>
<template #footer>
<!-- 这个是底部 -->
<AttachListComponent
v-if="item.question"
:question="item.question"
/>
<AttachListComponent v-if="item.question" :question="item.question" />
</template>
</ChatCardAI>
</template>
@@ -198,23 +122,17 @@
<template v-else>
<ChatCardOther class="flex flex-justify-center" :text="item.msg">
<ChatGuide v-if="chatMsgList.length < 2" />
<ActivityListComponent
v-if="
mainPageDataModel.activityList &&
mainPageDataModel.activityList.length > 0
"
:activityList="mainPageDataModel.activityList"
/>
<ActivityListComponent v-if="
mainPageDataModel.activityList &&
mainPageDataModel.activityList.length > 0
" :activityList="mainPageDataModel.activityList" />
<!-- 先不展示了,等后续有需求再加回来 false -->
<RecommendPostsComponent
v-if="
false &&
mainPageDataModel.recommendTheme &&
mainPageDataModel.recommendTheme.length > 0
"
:recommendThemeList="mainPageDataModel.recommendTheme"
/>
<RecommendPostsComponent v-if="
false &&
mainPageDataModel.recommendTheme &&
mainPageDataModel.recommendTheme.length > 0
" :recommendThemeList="mainPageDataModel.recommendTheme" />
</ChatCardOther>
</template>
</view>
@@ -223,17 +141,9 @@
<!-- 输入框区域 -->
<view class="pb-safe-area">
<ChatQuickAccess />
<ChatInputArea
ref="inputAreaRef"
v-model="inputMessage"
:holdKeyboard="holdKeyboard"
:is-session-active="isSessionActive"
:stop-request="stopRequest"
@send="sendMessageAction"
@noHideKeyboard="handleNoHideKeyboard"
@keyboardShow="handleKeyboardShow"
@keyboardHide="handleKeyboardHide"
/>
<ChatInputArea ref="inputAreaRef" v-model="inputMessage" :holdKeyboard="holdKeyboard"
:is-session-active="isSessionActive" :stop-request="stopRequest" @send="sendMessageAction"
@noHideKeyboard="handleNoHideKeyboard" @keyboardShow="handleKeyboardShow" @keyboardHide="handleKeyboardHide" />
</view>
</view>
</template>