USER-20230908AJ\Administrator 2 долоо хоног өмнө
parent
commit
5b5dc3e39e

+ 10 - 1
page_task/task_details/module/word.vue

@@ -2,7 +2,7 @@
   <view class="m-20">
 
     <view class="row-c r-20 sys-background-fff m-b20" v-for="(item,index) in stageList" :key="index">
-      <view class="file-box r-20">
+      <view class="file-box r-20" @click="openDocument(item.attachmentAddress)">
         <view class="file-data">
           <view class="file-icon" v-if="item.attachmentFormat==='docx'">
             <image class="wh-45 " src="/page_task/static/img/task-details/icon-word.png" mode="aspectFill"></image>
@@ -50,6 +50,15 @@ export default {
     this.getStageList()
   },
   methods: {
+    openDocument(url){
+      uni.openDocument({
+        filePath: url,
+        showMenu: true,
+        success: function (res) {
+          console.log('打开文档成功');
+        }
+      });
+    },
     getStageList() {
       this.stageList=[
         {'attachmentName':'拍卖裁定书.docx','attachmentFormat':'docx','attachmentSize':465445,'attachmentAddress':'https://storage.jd.com/auction.gateway/5EB379EF1ADA205F9525D1BFA9DC1D4D20250616121557808.docx'},