bug
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<div class="select-user">
|
||||
<div class="label color-666"><span class="tips">*</span>发送方式</div>
|
||||
<div class="right">
|
||||
<u-radio-group v-model="form.sendType" @change="radioGroupChange">
|
||||
<u-radio-group v-model="form.messageSource" @change="radioGroupChange">
|
||||
<u-radio v-for="(item, index) in typeList" :key="index" :label="item.name" :name="item.type">{{ item.name }}</u-radio>
|
||||
</u-radio-group>
|
||||
</div>
|
||||
@@ -43,15 +43,15 @@
|
||||
<div class="type-content">
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">图片</p>
|
||||
<AiUploader type="image" :def.sync="formData.fileListImg" :limit="1" @data="(v) => fileDataImg = v"></AiUploader>
|
||||
<AiUploader type="image" :limit="9" multiple :def.sync="fileListImg" @data="changeImg"></AiUploader>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex" >
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileListVideo" @data="(v) => fileDataVideo = v"></AiUploader>
|
||||
<AiUploader type="video" :limit="9" multiple placeholder="上传视频" :def.sync="fileListVideo" @data="changeVideo"></AiUploader>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">附件</p>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileListFile" @data="(v) => fileDataFile = v"></AiUploader>
|
||||
<AiUploader type="file" :limit="9" multiple placeholder="上传附件" :def.sync="fileListFile" @data="changeFile"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,20 +81,17 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
typeList: [
|
||||
{name: '居民群', type: '0'},
|
||||
{name: '居民群', type: '2'},
|
||||
{name: '居民', type: '1'}
|
||||
],
|
||||
form: {
|
||||
content: '',
|
||||
contentType: 'text',
|
||||
sendType: '0',
|
||||
},
|
||||
formData: {
|
||||
fileListImg: [],
|
||||
fileListVideo: [],
|
||||
fileListFile: [],
|
||||
fileList: [],
|
||||
messageSource: '2', // 1居民 2居民群
|
||||
},
|
||||
fileList: [],
|
||||
fileListImg: [],
|
||||
fileListVideo: [],
|
||||
fileListFile: [],
|
||||
areaIdList: [],
|
||||
tagIdList: [],
|
||||
fileDataImg: null,
|
||||
@@ -119,9 +116,39 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeImg(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListImg.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'image'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeVideo(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListVideo.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'video'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeFile(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListFile.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'file'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
radioGroupChange(e) {
|
||||
this.form.sendType = e
|
||||
uni.setStorageSync('sendType', e)
|
||||
this.form.messageSource = e
|
||||
uni.setStorageSync('messageSource', e)
|
||||
this.deptUserTagList = []
|
||||
this.deptUserList = []
|
||||
},
|
||||
@@ -171,48 +198,18 @@ export default {
|
||||
return res
|
||||
}).filter(e => !!e)
|
||||
|
||||
|
||||
this.formData.fileList = []
|
||||
this.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)
|
||||
}
|
||||
this.fileList = [...this.fileListImg, ...this.fileListVideo, ...this.fileListFile]
|
||||
this.fileList.unshift(contentFile)
|
||||
var params = {
|
||||
...this.form,
|
||||
...this.formData,
|
||||
fileList: this.fileList,
|
||||
areaId: this.areaIdList.join(','),
|
||||
deptList: deptList,
|
||||
messageSource: this.form.sendType == '1' ? '1' : '2'
|
||||
}
|
||||
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
||||
if (res?.code == 0) {
|
||||
@@ -242,10 +239,6 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.deptUserTagList = uni.getStorageSync('selectDeptUser')
|
||||
this.form.sendType = uni.getStorageSync('sendType')
|
||||
if (!this.form.sendType) {
|
||||
this.form.sendType = '0'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user