slider.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="slider-box">
  3. <div v-for="(item, index) in list" :key="index" class="slider-box-item" @click="handleClick(item, index)">
  4. <v-btn size="30" class="icons" icon variant="text">
  5. <v-icon class="icons" size="30">{{ item.mdi }}</v-icon>
  6. <v-tooltip :text="item.tips" location="start" activator="parent">
  7. <div v-if="item.showImg" class="ma-3" style="text-align: center">
  8. <v-img cover aspect-ratio="1/1" src="https://minio.citupro.com/dev/static/mendunerCode.jpg" :width="170" style="height: 170px;"></v-img>
  9. <span class="tips-text">关注门墩儿微信公众号</span>
  10. </div>
  11. <span v-else>{{ item.tips }}</span>
  12. </v-tooltip>
  13. </v-btn>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup>
  18. defineOptions({ name: 'personalSlider' })
  19. import { useRouter } from 'vue-router'
  20. const router = useRouter()
  21. const list = [
  22. { mdi: 'mdi-arrow-up-bold', tips: '返回顶部' },
  23. { mdi: 'mdi-qrcode', tips: '微信公众号', showImg: 'https://minio.citupro.com/dev/static/mendunerCode.jpg' },
  24. { mdi: 'mdi-bell-outline', tips: '消息', path: '/recruit/enterprise/interviewManagement/communicate' }
  25. ]
  26. const handleClick = (item, index) => {
  27. // 回到顶部
  28. if (index === 0) window.scrollTo({ top: 0, behavior: 'smooth' })
  29. if (item.path) router.push(item.path)
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .slider-box {
  34. width: 44px;
  35. height: 134px;
  36. background-color: #fff;
  37. border-radius: 22px;
  38. box-shadow: 0 4px 20px 0 rgba(0,0,0,.06);
  39. }
  40. .slider-box-item {
  41. width: 44px;
  42. height: 44px;
  43. padding: 6px 0;
  44. text-align: center;
  45. }
  46. .icons {
  47. color: var(--color-ccc);
  48. &:hover {
  49. color: var(--v-primary-base);
  50. }
  51. }
  52. .tip-text {
  53. font-size: 14px;
  54. color: var(--color-222);
  55. }
  56. </style>