Commit c4dfdf15 authored by jyx's avatar jyx

修复首页加载不全问题

parent c6ae228b
......@@ -19,8 +19,6 @@
// #endif
this.globalData.windowWidth = res.windowWidth;
this.globalData.clientHeight = res.windowHeight - this.globalData.windowWidth / 7;
this.globalData.tabHeight = this.globalData.windowWidth / 7;
// 抖音
// #ifdef MP-TOUTIAO
......@@ -76,8 +74,6 @@
// baseUrl: 'http://test.mints-id.com/camera-api/miniApi',
// baseUrl: 'http://192.168.110.71:8301/miniApi',
titleButtonWidth: 38,
clientHeight: 0,
tabHeight: 0,
token: '',
userId: 0,
inviteUId: '',
......
......@@ -13,7 +13,7 @@
<image :src="maskImage2" mode="widthFix"></image>
</view>
<scroll-view style="height: 100%;" scroll-y @scroll="onScroll">
<scroll-view scroll-y :style="{'height': clientHeight + 'px'}" @scroll="onScroll">
<view class="content">
<swiper class="banner" :indicator-dots="true" :autoplay="true" :interval="2000" :duration="500">
<swiper-item v-for="banner in bannerList" :key="banner.vedioId" @click="handleBanner(banner)">
......@@ -214,13 +214,12 @@
loadStatus: 'loadmore'
};
},
created() {
const res = tt.getSystemInfoSync();
this.clientHeight = res.windowHeight - res.windowWidth / 7
},
mounted() {
let that = this
uni.getSystemInfo({
success: (res => {
this.clientHeight = res.windowHeight - 50;
})
});
// 匹配视频
this.showFirstDialog();
},
......
<template>
<view class="body">
<scroll-view style="height: 100%;" scroll-y>
<scroll-view scroll-y>
<view
:style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'">
<image class="avatar" src="@/static/logo-about.png"></image>
......
<template>
<view class="body">
<view v-if="clientHeight!=0" :style="{'height': clientHeight + 'px'}">
<view :style="{'height': clientHeight + 'px;'}">
<indexPage v-show="currentPage==0" ref="index" />
<recommendPage v-on:showEditBarH="showEditBarH" v-on:changeBottomBarColor="changeBottomBarColor"
v-show="currentPage==1" ref="recommend" />
<userPage v-show="currentPage==2" ref="user" />
</view>
<view v-if="!isShowBlackBar" class="tabs-bar" :style="{'height': tabHeight + 'px'}">
<view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==0" class="tabs-image" src="/static/tab/index_selected.png"
mode="heightFix">
</image>
<image v-else class="tabs-image" src="/static/tab/index_unselected.png" mode="heightFix"></image>
</view>
剧场
</view>
<view :class="currentPage == 1?'tab active': 'tab'" @click="tabChange(1)">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==1" class="tabs-image" src="/static/tab/promote_selected.png"
mode="heightFix"></image>
<image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image>
</view>
推荐
</view>
<view :class="currentPage == 2?'tab active': 'tab'" @click="tabChange(2)">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==2" class="tabs-image" src="/static/tab/my_selected.png" mode="heightFix">
</image>
<image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image>
</view>
我的
</view>
</view>
<view v-if="isShowBlackBar" class="tabs-bar2" :style="{'height': tabHeight + 'px'}">
<view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)">
<view class="tabs-bar" :style="'height:'+tabHeight+'px;background-color:'+(isShowBlackBar?'#000000':'#FFFFFF')">
<view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)"
:style="'color:'+(isShowBlackBar?'#FFFFFF':'#000000')">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==0" class="tabs-image" src="/static/tab/index_selected.png"
mode="heightFix">
......@@ -44,7 +18,8 @@
</view>
剧场
</view>
<view :class="currentPage == 1?'tab active': 'tab'" @click="tabChange(1)">
<view :class="currentPage == 1?'tab active': 'tab'" @click="tabChange(1)"
:style="'color:'+(isShowBlackBar?'#FFFFFF':'#000000')">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==1" class="tabs-image" src="/static/tab/promote_selected.png"
mode="heightFix"></image>
......@@ -52,7 +27,8 @@
</view>
推荐
</view>
<view :class="currentPage == 2?'tab active': 'tab'" @click="tabChange(2)">
<view :class="currentPage == 2?'tab active': 'tab'" @click="tabChange(2)"
:style="'color:'+(isShowBlackBar?'#FFFFFF':'#000000')">
<view style="margin-top: 15rpx;">
<image v-if="currentPage==2" class="tabs-image" src="/static/tab/my_selected.png" mode="heightFix">
</image>
......@@ -105,8 +81,8 @@
showEditBar: false,
isFullChoice: false,
isShowBlackBar: false,
clientHeight: app.globalData.clientHeight,
tabHeight: app.globalData.tabHeight,
clientHeight: 0,
tabHeight: 0,
}
},
onLoad(options) {
......@@ -160,6 +136,11 @@
}
},
created() {
const res = tt.getSystemInfoSync()
this.tabHeight = res.windowWidth / 7
this.clientHeight = res.windowHeight - res.windowWidth / 7
},
mounted() {
// 渲染完成 初始化首页数据
this.loadComponentData();
......@@ -228,6 +209,8 @@
<style lang="scss">
.body {
height: 100%;
display: flex;
flex-direction: column;
background-color: #f5f5f5;
}
......@@ -246,22 +229,4 @@
width: 50%;
}
}
.tabs-bar2 {
display: flex;
background-color: black;
.tab {
height: 110rpx;
flex: 1;
text-align: center;
font-size: 26rpx;
font-weight: bold;
color: white;
&.active {
color: #F8425A;
}
}
}
</style>
\ No newline at end of file
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