Browse Source

上传图片

ck@123911.net 4 days ago
parent
commit
d3802ec0d0
3 changed files with 1124 additions and 970 deletions
  1. 402 392
      pages/make/fabuArticle.vue
  2. 16 12
      pages/my/editInfo.vue
  3. 706 566
      pages/my/initiateCrowdfunding.vue

+ 402 - 392
pages/make/fabuArticle.vue

@@ -110,450 +110,460 @@
 </template>
 
 <script>
-import permission from '@/common/permission.js';
-export default {
-	components: {},
-	data() {
-		return {
-			skey: '',
-			uinfo: {},
-			is_first: 0,
-			pid: 0,
-			sel: 0,
-			pop_sel: false,
-			cate: '',
-			cid: 0,
-			catename: '',
-			img2: '',
-			cateNames: [],
-			cate_list: [],
-			CateIndex: 0,
-			nameList1: [],
-			nameList2: [],
-			content: '',
-			cate: '',
-			ainfo: {
-				id: 0,
-				title: '',
+	import permission from '@/common/permission.js';
+	export default {
+		components: {},
+		data() {
+			return {
+				skey: '',
+				uinfo: {},
+				is_first: 0,
+				pid: 0,
+				sel: 0,
+				pop_sel: false,
+				cate: '',
+				cid: 0,
+				catename: '',
+				img2: '',
+				cateNames: [],
+				cate_list: [],
+				CateIndex: 0,
+				nameList1: [],
+				nameList2: [],
 				content: '',
-				name: '',
-				telphone: '',
-				address: '',
-				contact: '',
-				num: '',
-			},
-			TypeArray: ['请选择', '线下服务', '电话咨询', '远程服务', '视频咨询', '其他服务'],
-			TypeIndex: 0,
-			TypeArray2: ['请选择', '次', '天', '小时', '分钟', '周', '月', '年', '单', '份'],
-			TypeIndex2: 0,
-			img_list: [],
-			img_list2: [],
-			img_list1: [],
-			visible: false,
-			maskCloseAble: true,
-			str: '',
-			defaultValue: '',
-			listData: [],
-			cateTag: [],
-			money: '',
-			item_gz: -1,
-			item_time: [],
-			item_dx: [],
-			is_top: false,
-			is_agree: 0,
-			selectedWork: {}
-		}
-	},
-
-	onLoad(params) {
-		if (getApp().globalData.skey != "") {
-			this.skey = getApp().globalData.skey;
-		} else {
-			this.skey = params.skey || ''; //1234567xef
-		}
-		if (params.id) {
-
-			this.id = params.id;
-		} else {
-			this.id = -1;
-
-		}
-		let that = this;
-		// this.getCate();
-		that.getInfo();
-		// this.getData();
-
-		// 添加事件监听
-		uni.$on('selectItem', this.handleSelect);
-
-
-	},
-	onUnload() {
-		uni.$off('selectItem', this.handleSelect);
-	},
-	onShow() {
-		let that = this;
-	},
-	methods: {
-		goBack() {
-			uni.navigateBack();
+				cate: '',
+				ainfo: {
+					id: 0,
+					title: '',
+					content: '',
+					name: '',
+					telphone: '',
+					address: '',
+					contact: '',
+					num: '',
+				},
+				TypeArray: ['请选择', '线下服务', '电话咨询', '远程服务', '视频咨询', '其他服务'],
+				TypeIndex: 0,
+				TypeArray2: ['请选择', '次', '天', '小时', '分钟', '周', '月', '年', '单', '份'],
+				TypeIndex2: 0,
+				img_list: [],
+				img_list2: [],
+				img_list1: [],
+				visible: false,
+				maskCloseAble: true,
+				str: '',
+				defaultValue: '',
+				listData: [],
+				cateTag: [],
+				money: '',
+				item_gz: -1,
+				item_time: [],
+				item_dx: [],
+				is_top: false,
+				is_agree: 0,
+				selectedWork: {}
+			}
 		},
-		handleSelect(item) {
-			console.log(item, '收到修改的数据');
 
-			this.selectedWork = item;
-		},
-		onManage() {
-			// 处理管理按钮点击
-			// uni.redirectTo({
-			// 	url: '/pages/make/manageArticle'
-			// })
-			uni.navigateTo({
-				url: '/pages/make/relatedWorks'
-			})
-		},
-		onPublish() {
-			this.onSubmit();
-		},
-		copyKd(item_data) {
-			if (item_data != "") {
-				uni.setClipboardData({
-					data: item_data, // e是需要设置的内容
-					success: function () {
-						uni.showToast({
-							title: '网址已复制',
-							icon: 'none'
-						})
-					}
-				})
+		onLoad(params) {
+			if (getApp().globalData.skey != "") {
+				this.skey = getApp().globalData.skey;
+			} else {
+				this.skey = params.skey || ''; //1234567xef
 			}
-		},
-		agreeChk() {
-			if (this.is_agree == 0) {
-				this.is_agree = 1;
+			if (params.id) {
+
+				this.id = params.id;
 			} else {
-				this.is_agree = 0;
+				this.id = -1;
+
 			}
+			let that = this;
+			// this.getCate();
+			that.getInfo();
+			// this.getData();
+
+			// 添加事件监听
+			uni.$on('selectItem', this.handleSelect);
+
+
 		},
-		showPicker() {
-			this.pop_sel = true;
-		},
-		open() {
-			this.visible = true
-		},
-		confirm(val) {
-			console.log(val)
-			this.defaultValue = val.code
-			this.ainfo.city = val.desc
-			this.visible = false
+		onUnload() {
+			uni.$off('selectItem', this.handleSelect);
 		},
-		cancel() {
-			this.visible = false
+		onShow() {
+			let that = this;
 		},
-		delIt(ind) {
-			let arr = [];
-			if (this.img_list.length > 0) {
-				for (let i = 0; i < this.img_list.length; i++) {
-					if (i == ind) { } else {
-						arr.push(this.img_list[i]);
+		methods: {
+			goBack() {
+				uni.navigateBack();
+			},
+			handleSelect(item) {
+				console.log(item, '收到修改的数据');
+
+				this.selectedWork = item;
+			},
+			onManage() {
+				// 处理管理按钮点击
+				// uni.redirectTo({
+				// 	url: '/pages/make/manageArticle'
+				// })
+				uni.navigateTo({
+					url: '/pages/make/relatedWorks'
+				})
+			},
+			onPublish() {
+				this.onSubmit();
+			},
+			copyKd(item_data) {
+				if (item_data != "") {
+					uni.setClipboardData({
+						data: item_data, // e是需要设置的内容
+						success: function() {
+							uni.showToast({
+								title: '网址已复制',
+								icon: 'none'
+							})
+						}
+					})
+				}
+			},
+			agreeChk() {
+				if (this.is_agree == 0) {
+					this.is_agree = 1;
+				} else {
+					this.is_agree = 0;
+				}
+			},
+			showPicker() {
+				this.pop_sel = true;
+			},
+			open() {
+				this.visible = true
+			},
+			confirm(val) {
+				console.log(val)
+				this.defaultValue = val.code
+				this.ainfo.city = val.desc
+				this.visible = false
+			},
+			cancel() {
+				this.visible = false
+			},
+			delIt(ind) {
+				let arr = [];
+				if (this.img_list.length > 0) {
+					for (let i = 0; i < this.img_list.length; i++) {
+						if (i == ind) {} else {
+							arr.push(this.img_list[i]);
+						}
 					}
+					this.img_list = arr;
 				}
-				this.img_list = arr;
-			}
-		},
-		getInfo() {
-			var that = this;
-
-			uni.request({
-				url: this.$apiHost + '/Article/getinfo', //仅为示例,并非真实接口地址。
-				data: {
-					uuid: getApp().globalData.uuid,
-					id: this.id
-				},
-				header: {
-					'content-type': 'application/json' //自定义请求头信息
-				},
-				success: (res) => {
-					console.log("====", res.data);
-					this.ainfo = res.data.article;
-					that.img_list1 = [];
-					that.img_list = [];
-					that.img_list2 = [];
-					this.selectedWork = res.data.work_info;
-
-					if (res.data.article.images.length > 1) {
-						let arr = res.data.article.images.split("|");
-						if (arr.length > 0) {
-							for (let i = 0; i < arr.length; i++) {
-								if (arr[i].length > 10) {
-									that.img_list.push(arr[i]);
+			},
+			getInfo() {
+				var that = this;
+
+				uni.request({
+					url: this.$apiHost + '/Article/getinfo', //仅为示例,并非真实接口地址。
+					data: {
+						uuid: getApp().globalData.uuid,
+						id: this.id
+					},
+					header: {
+						'content-type': 'application/json' //自定义请求头信息
+					},
+					success: (res) => {
+						console.log("====", res.data);
+						this.ainfo = res.data.article;
+						that.img_list1 = [];
+						that.img_list = [];
+						that.img_list2 = [];
+						this.selectedWork = res.data.work_info;
+
+						if (res.data.article.images.length > 1) {
+							let arr = res.data.article.images.split("|");
+							if (arr.length > 0) {
+								for (let i = 0; i < arr.length; i++) {
+									if (arr[i].length > 10) {
+										that.img_list.push(arr[i]);
+									}
 								}
 							}
 						}
-					}
 
-				}
-			});
+					}
+				});
 
 
-		},
-		checkField(str, tips) {
-			if (str.length < 2) {
-				uni.showToast({
-					title: tips,
-					icon: 'none'
-				});
-				return false;
-			}
-			return true;
-		},
-		onSubmit() {
-			console.log("skey", this.skey);
+			},
+			checkField(str, tips) {
+				if (str.length < 2) {
+					uni.showToast({
+						title: tips,
+						icon: 'none'
+					});
+					return false;
+				}
+				return true;
+			},
+			onSubmit() {
+				console.log("skey", this.skey);
 
-			// 校验标题
-			if (this.checkField(this.ainfo.title, "请输入名称") == false) {
-				return;
-			}
+				// 校验标题
+				if (this.checkField(this.ainfo.title, "请输入名称") == false) {
+					return;
+				}
 
-			// 校验内容
-			if (this.checkField(this.ainfo.content, "请输入具体内容") == false) {
-				return;
-			}
+				// 校验内容
+				if (this.checkField(this.ainfo.content, "请输入具体内容") == false) {
+					return;
+				}
 
-			// 校验是否正在提交
-			if (this.is_submit > 0) {
-				return;
-			}
-			// 构建图片字符串
-			let img_str = '';
-			if (this.img_list.length > 0) {
-				for (let i = 0; i < this.img_list.length; i++) {
-					img_str += this.img_list[i] + "|";
+				// 校验是否正在提交
+				if (this.is_submit > 0) {
+					return;
 				}
-			}
-			// 校验图片数量和作品选择
-			if (this.img_list.length < 1 && !this.selectedWork.id) {
-				uni.showToast({
-					title: '请上传 图片 或 选择一个作品',
-					icon: 'none'
-				});
-				return;
-			} else {
-				if (!this.selectedWork.id) {
-					// 校验图片字符串有效性(可选,因为已经检查了图片数量)
-					if (!img_str || img_str.trim().length < 2) {
-						uni.showToast({
-							title: '请确保至少上传一张有效图片作为封面',
-							icon: 'none'
-						});
-						return;
-					}
-					// 校验图片数量不超过 5 张
-					if (this.img_list.length > 5) {
-						uni.showToast({
-							title: '最多只能上传 5 张图片',
-							icon: 'none'
-						});
-						return;
+				// 构建图片字符串
+				let img_str = '';
+				if (this.img_list.length > 0) {
+					for (let i = 0; i < this.img_list.length; i++) {
+						img_str += this.img_list[i] + "|";
 					}
 				}
+				// 校验图片数量和作品选择
+				if (this.img_list.length < 1 && !this.selectedWork.id) {
+					uni.showToast({
+						title: '请上传 图片 或 选择一个作品',
+						icon: 'none'
+					});
+					return;
+				} else {
+					if (!this.selectedWork.id) {
+						// 校验图片字符串有效性(可选,因为已经检查了图片数量)
+						if (!img_str || img_str.trim().length < 2) {
+							uni.showToast({
+								title: '请确保至少上传一张有效图片作为封面',
+								icon: 'none'
+							});
+							return;
+						}
+						// 校验图片数量不超过 5 张
+						if (this.img_list.length > 5) {
+							uni.showToast({
+								title: '最多只能上传 5 张图片',
+								icon: 'none'
+							});
+							return;
+						}
+					}
 
-			}
+				}
 
 
 
 
 
-			let that = this;
-			this.is_submit = 1;
-			uni.request({
-				url: this.$apiHost + '/Article/add',
-				data: {
-					uuid: getApp().globalData.uuid,
-					id: this.ainfo.id,
-					title: this.ainfo.title,
-					content: this.ainfo.content,
-					img_list: img_str,
-					work_id: this.selectedWork.id
+				let that = this;
+				this.is_submit = 1;
+				uni.request({
+					url: this.$apiHost + '/Article/add',
+					data: {
+						uuid: getApp().globalData.uuid,
+						id: this.ainfo.id,
+						title: this.ainfo.title,
+						content: this.ainfo.content,
+						img_list: img_str,
+						work_id: this.selectedWork.id
 
-				},
-				//data: formdata,   // 这里传入你的参数(json格式)
-				method: 'POST',
-				header: {
-					'Content-Type': 'application/x-www-form-urlencoded',
-					'sign': getApp().globalData.headerSign
-				},
-				dataType: 'json',
-				success: (res) => {
-					console.log("---", res.data);
+					},
+					//data: formdata,   // 这里传入你的参数(json格式)
+					method: 'POST',
+					header: {
+						'Content-Type': 'application/x-www-form-urlencoded',
+						'sign': getApp().globalData.headerSign
+					},
+					dataType: 'json',
+					success: (res) => {
+						console.log("---", res.data);
+						uni.showToast({
+							title: res.data.str,
+							icon: 'none'
+						});
+						if (res.data.success == "yes") {
+							// if (that.ainfo.id > 0) {
+							console.log(1);
+
+							setTimeout(function() {
+								uni.$emit('switchToMyPage', {
+									type: 'article'
+								});
+								uni.switchTab({
+									url: '/pages/my/my'
+								})
+							}, 500);
+							// } else {
+							console.log(2);
+
+							that.ainfo.title = '';
+							that.ainfo.content = '';
+							that.ainfo.num = '';
+							that.img_list = [];
+							// }
+						} else {}
+						this.is_submit = 0;
+
+					},
+					fail: (err) => {
+						console.log('登录失败:', err);
+						this.is_submit = 0;
+					},
+					complete: (com) => {}
+				})
+			},
+			select(e) {
+				console.log('选择文件:', e)
+			},
+			upload(type) {
+				if (this.img_list.length >= 5) {
 					uni.showToast({
-						title: res.data.str,
+						title: '最多只能上传5张图片',
 						icon: 'none'
 					});
-					if (res.data.success == "yes") {
-						// if (that.ainfo.id > 0) {
-						console.log(1);
-
-						setTimeout(function () {
-							uni.$emit('switchToMyPage', { type: 'article' });
-							uni.switchTab({ url: '/pages/my/my' })
-						}, 500);
-						// } else {
-						console.log(2);
-
-						that.ainfo.title = '';
-						that.ainfo.content = '';
-						that.ainfo.num = '';
-						that.img_list = [];
-						// }
-					} else { }
-					this.is_submit = 0;
-
-				},
-				fail: (err) => {
-					console.log('登录失败:', err);
-					this.is_submit = 0;
-				},
-				complete: (com) => { }
-			})
-		},
-		select(e) {
-			console.log('选择文件:', e)
-		},
-		upload(type) {
-			if (this.img_list.length >= 5) {
-				uni.showToast({
-					title: '最多只能上传5张图片',
-					icon: 'none'
-				});
-				return
-			}
-			uni.showActionSheet({
-				itemList: ['拍照', '从相册选择'],
-				success: (res) => {
-					const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
-					this.checkRights(sourceType);
+					return
 				}
-			});
-		},
-		async checkRights(sourceType) {
-			try {
-				let hasPermission = false;
-
-				if (sourceType === 'camera') {
-					hasPermission = await permission.request(permission.PermissionType.CAMERA, {
-						title: '“萌创星球”想访问你的相机',
-						describe: '萌创星球想访问您的摄像头,便于拍摄获取图片来与其他用户进行交流'
-					});
+				uni.showActionSheet({
+					itemList: ['拍照', '从相册选择'],
+					success: (res) => {
+						const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
+						if (plus.os.name.toLowerCase() === 'android') {
+							this.checkRights(sourceType);
+						} else {
+							this.upload2('list', sourceType);
 
-					if (!hasPermission) {
-						uni.showToast({
-							title: '未获得相机权限',
-							icon: 'none'
-						});
-						return;
+						}
 					}
-				} else {
-					hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
-						title: '“萌创星球”想访问你的照片图库',
-						describe: '萌创星球想访问您本地照片图库,便于获取图片来与其他用户进行交流'
-					});
+				});
+			},
+			async checkRights(sourceType) {
+				try {
+					let hasPermission = false;
+
+					if (sourceType === 'camera') {
+						hasPermission = await permission.request(permission.PermissionType.CAMERA, {
+							title: '“萌创星球”想访问你的相机',
+							describe: '萌创星球想访问您的摄像头,便于拍摄获取图片来与其他用户进行交流'
+						});
 
-					if (!hasPermission) {
-						uni.showToast({
-							title: '未获得相册权限',
-							icon: 'none'
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得相机权限',
+								icon: 'none'
+							});
+							return;
+						}
+					} else {
+						hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
+							title: '“萌创星球”想访问你的照片图库',
+							describe: '萌创星球想访问您本地照片图库,便于获取图片来与其他用户进行交流'
 						});
-						return;
+
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得相册权限',
+								icon: 'none'
+							});
+							return;
+						}
 					}
-				}
 
-				// 权限获取成功后,继续执行上传
-				this.upload2('list', sourceType);
-			} catch (error) {
-				console.error('权限检查失败:', error);
-				uni.showToast({
-					title: '权限检查失败',
-					icon: 'none'
-				});
-			}
-		},
-		upload2(type, sourceType) {
-			console.log("----upload");
-			var _self = this;
-			uni.chooseImage({
-				count: 5,
-				sizeType: ['compressed'],
-				sourceType: [sourceType],
-				success: function (res) {
-					console.log('res:', res)
-					for (let index = 0; index < res.tempFilePaths.length; index++) {
-						let filepath = "";
-						// #ifdef H5
-						filepath = res.tempFiles[index].path;
-						// #endif
-
-						// #ifdef APP-PLUS
-						filepath = res.tempFilePaths[index];
-						// #endif
-
-						_self.imglocal = filepath; //res.tempFilePaths[0]
-						const uploadTask = uni.uploadFile({
-							url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey, // post请求地址
-							filePath: filepath,
-							name: 'file', // 待确认
-							success: function (uploadFileRes) {
-								let resdata = JSON.parse(uploadFileRes.data)
-								console.log('Success1:', uploadFileRes);
-								if (resdata.success == 'no') {
-									uni.showToast({
-										title: resdata.str,
-										icon: 'none'
-									});
-									return;
-								}
-								if (resdata.code == 0) {
-									console.log('Success2:', resdata.data.path);
-									if (type == 'avatar') {
-										_self.img2 = resdata.data.path;
-									} else if (type == 'list') {
-										_self.img_list.push(resdata.data.path)
-										console.log('_self.img_list:', _self.img_list);
-									} else if (type == 'list2') {
-										_self.img_list2.push(resdata.data.path)
-									} else if (type == 'list1') {
-										_self.img_list1.push(resdata.data.path)
+					// 权限获取成功后,继续执行上传
+					this.upload2('list', sourceType);
+				} catch (error) {
+					console.error('权限检查失败:', error);
+					uni.showToast({
+						title: '权限检查失败',
+						icon: 'none'
+					});
+				}
+			},
+			upload2(type, sourceType) {
+				console.log("----upload");
+				var _self = this;
+				uni.chooseImage({
+					count: 5,
+					sizeType: ['compressed'],
+					sourceType: [sourceType],
+					success: function(res) {
+						console.log('res:', res)
+						for (let index = 0; index < res.tempFilePaths.length; index++) {
+							let filepath = "";
+							// #ifdef H5
+							filepath = res.tempFiles[index].path;
+							// #endif
+
+							// #ifdef APP-PLUS
+							filepath = res.tempFilePaths[index];
+							// #endif
+
+							_self.imglocal = filepath; //res.tempFilePaths[0]
+							const uploadTask = uni.uploadFile({
+								url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self
+								.skey, // post请求地址
+								filePath: filepath,
+								name: 'file', // 待确认
+								success: function(uploadFileRes) {
+									let resdata = JSON.parse(uploadFileRes.data)
+									console.log('Success1:', uploadFileRes);
+									if (resdata.success == 'no') {
+										uni.showToast({
+											title: resdata.str,
+											icon: 'none'
+										});
+										return;
+									}
+									if (resdata.code == 0) {
+										console.log('Success2:', resdata.data.path);
+										if (type == 'avatar') {
+											_self.img2 = resdata.data.path;
+										} else if (type == 'list') {
+											_self.img_list.push(resdata.data.path)
+											console.log('_self.img_list:', _self.img_list);
+										} else if (type == 'list2') {
+											_self.img_list2.push(resdata.data.path)
+										} else if (type == 'list1') {
+											_self.img_list1.push(resdata.data.path)
+										}
 									}
+								},
+								fail: function(uploadFileFail) {
+									console.log('Error:', uploadFileFail.data);
+								},
+								complete: () => {
+									console.log('Complete:');
 								}
-							},
-							fail: function (uploadFileFail) {
-								console.log('Error:', uploadFileFail.data);
-							},
-							complete: () => {
-								console.log('Complete:');
-							}
-						});
-					}
-				},
+							});
+						}
+					},
 
-				error: function (e) {
+					error: function(e) {
 
-					console.log(e);
+						console.log(e);
 
-				}
+					}
 
-			});
+				});
 
 
-		},
-		deleteWorkInfo() {
-			this.selectedWork = {}
+			},
+			deleteWorkInfo() {
+				this.selectedWork = {}
 
+			}
 		}
 	}
-}
 </script>
 
 <style scoped lang="scss">
-@import 'fabuArticle.scss';
+	@import 'fabuArticle.scss';
 </style>

+ 16 - 12
pages/my/editInfo.vue

@@ -447,20 +447,24 @@
 			},
 			async chooseImage(sourceType) {
 				try {
-					let hasPermission = false;
+					if (plus.os.name.toLowerCase() === 'android') {
+						let hasPermission = false;
 
-					if (sourceType === 'camera') {
-						hasPermission = await this.checkCameraPermission();
-					} else if (sourceType === 'album') {
-						hasPermission = await this.checkPhotoLibraryPermission();
-					}
+						if (sourceType === 'camera') {
+							hasPermission = await this.checkCameraPermission();
+						} else if (sourceType === 'album') {
+							hasPermission = await this.checkPhotoLibraryPermission();
+						}
+
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得权限',
+								icon: 'none'
+							});
+							return;
+						}
+					} else {
 
-					if (!hasPermission) {
-						uni.showToast({
-							title: '未获得权限',
-							icon: 'none'
-						});
-						return;
 					}
 
 					uni.chooseImage({

+ 706 - 566
pages/my/initiateCrowdfunding.vue

@@ -69,150 +69,162 @@
 </template>
 
 <script>
-import permission from '@/common/permission.js';
-export default {
-	components: {},
-	data() {
-		return {
-			skey: '',
-			pop_sel: false,
-			cid: 0,
-			catename: '',
-			img2: '',
-			ainfo: {
-				id: 0,
-				title: '',
-				content: '',
-				name: '',
-				telphone: '',
-				address: '',
-				contact: '',
-				num: '',
-			},
-			img_list: [],
-			video_path: '',
-			is_agree: 0,
-			selectedWork: {},
-			content_images: [],
-		}
-	},
+	import permission from '@/common/permission.js';
+	export default {
+		components: {},
+		data() {
+			return {
+				skey: '',
+				pop_sel: false,
+				cid: 0,
+				catename: '',
+				img2: '',
+				ainfo: {
+					id: 0,
+					title: '',
+					content: '',
+					name: '',
+					telphone: '',
+					address: '',
+					contact: '',
+					num: '',
+				},
+				img_list: [],
+				video_path: '',
+				is_agree: 0,
+				selectedWork: {},
+				content_images: [],
+			}
+		},
 
-	onLoad(params) {
-		if (getApp().globalData.skey != "") {
-			this.skey = getApp().globalData.skey;
-		} else {
-			this.skey = params.skey || ''; //1234567xef
-		}
-		if (params.id) {
+		onLoad(params) {
+			if (getApp().globalData.skey != "") {
+				this.skey = getApp().globalData.skey;
+			} else {
+				this.skey = params.skey || ''; //1234567xef
+			}
+			if (params.id) {
+
+				this.id = params.id;
+			} else {
+				this.id = -1;
+
+			}
+			let that = this;
+			// this.getCate();
+			that.getInfo();
+			// this.getData();
+
+			// 添加事件监听
+			uni.$on('selectItem', this.handleSelect);
 
-			this.id = params.id;
-		} else {
-			this.id = -1;
 
-		}
-		let that = this;
-		// this.getCate();
-		that.getInfo();
-		// this.getData();
-
-		// 添加事件监听
-		uni.$on('selectItem', this.handleSelect);
-
-
-	},
-	onUnload() {
-		uni.$off('selectItem', this.handleSelect);
-	},
-	onShow() {
-		let that = this;
-	},
-	methods: {
-		goBack() {
-			uni.navigateBack();
 		},
-		handleSelect(item) {
-			this.selectedWork = item;
+		onUnload() {
+			uni.$off('selectItem', this.handleSelect);
 		},
-		delIt(ind) {
-			let arr = [];
-			if (this.img_list.length > 0) {
-				for (let i = 0; i < this.img_list.length; i++) {
-					if (i !== ind) {
-						arr.push(this.img_list[i]);
+		onShow() {
+			let that = this;
+		},
+		methods: {
+			goBack() {
+				uni.navigateBack();
+			},
+			handleSelect(item) {
+				this.selectedWork = item;
+			},
+			delIt(ind) {
+				let arr = [];
+				if (this.img_list.length > 0) {
+					for (let i = 0; i < this.img_list.length; i++) {
+						if (i !== ind) {
+							arr.push(this.img_list[i]);
+						}
 					}
+					this.img_list = arr;
 				}
-				this.img_list = arr;
-			}
-		},
-		getInfo() {
-			var that = this;
-			uni.request({
-				url: this.$apiHost + '/Article/getinfo',
-				data: {
-					uuid: getApp().globalData.uuid,
-					id: this.id
-				},
-				header: {
-					'content-type': 'application/json'
-				},
-				success: (res) => {
-					this.ainfo = res.data.article;
-					this.img_list = [];
-					this.selectedWork = res.data.work_info;
-					if (res.data.article.images.length > 1) {
-						let arr = res.data.article.images.split("|");
-						if (arr.length > 0) {
-							for (let i = 0; i < arr.length; i++) {
-								if (arr[i].length > 10) {
-									this.img_list.push(arr[i]);
+			},
+			getInfo() {
+				var that = this;
+				uni.request({
+					url: this.$apiHost + '/Article/getinfo',
+					data: {
+						uuid: getApp().globalData.uuid,
+						id: this.id
+					},
+					header: {
+						'content-type': 'application/json'
+					},
+					success: (res) => {
+						this.ainfo = res.data.article;
+						this.img_list = [];
+						this.selectedWork = res.data.work_info;
+						if (res.data.article.images.length > 1) {
+							let arr = res.data.article.images.split("|");
+							if (arr.length > 0) {
+								for (let i = 0; i < arr.length; i++) {
+									if (arr[i].length > 10) {
+										this.img_list.push(arr[i]);
+									}
 								}
 							}
 						}
 					}
+				});
+			},
+			checkField(str, tips) {
+				if (str.length < 2) {
+					uni.showToast({
+						title: tips,
+						icon: 'none'
+					});
+					return false;
 				}
-			});
-		},
-		checkField(str, tips) {
-			if (str.length < 2) {
-				uni.showToast({ title: tips, icon: 'none' });
-				return false;
-			}
-			return true;
-		},
-		onSubmit() {
-			if (this.checkField(this.ainfo.title, "请输入名称") == false) return;
-			if (this.checkField(this.ainfo.content, "请输入具体内容") == false) return;
-			if (this.is_submit > 0) return;
-			let img_str = '';
-			if (this.img_list.length > 0) {
-				for (let i = 0; i < this.img_list.length; i++) {
-					img_str += this.img_list[i] + "|";
-				}
-			}
-			if (this.img_list.length < 1 && !this.selectedWork.id) {
-				uni.showToast({ title: '请上传 图片 或 选择一个作品', icon: 'none' });
-				return;
-			} else {
-				if (!this.selectedWork.id) {
-					if (!img_str || img_str.trim().length < 2) {
-						uni.showToast({ title: '请确保至少上传一张有效图片作为封面', icon: 'none' });
-						return;
+				return true;
+			},
+			onSubmit() {
+				if (this.checkField(this.ainfo.title, "请输入名称") == false) return;
+				if (this.checkField(this.ainfo.content, "请输入具体内容") == false) return;
+				if (this.is_submit > 0) return;
+				let img_str = '';
+				if (this.img_list.length > 0) {
+					for (let i = 0; i < this.img_list.length; i++) {
+						img_str += this.img_list[i] + "|";
 					}
-					if (this.img_list.length > 5) {
-						uni.showToast({ title: '最多只能上传 5 张图片', icon: 'none' });
-						return;
+				}
+				if (this.img_list.length < 1 && !this.selectedWork.id) {
+					uni.showToast({
+						title: '请上传 图片 或 选择一个作品',
+						icon: 'none'
+					});
+					return;
+				} else {
+					if (!this.selectedWork.id) {
+						if (!img_str || img_str.trim().length < 2) {
+							uni.showToast({
+								title: '请确保至少上传一张有效图片作为封面',
+								icon: 'none'
+							});
+							return;
+						}
+						if (this.img_list.length > 5) {
+							uni.showToast({
+								title: '最多只能上传 5 张图片',
+								icon: 'none'
+							});
+							return;
+						}
 					}
 				}
-			}
-			let that = this;
-			let contentImagesStr = '';
-			if (this.content_images.length > 0) {
-				for (let i = 0; i < this.content_images.length; i++) {
-					contentImagesStr += this.content_images[i] + "|";
+				let that = this;
+				let contentImagesStr = '';
+				if (this.content_images.length > 0) {
+					for (let i = 0; i < this.content_images.length; i++) {
+						contentImagesStr += this.content_images[i] + "|";
+					}
 				}
-			}
-			this.is_submit = 1;
-			console.log( {
+				this.is_submit = 1;
+				console.log({
 					uuid: getApp().globalData.uuid,
 					id: this.ainfo.id,
 					title: this.ainfo.title,
@@ -220,518 +232,646 @@ export default {
 					images: img_str,
 					content_images: contentImagesStr,
 					video_url: this.video_path,
-				},9999999999);
-			
-			uni.request({
-				url: this.$apiHost + '/crowdfund/seji/save',
-				data: {
-					uuid: getApp().globalData.uuid,
-					id: this.ainfo.id,
-					title: this.ainfo.title,
-					content: this.ainfo.content,
-					images: img_str,
-					content_images: contentImagesStr,
-					video_url: this.video_path,
-				},
-				method: 'POST',
-				header: {
-					'Content-Type': 'application/x-www-form-urlencoded',
-					'sign': getApp().globalData.headerSign
-				},
-				dataType: 'json',
-				success: (res) => {
-					uni.showToast({ title: res.data.str, icon: 'none' });
-					if (res.data.success == "yes") {
-						setTimeout(function () {
-							uni.$emit('switchToMyPage', { type: 'article' });
-							uni.switchTab({ url: '/pages/my/my' })
-						}, 500);
-						that.ainfo.title = '';
-						that.ainfo.content = '';
-						that.ainfo.num = '';
-						that.img_list = [];
+				}, 9999999999);
+
+				uni.request({
+					url: this.$apiHost + '/crowdfund/seji/save',
+					data: {
+						uuid: getApp().globalData.uuid,
+						id: this.ainfo.id,
+						title: this.ainfo.title,
+						content: this.ainfo.content,
+						images: img_str,
+						content_images: contentImagesStr,
+						video_url: this.video_path,
+					},
+					method: 'POST',
+					header: {
+						'Content-Type': 'application/x-www-form-urlencoded',
+						'sign': getApp().globalData.headerSign
+					},
+					dataType: 'json',
+					success: (res) => {
+						uni.showToast({
+							title: res.data.str,
+							icon: 'none'
+						});
+						if (res.data.success == "yes") {
+							setTimeout(function() {
+								uni.$emit('switchToMyPage', {
+									type: 'article'
+								});
+								uni.switchTab({
+									url: '/pages/my/my'
+								})
+							}, 500);
+							that.ainfo.title = '';
+							that.ainfo.content = '';
+							that.ainfo.num = '';
+							that.img_list = [];
+						}
+						this.is_submit = 0;
+					},
+					fail: (err) => {
+						this.is_submit = 0;
+					},
+					complete: (com) => {}
+				})
+			},
+			async upload(type) {
+				// 权限弹窗校验
+				if (plus.os.name.toLowerCase() === 'android') {
+					let hasPermission = false;
+					try {
+						hasPermission = await permission.request('photoLibrary', {
+							title: '相册/视频权限说明',
+							describe: '便于您上传图片或视频,请您确认授权,否则无法使用该功能'
+						});
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得相册权限',
+								icon: 'none'
+							});
+							return;
+						}
+					} catch (e) {
+						uni.showToast({
+							title: '权限检查失败',
+							icon: 'none'
+						});
+						return;
 					}
-					this.is_submit = 0;
-				},
-				fail: (err) => {
-					this.is_submit = 0;
-				},
-				complete: (com) => { }
-			})
-		},
-		async upload(type) {
-			// 权限弹窗校验
-			let hasPermission = false;
-			try {
-				hasPermission = await permission.request('photoLibrary', {
-					title: '相册/视频权限说明',
-					describe: '便于您上传图片或视频,请您确认授权,否则无法使用该功能'
-				});
-				if (!hasPermission) {
-					uni.showToast({ title: '未获得相册权限', icon: 'none' });
+				} else {
+
+				}
+				if (this.img_list.length >= 9 && !this.video_path) {
+					uni.showToast({
+						title: '最多只能上传9张图片',
+						icon: 'none'
+					});
 					return;
 				}
-			} catch (e) {
-				uni.showToast({ title: '权限检查失败', icon: 'none' });
-				return;
-			}
-			if (this.img_list.length >= 9 && !this.video_path) {
-				uni.showToast({ title: '最多只能上传9张图片', icon: 'none' });
-				return;
-			}
-			uni.chooseMedia({
-				count: 9 - this.img_list.length,
-				mediaType: ['image', 'video'],
-				sourceType: ['album', 'camera'],
-				maxDuration: 60,
-				success: (res) => {
-					console.log(res, 'res');
-
-					if (res.tempFiles && res.tempFiles.length > 0) {
-						// 判断是否有视频
-						let videoFiles = res.tempFiles.filter(file => file.fileType === 'video');
-						if (videoFiles.length > 0) {
-							// 如果多选视频,只处理第一个并提示
-							if (videoFiles.length > 1) {
-								uni.showToast({ title: '只能上传一个视频,已自动选取第一个', icon: 'none' });
-							}
-							// 如果已存在视频,替换并提示
-							if (this.video_path) {
-								uni.showToast({ title: '已替换为新上传的视频', icon: 'none' });
+				uni.showActionSheet({
+					itemList: ['拍照', '从相册选择'],
+					success: (res) => {
+						const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
+						this.upload_ext(sourceType);
+					}
+				});
+				// uni.chooseMedia({
+				// 	count: 9 - this.img_list.length,
+				// 	mediaType: ['image', 'video'],
+				// 	sourceType: ['album', 'camera'],
+				// 	maxDuration: 60,
+				// 	success: (res) => {
+				// 		console.log(res, 'res');
+
+				// 	}
+				// });
+			},
+			upload_ext(sourceType) {
+				console.log("----upload");
+				var _self = this;
+				uni.chooseImage({
+					count: 5,
+					sizeType: ['compressed'],
+					sourceType: [sourceType],
+					success: function(res) {
+						console.log('res:', res)
+						if (res.tempFiles && res.tempFiles.length > 0) {
+							// 根据文件扩展名判断文件类型
+							const getFileType = (filePath) => {
+								const ext = filePath.split('.').pop().toLowerCase();
+								const videoExts = ['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm', '3gp',
+									'rm', 'rmvb'
+								];
+								const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
+
+								if (videoExts.includes(ext)) {
+									return 'video';
+								} else if (imageExts.includes(ext)) {
+									return 'image';
+								}
+								return 'unknown';
+							};
+
+							// 判断是否有视频
+							let videoFiles = res.tempFiles.filter(file => getFileType(file.path) === 'video');
+
+							if (videoFiles.length > 0) {
+								// 如果多选视频,只处理第一个并提示
+								if (videoFiles.length > 1) {
+									uni.showToast({
+										title: '只能上传一个视频,已自动选取第一个',
+										icon: 'none'
+									});
+								}
+								// 如果已存在视频,替换并提示
+								if (_self.video_path) {
+									uni.showToast({
+										title: '已替换为新上传的视频',
+										icon: 'none'
+									});
+								}
+								_self.upload2('list', videoFiles[0].path, 'video',
+									'/Xweb/upload_video?skey=');
+								console.log(videoFiles, 'videoFiles');
 							}
-							this.upload2(type, videoFiles[0].tempFilePath, 'video', '/Xweb/upload_video?skey=');
-							console.log(videoFiles, 'videoFiles');
 
+							let imageFiles = res.tempFiles.filter(file => getFileType(file.path) === 'image');
+							console.log(imageFiles, 'imageFiles');
+							if (imageFiles.length > 0) {
+								// 多图全部上传
+								imageFiles.forEach(img => {
+									_self.upload2('list', img.path, 'image',
+										'/Xweb/upload_img?skey=');
+								});
+							}
 						}
-						let imageFiles = res.tempFiles.filter(file => file.fileType === 'image');
-						console.log(imageFiles, 'imageFiles');
-						if (imageFiles.length > 0) {
-							// 多图全部上传
-							imageFiles.forEach(img => {
-								this.upload2(type, img.tempFilePath, 'image', '/Xweb/upload_img?skey=');
-							});
-						}
+						// for (let index = 0; index < res.tempFilePaths.length; index++) {
+						// 	let filepath = "";
+						// 	// #ifdef H5
+						// 	filepath = res.tempFiles[index].path;
+						// 	// #endif
+
+						// 	// #ifdef APP-PLUS
+						// 	filepath = res.tempFilePaths[index];
+						// 	// #endif
+
+						// 	_self.imglocal = filepath; //res.tempFilePaths[0]
+						// 	const uploadTask = uni.uploadFile({
+						// 		url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self
+						// 			.skey, // post请求地址
+						// 		filePath: filepath,
+						// 		name: 'file', // 待确认
+						// 		success: function(uploadFileRes) {
+						// 			let resdata = JSON.parse(uploadFileRes.data)
+						// 			console.log('Success1:', uploadFileRes);
+						// 			if (resdata.success == 'no') {
+						// 				uni.showToast({
+						// 					title: resdata.str,
+						// 					icon: 'none'
+						// 				});
+						// 				return;
+						// 			}
+						// 			if (resdata.code == 0) {
+						// 				console.log('Success2:', resdata.data.path);
+
+						// 				_self.content_images.push(resdata.data.path)
+						// 				console.log('_self.content_images:', _self.content_images);
+						// 				.0
+						// 			}
+						// 		},
+						// 		fail: function(uploadFileFail) {
+						// 			console.log('Error:', uploadFileFail.data);
+						// 		},
+						// 		complete: () => {
+						// 			console.log('Complete:');
+						// 		}
+						// 	});
+						// }
+					},
+
+					error: function(e) {
+
+						console.log(e);
+
 					}
+
+				});
+
+
+			},
+			delVideo() {
+				this.video_path = '';
+			},
+			upload2(type, filepath, fileType, url) {
+				console.log(filepath, 'filepath');
+				console.log(fileType, 'fileType');
+
+				// 上传前先显示临时图
+				if (fileType === 'image') {
+					this.img_list.push(filepath);
+				} else if (fileType === 'video') {
+					this.video_path = filepath;
 				}
-			});
-		},
-		delVideo() {
-			this.video_path = '';
-		},
-		upload2(type, filepath, fileType, url) {
-			console.log(filepath, 'filepath');
-			console.log(fileType, 'fileType');
-
-			// 上传前先显示临时图
-			if (fileType === 'image') {
-				this.img_list.push(filepath);
-			} else if (fileType === 'video') {
-				this.video_path = filepath;
-			}
 
-			let uploadUrl = this.$apiHost + url + this.skey;
-			console.log({
-				url: uploadUrl,
-				filePath: filepath,
-				name: 'file',
-			}, 99999);
-
-			uni.uploadFile({
-				url: uploadUrl,
-				filePath: filepath,
-				name: 'file',
-				success: (uploadFileRes) => {
-					console.log(uploadFileRes, 'uploadFileRes');
-
-					let resdata = JSON.parse(uploadFileRes.data);
-					if (resdata.success == 'no') {
-						uni.showToast({ title: resdata.str, icon: 'none' });
-						// 上传失败时移除临时图
-						if (fileType === 'image') {
-							this.img_list.pop();
-						} else if (fileType === 'video') {
-							this.video_path = '';
+				let uploadUrl = this.$apiHost + url + this.skey;
+				console.log({
+					url: uploadUrl,
+					filePath: filepath,
+					name: 'file',
+				}, 99999);
+				let that = this;
+
+				uni.uploadFile({
+					url: uploadUrl,
+					filePath: filepath,
+					name: 'file',
+					success: (uploadFileRes) => {
+						console.log(uploadFileRes, 'uploadFileRes');
+
+						let resdata = JSON.parse(uploadFileRes.data);
+						if (resdata.success == 'no') {
+							uni.showToast({
+								title: resdata.str,
+								icon: 'none'
+							});
+							// 上传失败时移除临时图
+							if (fileType === 'image') {
+								that.img_list.pop();
+							} else if (fileType === 'video') {
+								that.video_path = '';
+							}
+							return;
 						}
-						return;
-					}
-					if (resdata.code == 0) {
-						if (fileType === 'image') {
-							// 替换临时图为服务端路径
-							const index = this.img_list.indexOf(filepath);
-							if (index !== -1) {
-								this.img_list[index] = resdata.data.path;
+						if (resdata.code == 0) {
+							if (fileType === 'image') {
+								// 替换临时图为服务端路径
+								const index = that.img_list.indexOf(filepath);
+								if (index !== -1) {
+									// 使用 Vue.set 确保响应式更新
+									that.$set(that.img_list, index, resdata.data.path);
+								}
+								// this.img_list.push(resdata.data.path);
+								console.log("img_list-1", that.img_list);
+							} else if (fileType === 'video') {
+								that.video_path = resdata.data.path;
 							}
+						}
+					},
+					fail: () => {
+						// 上传失败时移除临时图
+						if (fileType === 'image') {
+							that.img_list.pop();
 						} else if (fileType === 'video') {
-							this.video_path = resdata.data.path;
+							that.video_path = '';
 						}
 					}
-				},
-				fail: () => {
-					// 上传失败时移除临时图
-					if (fileType === 'image') {
-						this.img_list.pop();
-					} else if (fileType === 'video') {
-						this.video_path = '';
-					}
-				}
-			});
-		},
+				});
+			},
 
 
 
-		upload4(type) {
-			if (this.content_images.length >= 5) {
-				uni.showToast({
-					title: '最多只能上传5张图片',
-					icon: 'none'
-				});
-				return
-			}
-			uni.showActionSheet({
-				itemList: ['拍照', '从相册选择'],
-				success: (res) => {
-					const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
-					this.checkRights1(sourceType);
-				}
-			});
-		},
-		async checkRights1(sourceType) {
-			try {
-				let hasPermission = false;
-
-				if (sourceType === 'camera') {
-					hasPermission = await permission.request(permission.PermissionType.CAMERA, {
-						title: '“萌创星球”想访问你的相机',
-						describe: '萌创星球想访问您的摄像头,便于拍摄获取图片来与其他用户进行交流'
+			upload4(type) {
+				if (this.content_images.length >= 5) {
+					uni.showToast({
+						title: '最多只能上传5张图片',
+						icon: 'none'
 					});
+					return
+				}
+				uni.showActionSheet({
+					itemList: ['拍照', '从相册选择'],
+					success: (res) => {
+						const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
+						if (plus.os.name.toLowerCase() === 'android') {
+							this.checkRights1(sourceType);
+						} else {
+							this.upload5('list', sourceType);
 
-					if (!hasPermission) {
-						uni.showToast({
-							title: '未获得相机权限',
-							icon: 'none'
-						});
-						return;
+						}
 					}
-				} else {
-					hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
-						title: '“萌创星球”想访问你的照片图库',
-						describe: '萌创星球想访问您本地照片图库,便于获取图片来与其他用户进行交流'
-					});
+				});
+			},
+			async checkRights1(sourceType) {
+				try {
+					let hasPermission = false;
+
+					if (sourceType === 'camera') {
+						hasPermission = await permission.request(permission.PermissionType.CAMERA, {
+							title: '“萌创星球”想访问你的相机',
+							describe: '萌创星球想访问您的摄像头,便于拍摄获取图片来与其他用户进行交流'
+						});
 
-					if (!hasPermission) {
-						uni.showToast({
-							title: '未获得相册权限',
-							icon: 'none'
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得相机权限',
+								icon: 'none'
+							});
+							return;
+						}
+					} else {
+						hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
+							title: '“萌创星球”想访问你的照片图库',
+							describe: '萌创星球想访问您本地照片图库,便于获取图片来与其他用户进行交流'
 						});
-						return;
-					}
-				}
 
-				// 权限获取成功后,继续执行上传
-				this.upload5('list', sourceType);
-			} catch (error) {
-				console.error('权限检查失败:', error);
-				uni.showToast({
-					title: '权限检查失败',
-					icon: 'none'
-				});
-			}
-		},
-		upload5(type, sourceType) {
-			console.log("----upload");
-			var _self = this;
-			uni.chooseImage({
-				count: 5,
-				sizeType: ['compressed'],
-				sourceType: [sourceType],
-				success: function (res) {
-					console.log('res:', res)
-					for (let index = 0; index < res.tempFilePaths.length; index++) {
-						let filepath = "";
-						// #ifdef H5
-						filepath = res.tempFiles[index].path;
-						// #endif
-
-						// #ifdef APP-PLUS
-						filepath = res.tempFilePaths[index];
-						// #endif
-
-						_self.imglocal = filepath; //res.tempFilePaths[0]
-						const uploadTask = uni.uploadFile({
-							url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey, // post请求地址
-							filePath: filepath,
-							name: 'file', // 待确认
-							success: function (uploadFileRes) {
-								let resdata = JSON.parse(uploadFileRes.data)
-								console.log('Success1:', uploadFileRes);
-								if (resdata.success == 'no') {
-									uni.showToast({
-										title: resdata.str,
-										icon: 'none'
-									});
-									return;
-								}
-								if (resdata.code == 0) {
-									console.log('Success2:', resdata.data.path);
+						if (!hasPermission) {
+							uni.showToast({
+								title: '未获得相册权限',
+								icon: 'none'
+							});
+							return;
+						}
+					}
 
-									_self.content_images.push(resdata.data.path)
-									console.log('_self.content_images:', _self.content_images);
-.0
+					// 权限获取成功后,继续执行上传
+					this.upload5('list', sourceType);
+				} catch (error) {
+					console.error('权限检查失败:', error);
+					uni.showToast({
+						title: '权限检查失败',
+						icon: 'none'
+					});
+				}
+			},
+			upload5(type, sourceType) {
+				console.log("----upload");
+				var _self = this;
+				uni.chooseImage({
+					count: 5,
+					sizeType: ['compressed'],
+					sourceType: [sourceType],
+					success: function(res) {
+						console.log('res:', res)
+						for (let index = 0; index < res.tempFilePaths.length; index++) {
+							let filepath = "";
+							// #ifdef H5
+							filepath = res.tempFiles[index].path;
+							// #endif
+
+							// #ifdef APP-PLUS
+							filepath = res.tempFilePaths[index];
+							// #endif
+
+							_self.imglocal = filepath; //res.tempFilePaths[0]
+							const uploadTask = uni.uploadFile({
+								url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self
+									.skey, // post请求地址
+								filePath: filepath,
+								name: 'file', // 待确认
+								success: function(uploadFileRes) {
+									let resdata = JSON.parse(uploadFileRes.data)
+									console.log('Success1:', uploadFileRes);
+									if (resdata.success == 'no') {
+										uni.showToast({
+											title: resdata.str,
+											icon: 'none'
+										});
+										return;
+									}
+									if (resdata.code == 0) {
+										console.log('Success2:', resdata.data.path);
+
+										_self.content_images.push(resdata.data.path)
+										console.log('_self.content_images:', _self.content_images);
+										.0
+									}
+								},
+								fail: function(uploadFileFail) {
+									console.log('Error:', uploadFileFail.data);
+								},
+								complete: () => {
+									console.log('Complete:');
 								}
-							},
-							fail: function (uploadFileFail) {
-								console.log('Error:', uploadFileFail.data);
-							},
-							complete: () => {
-								console.log('Complete:');
-							}
-						});
-					}
-				},
+							});
+						}
+					},
 
-				error: function (e) {
+					error: function(e) {
 
-					console.log(e);
+						console.log(e);
 
-				}
+					}
 
-			});
+				});
 
 
-		},
+			},
+		}
 	}
-}
 </script>
 
 <style scoped lang="scss">
-page {
-	position: absolute;
-	left: 0;
-	top: 0;
-	width: 100%;
-	display: flex;
-	background-color: #f2f6f2;
-	min-height: 100vh;
-}
-
-.status_bar {
-	height: 44rpx;
-	width: 100%;
-}
-
-.page {
-	background-color: #f2f6f2;
-	display: flex;
-	flex-direction: column;
-	width: 750rpx;
-	min-height: 100vh;
-}
-
-.nav-bar {
-	width: calc(100ve - 73rpx);
-	height: calc(96rpx + var(--status-bar-height));
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	padding: 0;
-	padding-right: 40rpx;
-	padding-left: 33rpx;
-	padding-top: var(--status-bar-height);
-	box-sizing: border-box;
-
-	.left {
+	page {
+		position: absolute;
+		left: 0;
+		top: 0;
+		width: 100%;
+		display: flex;
+		background-color: #f2f6f2;
+		min-height: 100vh;
+	}
+
+	.status_bar {
+		height: 44rpx;
+		width: 100%;
+	}
+
+	.page {
+		background-color: #f2f6f2;
+		display: flex;
+		flex-direction: column;
+		width: 750rpx;
+		min-height: 100vh;
+	}
+
+	.nav-bar {
+		width: calc(100ve - 73rpx);
+		height: calc(96rpx + var(--status-bar-height));
 		display: flex;
 		align-items: center;
-		font-family: PingFang SC-Bold;
-		font-weight: 400;
-		font-size: 32rpx;
-		color: #1f1f1f;
-
-		.uni-btn-icon {
-			font-size: 45rpx;
-			font-weight: bold;
+		justify-content: space-between;
+		padding: 0;
+		padding-right: 40rpx;
+		padding-left: 33rpx;
+		padding-top: var(--status-bar-height);
+		box-sizing: border-box;
+
+		.left {
+			display: flex;
+			align-items: center;
+			font-family: PingFang SC-Bold;
+			font-weight: 400;
+			font-size: 32rpx;
 			color: #1f1f1f;
-			transition: color 0.2s;
-			margin-right: 20rpx;
 
-			&:active {
-				color: #2b85e4;
+			.uni-btn-icon {
+				font-size: 45rpx;
+				font-weight: bold;
+				color: #1f1f1f;
+				transition: color 0.2s;
+				margin-right: 20rpx;
+
+				&:active {
+					color: #2b85e4;
+				}
 			}
 		}
-	}
 
-	.right {
-		display: flex;
-		align-items: center;
-		font-size: 28rpx;
-		font-family: "PingFang SC-Bold";
-		font-weight: 400;
-
-		.btn {
-			border-radius: 26rpx;
-			background: #1f1f1f;
-			padding: 6rpx 32rpx;
-			color: #acf934;
+		.right {
+			display: flex;
+			align-items: center;
 			font-size: 28rpx;
+			font-family: "PingFang SC-Bold";
+			font-weight: 400;
+
+			.btn {
+				border-radius: 26rpx;
+				background: #1f1f1f;
+				padding: 6rpx 32rpx;
+				color: #acf934;
+				font-size: 28rpx;
+			}
 		}
 	}
-}
-
-.enterContentDetails {
-	width: calc(100% - 40rpx);
-	min-height: 726rpx;
-	background: #ffffff;
-	border-radius: 20rpx;
-	margin: 0 20rpx;
-	padding: 0rpx 24rpx 24rpx 24rpx;
-	box-sizing: border-box;
-
-	.edit {
-		height: 92rpx;
-		border-bottom: 2rpx solid #f2f6f2;
-	}
-
-	.edit2 {
-		min-height: 350rpx;
-		width: 100%;
-	}
 
-	.content-textarea {
-		padding-top: 24rpx;
-	}
+	.enterContentDetails {
+		width: calc(100% - 40rpx);
+		min-height: 726rpx;
+		background: #ffffff;
+		border-radius: 20rpx;
+		margin: 0 20rpx;
+		padding: 0rpx 24rpx 24rpx 24rpx;
+		box-sizing: border-box;
+
+		.edit {
+			height: 92rpx;
+			border-bottom: 2rpx solid #f2f6f2;
+		}
 
-	::v-deep.input-placeholder,
-	::v-deep.textarea-placeholder {
-		font-family: PingFang SC;
-		font-weight: 400;
-		font-size: 32rpx;
-		color: #999999;
-	}
+		.edit2 {
+			min-height: 350rpx;
+			width: 100%;
+		}
 
-	.agree {
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 400;
-		font-size: 24rpx;
-		color: #999999;
-		display: flex;
-		align-items: center;
-		justify-content: flex-end;
-	}
+		.content-textarea {
+			padding-top: 24rpx;
+		}
 
-	.img_list {
-		width: 100%;
-		display: grid;
-		grid-template-columns: repeat(3, 1fr);
-		row-gap: 20rpx;
-		flex-wrap: wrap;
-		margin-top: 15rpx;
+		::v-deep.input-placeholder,
+		::v-deep.textarea-placeholder {
+			font-family: PingFang SC;
+			font-weight: 400;
+			font-size: 32rpx;
+			color: #999999;
+		}
 
-		.image {
+		.agree {
+			font-family: PingFang SC, PingFang SC;
+			font-weight: 400;
+			font-size: 24rpx;
+			color: #999999;
 			display: flex;
-			width: 208rpx;
-			height: 208rpx;
-			position: relative;
-			box-sizing: border-box;
-			justify-content: center;
 			align-items: center;
-			background: #f2f6f2;
-			border-radius: 16rpx;
-
-			.txt {
-				font-size: 120rpx;
-				color: #999;
-				width: 40rpx;
-				height: 40rpx;
-			}
-
-			.upimg {
-				position: absolute;
-				left: 0;
-				top: 0;
-				width: 100%;
-				height: 100%;
-				border-radius: 8rpx;
-			}
+			justify-content: flex-end;
+		}
 
-			.del {
-				width: 40rpx;
-				height: 40rpx;
-				position: absolute;
-				right: 0rpx;
-				top: 0rpx;
-			}
+		.img_list {
+			width: 100%;
+			display: grid;
+			grid-template-columns: repeat(3, 1fr);
+			row-gap: 20rpx;
+			flex-wrap: wrap;
+			margin-top: 15rpx;
 
-			.loading {
-				position: absolute;
-				left: 0;
-				top: 0;
-				width: 100%;
-				height: 100%;
-				background: rgba(0, 0, 0, 0.5);
+			.image {
 				display: flex;
-				align-items: center;
+				width: 208rpx;
+				height: 208rpx;
+				position: relative;
+				box-sizing: border-box;
 				justify-content: center;
-				border-radius: 8rpx;
+				align-items: center;
+				background: #f2f6f2;
+				border-radius: 16rpx;
 
-				.loading-icon {
+				.txt {
+					font-size: 120rpx;
+					color: #999;
 					width: 40rpx;
 					height: 40rpx;
-					border: 4rpx solid #fff;
-					border-top-color: transparent;
-					border-radius: 50%;
-					animation: spin 1s linear infinite;
+				}
+
+				.upimg {
+					position: absolute;
+					left: 0;
+					top: 0;
+					width: 100%;
+					height: 100%;
+					border-radius: 8rpx;
+				}
+
+				.del {
+					width: 40rpx;
+					height: 40rpx;
+					position: absolute;
+					right: 0rpx;
+					top: 0rpx;
+				}
+
+				.loading {
+					position: absolute;
+					left: 0;
+					top: 0;
+					width: 100%;
+					height: 100%;
+					background: rgba(0, 0, 0, 0.5);
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					border-radius: 8rpx;
+
+					.loading-icon {
+						width: 40rpx;
+						height: 40rpx;
+						border: 4rpx solid #fff;
+						border-top-color: transparent;
+						border-radius: 50%;
+						animation: spin 1s linear infinite;
+					}
 				}
 			}
 		}
 	}
-}
-
-.worksBox {
-	border-radius: 20rpx;
-	overflow: hidden;
-	margin: 0 24rpx;
-	background: #fff;
-	margin-top: 20rpx;
-	padding-left: 24rpx;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-
-	.optionalWorks {
+
+	.worksBox {
+		border-radius: 20rpx;
+		overflow: hidden;
+		margin: 0 24rpx;
+		background: #fff;
+		margin-top: 20rpx;
+		padding-left: 24rpx;
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
-		padding: 24rpx;
-		height: 88rpx;
-		padding-left: 0;
 
-		.title {
-			font-family: "PingFang SC-Bold";
-			font-weight: bold;
-			font-size: 28rpx;
-
-			text {
-				color: #bbb;
-				font-size: 24rpx;
-				padding-left: 10rpx;
+		.optionalWorks {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 24rpx;
+			height: 88rpx;
+			padding-left: 0;
+
+			.title {
+				font-family: "PingFang SC-Bold";
+				font-weight: bold;
+				font-size: 28rpx;
+
+				text {
+					color: #bbb;
+					font-size: 24rpx;
+					padding-left: 10rpx;
+				}
 			}
 		}
-	}
-
-	.select-box {
-		width: 64rpx;
-		height: 64rpx;
 
-		image {
+		.select-box {
 			width: 64rpx;
 			height: 64rpx;
+
+			image {
+				width: 64rpx;
+				height: 64rpx;
+			}
 		}
 	}
-}
 
-@keyframes spin {
-	to {
-		transform: rotate(360deg);
+	@keyframes spin {
+		to {
+			transform: rotate(360deg);
+		}
 	}
-}
 </style>