home.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="home page-bg-color u-rela">
  3. <view class="banner">
  4. <banner/>
  5. </view>
  6. <u-card margin="30rpx 0" padding="10" :border-radius="0" :border="false" :show-foot="false">
  7. <view class="" slot="head">
  8. <u-icon name="list-dot" class="u-margin-right-10 text"></u-icon>
  9. <text class="text">业务服务</text>
  10. </view>
  11. <u-grid slot="body" :col="4" :border="false">
  12. <u-grid-item :key="index" v-for="(menu, index) in menuList" @click="handleMenuClick(menu)">
  13. <u-image :class="{gray: menu.forbidClick}" width="64rpx" height="64rpx" :src="menu.icon"></u-image>
  14. <view class="menu-text text">{{menu.title}}</view>
  15. </u-grid-item>
  16. </u-grid>
  17. </u-card>
  18. <u-card margin="30rpx 0" padding="10" :border-radius="0" :border="false" :show-foot="false" title-size="28">
  19. <view class="" slot="head">
  20. <u-icon name="calendar-fill" class="u-margin-right-10 text"></u-icon>
  21. <text class="text">日程安排</text>
  22. </view>
  23. <calendar slot="body" mode="date"></calendar>
  24. </u-card>
  25. </view>
  26. </template>
  27. <script>
  28. import banner from './banner/index.vue'
  29. import calendar from './calendar/calendar.vue'
  30. export default {
  31. data() {
  32. return {
  33. show: true,
  34. menuList: [
  35. {
  36. title: '发起流程',
  37. icon: require('@/static/images/workflow/start.png'),
  38. options: {
  39. type: 'start'
  40. }
  41. },
  42. {
  43. title: '我发起的',
  44. icon: require('@/static/images/workflow/myLanuch.png'),
  45. options: {
  46. type: 'myLaunch'
  47. }
  48. },
  49. {
  50. title: '我的待办',
  51. icon: require('@/static/images/workflow/todo.png'),
  52. options: {
  53. type: 'todo'
  54. }
  55. },
  56. {
  57. title: '我的已办',
  58. icon: require('@/static/images/workflow/done.png'),
  59. options: {
  60. type: 'done'
  61. }
  62. },
  63. {
  64. title: '请假申请',
  65. forbidClick: true,
  66. icon: require('@/static/images/menu/leave.png')
  67. },
  68. {
  69. title: '采购申请',
  70. forbidClick: true,
  71. icon: require('@/static/images/menu/buy.png')
  72. },
  73. {
  74. title: '企业内训',
  75. forbidClick: true,
  76. icon: require('@/static/images/menu/train.png')
  77. },
  78. {
  79. title: '邮件通知',
  80. forbidClick: true,
  81. icon: require('@/static/images/menu/email.png')
  82. }
  83. ]
  84. };
  85. },
  86. components: {
  87. banner,
  88. calendar
  89. },
  90. methods: {
  91. handleMenuClick(menu) {
  92. if(!menu.forbidClick) {
  93. this.openPage(menu.options)
  94. }
  95. },
  96. /**
  97. * 打开工作流页面
  98. */
  99. openPage(options) {
  100. uni.navigateTo({
  101. url: `/pages/workflowTask/index?type=${options.type}`
  102. });
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. page {
  109. height: unset;
  110. }
  111. .home {
  112. &-bg-color {
  113. top: 0;
  114. left: 0;
  115. width: 100%;
  116. height: 560rpx;
  117. }
  118. .text {
  119. font-weight: 400;
  120. font-size: $main-font-size;
  121. }
  122. .menu-text {
  123. margin-top: 5rpx;
  124. }
  125. .gray {
  126. filter: grayscale(100%);
  127. }
  128. }
  129. </style>