diff --git a/pages/publish/actorRelease.vue b/pages/publish/actorRelease.vue index a7d4ec7..ceff2a2 100644 --- a/pages/publish/actorRelease.vue +++ b/pages/publish/actorRelease.vue @@ -110,20 +110,21 @@ - - - 不需要置顶 - - - - - - - + + + + 不需要置顶 + + + + + + + @@ -147,8 +148,18 @@ 代表作 - + + + + + + + + @@ -212,6 +223,7 @@ ], fileListImage: [],//封面 upTopList: [], + inputs : [], }; }, computed : { @@ -240,6 +252,7 @@ // 删除图片 deleteImage(e) { this.fileList.splice(e.index, 1) + this.inputs.splice(e.index, 1) }, // 上传作品 afterRead(e) { @@ -249,6 +262,9 @@ self.fileList.push({ url }) + self.inputs.push({ + title : '', + }) }) }) }, @@ -272,8 +288,11 @@ let data = { ...this.form, isCard: 'N', - isImage : this.fileList.map((item) => item.url).join(","), - image : this.fileListImage.map((item) => item.url).join(","), + isImage : this.fileList.map((item) => item.url).join(","),//代表作视频列表 + image : this.fileListImage.map((item) => item.url).join(","),//封面 + + // 字段名称待确认 + titles : this.inputs.map((item) => item.title).join(","),//代表作名称列表 isTop : this.form.topId ? 'Y' : 'N', } @@ -325,6 +344,16 @@ }) } + for(let i = 0; i < this.inputs.length; i++){ + if(!this.inputs[i].title){ + return uni.showToast({ + title: `请输入第${i + 1}个代表作的名称`, + icon : 'none' + }) + } + } + + if (this.$utils.verificationAll(this.form, { name: '请输入演员名称', photographerContent: '请输入演员介绍', @@ -427,6 +456,15 @@ .upload { padding-left: 20rpx; + .input{ + margin: 20rpx auto; + border: 1px solid #00000022; + padding: 20rpx; + border-radius: 15rpx; + input{ + + } + } } } } diff --git a/utils/oss-upload/oss/index.js b/utils/oss-upload/oss/index.js index 024eb80..a7d5baa 100644 --- a/utils/oss-upload/oss/index.js +++ b/utils/oss-upload/oss/index.js @@ -43,6 +43,9 @@ function storeFolder() { * @param folder 存储桶中的目标文件夹 */ export function ossUpload(filePath, key = storeKey(), folder = storeFolder()) { + uni.showLoading({ + title: '上传中...' + }) return new Promise((resolve, reject) => { if (folder && folder?.length > 0) { if (folder[0] == "/") folder = folder.slice(1, folder.length) @@ -63,6 +66,7 @@ export function ossUpload(filePath, key = storeKey(), folder = storeFolder()) { signature: OSSConfig.signature, }, success(res) { + uni.hideLoading() if (res.errMsg.includes("uploadFile:ok")) { resolve(ossConfig.aliOss.url + key) } else { @@ -71,6 +75,7 @@ export function ossUpload(filePath, key = storeKey(), folder = storeFolder()) { }, fail(err) { reject(err) + uni.hideLoading() } } uni.uploadFile(config) diff --git a/utils/utils.js b/utils/utils.js index d7697e6..0cd44c9 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -36,33 +36,54 @@ function generateLightRandomColor() { function verificationAll(data, msg){ - let Msgs = { - default : msg || '表单数据未填写' - } - - if(typeof msg == 'object'){ - Msgs = { - default : '表单数据未填写', - ...msg, - } + if (!msg){ + return false } if (!data){ uni.showToast({ - title: Msgs.default, + title: '表单数据未填写', icon: "none" }) - return true } - for (let key in data) { - if (!data[key] && Msgs[key]) { + + for (let key in msg) { + if (!data[key]) { uni.showToast({ - title: Msgs[key], + title: msg[key], icon: "none" }) return true } } + + // let Msgs = { + // default : msg || '表单数据未填写' + // } + + // if(typeof msg == 'object'){ + // Msgs = { + // default : '表单数据未填写', + // ...msg, + // } + // } + + // if (!data){ + // uni.showToast({ + // title: Msgs.default, + // icon: "none" + // }) + // return true + // } + // for (let key in data) { + // if (!data[key] && Msgs[key]) { + // uni.showToast({ + // title: Msgs[key], + // icon: "none" + // }) + // return true + // } + // } return false }