job-list.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div id="job_list">
  3. <!-- <scroll :hasMore="hasMore" @loadMore="loadMore">
  4. <div>
  5. <el-row class="list_row" v-for="(item, index) in data" :key="index" @click.native="turnTo(item.id)">
  6. <el-col :span="24">
  7. <el-row type="flex" :gutter="10" align="middle">
  8. <el-col :span="16" class="word_etc" style="font-size:1rem;">
  9. <el-tag type="warning" v-if="item.is_intern === '1'" style="border-radius: 4px;">实习</el-tag>
  10. {{ item.job_name }}
  11. </el-col>
  12. <el-col :span="8" class="list_info_top-sWord">{{ item.create_time || '' }}</el-col>
  13. </el-row>
  14. <el-row type="flex" :gutter="10">
  15. <el-col :span="16" class="word_etc word_grey">专业:{{ item.zy_req }}</el-col>
  16. <el-col :span="8" class="list_info_top-sWord" style="color:#ff4400">{{ item.salary.text || '' }}</el-col>
  17. </el-row>
  18. <el-row type="flex" :gutter="10">
  19. <el-col :span="16" class="word_grey"> 学历需求: {{ item.xl_req }} </el-col>
  20. </el-row>
  21. </el-col>
  22. <el-col :span="24" style="margin-top:0.5rem;">
  23. <el-tag v-for="(tag, tag_index) in item.job_tag" :key="tag_index">{{ tag }}</el-tag>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. </scroll> -->
  28. <list-layout @search="loadMore" :hasMore="hasMore" :needSearch="false">
  29. <template v-slot:content>
  30. <el-row class="list_row" v-for="(item, index) in data" :key="index" @click.native="turnTo(item.id)">
  31. <el-card class="this_card">
  32. <el-col :span="24">
  33. <el-row type="flex" :gutter="10" align="middle">
  34. <el-col :span="16" class="word_etc" style="font-size:1rem;">
  35. <el-tag type="warning" v-if="item.is_intern === '1'" style="border-radius: 4px;">实习</el-tag>
  36. {{ item.job_name }}
  37. </el-col>
  38. <el-col :span="8" class="list_info_top-sWord">{{ item.create_time || '' }}</el-col>
  39. </el-row>
  40. <el-row type="flex" :gutter="10">
  41. <el-col :span="16" class="word_grey"> 招聘公司: {{ item.corpname }} </el-col>
  42. </el-row>
  43. <el-row type="flex" :gutter="10">
  44. <el-col :span="16" class="word_etc word_grey">专业:{{ item.zy_req }}</el-col>
  45. <el-col :span="8" class="list_info_top-sWord" style="color:#ff4400">{{ item.salary.text || '' }}</el-col>
  46. </el-row>
  47. <el-row type="flex" :gutter="10">
  48. <el-col :span="16" class="word_grey"> 学历需求: {{ item.xl_req }} </el-col>
  49. </el-row>
  50. </el-col>
  51. <el-col :span="24" style="margin-top:0.5rem;">
  52. <el-tag v-for="(tag, tag_index) in item.job_tag" :key="tag_index">{{ tag }}</el-tag>
  53. </el-col>
  54. </el-card>
  55. </el-row>
  56. </template>
  57. </list-layout>
  58. </div>
  59. </template>
  60. <script>
  61. import listLayout from '@/layout/list-layout.vue';
  62. import scroll from '@/layout/scroll.vue';
  63. import _ from 'lodash';
  64. export default {
  65. name: 'job_list',
  66. props: {
  67. data: { type: Array, default: () => [] },
  68. type: { type: String, default: 'jobs' },
  69. hasMore: { type: Boolean, default: true },
  70. total: { type: Number },
  71. },
  72. components: {
  73. // scroll,
  74. listLayout,
  75. },
  76. data: () => ({
  77. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  78. loading: false,
  79. currentPage: 1,
  80. list: [],
  81. }),
  82. watch: {
  83. data: {
  84. handler(val) {
  85. this.$set(this, `list`, val);
  86. this.changeTag();
  87. },
  88. },
  89. },
  90. created() {},
  91. computed: {},
  92. methods: {
  93. loadMore() {
  94. this.loading = true;
  95. this.$emit('search', { type: this.type, currentPage: this.currentPage });
  96. this.loading = false;
  97. },
  98. changeTag() {
  99. this.list.map(item => {
  100. let jobTag = item.job_tag.split(',');
  101. item.job_tag = jobTag;
  102. return item;
  103. });
  104. },
  105. turnTo(id) {
  106. let query = `?id=${id}`;
  107. window.location.href = `jobs.html#/${query}`;
  108. },
  109. },
  110. };
  111. </script>
  112. <style lang="less" scoped>
  113. .list_row {
  114. padding: 0.9rem;
  115. }
  116. .list_info_top-sWord {
  117. font-size: 0.6rem;
  118. text-align: right;
  119. }
  120. .word_etc {
  121. overflow: hidden;
  122. white-space: nowrap;
  123. text-overflow: ellipsis;
  124. }
  125. .word_grey {
  126. font-size: 0.87rem;
  127. color: #666666;
  128. }
  129. .el-tag {
  130. border-radius: 30px;
  131. }
  132. .this_card {
  133. padding: 5px 0px 15px 5px;
  134. }
  135. </style>