cmy 2 bulan lalu
induk
melakukan
c0707e092e
6 mengubah file dengan 866 tambahan dan 150 penghapusan
  1. 6 3
      manifest.json
  2. 671 14
      pages/columnGoods/static/yszc.html
  3. 1 1
      pages/goods/order_confirm/index.vue
  4. TEMPAT SAMPAH
      pages/users/static/logo2.png
  5. TEMPAT SAMPAH
      static/images/support.png
  6. 188 132
      utils/util.js

+ 6 - 3
manifest.json

@@ -1,7 +1,7 @@
 {
-    "name" : "易趣水果",
+    "name" : "易趣C果园",
     "appid" : "__UNI__EF80BD1",
-    "description" : "易趣水果",
+    "description" : "易趣C果园",
     "versionName" : "2.6.0",
     "versionCode" : 267,
     "transformPx" : false,
@@ -65,7 +65,7 @@
                     "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                 ],
-                "abiFilters" : [ "armeabi-v7a" ],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
                 "permissionExternalStorage" : {
                     "request" : "none",
                     "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
@@ -132,6 +132,9 @@
                         "__platform__" : [ "ios", "android" ],
                         "appkey_ios" : "aeb768547b9d752891e37e1ca0a2b66d",
                         "appkey_android" : "41ec5c3f4d110ce02a326210fe147be8"
+                    },
+                    "system" : {
+                        "__platform__" : [ "ios", "android" ]
                     }
                 }
             },

File diff ditekan karena terlalu besar
+ 671 - 14
pages/columnGoods/static/yszc.html


+ 1 - 1
pages/goods/order_confirm/index.vue

@@ -1449,7 +1449,7 @@
 								let sweixin = res.find(i=>i.id==='weixin');
 								if(sweixin){
 									sweixin.launchMiniProgram({
-										id:'',
+										id: res.data.result.id,
 										userName:'',
 										path:res.data.result.counter_url,
 										type:0,//0正式1测试2体验

TEMPAT SAMPAH
pages/users/static/logo2.png


TEMPAT SAMPAH
static/images/support.png


+ 188 - 132
utils/util.js

@@ -630,72 +630,99 @@ export default {
 	 */
 	uploadImageOne: function(opt, successCallback, errorCallback) {
 		let that = this;
-		if (typeof opt === 'string') {
-			let url = opt;
-			opt = {};
-			opt.url = url;
+		// #ifdef APP
+		let boolad = uni.getStorageSync("boolLoad") || false
+		// if (permision.isIOS) {
+		if (boolad) {
+			upimg()
+		} else {
+			let title = '申请相册权限';
+			let content = "是否允许访问相册用于上传图片?"
+			uni.showModal({
+				title,
+				content,
+				cancelText: '拒绝',
+				confirmText: '允许',
+				success: res => {
+					if (res.confirm) {
+						uni.setStorageSync("boolLoad", true)
+						upimg()
+					}
+				},
+			});
 		}
-		let count = opt.count || 1,
-			sizeType = opt.sizeType || ['compressed'],
-			sourceType = opt.sourceType || ['album', 'camera'],
-			is_load = opt.is_load || true,
-			uploadUrl = opt.url || '',
-			inputName = opt.name || 'pics',
-			fileType = opt.fileType || 'image';
-		uni.chooseImage({
-			count: count, //最多可以选择的图片总数  
-			sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
-			sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
-			success: function(res) {
-				//启动上传等待中...  
-				uni.showLoading({
-					title: '图片上传中',
-				});
-				uni.uploadFile({
-					url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
-					filePath: res.tempFilePaths[0],
-					fileType: fileType,
-					name: inputName,
-					formData: {
-						'filename': inputName
-					},
-					header: {
-						// #ifdef MP
-						"Content-Type": "multipart/form-data",
-						// #endif
-						[TOKENNAME]: 'Bearer ' + store.state.app.token
-					},
-					success: function(res) {
-						uni.hideLoading();
-						if (res.statusCode == 403) {
-							that.Tips({
-								title: res.data
-							});
-						} else if (res.statusCode == 413) {
-							that.Tips({
-								title: '上传图片失败,请重新上传小尺寸图片'
-							});
-						} else {
-							let data = res.data ? JSON.parse(res.data) : {};
-							if (data.status == 200) {
-								successCallback && successCallback(data)
-							} else {
-								errorCallback && errorCallback(data);
+		// #endif
+		// #ifndef APP
+		upimg()
+		// #endif
+		function upimg() {
+			if (typeof opt === 'string') {
+				let url = opt;
+				opt = {};
+				opt.url = url;
+			}
+			let count = opt.count || 1,
+				sizeType = opt.sizeType || ['compressed'],
+				sourceType = opt.sourceType || ['album', 'camera'],
+				is_load = opt.is_load || true,
+				uploadUrl = opt.url || '',
+				inputName = opt.name || 'pics',
+				fileType = opt.fileType || 'image';
+			uni.chooseImage({
+				count: count, //最多可以选择的图片总数  
+				sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
+				sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
+				success: function(res) {
+					//启动上传等待中...  
+					uni.showLoading({
+						title: '图片上传中',
+					});
+					uni.uploadFile({
+						url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
+						filePath: res.tempFilePaths[0],
+						fileType: fileType,
+						name: inputName,
+						formData: {
+							'filename': inputName
+						},
+						header: {
+							// #ifdef MP
+							"Content-Type": "multipart/form-data",
+							// #endif
+							[TOKENNAME]: 'Bearer ' + store.state.app.token
+						},
+						success: function(res) {
+							uni.hideLoading();
+							if (res.statusCode == 403) {
+								that.Tips({
+									title: res.data
+								});
+							} else if (res.statusCode == 413) {
 								that.Tips({
-									title: data.msg
+									title: '上传图片失败,请重新上传小尺寸图片'
 								});
+							} else {
+								let data = res.data ? JSON.parse(res.data) : {};
+								if (data.status == 200) {
+									successCallback && successCallback(data)
+								} else {
+									errorCallback && errorCallback(data);
+									that.Tips({
+										title: data.msg
+									});
+								}
 							}
+						},
+						fail: function(res) {
+							uni.hideLoading();
+							that.Tips({
+								title: '上传图片失败'
+							});
 						}
-					},
-					fail: function(res) {
-						uni.hideLoading();
-						that.Tips({
-							title: '上传图片失败'
-						});
-					}
-				})
-			}
-		})
+					})
+				}
+			})
+		}
 	},
 	/*
 	 * 单图上传压缩版
@@ -705,81 +732,110 @@ export default {
 	 */
 	uploadImageChange: function(opt, successCallback, errorCallback, sizeCallback) {
 		let that = this;
-		if (typeof opt === 'string') {
-			let url = opt;
-			opt = {};
-			opt.url = url;
+		// #ifdef APP
+		let boolad = uni.getStorageSync("boolLoad") || false
+		// if (permision.isIOS) {
+		if (boolad || plus.os.name == "iOS") {
+			upimg()
+		} else {
+			let title = '申请相册权限';
+			let content = "是否允许访问相册用于上传图片?"
+			uni.showModal({
+				title,
+				content,
+				cancelText: '拒绝',
+				confirmText: '允许',
+				success: res => {
+					if (res.confirm) {
+						uni.setStorageSync("boolLoad", true)
+						upimg()
+					}
+				},
+			});
 		}
-		let count = opt.count || 1,
-			sizeType = opt.sizeType || ['compressed'],
-			sourceType = opt.sourceType || ['album', 'camera'],
-			is_load = opt.is_load || true,
-			uploadUrl = opt.url || '',
-			inputName = opt.name || 'pics',
-			fileType = opt.fileType || 'image';
-		uni.chooseImage({
-			count: count, //最多可以选择的图片总数  
-			sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
-			sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
-			success: function(res) {
-				//启动上传等待中...  
-				let imgSrc
-				let objImg = res.tempFilePaths;
-				objImg.forEach(item => {
-					uni.getImageInfo({
-						src: item,
-						success(ress) {
-							uni.showLoading({
-								title: '图片上传中',
-							});
-							if (res.tempFiles[0].size <= 2097152) {
-								uploadImg(ress.path)
-								return
-							}
-							// uploadImg(canvasPath.tempFilePath)
-							let canvasWidth, canvasHeight, xs, maxWidth = 750
-							xs = ress.width / ress.height // 宽高比例
-							if (ress.width > maxWidth) {
-								canvasWidth = maxWidth // 这里是最大限制宽度
-								canvasHeight = maxWidth / xs
-							} else {
-								canvasWidth = ress.width
-								canvasHeight = ress.height
-							}
-							sizeCallback && sizeCallback({
-								w: canvasWidth,
-								h: canvasHeight
-							})
-							let canvas = uni.createCanvasContext('canvas');
-							canvas.width = canvasWidth
-							canvas.height = canvasHeight
-							canvas.clearRect(0, 0, canvasWidth, canvasHeight);
-							canvas.drawImage(ress.path, 0, 0, canvasWidth, canvasHeight)
-							canvas.save();
-							// 这里的画布drawImage是一种异步属性  可能存在未绘制全就执行了draw的问题  so添加延迟
-							setTimeout(e => {
-								canvas.draw(true, () => {
-									uni.canvasToTempFilePath({
-										canvasId: 'canvas',
-										fileType: 'JPEG',
-										destWidth: canvasWidth,
-										destHeight: canvasHeight,
-										quality: 0.7,
-										success: function(
-											canvasPath) {
-											uploadImg(
+		// #endif
+		// #ifndef APP
+		upimg()
+		// #endif
+		function upimg() {
+			if (typeof opt === 'string') {
+				let url = opt;
+				opt = {};
+				opt.url = url;
+			}
+			let count = opt.count || 1,
+				sizeType = opt.sizeType || ['compressed'],
+				sourceType = opt.sourceType || ['album', 'camera'],
+				is_load = opt.is_load || true,
+				uploadUrl = opt.url || '',
+				inputName = opt.name || 'pics',
+				fileType = opt.fileType || 'image';
+			uni.chooseImage({
+				count: count, //最多可以选择的图片总数  
+				sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
+				sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
+				success: function(res) {
+					//启动上传等待中...  
+					let imgSrc
+					let objImg = res.tempFilePaths;
+					objImg.forEach(item => {
+						uni.getImageInfo({
+							src: item,
+							success(ress) {
+								uni.showLoading({
+									title: '图片上传中',
+								});
+								if (res.tempFiles[0].size <= 2097152) {
+									uploadImg(ress.path)
+									return
+								}
+								// uploadImg(canvasPath.tempFilePath)
+								let canvasWidth, canvasHeight, xs, maxWidth = 750
+								xs = ress.width / ress.height // 宽高比例
+								if (ress.width > maxWidth) {
+									canvasWidth = maxWidth // 这里是最大限制宽度
+									canvasHeight = maxWidth / xs
+								} else {
+									canvasWidth = ress.width
+									canvasHeight = ress.height
+								}
+								sizeCallback && sizeCallback({
+									w: canvasWidth,
+									h: canvasHeight
+								})
+								let canvas = uni.createCanvasContext('canvas');
+								canvas.width = canvasWidth
+								canvas.height = canvasHeight
+								canvas.clearRect(0, 0, canvasWidth, canvasHeight);
+								canvas.drawImage(ress.path, 0, 0, canvasWidth,
+									canvasHeight)
+								canvas.save();
+								// 这里的画布drawImage是一种异步属性  可能存在未绘制全就执行了draw的问题  so添加延迟
+								setTimeout(e => {
+									canvas.draw(true, () => {
+										uni.canvasToTempFilePath({
+											canvasId: 'canvas',
+											fileType: 'JPEG',
+											destWidth: canvasWidth,
+											destHeight: canvasHeight,
+											quality: 0.7,
+											success: function(
 												canvasPath
-												.tempFilePath
+												) {
+												uploadImg(
+													canvasPath
+													.tempFilePath
 												)
-										}
-									})
-								});
-							}, 200)
-						}
+											}
+										})
+									});
+								}, 200)
+							}
+						})
 					})
-				})
-			}
-		})
+				}
+			})
+		}
 
 		function uploadImg(filePath) {
 			uni.uploadFile({

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini