card.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="content" :style="{'background': isDocument ? '#406CC4' : '#00C8DC'}" @click="handleGoAddClick">
  3. <img :src="isDocument ? documentKnowledge : myKnowledge" alt="">
  4. <div>{{ isDocument ? '新增知识' : '我的知识' }}</div>
  5. <div>
  6. <span>{{ isDocument ? '去新增' : '点击查看' }}</span>
  7. <img :src="rightGray" alt="">
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import documentKnowledge from '@/assets/img/warehouse/documentKnowledge.png'
  13. import wikiKnowledge from '@/assets/img/warehouse/wikiKnowledge.png'
  14. import myKnowledge from '@/assets/img/warehouse/myKnowledge.png'
  15. import rightGray from '@/assets/img/warehouse/rightGray.png'
  16. export default {
  17. props: {
  18. isDocument: {
  19. type: Boolean,
  20. default: false
  21. }
  22. },
  23. data() {
  24. return {
  25. documentKnowledge,
  26. wikiKnowledge,
  27. rightGray,
  28. myKnowledge
  29. }
  30. },
  31. methods: {
  32. // 去新增
  33. handleGoAddClick() {
  34. if(this.isDocument){
  35. this.$router.push({
  36. name: "knowledgeAddUpdate",
  37. query: {
  38. type: this.isDocument? '1' : '2'
  39. }
  40. })
  41. }else{
  42. this.$router.push({ path: 'contentData?type=0&showMy=1' });
  43. }
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="less" scoped>
  49. .content {
  50. width:100%;
  51. height:11.19vw;
  52. border-radius:0.52vw;
  53. display:flex;
  54. flex-direction:column;
  55. justify-content: center;
  56. align-items: center;
  57. cursor: pointer;
  58. >img {
  59. width: 3.4vw;
  60. }
  61. >:nth-child(2) {
  62. font-size: 1.25vw;
  63. font-weight: 500;
  64. color: #fff;
  65. margin: 1.04vw 0 0.41vw;
  66. }
  67. >:nth-child(3) {
  68. display:flex;
  69. align-items: center;
  70. span {
  71. font-size:0.83vw;
  72. color:#ddd;
  73. margin-right:0.56vw;
  74. }
  75. img {
  76. width:0.31vw;
  77. height:0.52vw;
  78. }
  79. }
  80. }
  81. </style>