deploy: auto commit repo-root changes 2026-06-13 00:17:26

This commit is contained in:
hajimi
2026-06-13 00:17:26 +08:00
parent 16b8d0365a
commit c3385b0e04
6 changed files with 160 additions and 258 deletions
@@ -166,102 +166,6 @@
</view>
</view>
<!-- 模块5: 波色+生肖分析六合彩专属 -->
<view v-if="isHK6" class="ai-section" :class="{ 'ai-section--visible': modules.colorZodiac.visible }">
<view class="ai-section__header">
<view class="ai-section__icon ai-section__icon--color">🎨</view>
<text class="ai-section__title">波色 & 生肖分析</text>
<view v-if="modules.colorZodiac.loading" class="ai-section__loading">
<view class="ai-dot" />
<view class="ai-dot" />
<view class="ai-dot" />
</view>
<text v-else-if="modules.colorZodiac.done" class="ai-section__done"></text>
</view>
<view v-if="modules.colorZodiac.data" class="ai-section__body">
<!-- 波色分析 -->
<view v-if="modules.colorZodiac.data.color_analysis" class="ai-color-block">
<text class="ai-nums-block__label">🔴🔵🟢 波色统计</text>
<view class="ai-color-grid">
<view v-if="modules.colorZodiac.data.color_analysis.red"
class="ai-color-card ai-color-card--red">
<text class="ai-color-card__name">红波</text>
<text class="ai-color-card__count">{{
modules.colorZodiac.data.color_analysis.red.count }}</text>
<text class="ai-color-card__pct">{{
modules.colorZodiac.data.color_analysis.red.percentage }}</text>
</view>
<view v-if="modules.colorZodiac.data.color_analysis.blue"
class="ai-color-card ai-color-card--blue">
<text class="ai-color-card__name">蓝波</text>
<text class="ai-color-card__count">{{
modules.colorZodiac.data.color_analysis.blue.count }}</text>
<text class="ai-color-card__pct">{{
modules.colorZodiac.data.color_analysis.blue.percentage }}</text>
</view>
<view v-if="modules.colorZodiac.data.color_analysis.green"
class="ai-color-card ai-color-card--green">
<text class="ai-color-card__name">绿波</text>
<text class="ai-color-card__count">{{
modules.colorZodiac.data.color_analysis.green.count }}</text>
<text class="ai-color-card__pct">{{
modules.colorZodiac.data.color_analysis.green.percentage }}</text>
</view>
</view>
<view v-if="modules.colorZodiac.data.color_analysis.summary" class="ai-text-block">
<text class="ai-typewriter">{{ colorZodiacTyped.colorText }}</text>
<text v-if="colorZodiacTyping.color" class="ai-cursor">|</text>
</view>
</view>
<!-- 生肖分析 -->
<view v-if="modules.colorZodiac.data.zodiac_analysis" class="ai-zodiac-block">
<text class="ai-nums-block__label">🐲 生肖分析</text>
<view v-if="modules.colorZodiac.data.zodiac_analysis.hot_zodiac?.length"
class="ai-zodiac-row">
<text class="ai-zodiac-row__label">热门生肖</text>
<view class="ai-zodiac-tags">
<text v-for="z in modules.colorZodiac.data.zodiac_analysis.hot_zodiac"
:key="'hz' + z" class="ai-zodiac-tag ai-zodiac-tag--hot">{{ z }}</text>
</view>
</view>
<view v-if="modules.colorZodiac.data.zodiac_analysis.cold_zodiac?.length"
class="ai-zodiac-row">
<text class="ai-zodiac-row__label">冷门生肖</text>
<view class="ai-zodiac-tags">
<text v-for="z in modules.colorZodiac.data.zodiac_analysis.cold_zodiac"
:key="'cz' + z" class="ai-zodiac-tag ai-zodiac-tag--cold">{{ z }}</text>
</view>
</view>
<view v-if="modules.colorZodiac.data.zodiac_analysis.summary" class="ai-text-block">
<text class="ai-typewriter">{{ colorZodiacTyped.zodiacText }}</text>
<text v-if="colorZodiacTyping.zodiac" class="ai-cursor">|</text>
</view>
</view>
<!-- 推荐 -->
<view v-if="modules.colorZodiac.data.recommended" class="ai-text-block">
<text class="ai-nums-block__label">💡 推荐</text>
<view v-if="modules.colorZodiac.data.recommended.colors?.length" class="ai-zodiac-row">
<text class="ai-zodiac-row__label">推荐波色</text>
<view class="ai-zodiac-tags">
<text v-for="c in modules.colorZodiac.data.recommended.colors" :key="'rc' + c"
class="ai-zodiac-tag ai-zodiac-tag--rec">{{ c }}</text>
</view>
</view>
<view v-if="modules.colorZodiac.data.recommended.zodiacs?.length" class="ai-zodiac-row">
<text class="ai-zodiac-row__label">推荐生肖</text>
<view class="ai-zodiac-tags">
<text v-for="z in modules.colorZodiac.data.recommended.zodiacs" :key="'rz' + z"
class="ai-zodiac-tag ai-zodiac-tag--rec">{{ z }}</text>
</view>
</view>
<view v-if="modules.colorZodiac.data.recommended.reason" class="ai-text-block">
<text class="ai-typewriter">{{ colorZodiacTyped.reasonText }}</text>
<text v-if="colorZodiacTyping.reason" class="ai-cursor">|</text>
</view>
</view>
</view>
</view>
<!-- 全部完成 -->
<view v-if="allDone" class="ai-footer">
<text class="ai-footer__text"> 分析完毕 </text>
@@ -280,8 +184,7 @@ import {
getLotteryAiHistory,
getLotteryAiHotCold,
getLotteryAiTrend,
getLotteryAiStats,
getLotteryAiColorZodiac
getLotteryAiStats
} from '@/api/lottery'
const statusBarHeight = ref(0)
@@ -299,19 +202,15 @@ uni.getSystemInfo({
const goBack = () => uni.navigateBack()
const isHK6 = ref(false)
const modules = reactive({
history: { visible: false, loading: false, done: false, data: null as any },
hotCold: { visible: false, loading: false, done: false, data: null as any },
trend: { visible: false, loading: false, done: false, data: null as any },
stats: { visible: false, loading: false, done: false, data: null as any },
colorZodiac: { visible: false, loading: false, done: false, data: null as any },
})
const allDone = computed(() =>
modules.history.done && modules.hotCold.done && modules.trend.done && modules.stats.done
&& (!isHK6.value || modules.colorZodiac.done)
)
// 历史数据逐行显示
@@ -324,8 +223,6 @@ const trendTyped = reactive({ trendText: '' })
const trendTyping = reactive({ trend: false })
const statsTyped = reactive({ consecutiveText: '', spanText: '', summaryText: '' })
const statsTyping = reactive({ consecutive: false, span: false, summary: false })
const colorZodiacTyped = reactive({ colorText: '', zodiacText: '', reasonText: '' })
const colorZodiacTyping = reactive({ color: false, zodiac: false, reason: false })
function typeText(fullText: string, target: any, key: string, typingFlag: any, flagKey: string, speed = 20, step = 2): Promise<void> {
return new Promise((resolve) => {
@@ -416,15 +313,6 @@ function restoreFromCache(cached: any) {
modules.stats.visible = true
modules.stats.done = true
}
// 波色生肖
if (cached.colorZodiac) {
modules.colorZodiac.data = cached.colorZodiac
colorZodiacTyped.colorText = cached.colorZodiac.color_analysis?.summary || ''
colorZodiacTyped.zodiacText = cached.colorZodiac.zodiac_analysis?.summary || ''
colorZodiacTyped.reasonText = cached.colorZodiac.recommended?.reason || ''
modules.colorZodiac.visible = true
modules.colorZodiac.done = true
}
}
async function showDrawsSequentially(draws: any[]) {
@@ -458,14 +346,10 @@ async function startAnalysis() {
if (cached && latestIssue && latestIssue === cachedIssue) {
modules.history.loading = false
isHK6.value = historyData?.template === 'HK6'
restoreFromCache(cached)
return
}
// 判断是否六合彩
isHK6.value = historyData?.template === 'HK6'
// 无缓存或期号不匹配 → 正常流式请求
const cacheData: any = {}
@@ -543,29 +427,6 @@ async function startAnalysis() {
modules.stats.done = true
}
// 模块5: 波色生肖(仅六合彩)
if (isHK6.value) {
await delay(300)
modules.colorZodiac.visible = true
modules.colorZodiac.loading = true
try {
const data = await getLotteryAiColorZodiac({ code: gameCode.value })
modules.colorZodiac.data = data
modules.colorZodiac.loading = false
modules.colorZodiac.done = true
cacheData.colorZodiac = data
await nextTick()
await typeText(data.color_analysis?.summary || '', colorZodiacTyped, 'colorText', colorZodiacTyping, 'color')
await delay(100)
await typeText(data.zodiac_analysis?.summary || '', colorZodiacTyped, 'zodiacText', colorZodiacTyping, 'zodiac')
await delay(100)
await typeText(data.recommended?.reason || '', colorZodiacTyped, 'reasonText', colorZodiacTyping, 'reason')
} catch {
modules.colorZodiac.loading = false
modules.colorZodiac.done = true
}
}
// 全部完成后存入缓存
if (cacheData.history) {
saveCache(gameCode.value, cacheData)
@@ -912,108 +773,6 @@ onLoad((opts: any) => {
}
}
/* 波色分析 */
.ai-color-block {
margin-bottom: 16rpx;
}
.ai-color-grid {
display: flex;
gap: 12rpx;
margin-top: 12rpx;
}
.ai-color-card {
flex: 1;
border-radius: 12rpx;
padding: 16rpx 12rpx;
text-align: center;
&--red {
background: rgba(239, 68, 68, 0.1);
border: 1rpx solid rgba(239, 68, 68, 0.3);
}
&--blue {
background: rgba(59, 130, 246, 0.1);
border: 1rpx solid rgba(59, 130, 246, 0.3);
}
&--green {
background: rgba(34, 197, 94, 0.1);
border: 1rpx solid rgba(34, 197, 94, 0.3);
}
&__name {
font-size: 24rpx;
font-weight: bold;
color: #333;
display: block;
}
&__count {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-top: 4rpx;
display: block;
}
&__pct {
font-size: 22rpx;
color: #999;
margin-top: 2rpx;
display: block;
}
}
/* 生肖分析 */
.ai-zodiac-block {
margin-bottom: 16rpx;
}
.ai-zodiac-row {
margin-top: 12rpx;
&__label {
font-size: 24rpx;
color: #666;
margin-bottom: 8rpx;
display: block;
}
}
.ai-zodiac-tags {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
}
.ai-zodiac-tag {
font-size: 24rpx;
padding: 6rpx 16rpx;
border-radius: 8rpx;
font-weight: 500;
&--hot {
background: rgba(239, 68, 68, 0.1);
color: #dc2626;
border: 1rpx solid rgba(239, 68, 68, 0.2);
}
&--cold {
background: rgba(59, 130, 246, 0.1);
color: #2563eb;
border: 1rpx solid rgba(59, 130, 246, 0.2);
}
&--rec {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
color: #667eea;
border: 1rpx solid rgba(102, 126, 234, 0.3);
}
}
/* 免责声明 */
.ai-disclaimer {
background: #fffbeb;
+15 -3
View File
@@ -646,8 +646,16 @@ const getRawAnalysisErrorMessage = (error: any) => {
: String(error?.msg || error?.errMsg || error?.message || '')
}
const getAnalysisHttpStatus = (error: any) => {
return Number(error?.statusCode || error?.status || error?.response?.statusCode || error?.response?.status || 0)
}
const isAnalysisTransportError = (error: any) => {
return /timeout|request:fail|abort|网络|network/i.test(getRawAnalysisErrorMessage(error))
const status = getAnalysisHttpStatus(error)
if ([502, 503, 504].includes(status)) {
return true
}
return /timeout|request:fail|abort|网络|network|Bad Gateway|Service Unavailable|Gateway Timeout|网关/i.test(getRawAnalysisErrorMessage(error))
}
const extractPostAnalysisPacket = (res: any) => {
@@ -667,7 +675,11 @@ const shouldRefreshPostAnalysisCache = (packet: { analysis: any; fromCache: bool
const getAnalysisErrorMessage = (error: any) => {
const rawMessage = getRawAnalysisErrorMessage(error)
const status = getAnalysisHttpStatus(error)
if ([502, 503, 504].includes(status) || /Bad Gateway|Service Unavailable|Gateway Timeout|网关/i.test(rawMessage)) {
return 'AI分析服务正在排队或网关暂时断开,请稍后重新进入分析页查看结果'
}
if (/timeout|超时/i.test(rawMessage)) {
return 'AI分析耗时较长,请稍后重新分析;页面已延长等待时间,但当前网络或模型响应仍超时'
}
@@ -888,7 +900,7 @@ const fetchPostAnalysis = async (postId: number) => {
packet = extractPostAnalysisPacket(await getCommunityPostAiAnalysis({ post_id: postId, force: 1 }))
}
if (!packet.analysis) {
throw new Error('AI分析结果为空,请稍后重试')
throw { message: 'AI分析结果为空,请稍后重试', statusCode: 502 }
}
analysisData.value = packet.analysis
} catch (e: any) {
@@ -897,7 +909,7 @@ const fetchPostAnalysis = async (postId: number) => {
try {
const resolved = await waitForPostAnalysisResult(postId)
if (!resolved) {
errorMsg.value = 'AI分析仍在生成或网络连接不稳定,请稍后重新进入分析页查看结果'
errorMsg.value = getAnalysisErrorMessage(e)
}
} catch (pollError: any) {
errorMsg.value = getAnalysisErrorMessage(pollError)