提交 0017236f 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

封装电池栏,刘海屏下班、电池栏背景色

上级 90996730
<template> <template>
<section class="header-section" > <section class="header-section" >
<div class="navBar" :style="{height: `${barHeight}Px`,backgroundColor: barColor}"></div> <div class="navBar" :style="{height: `${statusBarHeight}Px`,backgroundColor: statusBarColor}"></div>
<header class="header-container"> <header class="header-container">
<img @click="goBack" src="~/assets/img/icon-back.png" alt=""> <img @click="goBack" src="~/assets/img/icon-back.png" alt="">
{{title}} {{title}}
...@@ -31,18 +31,6 @@ ...@@ -31,18 +31,6 @@
return 1 return 1
} }
}, },
barHeight: {
type: Number,
default:function () {
return 0
}
},
barColor: {
type: String,
default: function () {
return '#ffffff'
}
}
}, },
data() { data() {
return {} return {}
......
<template> <template>
<section class="header-section" > <section class="header-section" >
<div class="navBar" :style="{height: `${barHeight}Px`,backgroundColor: barColor}"></div> <div class="navBar" :style="{height: `${statusBarHeight}Px`,backgroundColor: statusBarColor}"></div>
<header class="header-container"> <header class="header-container">
<img @click="goBack" src="~/assets/img/icon-back.png" alt=""> <img @click="goBack" src="~/assets/img/icon-back.png" alt="">
<div class="head-btn"> <div class="head-btn">
...@@ -45,18 +45,6 @@ ...@@ -45,18 +45,6 @@
return 1 return 1
} }
}, },
barHeight: {
type: Number,
default:function () {
return 0
}
},
barColor: {
type: String,
default: function () {
return '#ffffff'
}
},
headBtn: { headBtn: {
type: Object, type: Object,
default: function () { default: function () {
......
...@@ -55,6 +55,10 @@ module.exports = { ...@@ -55,6 +55,10 @@ module.exports = {
{ {
src: '~plugins/vue-infinite-scroll', src: '~plugins/vue-infinite-scroll',
ssr: false ssr: false
},
{
src: '~plugins/mixins',
ssr: false
} }
], ],
/* /*
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:activeBtnType="activeBtnType" :activeBtnType="activeBtnType"
@handleBtn="changeRanking"> @handleBtn="changeRanking">
</ranking-header> </ranking-header>
<div class="info-container" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info info-hospital" v-if="activeBtnType"> <div class="info info-hospital" v-if="activeBtnType">
<img src="~/assets/img/hospital-ranking/icon-hospital.png" alt=""> <img src="~/assets/img/hospital-ranking/icon-hospital.png" alt="">
<div class="content" v-if="hospitalRanking.score"> <div class="content" v-if="hospitalRanking.score">
...@@ -97,8 +97,6 @@ ...@@ -97,8 +97,6 @@
return { return {
showPop: false, showPop: false,
title: '个人明细', title: '个人明细',
barHeight: 0,
barColor: '#fff',
headBtn: { headBtn: {
leftName: '机构排行榜', leftName: '机构排行榜',
rightName: '人员贡献榜' rightName: '人员贡献榜'
......
...@@ -2,11 +2,9 @@ ...@@ -2,11 +2,9 @@
<section class="invite-details-wrap"> <section class="invite-details-wrap">
<normal-header <normal-header
:title="title" :title="title"
:barHeight="barHeight"
:barColor="barColor"
:backType="1"> :backType="1">
</normal-header> </normal-header>
<div class="main-container" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="main-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="invite-explain"> <div class="invite-explain">
<p class="title">邀请形式</p> <p class="title">邀请形式</p>
<div class="picture-explain"> <div class="picture-explain">
...@@ -103,8 +101,6 @@ ...@@ -103,8 +101,6 @@
return { return {
showPop: false, showPop: false,
title: '邀请明细', title: '邀请明细',
barHeight: 0,
barColor: '#fff',
inviteList: [], inviteList: [],
recordTotal: 0, recordTotal: 0,
recordType: 1, recordType: 1,
......
...@@ -2,11 +2,9 @@ ...@@ -2,11 +2,9 @@
<section class="person-detail-wrap"> <section class="person-detail-wrap">
<normal-header <normal-header
:title="title" :title="title"
:barHeight="barHeight"
:barColor="barColor"
:backType="1"> :backType="1">
</normal-header> </normal-header>
<div class="info-container" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info"> <div class="info">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt=""> <img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt="">
<div class="content"> <div class="content">
...@@ -75,8 +73,6 @@ ...@@ -75,8 +73,6 @@
return { return {
showPop: false, showPop: false,
title: '个人明细', title: '个人明细',
barHeight: 0,
barColor: '#fff',
personDetails: [], personDetails: [],
busy: true, //分页参数--start busy: true, //分页参数--start
pageNo: 0, pageNo: 0,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@handleBtn="changeRanking" @handleBtn="changeRanking"
@handleRightBtn="handleRightBtn"> @handleRightBtn="handleRightBtn">
</ranking-header> </ranking-header>
<div class="info-container" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info"> <div class="info">
<img :src="rankData.avatarImageUrl" alt=""> <img :src="rankData.avatarImageUrl" alt="">
<div class="right"> <div class="right">
...@@ -69,8 +69,6 @@ ...@@ -69,8 +69,6 @@
return { return {
showPop: false, showPop: false,
title: '个人明细', title: '个人明细',
barHeight: 0,
barColor: '#fff',
rankData: {}, rankData: {},
rightBtn: '昨日获奖', rightBtn: '昨日获奖',
headBtn: { headBtn: {
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
<normal-header <normal-header
:title="title" :title="title"
:rightText="rightText" :rightText="rightText"
:barHeight="barHeight"
:barColor="barColor"
:backType="1"> :backType="1">
</normal-header> </normal-header>
<div class="prize-list" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="prize-list" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="item" v-for="(item, index) in rewardsList"> <div class="item" v-for="(item, index) in rewardsList">
<img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon"> <img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon">
<p v-else class="icon-num" >{{index+1}}</p> <p v-else class="icon-num" >{{index+1}}</p>
...@@ -43,8 +41,6 @@ ...@@ -43,8 +41,6 @@
return { return {
showPop: false, showPop: false,
title: '昨日获奖名单', title: '昨日获奖名单',
barHeight: 0,
barColor: '#fff',
rightText: '如何领奖', rightText: '如何领奖',
rewardsList: [], rewardsList: [],
btnText: '今日我要拿奖', btnText: '今日我要拿奖',
......
import Vue from 'vue';
// 设置电池栏高度
const mixins = {
data() {
return {
statusBarHeight: 0,
homeIndicatorHeight: 0,
statusBarColor: '#fff'
}
},
created() {
const _this = this;
if (!_this.$rocNative.isWeb) {
_this.statusBarColor = _this.$rocNative.isAndroid?'#5C5C5C':'#fff'
_this.$rocNative.getStatusBarHeight().then(res => {
// resolve(data)
let height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
_this.statusBarHeight = height;
// 刘海屏底部高度
let homeIndicatorHeight = _this.$rocNative.isIOS ? res.homeIndicatorHeight : res.homeIndicatorHeight / window.devicePixelRatio;
_this.homeIndicatorHeight = homeIndicatorHeight;
})
}
},
mounted() {
},
};
Vue.mixin(mixins);
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册