homework.vue 775 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view>
  3. <!-- 头部区域 -->
  4. <top-box :timeStamp="timeStamp" />
  5. <!-- 作业模块 -->
  6. <task-box :current="1"></task-box>
  7. </view>
  8. </template>
  9. <script>
  10. import {
  11. mapState,
  12. mapMutations
  13. } from 'vuex'
  14. export default {
  15. data() {
  16. return {
  17. //时间戳
  18. timeStamp: '',
  19. };
  20. },
  21. onLoad() {
  22. this.init()
  23. },
  24. //刷新页面
  25. onPullDownRefresh() {
  26. this.init()
  27. setTimeout(function() {
  28. uni.stopPullDownRefresh();
  29. }, 1000);
  30. },
  31. methods: {
  32. //初始化页面
  33. init() {
  34. this.timeStamp = (new Date()).format("hh:mm")
  35. },
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. .home-topinfo {
  41. background: linear-gradient($color-yellow, $page-background-color) !important;
  42. }
  43. </style>