@@ -144,6 +144,9 @@ export default {
sendTime: ''
},
formData: {
+ fileListImg: [],
+ fileListVideo: [],
+ fileListFile: [],
fileList: [],
imgList: [],
accessImgurl: '',
@@ -164,16 +167,17 @@ export default {
minute: true,
second: true
},
- fileData: null
+ fileDataImg: null,
+ fileDataVideo: null,
+ fileDataFile: null
}
},
computed: {...mapState(['user'])},
methods: {
radioChange(e) {
- this.formDataInit()
- this.$nextTick(() => {
- this.form.contentType = e
- })
+ // this.$nextTick(() => {
+ // this.form.contentType = e
+ // })
},
toSelect() {
uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
@@ -192,6 +196,7 @@ export default {
// if(!this.areaIdList.length) {
// return this.$u.toast('请选择用户')
// }
+ this.$loading()
if(this.form.sendType == 1 && !this.form.sendTime) {
return this.$u.toast('请选择群发时间')
}
@@ -207,10 +212,40 @@ export default {
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
return this.$u.toast('请上传文件')
}
- if(this.formData.fileList.length) {
- this.formData.file = this.formData.fileList[0]
- this.formData.accessUrl = this.formData.fileList[0].url
- this.formData.mediaId = this.fileData.media.mediaId
+ this.formData.fileList = []
+ var contentFile = {
+ content: this.form.content,
+ contentType: 'text'
+ }
+ // if(this.formData.fileList.length) {
+ // this.formData.file = this.formData.fileList[0]
+ // this.formData.accessUrl = this.formData.fileList[0].url
+ // this.formData.mediaId = this.fileData.media.mediaId
+ // }
+ this.formData.fileList.push(contentFile)
+ if(this.formData.fileListImg.length) {
+ var info = {
+ contentType: 'image',
+ mediaId: this.fileDataImg.media.mediaId,
+ accessUrl: this.formData.fileListImg[0].url
+ }
+ this.formData.fileList.push(info)
+ }
+ if(this.formData.fileListVideo.length) {
+ var info = {
+ contentType: 'video',
+ mediaId: this.fileDataVideo.media.mediaId,
+ accessUrl: this.formData.fileListVideo[0].url
+ }
+ this.formData.fileList.push(info)
+ }
+ if(this.formData.fileListFile.length) {
+ var info = {
+ contentType: 'file',
+ mediaId: this.fileDataFile.media.mediaId,
+ accessUrl: this.formData.fileListFile[0].url
+ }
+ this.formData.fileList.push(info)
}
var params = {
...this.form,
@@ -241,9 +276,9 @@ export default {
for(let key in this.formData) {
this.formData[key] = ''
}
- this.formData.imgList = []
- this.formData.fileList = []
- this.formData.file = {}
+ this.formData.fileListImg = []
+ this.formData.fileListVideo = []
+ this.formData.fileListFile = []
},
back() {
uni.navigateBack()