更新
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
// ============ 邀请观看(家人分享页)============
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
inset: 0;
|
||||
background: rgba(15, 23, 42, 0.45);
|
||||
backdrop-filter: blur(12px);
|
||||
z-index: 999;
|
||||
z-index: 2000;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
--st-shadow-ambient: 0 24rpx 60rpx -20rpx rgba(0, 108, 73, 0.08), 0 8rpx 20rpx -8rpx rgba(0, 0, 0, 0.03);
|
||||
--st-shadow-cta: 0 16rpx 32rpx rgba(0, 108, 73, 0.2);
|
||||
--st-shadow-float: 0 16rpx 64rpx rgba(0, 108, 73, 0.15);
|
||||
--tab-dock-full-offset: calc(220rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom: var(--tab-dock-full-offset);
|
||||
}
|
||||
|
||||
/* ===== Header ===== */
|
||||
@@ -606,8 +608,43 @@
|
||||
position: fixed;
|
||||
left: var(--st-container-margin);
|
||||
right: var(--st-container-margin);
|
||||
bottom: calc(24rpx + env(safe-area-inset-bottom));
|
||||
z-index: 90;
|
||||
bottom: var(--tab-dock-full-offset);
|
||||
z-index: 210;
|
||||
}
|
||||
|
||||
.weekly-page .st-float-close {
|
||||
position: absolute;
|
||||
top: -18rpx;
|
||||
right: -6rpx;
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.weekly-page .st-float-close-icon {
|
||||
color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.weekly-page .st-float-reopen {
|
||||
position: fixed;
|
||||
right: var(--st-container-margin);
|
||||
bottom: var(--tab-dock-full-offset);
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(180deg, #2d7340 0%, #006c49 100%);
|
||||
box-shadow: var(--st-shadow-float);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 210;
|
||||
}
|
||||
|
||||
.weekly-page .st-float-inner {
|
||||
@@ -681,6 +718,63 @@
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-overlay {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 3000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.32);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
padding: 56rpx 64rpx;
|
||||
border-radius: 32rpx;
|
||||
background: rgba(20, 24, 22, 0.86);
|
||||
box-shadow: 0 16rpx 48rpx rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-icon {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(180deg, #2d7340 0%, #006c49 100%);
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-icon.active {
|
||||
animation: st-voice-pulse 1.1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes st-voice-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(0, 108, 73, 0.45); }
|
||||
50% { box-shadow: 0 0 0 20rpx rgba(0, 108, 73, 0); }
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.weekly-page .st-voice-sub {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
@keyframes st-float-mic-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(0, 108, 73, 0.35); }
|
||||
50% { box-shadow: 0 0 0 12rpx rgba(0, 108, 73, 0); }
|
||||
|
||||
Reference in New Issue
Block a user