mall.vue
802 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<view class="mall_container">
<!-- 头部模块 -->
<MallHeared />
<!-- 商品展示 -->
<MallSelect :scrollHeight="scrollHeight" />
</view>
</template>
<script>
import { rpx2px } from '@/utils/util.js'
import MallSelect from '@/components/mall/mallSelect.vue'
import MallHeared from '@/components/mall/mallHeared.vue'
export default {
components: { MallHeared, MallSelect },
data() {
return {
scrollHeight: 0, // 计算当前可用高度
};
},
onLoad() {
this.setListHeight()
},
methods: {
// 设置列表内容的高度
setListHeight() {
const { windowHeight } = uni.getSystemInfoSync()
this.scrollHeight = windowHeight - rpx2px(700)
},
}
}
</script>
<style lang="scss" scoped>
.mall_container{
min-height: 100vh;
}
</style>