浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

ccj 2 年之前
父节点
当前提交
2c2d5092a0
共有 2 个文件被更改,包括 22 次插入5 次删除
  1. 2 2
      config/index.js
  2. 20 3
      pages/task/audit/acquisitioncontract.vue

+ 2 - 2
config/index.js

@@ -7,9 +7,9 @@ const dev = {
 	// baseUrlNew: 'http://192.168.1.122:8090/',
 	// baseUrlNew: 'http://192.168.110.82:8099/',
 	// baseUrlNew: 'http://192.168.110.202:8090/',
-	baseUrlNew: 'http://192.168.110.138:8090/',
+	// baseUrlNew: 'http://192.168.110.138:8090/',
 	// 上传图片的
-	// baseUrlNew: 'https://api2.eliangeyun.com/',
+	baseUrlNew: 'https://api2.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 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