不允许缩放 安卓键盘问题

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> <head>
<meta charset="UTF-8"> <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"> <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> <title>优享地图</title>
</head> </head>
<script type="text/javascript" src="https://api.tianditu.gov.cn/api?v=4.0&tk=4e6d9067f64ad8101ca0f4ceb7cb4083" crossorigin></script> <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> </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 v-for="(v, i) in recomanTags" :key="i" @click="cksend(v)" class="recomand_itm"> {{ v }}</div>
</div> </div> -->
<div class="c_bottom"> <div class="c_bottom">
<img src="../assets/3.png"> <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" /> class="sendinput" />
<div class="w_icon"> <div class="w_icon">
<img src="../assets/4.png" alt=""> <img src="../assets/4.png" alt="">
@ -308,6 +308,10 @@ const cksend = (val) => {
} }
} }
const handleInputFocus = () => {
console.log("聚焦了");
scollToButtom();
}
const sendMessage = () => { const sendMessage = () => {
console.log("信息发送成功", inputText.value); console.log("信息发送成功", inputText.value);
let messageValue = inputText.value.trim() let messageValue = inputText.value.trim()
@ -370,12 +374,24 @@ const goke = () => {
const bookDoctor = () => { const bookDoctor = () => {
location.href = 'https://wx.nbgzjk.cn/#/home' 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 = () => { const scollToButtom = () => {
nextTick(() => { nextTick(() => {
let chatForm = document.getElementById('chatform'); // setTimeout(() => { //
let chatForm = document.getElementById('chatform');
if (chatForm) { if (chatForm) {
chatForm.scrollTop = chatForm.scrollHeight; // chatForm.scrollTop = chatForm.scrollHeight - chatForm.clientHeight; //
console.log("滚动", chatForm.scrollTop);
} }
}, 300); //
}); });
} }
/* watch(inputText, (newValue, oldValue) => { /* watch(inputText, (newValue, oldValue) => {