credit-item.vue 2.2 KB

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