From 9539896ac0759b3e4c10ebbd43bb93a5de1d178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 5 Mar 2026 09:24:34 +0800 Subject: [PATCH] =?UTF-8?q?JLBA202505130001=5F=E5=85=B3=E4=BA=8E=E5=90=89?= =?UTF-8?q?=E6=9E=97=E9=93=B6=E8=A1=8C=E6=96=B0=E5=BB=BAAI=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=9F=B9=E8=AE=AD=E7=B3=BB=E7=BB=9F=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=5Ffix:=20=E8=AF=84=E8=AE=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment-input/comment-input.vue | 49 ++++++++++++++----- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/components/comment-input/comment-input.vue b/src/components/comment-input/comment-input.vue index a8a8c051..75b6f280 100644 --- a/src/components/comment-input/comment-input.vue +++ b/src/components/comment-input/comment-input.vue @@ -24,7 +24,7 @@ - + @@ -70,11 +70,14 @@ - + + + - 发送 + 发送 @@ -113,7 +116,7 @@ import commentInput2 from '@/static/images/courseDetail/comment-input-2.png' import commentInput3 from '@/static/images/courseDetail/comment-input-3.png' import commentInput4 from '@/static/images/courseDetail/comment-input-4.png' - import { reactive, ref, watch, nextTick, computed } from 'vue'; + import { reactive, ref, watch, nextTick, computed, onBeforeUnmount } from 'vue'; import { emojiList } from '@/emoji'; import { publishCrsEvaluation, queryTraMemeInfoList } from '@/api/courseDetail.js' import common from '@/common/common.js'; @@ -144,7 +147,6 @@ // '/src/static/images/test/e7dd89a71493fcc6281700a4864e24cb.jpg' ]) const isShow = ref(false); - const popHeight = ref('0px') const value = ref(''); const click_input = () => { if(!isShow.value) isShow.value = true @@ -161,9 +163,14 @@ isFocus.value = true cursorLength.value = resStart.value || value.value.length } + const showEmoji = ref(false) + const showEmojiNow = () => { + showEmoji.value = !showEmoji.value + } + const popHeight = ref('0px') const focus = (event) => { - popHeight.value = 'calc(270px + 120rpx)' isShow.value = true + isFocus.value = true console.log('focusevent'); if(!isReply.value){ getMemList() @@ -263,15 +270,14 @@ }) } const setMemValue = (item) => { - console.log(item) if(!isImg.value || fileList.value.length == 0){ - fileList.value = [item.ossAddr] + fileList.value = [item.ossKey] isImg.value = false return } common.show('','是否清空当前图片并重新添加?').then((res) => { if (res) { - fileList.value = [item.ossAddr] + fileList.value = [item.ossKey] isImg.value = false } }); @@ -314,9 +320,6 @@ value.value = '' fileList.value = [] emit('submitOver') - if (from.value === 'study') { - } else { - } }, 500); }, delayTime); }).catch(err=>{ @@ -335,6 +338,24 @@ isImg.value = true } }) + const keyboardHeight = ref(0) + const maxKeyboardHeight = ref(0) + uni.onKeyboardHeightChange((res)=>{ + maxKeyboardHeight.value = res.height > keyboardHeight.value?res.height : keyboardHeight.value + keyboardHeight.value = res.height + }) + onBeforeUnmount(()=>{ + + }) + watch(()=> showEmoji.value,(val)=>{ + popHeight.value = val ? `${maxKeyboardHeight.value}px` : (keyboardHeight.value+'px') + }) + watch(()=> keyboardHeight.value,(val)=>{ + console.log(val,showEmoji.value) + console.log(maxKeyboardHeight.value) + popHeight.value = showEmoji.value ? `${maxKeyboardHeight.value}px` : keyboardHeight.value+'px' + console.log(popHeight.value) + }) defineExpose({hideAll, resetVal}) @@ -455,6 +476,10 @@ font-size: 30rpx; color: #fff; margin-right: 20rpx; + &.is-disabled{ + background-color: #ccc; + // pointer-events: none; + } } } .main-div {