代码优化
This commit is contained in:
parent
a8706903fc
commit
70a75f36c2
|
|
@ -15,4 +15,9 @@ export default {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
||||||
@import 'uview-plus/index.scss';
|
@import 'uview-plus/index.scss';
|
||||||
|
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,24 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const isError = ref(false)
|
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 = () => {
|
const onSubmitOptions = () => {
|
||||||
uni.navigateTo({ url: '/pages/opinion/index' })
|
uni.navigateTo({ url: '/pages/opinion/index' })
|
||||||
|
|
@ -31,9 +47,9 @@ if (isError.value) {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
height: 100vh;
|
height: calc(100% - 40px);
|
||||||
padding: 20px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
padding: 20px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue