Commit 27b1db56 authored by jyx's avatar jyx

兼容首页 TAB 超出组件

parent d5dcb753
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
// #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
this.globalData.statusBarHeight = 0; this.globalData.statusBarHeight = 0;
...@@ -49,30 +52,7 @@ ...@@ -49,30 +52,7 @@
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
uni.getSystemInfo({
success: (res => {
this.globalData.clientHeight = res.windowHeight - 50;
})
});
// checkUpdate(this); // checkUpdate(this);
// #ifdef H5
if (window.location.host === 'www.baosheji.cn') {
var icp = document.createElement('div');
icp.innerText = '京ICP备18032652号';
icp.style.color = 'white';
icp.style.textAlign = 'center';
icp.style.position = 'fixed';
icp.style.bottom = '0';
icp.style.left = '0';
icp.style.right = '0';
icp.style.zIndex = '100';
document.body.appendChild(icp);
}
// #endif
}, },
onShow: function(options) { onShow: function(options) {
this.globalData.resetLogin = true this.globalData.resetLogin = true
...@@ -96,6 +76,7 @@ ...@@ -96,6 +76,7 @@
// baseUrl: 'http://192.168.110.71:8301/miniApi', // baseUrl: 'http://192.168.110.71:8301/miniApi',
titleButtonWidth: 38, titleButtonWidth: 38,
clientHeight: 0, clientHeight: 0,
tabHeight: 0,
token: '', token: '',
userId: 0, userId: 0,
inviteUId: '', inviteUId: '',
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view v-if="Math.abs(displayIndex-index)==0" style="height: 100%;" @click="tapVideoHover()"> <view v-if="Math.abs(displayIndex-index)==0" style="height: 100%;" @click="tapVideoHover()">
<tt-video-player v-if="Math.abs(displayIndex-index)==0" :id="'remmend'+list.vedioId" <tt-video-player v-if="Math.abs(displayIndex-index)==0" :id="'remmend'+list.vedioId"
:album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1" :album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1"
object-fit="contain" :controls="controls" :poster="data.coverImage" :loop="!isplay" object-fit="fill" :controls="controls" :poster="data.coverImage" :loop="!isplay"
:autoplay="false" :enable-progress-gesture="false" :show-loading="true" @play="startPlay" :autoplay="false" :enable-progress-gesture="false" :show-loading="true" @play="startPlay"
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" @ended="ended" /> :show-fullscreen-btn="false" @controlstoggle="controlstoggle" @ended="ended" />
</view> </view>
......
<template> <template>
<view class="body"> <view class="body">
<view style="height: 92%;"> <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"> <view v-if="!isShowBlackBar" class="tabs-bar" :style="{'height': tabHeight + 'px'}">
<view :class="currentPage==0?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)">
@click="tabChange(0)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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">
</image> </image>
...@@ -17,18 +16,16 @@ ...@@ -17,18 +16,16 @@
</view> </view>
剧场 剧场
</view> </view>
<view :class="currentPage == 1?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage == 1?'tab active': 'tab'" @click="tabChange(1)">
@click="tabChange(1)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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>
<image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image> <image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image>
</view> </view>
推荐 推荐
</view> </view>
<view :class="currentPage == 2?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage == 2?'tab active': 'tab'" @click="tabChange(2)">
@click="tabChange(2)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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>
<image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image> <image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image>
...@@ -37,10 +34,9 @@ ...@@ -37,10 +34,9 @@
</view> </view>
</view> </view>
<view v-if="isShowBlackBar" class="tabs-bar2"> <view v-if="isShowBlackBar" class="tabs-bar2" :style="{'height': tabHeight + 'px'}">
<view :class="currentPage==0?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage==0?'tab active': 'tab'" @click="tabChange(0)">
@click="tabChange(0)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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">
</image> </image>
...@@ -48,18 +44,16 @@ ...@@ -48,18 +44,16 @@
</view> </view>
剧场 剧场
</view> </view>
<view :class="currentPage == 1?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage == 1?'tab active': 'tab'" @click="tabChange(1)">
@click="tabChange(1)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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>
<image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image> <image v-else class="tabs-image" src="/static/tab/promote_unselected.png" mode="heightFix"></image>
</view> </view>
推荐 推荐
</view> </view>
<view :class="currentPage == 2?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'" <view :class="currentPage == 2?'tab active': 'tab'" @click="tabChange(2)">
@click="tabChange(2)"> <view style="margin-top: 15rpx;">
<view style="margin: 16rpx 0 11rpx;">
<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>
<image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image> <image v-else class="tabs-image" src="/static/tab/my_unselected.png" mode="heightFix"></image>
...@@ -68,7 +62,7 @@ ...@@ -68,7 +62,7 @@
</view> </view>
</view> </view>
<view v-if="showEditBar" class="editBar" :style="'padding-bottom:' + bottomSafePadding + 'px;'"> <view v-if="showEditBar" class="editBar" :style="{'height': tabHeight + 'px'}">
<view class="editItem" @click="!isFullChoice?fullChoice():noChoice()"> <view class="editItem" @click="!isFullChoice?fullChoice():noChoice()">
{{!isFullChoice?'全选':'全不选'}} {{!isFullChoice?'全选':'全不选'}}
</view> </view>
...@@ -87,11 +81,6 @@ ...@@ -87,11 +81,6 @@
import common from '@/mixins/common'; import common from '@/mixins/common';
const app = getApp(); const app = getApp();
// 首页
// import indexPage from "@/pages/index/index.vue";
// import recommendPage from "@/pages/recommend/recommend.vue";
// import userPage from "@/pages/my/my.vue";
import indexPage from "@/components/home/index.vue"; import indexPage from "@/components/home/index.vue";
import recommendPage from "@/components/home/recommend.vue"; import recommendPage from "@/components/home/recommend.vue";
import userPage from "@/components/home/my.vue"; import userPage from "@/components/home/my.vue";
...@@ -110,7 +99,9 @@ ...@@ -110,7 +99,9 @@
currentPage: 0, currentPage: 0,
showEditBar: false, showEditBar: false,
isFullChoice: false, isFullChoice: false,
isShowBlackBar: false isShowBlackBar: false,
clientHeight: app.globalData.clientHeight,
tabHeight: app.globalData.tabHeight,
} }
}, },
onLoad(options) { onLoad(options) {
......
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