消息推送
This commit is contained in:
@@ -39,24 +39,24 @@
|
|||||||
<u-input v-model="form.content" type="textarea" :height="400" auto-height maxlength="1000" placeholder="请输入文本内容" />
|
<u-input v-model="form.content" type="textarea" :height="400" auto-height maxlength="1000" placeholder="请输入文本内容" />
|
||||||
<div class="hint">{{ form.content.length }}/1000</div>
|
<div class="hint">{{ form.content.length }}/1000</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="type">
|
<!-- <div class="type">
|
||||||
<p class="color-666">其它类型</p>
|
<p class="color-666">其它类型</p>
|
||||||
<u-radio-group v-model="form.contentType">
|
<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 v-for="(item, index) in typeList" :key="index" :name="item.type" @change="radioChange" > {{item.name}}</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="type-content">
|
<div class="type-content">
|
||||||
<div class="flex" v-if="form.contentType == 'image'">
|
<div class="flex">
|
||||||
<p class="label" style="width:40px;">图片</p>
|
<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>
|
||||||
<div class="flex" v-if="form.contentType == 'video'">
|
<div class="flex" >
|
||||||
<p class="label" style="width:40px;">视频</p>
|
<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>
|
||||||
<div class="flex" v-if="form.contentType == 'file'">
|
<div class="flex">
|
||||||
<p class="label" style="width:40px;">附件</p>
|
<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>
|
||||||
<div v-if="form.contentType == 'link'">
|
<div v-if="form.contentType == 'link'">
|
||||||
<div class="flex border-b">
|
<div class="flex border-b">
|
||||||
@@ -144,6 +144,9 @@ export default {
|
|||||||
sendTime: ''
|
sendTime: ''
|
||||||
},
|
},
|
||||||
formData: {
|
formData: {
|
||||||
|
fileListImg: [],
|
||||||
|
fileListVideo: [],
|
||||||
|
fileListFile: [],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
imgList: [],
|
imgList: [],
|
||||||
accessImgurl: '',
|
accessImgurl: '',
|
||||||
@@ -164,16 +167,17 @@ export default {
|
|||||||
minute: true,
|
minute: true,
|
||||||
second: true
|
second: true
|
||||||
},
|
},
|
||||||
fileData: null
|
fileDataImg: null,
|
||||||
|
fileDataVideo: null,
|
||||||
|
fileDataFile: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {...mapState(['user'])},
|
computed: {...mapState(['user'])},
|
||||||
methods: {
|
methods: {
|
||||||
radioChange(e) {
|
radioChange(e) {
|
||||||
this.formDataInit()
|
// this.$nextTick(() => {
|
||||||
this.$nextTick(() => {
|
// this.form.contentType = e
|
||||||
this.form.contentType = e
|
// })
|
||||||
})
|
|
||||||
},
|
},
|
||||||
toSelect() {
|
toSelect() {
|
||||||
uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
|
uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
|
||||||
@@ -192,6 +196,7 @@ export default {
|
|||||||
// if(!this.areaIdList.length) {
|
// if(!this.areaIdList.length) {
|
||||||
// return this.$u.toast('请选择用户')
|
// return this.$u.toast('请选择用户')
|
||||||
// }
|
// }
|
||||||
|
this.$loading()
|
||||||
if(this.form.sendType == 1 && !this.form.sendTime) {
|
if(this.form.sendType == 1 && !this.form.sendTime) {
|
||||||
return this.$u.toast('请选择群发时间')
|
return this.$u.toast('请选择群发时间')
|
||||||
}
|
}
|
||||||
@@ -207,10 +212,40 @@ export default {
|
|||||||
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
|
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
|
||||||
return this.$u.toast('请上传文件')
|
return this.$u.toast('请上传文件')
|
||||||
}
|
}
|
||||||
if(this.formData.fileList.length) {
|
this.formData.fileList = []
|
||||||
this.formData.file = this.formData.fileList[0]
|
var contentFile = {
|
||||||
this.formData.accessUrl = this.formData.fileList[0].url
|
content: this.form.content,
|
||||||
this.formData.mediaId = this.fileData.media.mediaId
|
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 = {
|
var params = {
|
||||||
...this.form,
|
...this.form,
|
||||||
@@ -241,9 +276,9 @@ export default {
|
|||||||
for(let key in this.formData) {
|
for(let key in this.formData) {
|
||||||
this.formData[key] = ''
|
this.formData[key] = ''
|
||||||
}
|
}
|
||||||
this.formData.imgList = []
|
this.formData.fileListImg = []
|
||||||
this.formData.fileList = []
|
this.formData.fileListVideo = []
|
||||||
this.formData.file = {}
|
this.formData.fileListFile = []
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|||||||
Reference in New Issue
Block a user