Merge branch 'main' of https://git.brother7.cn/zoujing/YGChatCS into order-729
This commit is contained in:
@@ -85,16 +85,16 @@
|
||||
import { ref, watch, nextTick, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
inputMessage: String,
|
||||
modelValue: String,
|
||||
holdKeyboard: Boolean,
|
||||
isSessionActive: Boolean,
|
||||
stopRequest: Function
|
||||
})
|
||||
const emit = defineEmits(['update:inputMessage', 'send', 'noHideKeyboard', 'keyboardShow', 'keyboardHide', 'sendVoice'])
|
||||
const emit = defineEmits(['update:modelValue', 'send', 'noHideKeyboard', 'keyboardShow', 'keyboardHide', 'sendVoice'])
|
||||
|
||||
const textareaRef = ref(null)
|
||||
const placeholder = ref('快告诉朵朵您在想什么~')
|
||||
const inputMessage = ref(props.inputMessage || '')
|
||||
const inputMessage = ref(props.modelValue || '')
|
||||
const isFocused = ref(false)
|
||||
const keyboardHeight = ref(0)
|
||||
const isVoiceMode = ref(false)
|
||||
@@ -107,10 +107,18 @@ const isSlideToText = ref(false)
|
||||
|
||||
|
||||
// 保持和父组件同步
|
||||
watch(() => props.inputMessage, (val) => {
|
||||
watch(() => props.modelValue, (val) => {
|
||||
inputMessage.value = val
|
||||
})
|
||||
|
||||
// 当子组件的 inputMessage 变化时,通知父组件(但要避免循环更新)
|
||||
watch(inputMessage, (val) => {
|
||||
// 只有当值真正不同时才emit,避免循环更新
|
||||
if (val !== props.modelValue) {
|
||||
emit('update:modelValue', val)
|
||||
}
|
||||
})
|
||||
|
||||
// 切换语音/文本模式
|
||||
const toggleVoiceMode = () => {
|
||||
isVoiceMode.value = !isVoiceMode.value
|
||||
|
||||
@@ -133,8 +133,8 @@ onMounted(() => {
|
||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1); /* 阴影 */
|
||||
}
|
||||
.calendar-img {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.calendar-text {
|
||||
font-size: 22rpx;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="container">
|
||||
<ModuleTitle :title="commodityDTO.title" />
|
||||
<view class="container-scroll">
|
||||
<view class="mk-card-item" v-for="(item) in commodityDTO.commodityList" :key="item.commodityName">
|
||||
<view class="mk-card-item" v-for="(item, index) in commodityDTO.commodityList" :key="`${item.commodityId}-${index}`">
|
||||
<!-- <view class="card-badge">超值推荐</view> -->
|
||||
<image class="card-img" :src="item.commodityIcon" mode="aspectFill" />
|
||||
<view class="card-content">
|
||||
|
||||
Reference in New Issue
Block a user