refactor: 移除爽文页面我的剧本按钮和人生素材画像容器

移除我的剧本按钮(模板、样式、方法),用户可通过底部我的Tab查看剧本
移除人生素材画像容器组件(模板、样式、JS逻辑)
保留导入社交数据按钮及完整流程
useSocialInsights 改为默认 true,后端自动判断是否有可用画像
清理未使用的 socialImport 导入、confirmedInsights、loadConfirmedInsights 等

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 21:28:29 +08:00
parent ba196486c0
commit 812e126b2b
+1 -94
View File
@@ -23,9 +23,6 @@
<view class="social-import-btn" @click="openSocialImport"> <view class="social-import-btn" @click="openSocialImport">
<text>导入社交数据</text> <text>导入社交数据</text>
</view> </view>
<view class="script-list-btn" @click="openScriptLibrary">
<text>我的剧本</text>
</view>
</view> </view>
</view> </view>
@@ -62,19 +59,6 @@
<view class="send-button" :class="{ disabled: !wishText.trim() }" @click="submitWish('text')">发送</view> <view class="send-button" :class="{ disabled: !wishText.trim() }" @click="submitWish('text')">发送</view>
</view> </view>
<view class="profile-boost">
<view class="boost-main" @click="openSocialInsights">
<text class="boost-title">人生素材画像</text>
<text class="boost-copy">{{ socialInsightCopy }}</text>
</view>
<switch
class="boost-switch"
:checked="useSocialInsights"
color="#a855f7"
@change="useSocialInsights = $event.detail.value"
/>
</view>
<view class="orb-wrap"> <view class="orb-wrap">
<view <view
class="mic-orb" class="mic-orb"
@@ -191,7 +175,6 @@
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import { useAppStore } from '../../stores/app.js' import { useAppStore } from '../../stores/app.js'
import analytics from '../../services/analytics.js' import analytics from '../../services/analytics.js'
import * as socialImport from '../../services/socialImport.js'
import * as epicScriptService from '../../services/epicScript.js' import * as epicScriptService from '../../services/epicScript.js'
import { useTtsPlayer } from '../../composables/useTtsPlayer.js' import { useTtsPlayer } from '../../composables/useTtsPlayer.js'
import { useTypewriterStream } from '../../composables/useTypewriterStream.js' import { useTypewriterStream } from '../../composables/useTypewriterStream.js'
@@ -221,7 +204,6 @@ const remainingCount = ref(3)
const style = ref('career') const style = ref('career')
const randomRecommendations = ref([]) const randomRecommendations = ref([])
const useSocialInsights = ref(true) const useSocialInsights = ref(true)
const confirmedInsights = ref([])
const ttsPlayer = useTtsPlayer({ pagePath }) const ttsPlayer = useTtsPlayer({ pagePath })
let recorderManager = null let recorderManager = null
let recordStartedAt = 0 let recordStartedAt = 0
@@ -250,11 +232,6 @@ const recommendations = computed(() => {
return source.length ? source.slice(0, 4) : fallbackRecommendations return source.length ? source.slice(0, 4) : fallbackRecommendations
}) })
const socialInsightCopy = computed(() => {
if (!confirmedInsights.value.length) return '未确认画像,点这里导入社交内容'
return `已确认 ${confirmedInsights.value.length} 个,将辅助生成更像你的剧本`
})
const voiceCopy = computed(() => { const voiceCopy = computed(() => {
if (voiceState.value === 'pressing') return '松开后识别心愿' if (voiceState.value === 'pressing') return '松开后识别心愿'
if (voiceState.value === 'recognizing') return '正在识别你的心愿……' if (voiceState.value === 'recognizing') return '正在识别你的心愿……'
@@ -417,19 +394,10 @@ const normalizeGeneratedScript = (data) => {
} }
const openScriptLibrary = () => { const openScriptLibrary = () => {
analytics.track('script_my_scripts_click', {}, { eventType: 'script', pagePath }) analytics.track('script_history_click', {}, { eventType: 'script', pagePath })
uni.$emit('switchTab', 'mine') uni.$emit('switchTab', 'mine')
} }
const openSocialInsights = () => {
analytics.track('script_social_insights_click', {
confirmed_count: confirmedInsights.value.length
}, { eventType: 'social_import', pagePath })
uni.navigateTo({
url: confirmedInsights.value.length ? '/pages/social-import/insights' : '/pages/social-import/index'
})
}
const openSocialImport = () => { const openSocialImport = () => {
analytics.track('script_social_import_entry_click', { analytics.track('script_social_import_entry_click', {
source: 'home_head' source: 'home_head'
@@ -739,19 +707,9 @@ const trackTtsClick = () => {
ttsPlayer.playSource(currentResult.value?.id || '') ttsPlayer.playSource(currentResult.value?.id || '')
} }
const loadConfirmedInsights = async () => {
try {
const res = await socialImport.listInsights('confirmed')
confirmedInsights.value = res.data || []
} catch (error) {
confirmedInsights.value = []
}
}
onMounted(() => { onMounted(() => {
analytics.track('script_home_view', {}, { eventType: 'script', pagePath }) analytics.track('script_home_view', {}, { eventType: 'script', pagePath })
setupRecorder() setupRecorder()
loadConfirmedInsights()
}) })
onUnmounted(() => { onUnmounted(() => {
@@ -966,21 +924,6 @@ onUnmounted(() => {
gap: 14rpx; gap: 14rpx;
} }
.history-button,
.script-list-btn {
height: 64rpx;
display: flex;
align-items: center;
gap: 12rpx;
padding: 0 22rpx;
border-radius: 999rpx;
color: #e8ccff;
font-size: 28rpx;
background: rgba(43, 19, 83, 0.72);
border: 1rpx solid rgba(168, 85, 247, 0.28);
box-shadow: 0 0 22rpx rgba(116, 52, 202, 0.12);
}
.head-action-row { .head-action-row {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -1169,42 +1112,6 @@ onUnmounted(() => {
opacity: 0.45; opacity: 0.45;
} }
.profile-boost {
min-height: 88rpx;
display: flex;
align-items: center;
gap: 18rpx;
padding: 18rpx 22rpx;
border-radius: 28rpx;
border: 1rpx solid rgba(168, 85, 247, 0.26);
background: rgba(43, 19, 83, 0.44);
}
.boost-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6rpx;
}
.boost-title {
color: #fff;
font-size: 28rpx;
font-weight: 800;
}
.boost-copy {
color: rgba(232, 204, 255, 0.72);
font-size: 23rpx;
line-height: 1.35;
}
.boost-switch {
transform: scale(0.78);
transform-origin: right center;
}
.inspiration-section { .inspiration-section {
display: flex; display: flex;
flex-direction: column; flex-direction: column;