mediaList.nvue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="tui-list-view">
  3. <div class="tui-list-cell" :class="[lastChild?'tui-last-child':'']" @click="bindClick">
  4. <div class="tui-title-box">
  5. <text class="tui-cell-title">{{entity.title}}</text>
  6. </div>
  7. <div class="tui-img-container" v-if="entity.imgArr && entity.imgArr.length>0">
  8. <div class="tui-cell-img" v-for="(item,index) in entity.imgArr" :key="index">
  9. <image :src="item" class="tui-img"></image>
  10. </div>
  11. </div>
  12. <div class="tui-sub-title">
  13. <text class="tui-badge" :class="[getClass(entity.badgeType)]" v-if="entity.badgeType!=0">{{entity.badgeText}}</text>
  14. <text class="tui-sub-content">{{entity.subContent}}</text>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. entity: {
  23. type: Object,
  24. default: function(e) {
  25. return {}
  26. }
  27. },
  28. lastChild: {
  29. type: Boolean,
  30. default: function(e) {
  31. return false
  32. }
  33. }
  34. },
  35. methods: {
  36. bindClick() {
  37. this.$emit('click')
  38. },
  39. getClass(type) {
  40. //1-tui-red 2-tui-blue 3-tui-orange 4-tui-green
  41. return ["tui-red", "tui-blue", "tui-orange", "tui-green"][type - 1];
  42. }
  43. }
  44. }
  45. </script>
  46. <style>
  47. .tui-list-view {
  48. width: 750px;
  49. background-color: #fff;
  50. /* padding-bottom: env(safe-area-inset-bottom); */
  51. }
  52. .tui-list-view:active {
  53. background-color: #eeeeee;
  54. }
  55. .tui-list-cell {
  56. width: 750px;
  57. padding-top: 30px;
  58. padding-bottom: 30px;
  59. padding-right: 30px;
  60. border-bottom-width: 1px;
  61. border-bottom-style: solid;
  62. border-bottom-color: #E6E6E6;
  63. }
  64. .tui-last-child {
  65. border-bottom-width: 0;
  66. }
  67. .tui-title-box {
  68. width: 690px;
  69. flex: 1;
  70. lines: 2;
  71. }
  72. .tui-cell-title {
  73. font-size: 36px;
  74. line-height: 56px;
  75. flex: 1;
  76. lines: 2;
  77. text-overflow: ellipsis;
  78. color: #333333;
  79. }
  80. .tui-img-container {
  81. width: 690px;
  82. padding-top: 24px;
  83. height: 184px;
  84. flex-direction: row;
  85. justify-content: space-between;
  86. }
  87. .tui-cell-img {
  88. width: 220px;
  89. overflow: hidden;
  90. position: relative;
  91. }
  92. .tui-img {
  93. width: 220px;
  94. height: 184px;
  95. border-radius: 4px;
  96. }
  97. .tui-sub-title {
  98. padding-top: 24px;
  99. align-items: center;
  100. flex-direction: row;
  101. }
  102. .tui-sub-content {
  103. font-size: 28px;
  104. color: #BCBCBC;
  105. }
  106. .tui-badge {
  107. padding-top: 5px;
  108. padding-bottom: 5px;
  109. padding-left: 10px;
  110. padding-right: 10px;
  111. font-size: 24px;
  112. border-radius: 4px;
  113. margin-right: 20px;
  114. }
  115. .tui-red {
  116. background-color: #FCEBEF;
  117. color: #8A5966;
  118. }
  119. .tui-blue {
  120. background-color: #ECF6FD;
  121. color: #4DABEB;
  122. }
  123. .tui-orange {
  124. background-color: #FEF5EB;
  125. color: #FAA851
  126. }
  127. .tui-green {
  128. background-color: #E8F6E8;
  129. color: #44CF85
  130. }
  131. </style>