top-semester.vue 2.0 KB

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