Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -42,13 +42,13 @@
|
||||
<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"> {{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>
|
||||
</div>
|
||||
<div class="type-content">
|
||||
<div class="flex" v-if="form.contentType == 'image'">
|
||||
<p class="label" style="width:40px;">图片</p>
|
||||
<ai-uploader multiple @data="formData.fileList" :limit="1" action="/admin/file/add2"></ai-uploader>
|
||||
<AiUploader :def.sync="formData.imgList" :limit="1" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
<div v-if="form.contentType == 'link'">
|
||||
<div class="flex border-b">
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="flex border-b">
|
||||
<p class="label">链接图片</p>
|
||||
<ai-uploader multiple @data="formData.imgList" :limit="1" action="/admin/file/add2"></ai-uploader>
|
||||
<AiUploader multiple :def.sync="formData.imgList" :limit="1" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="label">链接标题</p>
|
||||
@@ -70,11 +70,11 @@
|
||||
</div>
|
||||
<div class="flex" v-if="form.contentType == 'video'">
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader :multiple="true" type="file" :limit="1" placeholder="上传视频" @list="formData.fileList" action="/admin/file/add2"></AiUploader>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileList" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
<div class="flex" v-if="form.contentType == 'file'">
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader :multiple="true" type="file" :limit="1" placeholder="上传附件" @list="formData.fileList" action="/admin/file/add2"></AiUploader>
|
||||
<p class="label" style="width:40px;">附件</p>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileList" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
<div v-if="form.contentType == 'miniapp'" class="flex-label">
|
||||
<div class="flex border-b">
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="label" style="width:80px;">小程序图片</p>
|
||||
<ai-uploader multiple @data="formData.imgList" :limit="1" action="/admin/file/add2"></ai-uploader>
|
||||
<AiUploader multiple :def.sync="formData.imgList" :limit="1" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,10 +168,10 @@ export default {
|
||||
computed: {...mapState(['user'])},
|
||||
methods: {
|
||||
radioChange(e) {
|
||||
this.formDataInit()
|
||||
this.$nextTick(() => {
|
||||
this.form.contentType = e
|
||||
},
|
||||
typeChange(e) {
|
||||
this.form.sendType = e
|
||||
})
|
||||
},
|
||||
toSelect() {
|
||||
uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
|
||||
@@ -196,6 +196,15 @@ export default {
|
||||
if(!this.form.content) {
|
||||
return this.$u.toast('请输入文本内容')
|
||||
}
|
||||
if(this.form.contentType == 'image' && !this.formData.imgList.length) {
|
||||
return this.$u.toast('请上传图片')
|
||||
}
|
||||
if(this.form.contentType == 'video' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传视频')
|
||||
}
|
||||
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]
|
||||
}
|
||||
@@ -210,10 +219,31 @@ export default {
|
||||
}
|
||||
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
||||
if (res?.code == 0) {
|
||||
|
||||
this.$u.toast('发送成功')
|
||||
this.form = {
|
||||
content: '',
|
||||
contentType: 'text',
|
||||
sendType: '0',
|
||||
sendTime: ''
|
||||
}
|
||||
this.areaIdList = []
|
||||
this.tagIdList = []
|
||||
this.formDataInit()
|
||||
}else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
},
|
||||
formDataInit() {
|
||||
for(let key in this.formData) {
|
||||
this.formData[key] = ''
|
||||
}
|
||||
this.formData.imgList = []
|
||||
this.formData.fileList = []
|
||||
this.formData.file = {}
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
@@ -66,12 +66,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex'
|
||||
import { mapActions, mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'info',
|
||||
inject: ['top'],
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
resident() {
|
||||
return this.top.detail?.residentInfo?.resident || {}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user