enterpriseRecommendationLetter.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view style="height: 98vh; background-color: #f2f4f7; padding-top: 10px;">
  3. <view v-if="list.length > 0">
  4. <uni-card v-for="(item, index) in list" class="list-item" @tap.stop="viewReport(item)" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  5. <view class="font-weight-bold">From: {{ formatName(item.enterprise.enterpriseName) }}</view>
  6. <view>创建时间:{{ timesTampChange(item.entity.createDate) }}</view>
  7. <view style="text-align: end;">
  8. <text class="color-primary" @tap.stop="viewReport(item)">点击查看</text>
  9. </view>
  10. </uni-card>
  11. <uni-load-more status="noMore" style="line-height: 20vh;" />
  12. </view>
  13. <view v-else class="nodata-img-parent">
  14. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import { ref } from 'vue'
  20. import { getRecommendationPage } from '@/api/student'
  21. import { onShow } from '@dcloudio/uni-app'
  22. import { formatName } from '@/utils/getText'
  23. import { timesTampChange } from '@/utils/date'
  24. import { preview } from '@/utils/preview'
  25. const list = ref([
  26. {
  27. enterprise: {
  28. enterpriseName: '门墩儿科技有限公司',
  29. },
  30. entity: {
  31. createDate: 1740570206120,
  32. fileUrl: 'https://minio.menduner.com/dev/person/725759784858554368/attachment/7cde29dc69c1403649be55d4c2bfd3d8304c088dc79ab25afe9c4bf55d3b382f.docx'
  33. }
  34. }
  35. ])
  36. // list.value = Array.from({ length: 10 }, () => list.value[0]);
  37. // 推荐信预览
  38. const viewReport = (item) => {
  39. if (!item.entity.fileUrl) {
  40. uni.showToast({
  41. title: '加载失败,请稍后重试',
  42. icon: 'none',
  43. duration: 2000
  44. })
  45. return
  46. }
  47. preview(item.entity.fileUrl)
  48. }
  49. // 获取推荐信列表
  50. const getList = async () => {
  51. try {
  52. const { data } = await getRecommendationPage({ size: 9999, current: 1 })
  53. console.log(data, '推荐信列表')
  54. // list.value = data.records.reverse()
  55. } catch {}
  56. }
  57. onShow(async () => {
  58. await getList()
  59. })
  60. </script>
  61. <style lang="scss" scoped>
  62. .list-item {
  63. background-color: #fff;
  64. border-radius: 3px;
  65. box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.1);
  66. }
  67. </style>