|
|
@ -1,6 +1,6 @@ |
|
|
|
<script setup> |
|
|
|
// 导入 |
|
|
|
import { ref, computed, onMounted, watch, nextTick, onUnmounted } from "vue"; |
|
|
|
import { ref, computed, onMounted, watch, nextTick, onUnmounted, h } from "vue"; |
|
|
|
import { setHeight } from "../utils/setHeight"; |
|
|
|
import { getUserCountAPI } from "../api/AIxiaocaishen"; |
|
|
|
import { ElMessage } from "element-plus"; |
|
|
@ -417,46 +417,32 @@ const goToRecharge = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const adjustFooterPosition = (height) => { |
|
|
|
console.log("调整底部位置", height); |
|
|
|
const footer = document.querySelector(".el-footer"); |
|
|
|
const main = document.querySelector(".el-main"); |
|
|
|
const homePage = document.querySelector(".homepage"); |
|
|
|
const app = document.getElementById("app"); |
|
|
|
// Footer 的默认高度(假设为 60px) // 动态推高 Footer |
|
|
|
// footer.style.bottom = `${keyboardHeight}px`; |
|
|
|
// 给 Main 区域留出 Footer + 键盘的空间 |
|
|
|
homePage.style.height = `${height}px`; |
|
|
|
// app.style.height = `${height}px`; |
|
|
|
|
|
|
|
void homePage.offsetHeight; |
|
|
|
|
|
|
|
const html = document.querySelector("html"); |
|
|
|
const body = document.querySelector("body"); |
|
|
|
|
|
|
|
html.style.height = `${height}px`; |
|
|
|
body.style.height = `${height}px`; |
|
|
|
const isAndroid = /Android/i.test(navigator.userAgent); |
|
|
|
if (isAndroid) { |
|
|
|
console.log("是安卓设备"); |
|
|
|
console.log("window.visualViewport", window.visualViewport.height); |
|
|
|
const homePage = document.querySelector(".homepage"); |
|
|
|
|
|
|
|
homePage.style.height = `${height}px`; |
|
|
|
// homePage.style.height = `460px`; |
|
|
|
|
|
|
|
html.scrollTop = 0; |
|
|
|
html.scrollTop = 0; |
|
|
|
} else { |
|
|
|
console.log("非安卓设备"); |
|
|
|
console.log("调整底部位置", height); |
|
|
|
const homePage = document.querySelector(".homepage"); |
|
|
|
homePage.style.height = `${height}px`; |
|
|
|
|
|
|
|
html.scrollTop = 0; |
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
// 隐藏滚动条 |
|
|
|
html.style.overflow = "hidden"; |
|
|
|
body.style.overflow = "hidden"; |
|
|
|
}, 200); |
|
|
|
|
|
|
|
// console.log(html.offsetHeight, 'html') |
|
|
|
// console.log(html.clientHeight, 'html') |
|
|
|
// console.log(html.scrollHeight, 'htmlScrollHeight') |
|
|
|
// console.log(body.clientHeight, 'body') |
|
|
|
// console.log(body.scrollHeight, 'bodyScrollHeight') |
|
|
|
// console.log(homePage.offsetHeight, 'homePage') |
|
|
|
// console.log(homePage.clientHeight, 'homePageClientHeight') |
|
|
|
// console.log(homePage.scrollHeight, 'homePageScrollHeight') |
|
|
|
// console.log(window.innerHeight, 'window.innerHeight') |
|
|
|
// console.log(window.visualViewport.height, 'window.visualViewport.height') |
|
|
|
// console.log(main.offsetHeight, 'main') |
|
|
|
// console.log(main.clientHeight, 'mainClientHeight') |
|
|
|
// console.log(main.scrollHeight, 'mainScrollHeight') |
|
|
|
}; |
|
|
|
|
|
|
|
const onFocus = function () { |
|
|
|