1.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="listNewsTitle">
  3. 本网招聘
  4. </div>
  5. <ul class="list" v-if="componentStyle == 1">
  6. <div v-if="newsList.length > 0">
  7. <li class="content" v-for="(item, index) in newsList" :key="index">
  8. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  9. <span class="title">{{ getTitleLength(item.con_title, 50) }}</span>
  10. <span class="time">{{ item.updated_at }}</span>
  11. </NuxtLink>
  12. </li>
  13. </div>
  14. <div v-else-if="newsList.con_title">
  15. <li class="content">
  16. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  17. <span class="title">{{ newsList.con_title }}</span>
  18. <span class="time">{{ newsList.updated_at }}</span>
  19. </NuxtLink>
  20. </li>
  21. </div>
  22. </ul>
  23. <ul class="list" v-if="componentStyle == 2">
  24. <div v-if="newsList.length > 0">
  25. <li class="content style2" v-for="(item, index) in newsList" :key="index">
  26. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  27. <span class="title">{{ getTitleLength(item.con_title, 50) }}</span>
  28. <span class="time">{{ item.updated_at }}</span>
  29. </NuxtLink>
  30. </li>
  31. </div>
  32. <div v-else-if="newsList.con_title">
  33. <li class="content style2">
  34. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  35. <span class="title">{{ newsList.con_title }}</span>
  36. <span class="time">{{ newsList.updated_at }}</span>
  37. </NuxtLink>
  38. </li>
  39. </div>
  40. </ul>
  41. <ul class="list" v-if="componentStyle == 3">
  42. <div v-if="newsList.length > 0">
  43. <li class="content style3" v-for="(item, index) in newsList" :key="index">
  44. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  45. <span class="title">{{ getTitleLength(item.con_title, 50) }}</span>
  46. <span class="time">{{ item.updated_at }}</span>
  47. </NuxtLink>
  48. </li>
  49. </div>
  50. <div v-else-if="newsList.con_title">
  51. <li class="content style3">
  52. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  53. <span class="title">{{ newsList.con_title }}</span>
  54. <span class="time">{{ newsList.updated_at }}</span>
  55. </NuxtLink>
  56. </li>
  57. </div>
  58. </ul>
  59. <ul class="list" v-if="componentStyle == 4">
  60. <div v-if="newsList.length > 0">
  61. <li class="content style4" v-for="(item, index) in newsList" :key="index">
  62. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  63. <span class="title">{{ getTitleLength(item.con_title, 50) }}</span>
  64. <span class="time">{{ item.updated_at }}</span>
  65. </NuxtLink>
  66. </li>
  67. </div>
  68. <div v-else-if="newsList.con_title">
  69. <li class="content style4">
  70. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  71. <span class="title">{{ newsList.con_title }}</span>
  72. <span class="time">{{ newsList.updated_at }}</span>
  73. </NuxtLink>
  74. </li>
  75. </div>
  76. </ul>
  77. </template>
  78. <script setup>
  79. const props = defineProps({
  80. newsList: Array,//模板数据
  81. componentStyle: Number//样式编号
  82. });
  83. </script>
  84. <style lang="less" scoped>
  85. //基本样式 start ---------------------------------------->
  86. .listNewsTitle {
  87. font-size: 22px;
  88. font-weight: bold;
  89. height: 44px;
  90. // border-bottom: 2px solid #154079;
  91. color: #154079;
  92. box-sizing: border-box;
  93. margin-top: 28px;
  94. margin-bottom: 30px;
  95. }
  96. //基本样式 end ---------------------------------------->
  97. //样式1 start ---------------------------------------->
  98. .list {
  99. margin-bottom: 30px;
  100. padding-bottom: 10px;
  101. margin-top: 10px;
  102. div {
  103. .content {
  104. width: 100%;
  105. height: 99px;
  106. border-bottom: 1px dashed #cbcbcb;
  107. margin-bottom: 20px;
  108. cursor: pointer;
  109. .title {
  110. display: block;
  111. height: 24px;
  112. line-height: 24px;
  113. color: #333333;
  114. font-size: 18px;
  115. font-weight: bold;
  116. margin-bottom: 25px;
  117. }
  118. .desc {
  119. height: 63px;
  120. line-height: 20px;
  121. color: #666666;
  122. font-size: 18px;
  123. font-family: "Abhaya Libre", serif;
  124. margin-bottom: 20px;
  125. overflow: hidden;
  126. }
  127. .time {
  128. font-family: "Abhaya Libre", serif;
  129. font-size: 18px;
  130. color: #666666;
  131. }
  132. }
  133. // 样式2
  134. .style2 {
  135. border-bottom: 1px solid #cbcbcb;
  136. }
  137. // 样式3
  138. .style3 {
  139. .title {
  140. font-weight: 400;
  141. }
  142. }
  143. // 样式4
  144. .style4 {
  145. border-bottom: 1px solid #cbcbcb;
  146. .title {
  147. font-weight: 400;
  148. }
  149. }
  150. }
  151. }
  152. //样式1 end ---------------------------------------->
  153. //样式2 start ---------------------------------------->
  154. .listStyle2 {
  155. li {
  156. &:nth-child(1),
  157. &:nth-child(6),
  158. &:nth-child(11),
  159. &:nth-child(16) {
  160. font-size: 18px;
  161. font-weight: normal;
  162. }
  163. }
  164. }
  165. //样式2 end ----------------------------------------></style>