SolutionCell.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template lang="pug">
  2. .solution-cell
  3. a.cell-block(:href="`/s/${data.hash_id}`")
  4. .figure
  5. img.cover(
  6. :src="data.images"
  7. )
  8. .info
  9. .title
  10. span {{data.title}}
  11. .tag.is-choice(v-if="data.is_choice == 1") 优选
  12. .desc {{data.description}}
  13. .provider 服务商: {{data.company_name}}
  14. .tags
  15. .tag.is-primary.is-light.is-border(v-for="item in data.cats") {{item.name}}
  16. .tag.is-border(
  17. v-for="item in data.tags"
  18. v-if="!data.cats || !data.cats.find((cat) => cat.name === item.name)"
  19. ) {{item.name}}
  20. </template>
  21. <script lang="ts">
  22. import Vue from 'vue'
  23. export default Vue.extend({
  24. name: 'SolutionCell',
  25. components: {
  26. },
  27. props: {
  28. data: Object
  29. }
  30. })
  31. </script>
  32. <style lang="scss">
  33. @import '../assets/styles/vars';
  34. .kaifain-view .solution-cell {
  35. padding: 24px 24px 20px;
  36. border-bottom: 1px solid #eee;
  37. .figure {
  38. margin: 4px 24px 0 0;
  39. flex: none;
  40. .cover {
  41. width: 64px;
  42. height: 64px;
  43. display: block;
  44. }
  45. }
  46. .info {
  47. font-size: 12px;
  48. flex: 1;
  49. overflow: hidden;
  50. }
  51. .tag {
  52. font-size: 0.6875rem;
  53. cursor: default;
  54. }
  55. a.tag {
  56. cursor: pointer;
  57. text-decoration: none;
  58. }
  59. .title {
  60. font-size: 1rem;
  61. font-weight: 500;
  62. color: $ink;
  63. margin-bottom: 8px;
  64. .tag {
  65. margin-left: 8px;
  66. height: 1.6em;
  67. padding-left: 0.5em;
  68. padding-right: 0.5em;
  69. }
  70. }
  71. .desc,
  72. .provider {
  73. white-space: nowrap;
  74. word-break: break-all;
  75. text-overflow: ellipsis;
  76. overflow: hidden;
  77. }
  78. .desc {
  79. color: lighten($ink, 10%);
  80. margin: 10px 0;
  81. font-size: 0.8125rem;
  82. }
  83. .provider {
  84. color: lighten($ink, 42%);
  85. }
  86. .tags {
  87. padding: 2px 0;
  88. margin: 10px 0 0 88px;
  89. }
  90. &.card {
  91. background: #fff;
  92. margin: 10px 12px;
  93. border-radius: 12px;
  94. }
  95. .cell-block {
  96. display: flex;
  97. &:hover {
  98. .title span {
  99. color: $primary;
  100. }
  101. }
  102. }
  103. }
  104. </style>