index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="content">
  3. <u-navbar back-icon-size="0" title="星火纵横" :title-color="mainColor" title-bold></u-navbar>
  4. <u-card :head-border-bottom="false" :foot-border-top="false" padding="0px" margin="10px" borderRadius="40" v-for="(item, index) in cardList"
  5. :key="index" class="card-box" @click="goToHandle(item)">
  6. <view class="card-content" slot="body">
  7. <view class="iconfont" :class="item.icon"></view>
  8. <view class="card-label">{{item.label}}</view>
  9. <view class="iconfont iconjinru"></view>
  10. </view>
  11. </u-card>
  12. <u-top-tips ref="uTips"></u-top-tips>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. mapGetters
  18. } from 'vuex'
  19. const NET = require('@/utils/request')
  20. const API = require('@/config/api')
  21. export default {
  22. computed: {
  23. ...mapGetters([
  24. 'mainColor',
  25. ])
  26. },
  27. data() {
  28. return {
  29. cardList: [
  30. /*{
  31. icon: 'iconzu4931',
  32. label: '我的补课',
  33. path: 'extraLessonsForm'
  34. },*/
  35. {
  36. icon: 'iconwodebanji',
  37. label: '我的班级',
  38. path: 'classList'
  39. },
  40. {
  41. icon: 'iconwodepaiban',
  42. label: '我的排班',
  43. path: 'timetable'
  44. }
  45. ]
  46. }
  47. },
  48. onLoad() {
  49. // uni.setStorage({
  50. // key: 'token',
  51. // data: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDT0FDSDo4OSJ9.7DPbdHQIkhpCXE2Tf6eHkdl0Y69C6kbRwntVdKm4DXu1_LlP1ue_2t4LKW0CYLm-enBRzBvIxkgvYjZSoKhqSA'
  52. // })
  53. if (!uni.getStorageSync('token')) {
  54. uni.navigateTo({
  55. url: '/pages/login/index'
  56. });
  57. }
  58. },
  59. methods: {
  60. // 跳转
  61. goToHandle(item) {
  62. uni.removeStorageSync({
  63. key: 'extraLessonsUserList'
  64. })
  65. uni.navigateTo({
  66. url: '/pagesClass/' + item.path
  67. });
  68. },
  69. },
  70. }
  71. </script>
  72. <style>
  73. page {
  74. width: 100%;
  75. height: 100%;
  76. background-color: #f7f7f7;
  77. }
  78. </style>
  79. <style lang="scss" scoped>
  80. @import "@/static/css/themes.scss";
  81. .content {
  82. width: 100%;
  83. float: left;
  84. /deep/.u-navbar {
  85. .u-title {
  86. font-weight: bold;
  87. }
  88. }
  89. .card-box {
  90. .card-content {
  91. padding: 20px 15px;
  92. display: flex;
  93. align-items: center;
  94. .iconfont {
  95. width: 40px;
  96. height: 40px;
  97. font-size: 32px;
  98. color: $mainColor;
  99. display: flex;
  100. align-items: center;
  101. }
  102. .card-label {
  103. font-size: 16px;
  104. font-weight: bold;
  105. flex: 1;
  106. margin-left: 10px;
  107. }
  108. .iconjinru {
  109. font-size: 22px;
  110. justify-content: flex-end;
  111. }
  112. }
  113. }
  114. }
  115. </style>