homework.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="homework-container">
  3. <!-- 头部区域 -->
  4. <top-box :timeStamp="timeStamp"></top-box>
  5. <view class="module-container">
  6. <u-tabs :list="list" :current="current" @change="changeModule"
  7. :activeStyle="{color: '#5b7cff',fontWeight: 'bold',transform: 'scale(1.04)',}"
  8. :inactiveStyle="{fontWeight: 'bold',transform: 'scale(1)'}" lineColor="#5b7cff" lineWidth="60"></u-tabs>
  9. <!-- 详情模块 -->
  10. <view class="module-box" v-if="current == 0">
  11. <view class="card">
  12. <text class="card-title">今日评测数:</text>
  13. <view class="image"></view>
  14. </view>
  15. </view>
  16. <view class="module-box" v-if="current == 1"></view>
  17. <view class="module-box" v-if="current == 2"></view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. //模块名
  26. list: [{
  27. name: '评测详情'
  28. }, {
  29. name: '活动详情'
  30. }, {
  31. name: '作业详情'
  32. }],
  33. //当前模块
  34. current: 0,
  35. //时间戳
  36. timeStamp: '',
  37. //卡片内容
  38. card: [{
  39. title: '评测详情',
  40. color: 'background-color: #8c8ff6;',
  41. icon: '$test-base64'
  42. }, {
  43. title: '作业详情',
  44. color: 'background-color: #64d2fd;',
  45. icon: '$homework-base64'
  46. }, {
  47. title: '活动详情',
  48. color: 'background-color: #ff8caf;',
  49. icon: '$actility-base64'
  50. }]
  51. };
  52. },
  53. onLoad() {
  54. this.$getTimeStamp()
  55. },
  56. //刷新页面
  57. onPullDownRefresh() {
  58. this.$getTimeStamp()
  59. console.log('refresh');
  60. setTimeout(function() {
  61. uni.stopPullDownRefresh();
  62. }, 1000);
  63. },
  64. methods: {
  65. //更改模块
  66. changeModule(index) {
  67. this.current = index.index
  68. },
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .homework-container {
  74. .home-topinfo {
  75. background: linear-gradient(#ff8419, $page-background-color) !important;
  76. }
  77. }
  78. .module-container {
  79. margin: -70rpx 20rpx 0 20rpx;
  80. .card {
  81. display: flex;
  82. justify-content: space-between;
  83. margin: 40rpx auto 20rpx auto;
  84. height: 250rpx;
  85. width: 96%;
  86. background: linear-gradient(to right, #fd76007a,#ff8419);
  87. border-radius: $card-border-radius;
  88. .card-title{
  89. font-size: 40rpx;
  90. font-weight: bold;
  91. color: #FFF;
  92. }
  93. .image {
  94. position: relative;
  95. top: -40rpx;
  96. right: -200rpx;
  97. height: 500rpx;
  98. width: 500rpx;
  99. background-image: $test-base64;
  100. background-size: contain;
  101. background-repeat: no-repeat;
  102. z-index: 2;
  103. }
  104. }
  105. }
  106. .t-icon {
  107. margin: 20rpx;
  108. width: 110rpx;
  109. height: 110rpx;
  110. }
  111. </style>