index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="ss-p-b-100">
  3. <view v-if="bioList.length > 0">
  4. <uni-card v-for="(item, index) in bioList" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  5. <view style="font-weight: bold;">{{ item.fileName ? item.fileName : `简历${index + 1}` }}</view>
  6. <view>上传时间:{{ item.createTime }}</view>
  7. </uni-card>
  8. </view>
  9. <view v-else class="nodata-img-parent">
  10. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  11. </view>
  12. <view class="bottom-sticky">
  13. <button class="recomm-button" @click="handleUpload">从微信导入简历</button>
  14. </view>
  15. </view>
  16. </template>
  17. <script setup>
  18. import { ref } from 'vue'
  19. import { getPersonResumeCv } from '@/api/user'
  20. // 获取附件
  21. const bioList = ref([])
  22. const getList = async () => {
  23. const { data } = await getPersonResumeCv()
  24. bioList.value = data
  25. }
  26. getList()
  27. const handleUpload = () => {
  28. wx.chooseMessageFile({
  29. count: 1,
  30. type: 'file',
  31. success (res) {
  32. console.log(res,'res');
  33. const tempFilePaths = res.tempFiles.map(item=>{
  34. return item.path
  35. })
  36. let name = res.tempFiles[0].name
  37. //效验是否为支持的文件格式
  38. if(/\.(pdf|docx|doc)$/.test(name)){
  39. console.log(tempFilePaths, name, '============')
  40. }else{
  41. uni.showToast({
  42. icon: 'none',
  43. title: '请上传pdf、word类型的文件',
  44. duration: 2000
  45. })
  46. return
  47. }
  48. }
  49. })
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. </style>