| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="cu-custom" :style="[{ height: CustomBar + 'px' }]">
- <view class="cu-bar fixed" :style="style" :class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]">
- <view class="action" v-if="isBack">
- <text class="cuIcon-back cu-back text-white" @tap="BackPage" v-if="showBackIcon"></text>
- <slot name="backText"></slot>
- </view>
- <view class="content text-white" :style="[{ top: StatusBar + 'px' }]">
- <text>个人中心</text>
- </view>
- <view style="margin-left: auto;margin-right: 15rpx;color: #fff;font-size: 14px;font-weight: 500;">
- <slot name="right"></slot>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- StatusBar: this.StatusBar,
- CustomBar: this.CustomBar
- };
- },
- name: 'cu-custom',
- computed: {
- style() {
- var StatusBar = this.StatusBar;
- var CustomBar = this.CustomBar;
- var bgImage = this.bgImage;
- var style = `height:${CustomBar}px;padding-top:${StatusBar}px;background-color: rgba(255,255,255,${this.navOpacity}) `;
- if (this.bgImage) {
- style = `${style}background-image:url(${bgImage});`;
- }
- return style;
- }
- },
- props: {
- bgColor: {
- type: String,
- default: ''
- },
- linear: {
- type: Boolean,
- default: false
- },
- isBack: {
- type: [Boolean, String],
- default: false
- },
- showBackIcon: {
- type: Boolean,
- default: true
- },
- bgImage: {
- type: String,
- default: ''
- },
- navOpacity: {
- type: Number,
- default: 0
- }
- },
- methods: {
- BackPage() {
- uni.navigateBack({
- delta: 1
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .liner-height{
- height: 20vh;
- }
- .text-white{
- color: #212121;
- font-size: 30rpx !important;
- font-family: PingFang SC;
- font-weight: bold;
- }
- .cu-custom .content{
- padding-left: 49rpx;
- left: 0;
- text-align: left;
- margin-right: auto;
- margin-left: 0;
- font-weight: unset;
- }
- </style>
|