gjy 2 years ago
parent
commit
335e34427c
1 changed files with 20 additions and 3 deletions
  1. 20 3
      pages/task/audit/acquisitioncontract.vue

+ 20 - 3
pages/task/audit/acquisitioncontract.vue

@@ -105,9 +105,11 @@
 				</view> -->
 				<view v-if='imglist.length'>
 					<view v-for='item in imglist'>
-					<view @click='shadeshow(item)'>
-						<image style='width: 200rpx;height: 200rpx;' :src="item" mode=""></image>
-					</view>
+						<view class="" style="color: #19be6b;text-decoration:underline;" @click="openDocument(item)">
+							点击下载
+						</view>
+						<!-- <u-icon name="attach" ></u-icon> -->
+						<!-- <image style='width: 200rpx;height: 200rpx;' :src="item" mode=""></image> -->
 				</view>
 				</view>
 				
@@ -241,6 +243,21 @@
 
 		},
 		methods: {
+			openDocument(src){
+				uni.downloadFile({
+				  url: src,
+				  success: function (res) {
+				    var filePath = res.tempFilePath;
+				    uni.openDocument({
+				      filePath: filePath,
+				      showMenu: true,
+				      success: function (res) {
+				        console.log('打开文档成功');
+				      }
+				    });
+				  }
+				});
+			},
 			shadeshow(url) {
 				this.imgShow = true
 				this.url = url