timetable.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="content">
  3. <u-calendar v-model="timeShow" mode="date" :active-bg-color="mainColor" :availableBgColor="mainColor" btn-type="error"
  4. availableText="有课" popupMode="top" :available="availableList" max-date="2300-12-31" :closeable="false"
  5. :mask-close-able="false" :handleStatus="false" :popupMask="false" toolTip=" "></u-calendar>
  6. <u-top-tips ref="uTips"></u-top-tips>
  7. </view>
  8. </template>
  9. <script>
  10. import {
  11. mapGetters
  12. } from 'vuex'
  13. const NET = require('@/utils/request')
  14. const API = require('@/config/api')
  15. export default {
  16. computed: {
  17. ...mapGetters([
  18. 'mainColor',
  19. 'customStyle',
  20. ])
  21. },
  22. data() {
  23. return {
  24. timeShow: true,
  25. availableList: []
  26. }
  27. },
  28. onLoad() {
  29. NET.request(API.getTimetableList, {}, 'POST').then(res => {
  30. this.availableList = res.data.map(site => {
  31. return site.beginsDate
  32. })
  33. }).catch(error => {
  34. this.$refs.uTips.show({
  35. title: error.message,
  36. type: 'warning',
  37. })
  38. })
  39. },
  40. onReady() {},
  41. methods: {},
  42. }
  43. </script>
  44. <style>
  45. page {
  46. width: 100%;
  47. height: 100%;
  48. position: relative;
  49. }
  50. </style>
  51. <style lang="scss" scoped>
  52. .content {
  53. width: 100%;
  54. float: left;
  55. height: 100%;
  56. }
  57. </style>