Ppt.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <!-- ppt -->
  3. <div class="Ppt">
  4. <div class="top">
  5. <div class="title">
  6. <span class="icon">P</span>
  7. <span class="text"> PPT </span>
  8. </div>
  9. </div>
  10. <div class="class_list">
  11. <div v-for="(item, i) in classList" :key="i">
  12. <img lazy src="../../assets/teacherdev/ppt.png" alt="" />
  13. <p class="one_name">{{ item.name }}</p>
  14. <p class="price">
  15. $
  16. <span class="price_1" v-text="changePrice('1', item.price)"></span>
  17. <span class="price_2" v-text="changePrice('2', item.price)"></span>
  18. </p>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. props: ["classList"],
  26. data() {
  27. return {};
  28. },
  29. methods: {
  30. // 处理价格
  31. changePrice(type, item) {
  32. if (item.indexOf(".") != -1) {
  33. if (type == 1) {
  34. return item.split(".")[0];
  35. } else if (type == 2) {
  36. return "." + item.split(".")[1];
  37. }
  38. } else {
  39. if (type == 1) {
  40. return item;
  41. }
  42. }
  43. },
  44. },
  45. };
  46. </script>
  47. <style lang="scss" scoped>
  48. .Ppt {
  49. .top {
  50. width: 1200px;
  51. margin: 0 auto;
  52. display: flex;
  53. height: 100px;
  54. justify-content: space-between;
  55. line-height: 100px;
  56. .title {
  57. font-weight: bold;
  58. font-size: 30px;
  59. .icon {
  60. display: inline-block;
  61. width: 42px;
  62. height: 42px;
  63. border-radius: 50%;
  64. background: linear-gradient(215.75deg, #ff881a 17.74%, #ffc077 82.17%);
  65. text-align: center;
  66. margin-right: 16px;
  67. color: white;
  68. font-size: 20px;
  69. line-height: 42px;
  70. }
  71. .text {
  72. position: relative;
  73. top: 10px;
  74. }
  75. }
  76. }
  77. .class_list {
  78. width: 1200px;
  79. margin: 0 auto;
  80. background: #fff;
  81. display: flex;
  82. flex-wrap: wrap;
  83. justify-content: flex-start;
  84. padding-top: 50px;
  85. > div {
  86. margin: 0 0 0 32px;
  87. width: 192px;
  88. height: 356px;
  89. overflow: hidden;
  90. transition: all 1s;
  91. .one_name {
  92. width: 90%;
  93. height: 50px;
  94. margin-top: 10px;
  95. word-break: break-all;
  96. display: -webkit-box;
  97. -webkit-box-orient: vertical;
  98. -webkit-line-clamp: 2;
  99. text-overflow: ellipsis;
  100. overflow: hidden;
  101. font-size: 14px;
  102. color: #2c2c2c;
  103. }
  104. .price {
  105. font-weight: bold;
  106. color: #2c2c2c;
  107. font-size: 24px;
  108. .price_2 {
  109. font-size: 16px;
  110. }
  111. }
  112. p {
  113. font-size: 16px;
  114. margin-left: 10px;
  115. }
  116. img {
  117. width: 100%;
  118. height: 60%;
  119. cursor: pointer;
  120. }
  121. .gray {
  122. color: #a3a3a3;
  123. }
  124. .origin {
  125. color: #ff9900;
  126. }
  127. }
  128. .more {
  129. background: url("../../assets/teacherdev/image 13.png") center;
  130. position: relative;
  131. .shade {
  132. position: absolute;
  133. width: 100%;
  134. height: 100%;
  135. background: #000000;
  136. opacity: 0.6;
  137. cursor: pointer;
  138. display: flex;
  139. justify-content: center;
  140. align-items: center;
  141. > div {
  142. img {
  143. width: 58px;
  144. height: 58px;
  145. }
  146. span {
  147. position: relative;
  148. color: white;
  149. top: -20px;
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }
  156. </style>