t-i-icon.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="content" v-if="iconList.arr || iconList.data">
  3. <view class="nav">
  4. <view class="item" v-for="(item,index) in iconList.arr" :key="index" @click="go_link(item)">
  5. <view class="icon">
  6. <image :src="item.icon" mode=""></image>
  7. </view>
  8. <view class="name">{{item.title}}</view>
  9. </view>
  10. </view>
  11. <view class="section" v-for="(item,index) in iconList.data" :key="index">
  12. <view v-if="item.data.length > 0">
  13. <view class="title">{{item.category_name}}</view>
  14. <view class="list">
  15. <view class="item" v-for="(item_2,index_2) in item.data" :key="index_2" @click="go_link(item_2)">
  16. <view class="icon">
  17. <image :src="item_2.icon" mode=""></image>
  18. </view>
  19. <view class="name">{{item_2.title}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {goToLink} from "@/common/common.js"
  28. export default {
  29. name: "t-i-icon",
  30. props: [
  31. "iconList",
  32. "mine_code"
  33. ],
  34. data() {
  35. return {
  36. };
  37. },
  38. methods: {
  39. go_link(item) {
  40. goToLink(item,this.mine_code)
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .content {
  47. margin-bottom: 20rpx;
  48. background-color: #FFFFFF;
  49. box-sizing: border-box;
  50. padding: 50rpx 25rpx 15rpx;
  51. }
  52. .nav {
  53. overflow: hidden;
  54. .item {
  55. float: left;
  56. width: 120rpx;
  57. margin-right: 25rpx;
  58. margin-bottom: 30rpx;
  59. .icon {
  60. width: 120rpx;
  61. text-align: center;
  62. image {
  63. width: 100rpx;
  64. height: 100rpx;
  65. border-radius: 50%;
  66. }
  67. }
  68. .name {
  69. width: 120rpx;
  70. text-align: center;
  71. font-size: 30rpx;
  72. white-space: nowrap;
  73. overflow: hidden;
  74. text-overflow: ellipsis;
  75. }
  76. }
  77. .item:nth-child(5n) {
  78. margin-right: 0;
  79. }
  80. }
  81. .section {
  82. margin-top: 20rpx;
  83. .title {
  84. font-size: 36rpx;
  85. margin-bottom: 40rpx;
  86. }
  87. .list {
  88. overflow: hidden;
  89. .item {
  90. float: left;
  91. width: 148rpx;
  92. margin-right: 36rpx;
  93. margin-bottom: 30rpx;
  94. .icon {
  95. width: 148rpx;
  96. text-align: center;
  97. image {
  98. width: 104rpx;
  99. height: 104rpx;
  100. border-radius: 50%;
  101. }
  102. }
  103. .name {
  104. width: 148rpx;
  105. text-align: center;
  106. font-size: 30rpx;
  107. white-space: nowrap;
  108. overflow: hidden;
  109. text-overflow: ellipsis;
  110. }
  111. }
  112. .item:nth-child(4n) {
  113. margin-right: 0;
  114. }
  115. }
  116. }
  117. </style>