dever 4 rokov pred
rodič
commit
1c7cf0630d
2 zmenil súbory, kde vykonal 21 pridanie a 16 odobranie
  1. 19 15
      lib/dever/index.js
  2. 2 1
      pages/dream/func/share.vue

+ 19 - 15
lib/dever/index.js

@@ -836,7 +836,7 @@ var dever = {
 		//#ifdef H5
 		this.source = 'h5';
 		this.source_id = 1;
-		this.host = window.location.protocol + '//' + window.location.host + '/#';
+		this.host = window.location.protocol + '//' + window.location.host + '/web/#';
 		//#endif
 		//#ifdef APP-PLUS
 		this.source = uni.getSystemInfoSync().platform;
@@ -1572,21 +1572,10 @@ var dever = {
 				imgs = temp;
 			}
 			// 检测图片是否原图
-			if (img.indexOf('?') != -1) {
-				var t = img.split('?');
-				img = t[0];
+			img = this.getImg(img);
+			if (imgs.length > 0)  {
 				for (i in imgs) {
-					t = imgs[i].split('?');
-					imgs[i] = t[0];
-				}
-			} else if (img.indexOf('_t') != -1) {
-				var t = img.split('.');
-				var ext = t[1];
-				t = img.split('_t');
-				img = t[0] + '.' + ext;
-				for (i in imgs) {
-					t = imgs[i].split('_t');
-					imgs[i] = t[0] + '.' + ext;
+					imgs[i] = this.getImg(imgs[i]);
 				}
 			}
 			uni.previewImage({
@@ -1610,6 +1599,21 @@ var dever = {
 		}
 	},
 	
+	//获取原图
+	getImg : function(img) {
+		if (img.indexOf('?') != -1) {
+			var t = img.split('?');
+			img = t[0];
+		} else if (img.indexOf('_t') != -1) {
+			var t = img.split('.');
+			var ext = t[1];
+			t = img.split('_t');
+			img = t[0] + '.' + ext;
+		}
+		
+		return img;
+	},
+	
 	//截取APP退出功能
 	quit : function(page, call) {
 		var self = this;

+ 2 - 1
pages/dream/func/share.vue

@@ -228,8 +228,9 @@ export default {
 		//下载图片
 		downPic : function(ctx, resolve, reject) {
 			var self = this;
+			var pic = self.Dever.getImg(self.fetch.pic[self.swiperIndex]);
 			uni.downloadFile({
-				url: self.fetch.pic[self.swiperIndex],
+				url: pic,
 				success: (res) => {
 					if (res.statusCode === 200) {
 						uni.getImageInfo({