classify-1.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="classify">
  3. <view v-if="0 === list.length" style="margin: 0 auto;padding: 50rpx;color: #a8a8a8;">
  4. 暂无数据
  5. </view>
  6. <view class="classify-li" v-for="(item, index) in list" :key="index" @click="downLoad(item.link)">
  7. <img class="classify-li__img" :src="url+item.imgPath" alt=""></img>
  8. <view class="classify-li__text" >
  9. {{item.text}}
  10. <span v-if="item.count > 0 && item.count > 0" class="hs-hzl-app-count count">
  11. {{item.count}}
  12. </span>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'Classify1',
  20. props: {
  21. list: {
  22. type: Array,
  23. default: () => []
  24. },
  25. url: {
  26. type: String,
  27. }
  28. },
  29. data() {
  30. return {
  31. baseURL: uni.$BASE_URL
  32. }
  33. },
  34. onLoad() {
  35. this.$goto({
  36. url: '../../pages/integral/index'
  37. })
  38. },
  39. methods: {
  40. // 打开自定义链接
  41. openCustomLink(link = '') {
  42. console.log(`link: ${link}`)
  43. },
  44. downLoad(item) {
  45. if (item === '../../pageApp/hr/leave') {
  46. uni.requestSubscribeMessage({
  47. tmplIds: ['qgp7iG6xTRm4JewW8N46nXJT-E6xorFn2hZ2V7gD8wY'],
  48. success(res) {}
  49. })
  50. }
  51. if (item === '../../pageA/salary/salary') {
  52. uni.requestSubscribeMessage({
  53. tmplIds: ['SSsS8EV9dfv-CC7-w_JUKYnfEuWm6FiGL_eED8hf80Q'],
  54. success(res) {}
  55. })
  56. }
  57. if (item === '../../pageApp/my/MyApproval') {
  58. uni.requestSubscribeMessage({
  59. tmplIds: ['Toomi1XWGMzNxOCoPX1rRNj7gLuykgszEzUstXaAp9c'],
  60. success(res) {}
  61. })
  62. }
  63. //this.$router.push('/pageA/integral/index')
  64. uni.removeStorageSync('approval')
  65. if (0 < item.indexOf("../page")) {
  66. uni.navigateTo({
  67. url: item
  68. })
  69. } else
  70. if (item) {
  71. let url = encodeURIComponent(item)
  72. uni.navigateTo({
  73. url: '../../pages/home/myWebView?url=' + url
  74. })
  75. }
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .classify {
  82. display: flex;
  83. justify-content: flex-start;
  84. flex-flow: row wrap;
  85. padding: 14upx 24upx 8rpx;
  86. .classify-li {
  87. flex: 0 0 20%;
  88. position: relative;
  89. &__img {
  90. display: block;
  91. width: 70upx;
  92. height: 70upx;
  93. margin: 0 auto;
  94. }
  95. &__text {
  96. font-size: 24upx;
  97. display: block;
  98. color: #5a5a5a;
  99. text-align: center;
  100. margin: 8upx 8upx 14upx 0;
  101. }
  102. }
  103. }
  104. .hs-hzl-app-count {
  105. text-align: center;
  106. font-size: 20rpx;
  107. font-weight: bold;
  108. color: #FFFFFF;
  109. background-color: #ff0000;
  110. width: 35rpx;
  111. height: 35rpx;
  112. border-radius: 50%;
  113. position: absolute;
  114. }
  115. .count {
  116. bottom: 110rpx;
  117. left: 70rpx;
  118. padding: 0px 0 2rpx 2rpx;
  119. }
  120. </style>