Commit 0af5f384 by zhangcheng

初始化

parent 80a45971
<template>
<view class="page-body" :style="{height:`${height}px`,'padding-bottom':'50px'}">
<view class="menu-box">
<!-- height:`${height}px`, -->
<view class="menu-banner"><image src="../../static/imgs/banner.png"></image></view>
<view class="page-body" :style="{height:`${height-bannerh}px`}">
<!-- <u-button @click="uniGetUserInfo">按钮授权</u-button> -->
<scroll-view class="nav-left" scroll-y :style="{height:`${height}px`}" :scroll-top="scrollLeftTop" scroll-with-animation>
<scroll-view class="nav-left" scroll-y :style="{height:`${height-bannerh}px`}" :scroll-top="scrollLeftTop" scroll-with-animation>
<view class="nav-left-item" @click="categoryClickMain(index)" :key="index" :class="index == categoryActive ? 'active' : ''" v-for="(item, index) in classifyData">
{{ item.name }}
</view>
......@@ -11,7 +14,7 @@
scroll-y
:scroll-top="scrollTop"
@scroll="scroll"
:style="{height:`${height}px`}"
:style="{height:`${height-bannerh}px`}"
scroll-with-animation
>
<view v-for="(foods, index) in classifyData" :key="index" class="box">
......@@ -28,13 +31,14 @@
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item>
</u-tabbar>
</view>
</view>
</template>
<script>
export default {
data() {
return {
bannerh:0,
name: 'wkiwi',
height: 0,
categoryActive: 0,
......@@ -1135,6 +1139,19 @@
// })
},
onLoad: function() {
let _this = this;
uni.createSelectorQuery()
.select('.menu-banner')
.boundingClientRect(data => {
_this.bannerh = data.height;
}).exec();
uni.createSelectorQuery()
.select('.u-tabbar__content')
.boundingClientRect(data => {
_this.tabBarHeight = data.height;
console.log(_this.tabBarHeight,5555522222)
}).exec();
console.log(this.tabBarHeight,5544)
this.height = uni.getSystemInfoSync().windowHeight - this.tabBarHeight;
},
onReady() {
......@@ -1151,6 +1168,7 @@
},
getHeightList() {
let _this = this;
let selectorQuery = uni.createSelectorQuery();
selectorQuery.selectAll('.nav-left-item').boundingClientRect(function(rects) {
_this.leftItemHeight = rects[0].height;
......@@ -1217,6 +1235,13 @@
</script>
<style lang="scss">
.menu-box{}
.menu-banner{
image{
width: 100%;
height: 376rpx;
}
}
.page-body {
display: flex;
background: #fff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment