招聘网页
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.vue 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <!-- slice(0,6), 6,14 -->
  2. <template>
  3. <a-typography style="margin-top: 36px;">
  4. <a-flex justify="center">
  5. <a-space :size="50">
  6. <a-typography-title>热门企业</a-typography-title>
  7. </a-space>
  8. </a-flex>
  9. <a-typography-paragraph>
  10. <a-row :gutter="[10,10]">
  11. <a-col span="18">
  12. <a-row :gutter="[10,10]">
  13. <a-col span="8" v-for="(item, index) in data1">
  14. <a-card hoverable style="width: 100%;height: 222px;" @click="toCompanyDetail(item.id)">
  15. <template #cover>
  16. <div style="width: 100%;padding-top: 20px;">
  17. <a-flex justify="center" align="center">
  18. <image-container
  19. :imgObj="{src: 'https://admin1.jcjob.cn/img/' + item.image_url, width: adposition.width+'px',height: adposition.height+'px', mode: ''}"></image-container>
  20. </a-flex>
  21. </div>
  22. </template>
  23. <a-space direction="vertical" align="center" :size="2" style="width: 100%;">
  24. <div style="font-size: 16px;font-weight: bold;text-align: center;height: 48px;">
  25. {{item.company_name ? item.company_name : '企业'}}
  26. </div>
  27. <div>{{item.company_nature}} <span v-if="item.company_scale">·</span> {{item.company_scale}}
  28. </div>
  29. </a-space>
  30. </a-card>
  31. </a-col>
  32. </a-row>
  33. </a-col>
  34. <a-col span="6">
  35. <a-row :gutter="[10,10]">
  36. <a-col span="24">
  37. <a-card style="width: 100%;height: 454px;overflow: auto; background-color: #fff;border-radius: 8px;">
  38. <template #title>
  39. <div class="text-decoration">
  40. <h4 class="text-content">热门资讯</h4>
  41. </div>
  42. </template>
  43. <a-space direction="vertical" style="cursor: pointer;" :size="20">
  44. <template v-for="(item,index) in articleList">
  45. <a-flex v-if="index + 1 == 1" align="center">
  46. <a-space>
  47. <a-avatar :size="26" style="background-color: #ff1a1a">
  48. <a-flex justify="center" align="center">
  49. <span style="font-size: 14px;font-weight: bold;">{{index + 1}}</span>
  50. </a-flex>
  51. </a-avatar>
  52. <div style="font-size: 16px;">{{ item.title }}</div>
  53. </a-space>
  54. </a-flex>
  55. <a-flex v-if="index + 1 == 2" align="center" style="width: 100%;">
  56. <a-space>
  57. <a-avatar :size="26" style="background-color: #ff4d4d">
  58. <a-flex justify="center" align="center">
  59. <span style="font-size: 14px;font-weight: bold;">{{index + 1}}</span>
  60. </a-flex>
  61. </a-avatar>
  62. <div style="font-size: 16px;">{{ item.title }}</div>
  63. </a-space>
  64. </a-flex>
  65. <a-flex v-if="index + 1 == 3" align="center" style="width: 100%;">
  66. <a-space>
  67. <a-avatar :size="26" style="background-color: #ff6b6b">
  68. <a-flex justify="center" align="center">
  69. <span style="font-size: 14px;font-weight: bold;">{{index + 1}}</span>
  70. </a-flex>
  71. </a-avatar>
  72. <div style="font-size: 16px;">{{ item.title }}</div>
  73. </a-space>
  74. </a-flex>
  75. <a-flex v-if="index + 1 >= 4" align="center" style="width: 100%;">
  76. <a-space>
  77. <a-avatar :size="26">
  78. <a-flex justify="center" align="center">
  79. <span style="font-size: 14px;font-weight: bold;">{{index + 1}}</span>
  80. </a-flex>
  81. </a-avatar>
  82. <div style="font-size: 16px;">{{ item.title }}</div>
  83. </a-space>
  84. </a-flex>
  85. </template>
  86. </a-space>
  87. </a-card>
  88. </a-col>
  89. </a-row>
  90. </a-col>
  91. </a-row>
  92. <template v-if="showData">
  93. <a-row :gutter="[10,10]" style="margin-top: 10px;">
  94. <a-col span="6" v-for="(item, index) in data2">
  95. <a-card hoverable style="width: 100%;height: 222px;" @click="toCompanyDetail(item.id)">
  96. <template #cover>
  97. <div style="width: 100%;padding-top: 20px;">
  98. <a-flex justify="center" align="center">
  99. <image-container
  100. :imgObj="{src: imageprefix + item.image_url, width: adposition.width+'px',height: adposition.height+'px',mode: 'fill'}"></image-container>
  101. </a-flex>
  102. </div>
  103. </template>
  104. <a-space direction="vertical" align="center" :size="2" style="width: 100%;">
  105. <div style="font-size: 16px;font-weight: bold;text-align: center;height: 48px;">
  106. {{item.company_name ? item.company_name : '企业'}}
  107. </div>
  108. <div>{{item.company_nature}} <span v-if="item.company_scale">·</span> {{item.company_scale}}
  109. </div>
  110. </a-space>
  111. </a-card>
  112. </a-col>
  113. </a-row>
  114. </template>
  115. </a-typography-paragraph>
  116. </a-typography>
  117. </template>
  118. <script setup lang="ts">
  119. import { ref, computed, onMounted } from 'vue';
  120. import { GetAdvertscheduleList, GetArticleList } from '@/apis/models';
  121. import { router } from '@/router';
  122. import { useCommon } from '@/hooks/useCommon';
  123. let { imageprefix } = useCommon();
  124. let data1 = ref([])
  125. let data2 = ref([])
  126. let adposition = ref(null)
  127. let showData = ref(false)
  128. let articleList = ref([])
  129. const getData = () => {
  130. GetAdvertscheduleList({ pagesize: 20, area_id: 13 }).then(res => {
  131. adposition.value = res.data.advertarea;
  132. sliceData(res.data.advertschedules)
  133. })
  134. }
  135. const sliceData = (val) => {
  136. if (val.length > 14) {
  137. data1.value = val.slice(0, 6)
  138. data2.value = val.slice(6, 14)
  139. showData.value = true;
  140. } else {
  141. data1.value = val;
  142. showData.value = false;
  143. }
  144. }
  145. const getSection = () => {
  146. GetArticleList({ pagesize: 8, hot: 2 }).then(res => {
  147. articleList.value = res.data.articles;
  148. })
  149. }
  150. const toCompanyDetail = (val : Number) => {
  151. sessionStorage.setItem('pubilc_id', val)
  152. sessionStorage.setItem('mode', 'detail')
  153. router.push({
  154. path: '/personal'
  155. })
  156. }
  157. onMounted(() => {
  158. getData()
  159. getSection()
  160. })
  161. </script>
  162. <style lang="less" scoped>
  163. .text-decoration {
  164. position: relative;
  165. display: inline-block;
  166. overflow: visible;
  167. }
  168. .text-decoration::before {
  169. content: '';
  170. width: 6px;
  171. height: 22px;
  172. background-color: #4FBE70;
  173. transform: rotate(10deg);
  174. position: absolute;
  175. top: 4px
  176. }
  177. .text-content {
  178. position: relative;
  179. margin-left: 20px;
  180. }
  181. </style>