index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. icon: 'iconzu4931',
  31. label: '我的补课',
  32. path: 'extraLessonsForm'
  33. },
  34. {
  35. icon: 'iconwodebanji',
  36. label: '我的班级',
  37. path: 'classList'
  38. },
  39. {
  40. icon: 'iconwodepaiban',
  41. label: '我的排班',
  42. path: 'timetable'
  43. }
  44. ]
  45. }
  46. },
  47. onLoad() {},
  48. onReady() {},
  49. methods: {
  50. // 跳转
  51. goToHandle(item) {
  52. uni.navigateTo({
  53. url: '/pagesClass/' + item.path
  54. });
  55. },
  56. },
  57. }
  58. </script>
  59. <style>
  60. page {
  61. width: 100%;
  62. height: 100%;
  63. background-color: #f7f7f7;
  64. }
  65. </style>
  66. <style lang="scss" scoped>
  67. @import "@/static/css/themes.scss";
  68. .content {
  69. width: 100%;
  70. float: left;
  71. /deep/.u-navbar {
  72. .u-title {
  73. font-weight: bold;
  74. }
  75. }
  76. .card-box {
  77. .card-content {
  78. padding: 20px 15px;
  79. display: flex;
  80. align-items: center;
  81. .iconfont {
  82. width: 40px;
  83. height: 40px;
  84. font-size: 32px;
  85. color: $mainColor;
  86. display: flex;
  87. align-items: center;
  88. }
  89. .card-label {
  90. font-size: 16px;
  91. font-weight: bold;
  92. flex: 1;
  93. margin-left: 10px;
  94. }
  95. .iconjinru {
  96. font-size: 22px;
  97. justify-content: flex-end;
  98. }
  99. }
  100. }
  101. }
  102. </style>