graceIconClasses.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="graceIconClasses">
  3. <navigator :url="item.path" :open-type="item.openType" class="item" :style="{background:item.bgColor}" v-for="(item, index) in classes" :key="index">
  4. <image :src="item.icon" mode="widthFix"></image>
  5. <view class="content">
  6. <view>
  7. <view class="image"><image :src="item.icon" mode="widthFix"></image></view>
  8. <view class="txt">
  9. {{item.txt}}<text>{{item.smallTxt}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </navigator>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. classes:{
  20. type : Array,
  21. default : function(){return [];}
  22. }
  23. }
  24. }
  25. </script>
  26. <style>
  27. .graceIconClasses{display:flex; flex-direction:row; flex-wrap:wrap; justify-content:space-between;}
  28. .graceIconClasses > .item{width:31.3%; height:168rpx; display:flex; border-radius:5px; background:#6DCD70; color:#FFF; position:relative; margin:10rpx 0; overflow:hidden;}
  29. .graceIconClasses > .item > image{width:40%; position:absolute; z-index:1; opacity:0.15; height:auto; right:3px; bottom:3px;}
  30. .graceIconClasses > .item > .content{width:100%; height:168rpx; display:flex; flex-wrap:wrap; align-items:center !important;}
  31. .graceIconClasses > .item > .content view{width:100%;}
  32. .graceIconClasses > .item > .content .txt{font-size:28rpx !important; color:#FFFFFF; text-indent:20rpx; line-height:40rpx; margin-top:5px;}
  33. .graceIconClasses > .item > .content .txt text{font-size:20rpx; margin-left:5rpx; opacity:0.8;}
  34. .graceIconClasses > .item > .content .image{font-size:0;}
  35. .graceIconClasses > .item > .content .image image{width:30%; height:auto; margin-left:20rpx;}
  36. </style>