pageHead.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="horHead horSty">
  3. <div class="horHead-content">
  4. <!-- <img :src="title" /> 北京中海OFFICEZIP -->
  5. <div class="firtitle">之江实验室一期西区</div>
  6. <!-- <div class="firtitle">北京中海OFFICEZIP</div> -->
  7. <div class="sectitle">懂空间,更懂办公</div>
  8. </div>
  9. <div></div>
  10. <div class="horHead-left">
  11. <img :src="logo" alt="" style="height:60px;" />
  12. </div>
  13. <div class="horHead-right">
  14. <div class="right-item">
  15. <span class="item-time">{{ nowstr }}</span>
  16. </div>
  17. <div class="right-item">
  18. {{ weatherText }}
  19. </div>
  20. <div class="right-item" @click="changeScreen">
  21. <img
  22. class="firstImg"
  23. :src="nowScreen == 'vertical' ? changeHor : changeVer"
  24. alt=""
  25. />
  26. </div>
  27. <div class="right-item" style="display:none">
  28. 退出
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script lang="ts">
  34. import Vue from "vue";
  35. declare function require(img: string): string;
  36. const persagyLogo = require("@/assets/horImg/persagyLogo.svg");
  37. const zhijiangLogo = require("@/assets/horImg/zhijianglogo.png");
  38. const title = require("@/assets/horImg/hor_title.png");
  39. const changeVer = require("@/assets/horImg/changeVer.svg");
  40. const changeHor = require("@/assets/horImg/changeHor.svg");
  41. import { mapState } from "vuex";
  42. import moment from "moment";
  43. export default Vue.extend({
  44. data() {
  45. return {
  46. logo: zhijiangLogo,
  47. //logo:persagyLogo,
  48. title: title,
  49. changeVer: changeVer,
  50. changeHor: changeHor,
  51. nowScreen: "vertical",
  52. nowstr: "",
  53. // weatherText:''
  54. };
  55. },
  56. mounted() {
  57. // console.log("route", this.$route);
  58. // console.log("router", this.$router);
  59. var path = this.$route.path;
  60. if (path.indexOf("horizontalScreen") > -1) {
  61. this.nowScreen = "horizontal";
  62. } else if (path.indexOf("verticalScreen") > -1) {
  63. this.nowScreen = "vertical";
  64. }
  65. this.nowstr = moment().format("YYYY.MM.DD HH:mm");
  66. setInterval(() => {
  67. this.nowstr = moment().format("YYYY.MM.DD HH:mm");
  68. }, 5000);
  69. },
  70. computed: {
  71. ...mapState({
  72. weatherText(state: any) {
  73. //debugger;
  74. var text = state.weatherCont.text || "晴";
  75. return text;
  76. },
  77. }),
  78. },
  79. methods: {
  80. changeScreen() {
  81. if (this.nowScreen == "vertical") {
  82. this.nowScreen = "horizontal";
  83. this.$router.push({ name: "horizontalScreen" });
  84. } else {
  85. this.nowScreen = "vertical";
  86. this.$router.push({ name: "verticalScreen" });
  87. }
  88. },
  89. },
  90. });
  91. </script>
  92. <style lang="less" scoped>
  93. .horHead {
  94. // display: flex;
  95. // justify-content: space-between;
  96. // align-items: center;
  97. position: relative;
  98. &.horSty {
  99. height: 74px;
  100. // width: 1840px;
  101. }
  102. .horHead-content {
  103. width: 100%;
  104. height: 100%;
  105. color: #3b3558;
  106. text-align: center;
  107. .firtitle {
  108. font-weight: 700;
  109. font-size: 38px;
  110. font-family: Alibaba PuHuiTi;
  111. }
  112. .sectitle {
  113. font-weight: 500;
  114. font-size: 16px;
  115. letter-spacing: 8px;
  116. }
  117. }
  118. .horHead-left {
  119. position: absolute;
  120. top: 0;
  121. left: 0;
  122. }
  123. .horHead-right {
  124. position: absolute;
  125. top: 0;
  126. right: 0;
  127. display: flex;
  128. // justify-content: space-between;
  129. height: 46px;
  130. // width: 396px;
  131. .right-item {
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. cursor: pointer;
  136. padding: 12px 16px;
  137. font-size: 16px;
  138. color: #575271;
  139. font-weight: 400;
  140. line-height: 22px;
  141. margin-left: 10px;
  142. background: #ffffff99;
  143. border: 2px solid #ffffffcc;
  144. box-sizing: border-box;
  145. border-radius: 8px;
  146. .firstImg {
  147. margin-right: 6px;
  148. }
  149. .item-time {
  150. font-family: Persagy;
  151. font-weight: 400;
  152. }
  153. }
  154. }
  155. }
  156. </style>