sidebarItem.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!--
  2. * @Author: yangpeiqin
  3. * @Date: 2023-12-11 10:35:21
  4. * @LastEditors: zhangmudan
  5. * @LastEditTime: 2024-07-24 14:40:35
  6. * @FilePath: \tqApp\components\sidebar\module\sidebarItem.vue
  7. -->
  8. <template>
  9. <view class="sidebar-item-container">
  10. <view class="container">
  11. <u-badge
  12. numberType="overflow" max="99"
  13. :value="info.hint" shape="circle"
  14. :absolute="true" :offset="(!hasPlat(['sanitation']) && !hasPlat(['enterprises']))?[-5,10]:[-24,-7]"
  15. style="z-index: 1000;justify-content: center;overflow: hidden;"
  16. >
  17. </u-badge>
  18. <view class="item-icon">
  19. <image :src="info.icon" class="icon-img" :class="direction?'img80':''" />
  20. </view>
  21. <view class="item-label">{{ info.label }}</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. info: {
  29. type: Object,
  30. default: () => {
  31. return {}
  32. }
  33. },
  34. direction:{
  35. type: String,
  36. default: ''
  37. },
  38. },
  39. data() {
  40. return {
  41. }
  42. },
  43. onLoad() {
  44. },
  45. methods: {
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .sidebar-item-container {
  51. position: relative;
  52. width: 100%;
  53. height: auto;
  54. margin-top: 30rpx;
  55. .container {
  56. position: relative;
  57. width: 144rpx;
  58. width: 100%;
  59. height: auto;
  60. display: flex;
  61. flex-flow: column nowrap;
  62. align-items: center;
  63. .item-icon {
  64. .icon-img {
  65. width: 48rpx;
  66. height: 48rpx;
  67. }
  68. .img80{
  69. width: 80rpx;
  70. height: 80rpx;
  71. }
  72. }
  73. .item-label {
  74. // margin-top: 5px;
  75. color: #888;
  76. font-size: 22rpx;
  77. line-height: 32rpx;
  78. }
  79. }
  80. }
  81. </style>