Compare commits

..

No commits in common. "c6ce198c31673aaf2881a3e082a7391acf51ba6a" and "80772749b2ed2c5b6f8c3bb479eae2453b58c9d9" have entirely different histories.

View File

@ -118,36 +118,38 @@ const readnum = ref(0);
const agreenum = ref(0); const agreenum = ref(0);
const isAgree = ref(0); const isAgree = ref(0);
const user_uuid = ref(""); const user_uuid = ref("");
const bottomHeight = ref(65);
const NAV_BAR_HEIGHT_PX = 44; const NAV_BAR_HEIGHT_PX = 44;
const WEBVIEW_BOTTOM_PX = 55; const WEBVIEW_BOTTOM_PX = 65;
const webviewTopPx = ref(88); const webviewTopPx = ref(88);
const webviewBottomPx = ref(WEBVIEW_BOTTOM_PX); const webviewHeightPx = ref(600);
const webviewStyles = ref({ const webviewStyles = ref({
width: "100%", width: "100%",
top: `${webviewTopPx.value}px`, top: `${webviewTopPx.value}px`,
bottom: `${webviewBottomPx.value}px` height: `${webviewHeightPx.value}px`,
bottom: `65px`,
}); });
const applyWebviewLayout = () => { const applyWebviewLayout = () => {
};
const initWebviewLayout = () => {
const resInfo = uni.getSystemInfoSync(); const resInfo = uni.getSystemInfoSync();
const statusBarHeight = Number(resInfo.statusBarHeight || 0); const statusBarHeight = Number(resInfo.statusBarHeight || 0);
const safeAreaBottom = Number( const windowHeight = Number(resInfo.windowHeight || 0);
(resInfo.safeAreaInsets && resInfo.safeAreaInsets.bottom) || 0
);
webviewTopPx.value = Math.round(statusBarHeight + NAV_BAR_HEIGHT_PX); webviewTopPx.value = Math.round(statusBarHeight + NAV_BAR_HEIGHT_PX);
webviewBottomPx.value = Math.round(WEBVIEW_BOTTOM_PX + safeAreaBottom); webviewHeightPx.value = Math.max(
200,
Math.round(windowHeight - webviewTopPx.value - WEBVIEW_BOTTOM_PX)
);
webviewStyles.value = { webviewStyles.value = {
width: "100%", width: "100%",
top: `${webviewTopPx.value}px`, top: `${webviewTopPx.value}px`,
bottom: `${webviewBottomPx.value}px` height: `${webviewHeightPx.value}px`,
bottom: `${WEBVIEW_BOTTOM_PX}px`,
}; };
}; };
const initWebviewLayout = () => {
applyWebviewLayout();
};
const onWindowResize = () => {
applyWebviewLayout();
};
const getCollect = () => { const getCollect = () => {
api api
@ -298,7 +300,6 @@ const goBack = () => {
const webviewRef = ref(null); const webviewRef = ref(null);
onShow(() => { onShow(() => {
initWebviewLayout();
setTimeout(() => { setTimeout(() => {
uni.hideLoading(); uni.hideLoading();
}, 2000); }, 2000);
@ -306,9 +307,6 @@ onShow(() => {
// plus.screen.lockOrientation('portrait-primary'); // plus.screen.lockOrientation('portrait-primary');
}); });
onUnload(() => { onUnload(() => {
if (typeof uni.offWindowResize === "function") {
uni.offWindowResize(onWindowResize);
}
// console.log('onUnload'); // console.log('onUnload');
// plus.screen.lockOrientation('portrait-primary'); // plus.screen.lockOrientation('portrait-primary');
}); });
@ -321,10 +319,7 @@ onLoad((query) => {
title: '加载中', title: '加载中',
mask: true, mask: true,
}); });
initWebviewLayout(); //initWebviewLayout();
if (typeof uni.onWindowResize === "function") {
uni.onWindowResize(onWindowResize);
}
const userInfo = uni.getStorageSync("userInfo"); const userInfo = uni.getStorageSync("userInfo");
if (query.type) { if (query.type) {
type.value = query.type; type.value = query.type;
@ -1117,15 +1112,15 @@ const shareToWeibo = () => {
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: 55px; height: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 9999999999999999999999999999999999999999999999999999999999999999; z-index: 99;
background-color: #fff; background-color: #fff;
} }
.bottom-cell { .bottom-cell {
flex: 1; flex: 1;
height: 100%; height: 55px;
border-right: 2rpx solid #ccc; border-right: 2rpx solid #ccc;
border-top: 2rpx solid #ccc; border-top: 2rpx solid #ccc;
display: flex; display: flex;