enterpriseRecommendationLetter.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. </view>
  12. <view v-else class="nodata-img-parent">
  13. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  14. </view>
  15. </view>
  16. </template>
  17. <script setup>
  18. import { ref } from 'vue'
  19. import { getEnterpriseRecommendationList } from '@/api/student'
  20. import { onShow } from '@dcloudio/uni-app'
  21. import { formatName } from '@/utils/getText'
  22. import { timesTampChange } from '@/utils/date'
  23. import { preview } from '@/utils/preview'
  24. const list = ref([
  25. {
  26. enterprise: {
  27. enterpriseName: '门墩儿科技有限公司',
  28. },
  29. entity: {
  30. createDate: 1740570206120,
  31. fileUrl: 'https://minio.menduner.com/dev/person/725759784858554368/attachment/7cde29dc69c1403649be55d4c2bfd3d8304c088dc79ab25afe9c4bf55d3b382f.docx'
  32. }
  33. }
  34. ])
  35. // 推荐信预览
  36. const viewReport = (item) => {
  37. if (!item.entity.fileUrl) {
  38. uni.showToast({
  39. title: '加载失败,请稍后重试',
  40. icon: 'none',
  41. duration: 2000
  42. })
  43. return
  44. }
  45. preview(item.entity.fileUrl)
  46. }
  47. // 获取推荐信列表
  48. const getList = async () => {
  49. try {
  50. const { data } = await getEnterpriseRecommendationList({ size: 9999, current: 1 })
  51. console.log(data, '推荐信列表')
  52. // list.value = data.records.reverse()
  53. } catch {}
  54. }
  55. onShow(async () => {
  56. // await getList()
  57. })
  58. </script>
  59. <style lang="scss" scoped>
  60. .list-item {
  61. background-color: #fff;
  62. border-radius: 3px;
  63. padding: 20px;
  64. box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.1);
  65. }
  66. </style>