homework.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="homework-container">
  3. <!-- 头部区域 -->
  4. <top-box :timeStamp="timeStamp"></top-box>
  5. <text class="card-title">孩子今日任务</text>
  6. <view class="card-box">
  7. <view class="box-list">
  8. <view class="box-card" v-for="(item,index) in card" :key="index" :style="item.color">
  9. <view>
  10. <view class="card-name">{{item.title}}</view>
  11. </view>
  12. <view class="radio">
  13. <view class=""></view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="box-detail">
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. //时间戳
  27. timeStamp: '',
  28. //卡片内容
  29. card: [{
  30. title: '评测',
  31. color: 'background-color: #0080ff;',
  32. icon: ''
  33. }, {
  34. title: '作业',
  35. color: 'background-color: #ff8caf;'
  36. }, {
  37. title: '活动',
  38. color: 'background-color: #f9c752;'
  39. }]
  40. };
  41. },
  42. onLoad() {
  43. this.$getTimeStamp()
  44. },
  45. //刷新页面
  46. onPullDownRefresh() {
  47. this.$getTimeStamp()
  48. console.log('refresh');
  49. setTimeout(function() {
  50. uni.stopPullDownRefresh();
  51. }, 1000);
  52. },
  53. }
  54. </script>
  55. <style lang="scss">
  56. .homework-container {
  57. display: flex;
  58. flex-direction: column;
  59. .home-topinfo {
  60. background: linear-gradient($color-green, $page-background-color) !important;
  61. }
  62. .card-title {
  63. font-size: 45rpx;
  64. font-weight: bold;
  65. color: #FFF;
  66. padding: 0 0 30rpx 50rpx;
  67. margin-top: -90rpx;
  68. }
  69. .card-box {
  70. position: relative;
  71. box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
  72. background-color: #FFF;
  73. border-radius: 50rpx;
  74. width: 100%;
  75. height: 100vh;
  76. .box-list {
  77. margin: 40rpx auto;
  78. width: 96%;
  79. height: auto;
  80. display: flex;
  81. flex-direction: row;
  82. justify-content: space-between;
  83. background-color: #000000;
  84. .box-card {
  85. width: 30%;
  86. height: 300rpx;
  87. display: flex;
  88. flex-direction: column;
  89. align-items: center;
  90. border-radius: $card-border-radius;
  91. .card-name {
  92. color: #FFF;
  93. margin: 15rpx 0 15rpx 0;
  94. font-size: 35rpx;
  95. font-weight: bold;
  96. }
  97. .radio {
  98. width: 140rpx;
  99. height: 140rpx;
  100. border-radius: 100%;
  101. background: #FFF;
  102. }
  103. }
  104. }
  105. }
  106. }
  107. .box-detail {
  108. position: relative;
  109. background-color: #666;
  110. border-radius: $card-border-radius;
  111. margin: 40rpx auto;
  112. width: 96%;
  113. height: 500rpx;
  114. }
  115. .box-detail::before {
  116. content: " ";
  117. position: absolute;
  118. right: 13%;
  119. top: -35rpx;
  120. border-bottom: 50px solid #666;
  121. border-right-color: #666;
  122. }
  123. </style>