tanghaolin
2023-01-11 50ad0a40d942624f7fcdfa8af3bc67d656a747a3
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!--  -->
<template>
  <div class="head">
    <div class="left">
      &nbsp;<span style="color: #ff9900">{{ time }}</span> &nbsp;<span>{{
        date
      }}</span>
      &nbsp;<span>{{ daystr }}</span>
    </div>
    <div class="title">{{title}}</div>
    <div class="right">
      <slot></slot>
    </div>
  </div>
</template>
 
<script>
import axios from "axios";
import * as $ from "jquery";
 
export default {
  name: "tophead",
  props:{
    title:{
      type:String,
      default:'标题'
    }
  },
  components: {},
  data() {
    return {
      date: "",
      time: "",
      daystr: "",
      weather: "",
      weatherinfo: "",
      winddirect: "",
      windpower: "",
      /**公司列表 */
      corpList: [],
    };
  },
  created() {},
  mounted() {
    setInterval(() => {
      this.refreshTimeInTop();
    }, 1000);
    // this.GetCorpFlagList();
  },
  computed: {},
  watch: {},
  methods: {
    refreshTimeInTop() {
      var time = new Date();
      var year = time.getFullYear();
      var month = time.getMonth() + 1;
      if (month < 10) {
        month = "0" + month;
      }
      var day = time.getDate();
      if (day < 10) {
        day = "0" + day;
      }
 
      let dayi = time.getDay();
      let dayobj = {
        0: "星期天",
        1: "星期一",
        2: "星期二",
        3: "星期三",
        4: "星期四",
        5: "星期五",
        6: "星期六",
      };
      let daystr = dayobj[dayi];
      var h = time.getHours();
      var m = time.getMinutes();
      var s = time.getSeconds();
 
      h = h < 10 ? "0" + h : h;
      m = m < 10 ? "0" + m : m;
      s = s < 10 ? "0" + s : s;
      this.date = `${year}-${month}-${day}`;
      this.time = `${h}:${m}:${s}`;
      this.daystr = daystr;
    },
    
  },
};
</script>
<style scoped>
 
.head {
  background: url("../assets/images/head_top.png") no-repeat;
  background-size: 100% 100%;
  height: 100px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  color: #fff;
}
.head .left {
  width: 600px;
  height: 80px;
  line-height: 66px;
  text-align: center;
}
.head .left span {
  display: inline-block;
  height: 80px;
  line-height: 66px;
  font-size: 24px;
}
.head .right {
  width: 650px;
  height: 80px;
  line-height: 66px;
  text-align: center;
}
.head .right span {
  display: inline-block;
  height: 80px;
  line-height: 66px;
  font-size: 24px;
}
.head .title {
  flex: 1;
  height: 80px;
  line-height: 80px;
  font-size: 32px;
  padding-left: 230px;
}
</style>
 
<style>
 
</style>