/// <summary> /// 确认上传: /// 1.收集数据 /// 2.上传相关图片到七牛云 /// 3.上传基础信息到服务器 /// </summary> /// <param name="op"></param> /// <returns></returns> public async Task <bool> UploadActivityInfo(string op) { var qiniu = QiniuManager.Instance; foreach (var item in UploadingImageFiles) { if (item.State == UploadingImageFile.UploadState.ReadyForUpload) { item.State = UploadingImageFile.UploadState.Uploading; if (await qiniu.UploadFileAsync(item.File, item.QiniuFilename)) { item.State = UploadingImageFile.UploadState.UploadSuccess; } else { item.State = UploadingImageFile.UploadState.UploadFail; } } } InfoCollect(); switch (op) { case "Add": return(await api.AddActivity(SourceActivity)); case "Update": return(await api.UpdateActivity(SourceActivity.Id, SourceActivity)); default: return(false); } }