消息推送
This commit is contained in:
@@ -39,24 +39,24 @@
|
||||
<u-input v-model="form.content" type="textarea" :height="400" auto-height maxlength="1000" placeholder="请输入文本内容" />
|
||||
<div class="hint">{{ form.content.length }}/1000</div>
|
||||
</div>
|
||||
<div class="type">
|
||||
<!-- <div class="type">
|
||||
<p class="color-666">其它类型</p>
|
||||
<u-radio-group v-model="form.contentType">
|
||||
<u-radio v-for="(item, index) in typeList" :key="index" :name="item.type" @change="radioChange" > {{item.name}}</u-radio>
|
||||
</u-radio-group>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="type-content">
|
||||
<div class="flex" v-if="form.contentType == 'image'">
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">图片</p>
|
||||
<AiUploader :def.sync="formData.fileList" :limit="1" @data="(v) => fileData = v"></AiUploader>
|
||||
<AiUploader type="image" :def.sync="formData.fileListImg" :limit="1" @data="(v) => fileDataImg = v"></AiUploader>
|
||||
</div>
|
||||
<div class="flex" v-if="form.contentType == 'video'">
|
||||
<div class="flex" >
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileList" @data="(v) => fileData = v"></AiUploader>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileListVideo" @data="(v) => fileDataVideo = v"></AiUploader>
|
||||
</div>
|
||||
<div class="flex" v-if="form.contentType == 'file'">
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">附件</p>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileList" @data="(v) => fileData = v"></AiUploader>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileListFile" @data="(v) => fileDataFile = v"></AiUploader>
|
||||
</div>
|
||||
<div v-if="form.contentType == 'link'">
|
||||
<div class="flex border-b">
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user