Commit 3f394110 authored by jyx's avatar jyx

修复首页加载不全问题

parent e243d027
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
// #endif // #endif
this.globalData.windowWidth = res.windowWidth; this.globalData.windowWidth = res.windowWidth;
this.globalData.clientHeight = res.windowHeight - this.globalData.windowWidth / 7;
this.globalData.tabHeight = this.globalData.windowWidth / 7;
// 抖音 // 抖音
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
...@@ -75,8 +73,6 @@ ...@@ -75,8 +73,6 @@
// baseUrl: 'http://test.mints-id.com/camera-api/miniApi', // baseUrl: 'http://test.mints-id.com/camera-api/miniApi',
// baseUrl: 'http://192.168.110.71:8301/miniApi', // baseUrl: 'http://192.168.110.71:8301/miniApi',
titleButtonWidth: 38, titleButtonWidth: 38,
clientHeight: 0,
tabHeight: 0,
token: '', token: '',
userId: 0, userId: 0,
inviteUId: '', inviteUId: '',
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<image :src="maskImage2" mode="widthFix"></image> <image :src="maskImage2" mode="widthFix"></image>
</view> </view>
<scroll-view v-if="clientHeight != 0" scroll-y :style="{'height': clientHeight + 'px'}" @scroll="onScroll"> <scroll-view scroll-y :style="{'height': clientHeight + 'px'}" @scroll="onScroll">
<view class="content"> <view class="content">
<swiper class="banner" :indicator-dots="true" :autoplay="true" :interval="2000" :duration="500"> <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)"> <swiper-item v-for="banner in bannerList" :key="banner.vedioId" @click="handleBanner(banner)">
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
showMask: false, showMask: false,
maskImage1: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find1.png', maskImage1: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find1.png',
maskImage2: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find2.png', maskImage2: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find2.png',
clientHeight: app.globalData.clientHeight, clientHeight: 0,
page: 1, page: 1,
size: 10, size: 10,
loadStatus: 'loadmore' loadStatus: 'loadmore'
...@@ -218,6 +218,10 @@ ...@@ -218,6 +218,10 @@
// 匹配视频 // 匹配视频
this.showFirstDialog(); this.showFirstDialog();
}, },
created() {
const res = tt.getSystemInfoSync();
this.clientHeight = res.windowHeight - res.windowWidth / 7
},
methods: { methods: {
onScroll(event) { onScroll(event) {
// 获取scrollview已滚动的高度 // 获取scrollview已滚动的高度
......
<template> <template>
<view class="body"> <view class="body">
<scroll-view v-if="clientHeight != 0" scroll-y :style="{'height': clientHeight + 'px'}" @scroll="onScroll"> <scroll-view scroll-y>
<view <view
:style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'"> :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> <image class="avatar" src="@/static/logo-about.png"></image>
...@@ -104,7 +104,6 @@ ...@@ -104,7 +104,6 @@
versionName: app.globalData.versionName, versionName: app.globalData.versionName,
corpid: '', // 企业ID corpid: '', // 企业ID
curl: '', // 客服链接 curl: '', // 客服链接
clientHeight: app.globalData.clientHeight,
}; };
}, },
......
<template> <template>
<view v-if="clientHeight != 0" :style="{'height': clientHeight + 'px;background: white;'}"> <view style="background-color: white;height: 100%;">
<view class="tabContainer" :style=" <view class="tabContainer" :style="
'height:' + 'height:' +
titleBarHeight + titleBarHeight +
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
showTap: false, showTap: false,
titleBarHeight: app.globalData.titleBarHeight, titleBarHeight: app.globalData.titleBarHeight,
statusBarHeight: app.globalData.statusBarHeight, statusBarHeight: app.globalData.statusBarHeight,
clientHeight: app.globalData.clientHeight,
} }
}, },
onLoad(e) {}, onLoad(e) {},
......
<template> <template>
<view class="body"> <view class="body">
<view v-if="clientHeight!=0" :style="{'height': clientHeight + 'px'}"> <view :style="{'height': clientHeight + 'px;'}">
<indexPage v-show="currentPage==0" ref="index" /> <indexPage v-show="currentPage==0" ref="index" />
<recommendPage v-on:showEditBarH="showEditBarH" v-on:changeBottomBarColor="changeBottomBarColor" <recommendPage v-on:showEditBarH="showEditBarH" v-on:changeBottomBarColor="changeBottomBarColor"
v-show="currentPage==1" ref="recommend" /> v-show="currentPage==1" ref="recommend" />
<userPage v-show="currentPage==2" ref="user" /> <userPage v-show="currentPage==2" ref="user" />
</view> </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="tabs-bar" :style="'height:'+tabHeight+'px;background-color:'+(isShowBlackBar?'#000000':'#FFFFFF')">
<view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)"> <view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)"
:style="'color:'+(isShowBlackBar?'#FFFFFF':'#000000')">
<view style="margin-top: 15rpx;"> <view style="margin-top: 15rpx;">
<image v-if="currentPage==0" class="tabs-image" src="/static/tab/index_selected.png" <image v-if="currentPage==0" class="tabs-image" src="/static/tab/index_selected.png"
mode="heightFix"> mode="heightFix">
...@@ -44,7 +18,8 @@ ...@@ -44,7 +18,8 @@
</view> </view>
剧场 剧场
</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;"> <view style="margin-top: 15rpx;">
<image v-if="currentPage==1" class="tabs-image" src="/static/tab/promote_selected.png" <image v-if="currentPage==1" class="tabs-image" src="/static/tab/promote_selected.png"
mode="heightFix"></image> mode="heightFix"></image>
...@@ -52,7 +27,8 @@ ...@@ -52,7 +27,8 @@
</view> </view>
推荐 推荐
</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;"> <view style="margin-top: 15rpx;">
<image v-if="currentPage==2" class="tabs-image" src="/static/tab/my_selected.png" mode="heightFix"> <image v-if="currentPage==2" class="tabs-image" src="/static/tab/my_selected.png" mode="heightFix">
</image> </image>
...@@ -100,10 +76,15 @@ ...@@ -100,10 +76,15 @@
showEditBar: false, showEditBar: false,
isFullChoice: false, isFullChoice: false,
isShowBlackBar: false, isShowBlackBar: false,
clientHeight: app.globalData.clientHeight, clientHeight: 0,
tabHeight: app.globalData.tabHeight, tabHeight: 0,
} }
}, },
created() {
const res = tt.getSystemInfoSync()
this.tabHeight = res.windowWidth / 7
this.clientHeight = res.windowHeight - res.windowWidth / 7
},
onLoad(options) { onLoad(options) {
let index = options.index ?? '' let index = options.index ?? ''
if (index != '' && index != undefined) { if (index != '' && index != undefined) {
...@@ -222,6 +203,8 @@ ...@@ -222,6 +203,8 @@
<style lang="scss"> <style lang="scss">
.body { .body {
display: flex;
flex-direction: column;
height: 100%; height: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
...@@ -241,22 +224,4 @@ ...@@ -241,22 +224,4 @@
width: 50%; 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> </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