代码优化

This commit is contained in:
BianLzhaoMin 2025-03-27 18:11:29 +08:00
parent a8706903fc
commit 70a75f36c2
2 changed files with 23 additions and 2 deletions

View File

@ -15,4 +15,9 @@ export default {
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import 'uview-plus/index.scss';
page {
width: 100%;
height: 100%;
}
</style>

View File

@ -17,8 +17,24 @@
<script setup>
import { ref } from 'vue'
const isError = ref(false)
const pageHeight = ref(0)
const calcPageHeight = () => {
const systemInfo = uni.getSystemInfoSync()
console.log('systemInfo', systemInfo)
const windowHeight = systemInfo.windowHeight //
const statusBarHeight = systemInfo.statusBarHeight || 0
const navBarHeight = 44 //
const totalNavHeight = statusBarHeight + navBarHeight
pageHeight.value = windowHeight - totalNavHeight
}
// calcPageHeight()
//
const onSubmitOptions = () => {
uni.navigateTo({ url: '/pages/opinion/index' })
@ -31,9 +47,9 @@ if (isError.value) {
<style lang="scss" scoped>
.content {
height: 100vh;
padding: 20px;
height: calc(100% - 40px);
display: flex;
padding: 20px;
flex-direction: column;
justify-content: space-between;
background-color: #f5f5f5;