yangys
2024-01-13 f466ae4fdc645c66c9f25e2e4598b9809e2b41af
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
    <div class="padding">
      <div class="title">{{userInfo.name}}您好,欢迎使用航星MDC展示系统</div>
      <img :src="imgPreFix+ '/home.jpg'" class="logo" v-bind:style="getLogoWidth"/>
      <!--<div v-bind:style="getWrapperStyle"></div>-->
    </div>
</template>
<script>
    import { mapGetters } from 'vuex'
    export default {
      name: 'Home',
      data() {
        return {
          imgPreFix: (process.env.NODE_ENV === 'development' ? '' : '/mdc') + '/static/data/img/'
        }
      },
      computed: {
        ...mapGetters({
          userInfo: 'userInfo',
          mainHeight: 'mainHeight'
        }),
        getLogoWidth() {
          if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
            return { width: '90%' }
          } else {
            return { width: '68%' }
          }
        },
        getWrapperStyle() {
          return {
            width: '100%',
            backgroundImage: `url(${this.imgPreFix}/home.jpg)`,
            height: this.mainHeight + 'px',
            backgroundSize: 'cover',
            backgroundRepeat: 'no-repeat'
          }
        }
      }
    }
</script>
 
<style scoped>
  .title {
    padding: 10px; text-align: center;
  }
 
  .logo {
    display: block;
    width: 70%;
    margin: 0 auto;
  }
</style>