top-semester.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!-- 头部学期描述组件 -->
  2. <template>
  3. <view>
  4. <!-- 页面标题内容 -->
  5. <view class="flex-row" style="margin: 140rpx 40rpx 0 40rpx;">
  6. <view class="info-box">
  7. <view class="flex-baseline">
  8. <view class="info-title">{{currentYear}}</view>
  9. <view class="info-subtitle">学年</view>
  10. <view class="info-title" style="margin-left: 10rpx;">{{childInfo.periodName}}</view>
  11. </view>
  12. <view class="flex-baseline">
  13. <view class="tag" style="margin-left: 0;">
  14. <view class="tag-text">{{childInfo.schoolName}}</view>
  15. </view>
  16. <view class="tag">
  17. <view class="tag-text">{{childInfo.className}}</view>
  18. </view>
  19. <view class="tag">
  20. <view class="tag-text">{{childInfo.name}}同学</view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapState,
  30. mapMutations
  31. } from 'vuex'
  32. export default {
  33. name: "top-semester",
  34. computed: {
  35. ...mapState('m_children', ['childInfo']),
  36. },
  37. data() {
  38. return {
  39. currentYear: ''
  40. };
  41. },
  42. created() {
  43. this.getYear()
  44. },
  45. methods: {
  46. getYear() {
  47. this.currentYear = new Date().getFullYear()
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .info-box {
  54. display: flex;
  55. flex-direction: column;
  56. height: 170rpx;
  57. justify-content: space-around;
  58. .info-title {
  59. font-size: 70rpx;
  60. font-family: YSfont;
  61. color: #FFF;
  62. z-index: 2;
  63. text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
  64. }
  65. .info-subtitle {
  66. font-size: 40rpx;
  67. font-family: YSfont;
  68. color: #FFF;
  69. z-index: 2;
  70. margin-left: 10rpx;
  71. text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
  72. }
  73. }
  74. .tag {
  75. margin-left: 20rpx;
  76. border-radius: 6rpx;
  77. border: 2px solid #FFF;
  78. padding: 0 6rpx;
  79. z-index: 9;
  80. .tag-text {
  81. font-size: 32rpx;
  82. font-family: YSfont;
  83. color: #FFF;
  84. z-index: 9;
  85. }
  86. }
  87. </style>