index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!-- 招聘会 -->
  2. <template>
  3. <view style="padding-bottom: 30px; ">
  4. <view v-if="items.length">
  5. <uni-card v-for="val in items" :key="val.id" @tap="handleToJobFairEnterprises(val)">
  6. <image v-if="val?.previewImg" class="ss-m-t-10" :src="val.previewImg" mode="widthFix" style="width: 100%; height: auto; border-radius: 6px;"></image>
  7. <view class="ss-m-t-20">活动时间:{{ timesTampChange(val.startTime, 'Y-M-D') }}至{{ timesTampChange(val.endTime, 'Y-M-D') }}</view>
  8. <button class="ss-m-t-20 ss-m-b-10" style="background-color: #00B760; color: #fff;" type="primary">查看详情</button>
  9. </uni-card>
  10. </view>
  11. <view v-else class="nodata-img-parent">
  12. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import { ref } from 'vue'
  18. import { getJobFairList } from '@/api/jobFair'
  19. import { timesTampChange } from '@/utils/date'
  20. const items = ref([])
  21. // 获得招聘会列表
  22. const getList = async () => {
  23. const res = await getJobFairList()
  24. items.value = res?.data || []
  25. }
  26. getList()
  27. //招聘会
  28. const handleToJobFairEnterprises = (val) => {
  29. if (!val?.id) {
  30. uni.showToast({ title: '进去招聘会失败!', icon: 'none' })
  31. }
  32. let url = `/pagesB/jobFair/${Number(val?.category) ? 'positionClassification': 'enterprisesClassification'}?jobFairId=${val.id}`
  33. uni.navigateTo({url})
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .line {
  38. border-top: 1px solid #ccc;
  39. }
  40. </style>