credit-item.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="animate__animated animate__fadeIn">
  3. <view class="p-lr20 p-b40" v-if="list.length>0">
  4. <view class="sys-background-fff r-30 text-color-12 p-20 m-b20" v-for="(item,index) in list" :key="index">
  5. <view class="row-justify-sb center">
  6. <view class="size-30 sys-weight-600 credit-file-name ellipsis">{{item.file_name}}</view>
  7. <image v-if="item.status>=2" class="credit-file-icon"
  8. :src="'/page_subpack/static/img/task-details/icon-'+item.status+'.png'" mode="aspectFill">
  9. </image>
  10. </view>
  11. <view class="sys-from-background-color size-24 text-color-666 p-20 r-20 m-tb20">
  12. <view>
  13. <text>任务编号:</text>
  14. <text>{{item.task_sn}}</text>
  15. </view>
  16. <view class="m-t10">
  17. <text>备注:</text>
  18. <text> {{item.msg?item.msg:'无'}}</text>
  19. </view>
  20. </view>
  21. <view class="row-justify-sb center">
  22. <text class="size-24 text-color-999 flex">{{item.created_at}}上传</text>
  23. <button class="credit-item-button sys-weight-500 size-28" type="default" hover-class="is-hover"
  24. v-if="item.status === 3" @click="downPdf(item)">下载</button>
  25. </view>
  26. </view>
  27. </view>
  28. <en-blank v-if="list.length<=0"></en-blank>
  29. </view>
  30. </template>
  31. <script>
  32. import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
  33. export default {
  34. components: {
  35. EnBlank
  36. },
  37. props: {
  38. list: {
  39. default: []
  40. }
  41. },
  42. data() {
  43. return {
  44. }
  45. },
  46. methods: {
  47. downPdf(item) {
  48. uni.downloadFile({
  49. url: item.file_url,
  50. success: function(res) {
  51. let filePath = res.tempFilePath;
  52. uni.openDocument({
  53. filePath: filePath,
  54. fileType: 'xlsx',
  55. showMenu: true,
  56. success: function(res) {
  57. console.log('打开文档成功');
  58. }
  59. });
  60. // wx.shareFileMessage({
  61. //
  62. // })
  63. }
  64. });
  65. },
  66. },
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .credit-item-button {
  71. width: 173rpx;
  72. color: #fff;
  73. background: #0FB160;
  74. line-height: 70rpx;
  75. border-radius: 100rpx;
  76. }
  77. .credit-file-icon {
  78. width: 93rpx;
  79. height: 80rpx;
  80. display: block;
  81. }
  82. .credit-file-name {
  83. max-width: 500rpx;
  84. }
  85. button::after {
  86. border: none;
  87. }
  88. </style>