代码优化
This commit is contained in:
parent
a8706903fc
commit
70a75f36c2
|
|
@ -15,4 +15,9 @@ export default {
|
|||
<style lang="scss">
|
||||
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
||||
@import 'uview-plus/index.scss';
|
||||
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue