stencilledCon.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div :class="['stencilledCon',isChoice?'stencilledConActive':'']">
  3. <div class="top">
  4. <div class="tit"><img src="../../../assets/images/classObserve/science.svg" alt="" />{{ data.name }}</div>
  5. <div class="btn">
  6. <img src="../../../assets/images/classObserve/collect1.svg" alt="" v-if="collectData.findIndex(i=>i.id==data.id)==-1" @click.stop="collect(0)"/>
  7. <img src="../../../assets/images/classObserve/collect2.svg" alt="" v-else @click.stop="collect(1)"/>
  8. <div class="btnTxt" @click.stop="PerTel">预览</div>
  9. </div>
  10. </div>
  11. <div class="con">
  12. {{ data.detail }}
  13. </div>
  14. <div class="bom">
  15. <div>{{ data.use }}人已使用</div>
  16. <div>{{ tagSubjectList.find(i=>i.value==data.type)?tagSubjectList.find(i=>i.value==data.type).label:'' }}</div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. props:{
  23. data:{
  24. type:Object,
  25. default:{},
  26. },
  27. tagSubjectList:{
  28. type:Array,
  29. default:()=>[]
  30. },
  31. collectData:{
  32. type:Array,
  33. default:[]
  34. },
  35. isChoice:{
  36. type:Boolean,
  37. default:false
  38. }
  39. },
  40. data() {
  41. return {
  42. }
  43. },
  44. methods: {
  45. PerTel() {
  46. this.$parent.previewTel(this.data)
  47. // this.$emit('previewTel')
  48. },
  49. collect(type){
  50. this.$parent.collect(type,this.data)
  51. // this.$toast("收藏或不收藏")
  52. },
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .stencilledCon {
  58. padding: 10px;
  59. border-radius: 5px;
  60. box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
  61. box-shadow: 0px 16px 24px 2px rgba(0, 0, 0, 0.04);
  62. box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05);
  63. transition: .3s;
  64. border: solid 2px #fff;
  65. }
  66. .stencilledConActive{
  67. border-color: #3681FC;
  68. }
  69. .top {
  70. display: flex;
  71. justify-content: space-between;
  72. align-items: center;
  73. padding: 5px 0;
  74. .tit {
  75. font-size: 16px;
  76. font-weight: 600;
  77. display: flex;
  78. align-items: center;
  79. img {
  80. margin-right: 5px;
  81. }
  82. }
  83. .btn {
  84. display: flex;
  85. justify-content: space-between;
  86. align-items: center;
  87. .btnTxt {
  88. background-color: rgba(240, 242, 245, 1);
  89. padding: 7px 15px;
  90. border-radius: 5px;
  91. margin-left: 7px;
  92. }
  93. img {
  94. width: 20px;
  95. height: 20px;
  96. }
  97. }
  98. }
  99. .con {
  100. -webkit-line-clamp: 2;
  101. display: -webkit-box;
  102. -webkit-box-orient: vertical;
  103. overflow: hidden;
  104. text-overflow: ellipsis;
  105. font-size: 12px;
  106. padding: 10px 0;
  107. }
  108. .bom {
  109. display: flex;
  110. justify-content: space-between;
  111. font-size: 12px;
  112. color: rgba(0, 0, 0, 0.4);
  113. }
  114. </style>