This commit is contained in:
Your Name
2026-06-02 14:15:49 +08:00
parent 707e4888ad
commit 860b550180
13 changed files with 348 additions and 44 deletions
+1 -1
View File
@@ -3516,7 +3516,7 @@ function goBack() {
uni.navigateBack({ delta: 1 })
return
}
uni.redirectTo({ url: '/tongji/pages/weekly' })
uni.navigateTo({ url: '/tongji/pages/weekly' })
}
function goGlucosePage() {
+42 -3
View File
@@ -228,8 +228,16 @@
<view class="st-main-spacer" />
</view>
<!-- 收起后的重新唤起按钮 -->
<view v-if="diagnosisId && floatAskClosed" class="st-float-reopen" @click="floatAskClosed = false">
<TongjiIcon name="sparkles" size="sm" color="#ffffff" />
</view>
<!-- 底部浮动 AI 输入栏 -->
<view v-if="diagnosisId" class="st-float-ask">
<view v-if="diagnosisId && !floatAskClosed" class="st-float-ask">
<view class="st-float-close" @click="floatAskClosed = true">
<text class="st-float-close-icon">×</text>
</view>
<view class="st-float-inner">
<view class="st-float-icon">
<TongjiIcon name="sparkles" size="sm" color="#006c49" />
@@ -274,6 +282,17 @@
</view>
</view>
<!-- 语音长按状态浮层居中显示避免被键盘/底栏遮挡 -->
<view v-if="sttHolding && !dietAiAsking" class="st-voice-overlay">
<view class="st-voice-card">
<view class="st-voice-icon" :class="{ active: sttListening }">
<TongjiIcon name="mic" size="lg" color="#ffffff" />
</view>
<text class="st-voice-title">{{ sttListening ? '正在聆听…' : '准备录音…' }}</text>
<text class="st-voice-sub">松开手指结束并识别</text>
</view>
</view>
<!-- 无就诊卡授权手机号后可录入 -->
<view v-if="phoneGateVisible" class="input-modal-mask" @click="closePhoneGate">
<view class="input-modal phone-gate-modal" @click.stop>
@@ -323,7 +342,7 @@
<!-- 录入今日数据弹层 -->
<view v-if="inputForm.visible" class="input-modal-mask" @click="closeInputForm">
<view class="input-modal" @click.stop>
<view class="input-modal" :style="keyboardHeight ? { marginBottom: keyboardHeight + 'px' } : {}" @click.stop>
<view class="input-modal-grip" />
<view class="input-modal-head">
<view class="input-modal-title-wrap">
@@ -352,6 +371,7 @@
<view class="input-field-input">
<input
type="digit"
:adjust-position="false"
:value="inputForm.fasting_blood_sugar"
placeholder="如 6.5"
placeholder-class="input-placeholder"
@@ -367,6 +387,7 @@
<view class="input-field-input">
<input
type="digit"
:adjust-position="false"
:value="inputForm.postprandial_blood_sugar"
placeholder="如 8.0"
placeholder-class="input-placeholder"
@@ -382,6 +403,7 @@
<view class="input-field-input">
<input
type="digit"
:adjust-position="false"
:value="inputForm.other_blood_sugar"
placeholder="如 7.2"
placeholder-class="input-placeholder"
@@ -398,6 +420,7 @@
placeholder-class="input-placeholder"
:show-confirm-bar="false"
:auto-height="true"
:adjust-position="false"
@input="onInputField('remark', $event)"
/>
</view>
@@ -423,6 +446,7 @@
</view>
</view>
</block>
<TabBarDock :active="1" />
</view>
</template>
@@ -433,6 +457,7 @@ import SugarTreeGraphic from '../components/SugarTreeGraphic.vue'
import TongjiIcon from '../components/TongjiIcon.vue'
import { useDietAi } from '../composables/useDietAi.js'
import { useSpeechToText } from '../composables/useSpeechToText.js'
import TabBarDock from '@/components/app-tab-bar/tab-bar-dock.vue'
const { proxy } = getCurrentInstance()
@@ -501,6 +526,15 @@ const {
openDietForm
} = useDietAi(proxy, { diagnosisId, showUserToast, formatUserMessage })
/** 底部 AI 浮动卡片是否被用户收起 */
const floatAskClosed = ref(false)
/** 键盘高度(px):录入弹窗据此整体上移,避免输入框被键盘遮挡 */
const keyboardHeight = ref(0)
function onKeyboardHeightChange(res) {
keyboardHeight.value = res && res.height ? Math.round(res.height) : 0
}
const {
sttListening,
sttHolding,
@@ -1373,7 +1407,7 @@ function goGamePage() {
}
function navToUser() {
uni.switchTab({ url: '/pages/user/user' })
uni.redirectTo({ url: '/pages/user/user' })
}
// ============ 时段问候 / 打卡 / 健康日历 ============
@@ -2519,6 +2553,7 @@ onLoad((options) => {
onShow(() => {
initHeaderSafeArea()
try { uni.onKeyboardHeightChange(onKeyboardHeightChange) } catch (e) {}
if (authChecking.value) return
resetCanvasCache()
nextTick(() => scheduleChartRedraw())
@@ -2534,11 +2569,15 @@ onPullDownRefresh(async () => {
onHide(() => {
ttsStop()
stopSpeechToText()
try { uni.offKeyboardHeightChange(onKeyboardHeightChange) } catch (e) {}
keyboardHeight.value = 0
})
onUnload(() => {
ttsStop()
stopSpeechToText()
try { uni.offKeyboardHeightChange(onKeyboardHeightChange) } catch (e) {}
keyboardHeight.value = 0
})
// ============ 邀请观看(家人分享页)============