不允许缩放 安卓键盘问题

This commit is contained in:
liuyalei 2024-03-07 13:28:53 +08:00
parent 88d0431eb4
commit 7f5cf72d46
2 changed files with 25 additions and 8 deletions

View File

@ -3,8 +3,9 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<title>优享地图</title>
</head>
<script type="text/javascript" src="https://api.tianditu.gov.cn/api?v=4.0&tk=4e6d9067f64ad8101ca0f4ceb7cb4083" crossorigin></script>

View File

@ -255,14 +255,14 @@
</div>
</div>
<div class="recomand">
<!-- <div class="recomand">
<div v-for="(v, i) in recomanTags" :key="i" @click="cksend(v)" class="recomand_itm"> {{ v }}</div>
</div>
</div> -->
<div class="c_bottom">
<img src="../assets/3.png">
<input v-model="inputText" type="text" placeholder="有问题尽管问我~" @keydown.enter="sendMessage"
<input v-model="inputText" @focus="handleInputFocus" type="text" placeholder="有问题尽管问我~" @keydown.enter="sendMessage"
class="sendinput" />
<div class="w_icon">
<img src="../assets/4.png" alt="">
@ -308,6 +308,10 @@ const cksend = (val) => {
}
}
const handleInputFocus = () => {
console.log("聚焦了");
scollToButtom();
}
const sendMessage = () => {
console.log("信息发送成功", inputText.value);
let messageValue = inputText.value.trim()
@ -370,12 +374,24 @@ const goke = () => {
const bookDoctor = () => {
location.href = 'https://wx.nbgzjk.cn/#/home'
};
// const scollToButtom = () => {
// nextTick(() => {
// let chatForm = document.getElementById('chatform'); //
// if (chatForm) {
// chatForm.scrollTop = chatForm.scrollHeight+99999; //
// console.log("",chatForm.scrollTop);
// }
// });
// }
const scollToButtom = () => {
nextTick(() => {
let chatForm = document.getElementById('chatform'); //
if (chatForm) {
chatForm.scrollTop = chatForm.scrollHeight; //
}
setTimeout(() => { //
let chatForm = document.getElementById('chatform');
if (chatForm) {
chatForm.scrollTop = chatForm.scrollHeight - chatForm.clientHeight; //
console.log("滚动", chatForm.scrollTop);
}
}, 300); //
});
}
/* watch(inputText, (newValue, oldValue) => {