word.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="m-20">
  3. <view class="row-c r-20 sys-background-fff m-b20" v-for="(item,index) in stageList" :key="index">
  4. <view class="file-box r-20" @click="openDocument(item.attachmentAddress)">
  5. <view class="file-data">
  6. <view class="file-icon" v-if="item.attachmentFormat==='docx'">
  7. <image class="wh-45 " src="/page_task/static/img/task-details/icon-word.png" mode="aspectFill"></image>
  8. </view>
  9. <view class="file-icon file-icon-excel" v-if="item.attachmentFormat==='xlsx'">
  10. <image class="wh-45 " src="/page_task/static/img/task-details/icon-excel.png" mode="aspectFill"></image>
  11. </view>
  12. <view class="file-icon file-icon-pdf" v-if="item.attachmentFormat==='pdf'">
  13. <image class="wh-45 " src="/page_task/static/img/task-details/icon-pdf.png" mode="aspectFill"></image>
  14. </view>
  15. <view>
  16. <view>{{item.attachmentName}}</view>
  17. <view class="size-26 text-color-333 m-t10"><text>{{item.attachmentFormat}}</text>•<text>{{(item.attachmentSize/1024/1024).toFixed(2)}}MB</text></view>
  18. </view>
  19. </view>
  20. <view>
  21. <uni-icons type="right" size="20"></uni-icons>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name:'entities',
  30. props: {
  31. businessId:{
  32. default:0
  33. }
  34. },
  35. data() {
  36. return {
  37. stageList: []
  38. }
  39. },
  40. watch:{
  41. 'businessId':function () {
  42. // this.getStageList()
  43. }
  44. },
  45. mounted() {
  46. this.getStageList()
  47. },
  48. methods: {
  49. openDocument(url){
  50. uni.downloadFile({
  51. url: url,
  52. success: function (res) {
  53. let filePath = res.tempFilePath;
  54. uni.openDocument({
  55. filePath: filePath,
  56. showMenu: true,
  57. success: function (res) {
  58. console.log('打开文档成功');
  59. }
  60. });
  61. }
  62. });
  63. },
  64. getStageList() {
  65. this.stageList=[
  66. {'attachmentName':'拍卖裁定书.docx','attachmentFormat':'docx','attachmentSize':465445,'attachmentAddress':'https://storage.jd.com/auction.gateway/5EB379EF1ADA205F9525D1BFA9DC1D4D20250616121557808.docx'},
  67. {'attachmentName':'通知书(定向询价).pdf','attachmentFormat':'pdf','attachmentSize':284577,'attachmentAddress':'https://storage.jd.com/auction.gateway/2CC6F971D5CA2A11B829D01956446F3920250418151753793.pdf'},
  68. {'attachmentName':'评估报告1.pdf','attachmentFormat':'pdf','attachmentSize':3276836,'attachmentAddress':'https://storage.jd.com/auction.gateway/7F7226679C6E76620D9381906217543920250612120816112.pdf'},
  69. ]
  70. },
  71. },
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .file-box{
  76. box-shadow: 0 2rpx 6rpx 0 #0000001a, 0 2rpx 2px -2rpx #0000001a;
  77. width: 100%;
  78. padding: 32rpx;
  79. display: flex;
  80. align-items: center;
  81. justify-content: space-between;
  82. .file-data{
  83. display: flex;
  84. justify-content: flex-start;
  85. .file-icon{
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. width: 96rpx;
  90. height: 96rpx;
  91. border-radius: 20rpx;
  92. background-color:#f8f9ff;
  93. margin-right: 32rpx;
  94. }
  95. .file-icon-pdf{
  96. background-color: #fff8f8;
  97. }
  98. .file-icon-excel{
  99. background-color:#f6fffb;
  100. }
  101. }
  102. }
  103. .steps-item:last-child {
  104. margin-bottom: 0;
  105. }
  106. .steps-line {
  107. width: 2rpx;
  108. background-color: #D9D9D9;
  109. height: 90rpx;
  110. }
  111. </style>