12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <view>
- <u-navbar :class="title ? 'navbarL' : 'navbarC'" :is-back="false" :title="title" :border-bottom="false"
- :height="height" title-color="#ffffff" back-icon-color="#ffffff" :background="background">
- <view class="slot-wrap" v-if="isShowLogo">
- <!-- #ifdef MP-WEIXIN -->
- <image :src="$method.splitImgHost(header.wxlogo)" @load="load"
- :style="{ width: imgwidth + 'rpx', height: imgheight + 'rpx' }" />
- <!-- #endif -->
- <!-- #ifdef H5 -->
- <image :src="$method.splitImgHost(header.h5logo)" @load="load"
- :style="{ width: imgwidth + 'rpx', height: imgheight + 'rpx' }" />
- <!-- #endif -->
- </view>
- </u-navbar>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from "vuex";
- export default {
- name: "NavLogo",
- props: {
- title: {
- type: String,
- default: "",
- },
- isShowLogo: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- height: 50,
- imgwidth: 0,
- imgheight: 0,
- background: {
- backgroundColor: 'rgb(0, 122, 255)',
- }
- };
- },
- mounted() {},
- computed: {
- ...mapGetters(["userInfo", "header"]),
- },
- methods: {
- load(e) {
- console.log(e, 'e')
- this.imgwidth = e.detail.width;
- this.imgheight = e.detail.height;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .navbarL {
- image {
- margin-left: 20rpx;
- }
- img {
- margin-left: 20rpx;
- }
- }
- .navbarC {
- /deep/ .u-navbar-inner {
- margin-right: 0 !important;
- }
- .slot-wrap {
- width: 100vw;
- display: flex;
- align-items: center;
- image {
- margin-left: 20rpx;
- width: 178rpx;
- height: 31rpx;
- }
- }
- }
- </style>
|