hookehuyr

🐞 fix: 修复微信浏览器滚动高度适配问题

......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-21 09:35:14
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-07-01 18:07:00
* @LastEditTime: 2022-07-01 20:17:04
* @FilePath: /tswj/src/views/client/bookDetail.vue
* @Description:
-->
......@@ -191,8 +191,14 @@ window.onscroll = function () {
const windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
//变量scrollHeight是滚动条的总高度
const scrollHeight = document.documentElement.scrollHeight||document.body.scrollHeight;
console.warn('scrollTop', scrollTop);
console.warn('windowHeight', windowHeight);
console.warn('scrollTop + windowHeight', scrollTop + windowHeight);
console.warn('scrollHeight', scrollHeight);
//滚动条到底部的条件
if (parseInt(scrollTop + windowHeight) === scrollHeight){
const height1 = scrollTop + windowHeight;
const height2 = scrollTop + windowHeight - 1; // 手机上微信高度少了1px
if (parseInt(height1) === scrollHeight || parseInt(height2) === scrollHeight){
// console.warn("距顶部"+scrollTop+"可视区高度"+windowHeight+"滚动条总高度"+scrollHeight);
customStyle.value.bottom = '35%'
} else {
......