classlist.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  3. <back :text="'课程列表'"></back>
  4. <view class="card-box">
  5. <view class="card-item" style="width: 100%;">
  6. <view class="card-info">
  7. <view class="t-icon t-icon-shuji1"></view>
  8. <text class="info-text">今日课程列表</text>
  9. </view>
  10. <view class="home-title-text">
  11. <view class="msg">课程数:</view>
  12. <view class="card-content">{{classList.length}}</view>
  13. <view style="display: flex; align-items: center; margin-left: auto; margin-right: 30rpx;">
  14. <view class="t-icon t-icon-yuyue-lishi-shijian"></view>
  15. <view class="msg" style="margin-left: 10rpx;">{{today}}</view>
  16. <view class="msg" style="margin-left: 10rpx;">{{week}}</view>
  17. </view>
  18. </view>
  19. <!-- 课程列表 -->
  20. <view style="margin-bottom: 20rpx;">
  21. <view class="block-box" v-for="(item,index) in classList" :key="index">
  22. <view class="index"></view>
  23. <view class="class-block" style="width: 85%;">
  24. <view class="block-title">{{item.name}}</view>
  25. <view class="block-tag-box">
  26. <view class="block-tag">{{item.teacher}}</view>
  27. </view>
  28. <view class="block-subtitle">{{item.timeFrame}}</view>
  29. <view class="block-title">{{item.time}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="card-item" style="width: 100%;">
  35. <view class="card-info">
  36. <view class="t-icon t-icon-zhishi"></view>
  37. <text class="info-text">本周课程表</text>
  38. </view>
  39. <z-table class="table" :tableData="weekClassTable" :columns="columns">
  40. </z-table>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. mapState
  48. } from 'vuex'
  49. export default {
  50. computed: {
  51. ...mapState('m_children', ['classList'])
  52. },
  53. data() {
  54. return {
  55. columns: [{
  56. 'title': '课程表',
  57. 'key': '课程表',
  58. 'width': 220,
  59. },
  60. {
  61. 'title': '周一',
  62. 'key': '周一',
  63. },
  64. {
  65. 'title': '周二',
  66. 'key': '周二',
  67. },
  68. {
  69. 'title': '周三',
  70. 'key': '周三',
  71. },
  72. {
  73. 'title': '周四',
  74. 'key': '周四',
  75. },
  76. {
  77. 'title': '周五',
  78. 'key': '周五',
  79. },
  80. ],
  81. weekClassTable: [{
  82. '课程表': '上午一节',
  83. '周一': '语文',
  84. '周二': '数学',
  85. '周三': '外语',
  86. '周四': '语文',
  87. '周五': '数学',
  88. },
  89. {
  90. '课程表': '上午二节',
  91. '周一': '数学',
  92. '周二': '外语',
  93. '周三': '语文',
  94. '周四': '数学',
  95. '周五': '外语',
  96. },
  97. {
  98. '课程表': '上午三节',
  99. '周一': '外语',
  100. '周二': '语文',
  101. '周三': '数学',
  102. '周四': '外语',
  103. '周五': '语文',
  104. },
  105. {
  106. '课程表': '下午一节',
  107. '周一': '思品',
  108. '周二': '体育',
  109. '周三': '科学',
  110. '周四': '思品',
  111. '周五': '体育',
  112. },
  113. {
  114. '课程表': '下午二节',
  115. '周一': '体育',
  116. '周二': '科学',
  117. '周三': '思品',
  118. '周四': '体育',
  119. '周五': '科学',
  120. },
  121. {
  122. '课程表': '下午三节',
  123. '周一': '科学',
  124. '周二': '思品',
  125. '周三': '体育',
  126. '周四': '科学',
  127. '周五': '思品',
  128. }
  129. ],
  130. today: '',
  131. week: ''
  132. };
  133. },
  134. onLoad() {
  135. this.getToday()
  136. },
  137. methods: {
  138. getToday(){
  139. this.today = (new Date()).format('M-d').replace('-','月')+'日'
  140. this.week = "星期" + "日一二三四五六".charAt(new Date().getDay());
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. @import '@/pages/common/blockmsg.scss';
  147. .card-box {
  148. display: flex;
  149. flex-flow: column wrap;
  150. margin: 0 20rpx 0 20rpx;
  151. justify-content: space-between;
  152. .card-item {
  153. margin: 2% 0;
  154. width: 48%;
  155. height: auto;
  156. display: flex;
  157. flex-direction: column;
  158. justify-content: space-around;
  159. background-color: #FFF;
  160. // box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  161. border-radius: $card-border-radius;
  162. .card-info {
  163. display: flex;
  164. align-items: center;
  165. padding: 20rpx;
  166. .info-text {
  167. font-size: 30rpx;
  168. font-weight: bold;
  169. color: #3B4144;
  170. margin-left: 10rpx;
  171. }
  172. }
  173. }
  174. }
  175. .card-content {
  176. font-size: 35rpx;
  177. margin: 10rpx 0 10rpx 25rpx;
  178. color: $u-primary;
  179. font-weight: bold;
  180. }
  181. .home-title-text {
  182. display: flex;
  183. align-items: center;
  184. flex-wrap: wrap;
  185. margin: 10rpx 0 10rpx 0;
  186. }
  187. .msg {
  188. color: $color-title;
  189. margin-left: 30rpx;
  190. font-size: 30rpx;
  191. }
  192. .t-icon {
  193. width: 40rpx;
  194. height: 40rpx;
  195. }
  196. //表格
  197. .table {
  198. margin: 0 auto 20rpx auto;
  199. width: 93%;
  200. height: 100%;
  201. }
  202. </style>