大湾社区城市书房智慧大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.5 KiB

2 days ago
  1. <template>
  2. <div class="header-container">
  3. <div class="header-text header-date">
  4. <div class="time">{{ nowDate.split(' ')[1] }}</div>
  5. <div class="time-other">
  6. <span>{{ currentWeek }}</span>
  7. <span>{{ nowDate.split(' ')[0] }}</span>
  8. </div>
  9. </div>
  10. <div class="header-title">
  11. <h2>{{ headerTitle }}</h2>
  12. <div class="header-bottom">
  13. <span class="bottom-block" />
  14. </div>
  15. <div class="dot-container left-dots">
  16. <div class="dot" />
  17. <div class="dot" />
  18. <div class="dot" />
  19. </div>
  20. <div class="dot-container right-dots">
  21. <div class="dot" />
  22. <div class="dot" />
  23. <div class="dot" />
  24. </div>
  25. </div>
  26. <div style="display: flex; justify-content: flex-end; align-items: center; position: absolute; right: .175rem; top: .175rem; ">
  27. <div class="header-weather">
  28. <!-- 天气api: https://www.tianqi.com/plugin -->
  29. <!-- <iframe id="weather" width="400" scrolling="no" height="30" frameborder="0" allowtransparency="true" src="https://i.tianqi.com?c=code&id=34&color=%23FFFFFF&icon=1&py=wuhan&site=18" /> -->
  30. <iframe height="50" frameborder="0" scrolling="no" hspace="0" src="https://i.tianqi.com/?c=code&a=getcode&id=52&icon=1&color=%23FFFFFF&py=qiyang&site=14" />
  31. </div>
  32. <div class="header-page">{{ (currentIndex+1) +' / '+ pageData.length }}</div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import { getCurrentTime } from '@/utils/index'
  38. export default {
  39. name: 'Header',
  40. props: {
  41. headerTitle: {
  42. type: String,
  43. default: function() {
  44. return ''
  45. }
  46. },
  47. currentIndex: {
  48. type: Number,
  49. default: function() {
  50. return 0
  51. }
  52. },
  53. pageData: {
  54. type: Array,
  55. default: function() {
  56. return []
  57. }
  58. }
  59. },
  60. data() {
  61. return {
  62. nowDate: '',
  63. currentWeek: this.getCurrentWeek()
  64. }
  65. },
  66. watch: {
  67. headerTitle: function() {
  68. }
  69. },
  70. created() {
  71. this.timer = setInterval(() => {
  72. this.nowDate = getCurrentTime()
  73. }, 1000)
  74. },
  75. mounted() {
  76. },
  77. methods: {
  78. getCurrentWeek() {
  79. const days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  80. const date = new Date()
  81. return days[date.getDay()]
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. @import "~@/assets/styles/index.scss";
  88. </style>