diff --git a/src/project/saas/AppCooperationPropaganda/addPropaganda.vue b/src/project/saas/AppCooperationPropaganda/addPropaganda.vue index e2b92da8..bd4518e7 100644 --- a/src/project/saas/AppCooperationPropaganda/addPropaganda.vue +++ b/src/project/saas/AppCooperationPropaganda/addPropaganda.vue @@ -27,8 +27,11 @@
-
- + + +
+
+
@@ -78,10 +81,10 @@
- +
+ v-if="['.jpg', '.jpeg','png','.mp4'].indexOf(getExtension(item.name)) === -1">

{{ item.name }}

{{ item.fileSizeStr }}

@@ -99,6 +102,21 @@
+ +
+
+
{{ item.title }}
+
+
+ + {{ e.name }} +
+
+
+
取消
+
+
+
通知成员发送
@@ -134,6 +152,7 @@ export default { userListIds: [], showPopup: false, showFodder: false, + showUpload: false, params: { year: true, month: true, @@ -144,6 +163,41 @@ export default { timestamp: false, }, flag: false, + uploadList: [ + // { + // title: '从素材库上传', + // list: [ + // { + // icon: '', + // name: '' + // }, + // { + // icon: '', + // name: '' + // } + // ] + // }, + { + title: '从本地上传', + list: [ + { + icon: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png', + name: '图片', + msgType: 'image' + }, + { + icon: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png', + name: '视频', + msgType: 'video' + }, + { + icon: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png', + name: '文件', + msgType: 'file' + } + ] + } + ], } }, methods: { @@ -186,6 +240,56 @@ export default { return name.substring(name.lastIndexOf('.')) }, + uploadBtn(type) { + let count = 9 - (this.files?.length || 0) + if(count > 0){ + let params = { + count, + sizeType: ['compressed'], + sourceType: ['album', 'camera'], + success: (res) => { + let count = this.files?.length + (res.tempFiles?.length || res.tempFile ? 1 : 0) + if (count > 9) { + return this.$u.toast(`不能超过9个`) + } + if (res.tempFiles) { + res.tempFiles?.map((item) => { + this.uploadFile(item) + }) + } else if (res?.tempFile) { + this.uploadFile(res.tempFile) + } + }, + } + if (type == 'image') { + uni.chooseImage(params) + } else if (type == 'video') { + uni.chooseVideo(params) + } else if(type == 'file') { + uni.chooseFile(params) + } + } else { + this.$u.toast(`不能超过9个`) + } + }, + + uploadFile(img) { + uni.showLoading({title: '上传中'}) + let formData = new FormData() + formData.append('file', img) + this.$http.post('/admin/file/add2', formData).then((res) => { + uni.hideLoading() + if (res?.data) { + this.$u.toast('上传成功!') + this.showUpload = false + this.files.push(res.data) + } + }).catch(res => { + this.$u.toast(res) + uni.hideLoading() + }) + }, + choiceTime(e) { this.form.choiceTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second }, @@ -201,10 +305,21 @@ export default { ] this.form.contents.push(...firstContent) - const fileLists = this.files.map(item=> { - // if(this.getExtension(item.name)==) + const picUrl = this.files.map(e=> { + if(['.jpg','.jpeg','.png'].indexOf(this.getExtension(e.name)) !== -1) { + console.log({ + imgPicUrl: e.url, + msgType: '1' + }) + return { + imgPicUrl: e.url, + msgType: '1' + } + } }) + this.form.contents.push(...picUrl) + if(!this.form.taskTitle) { return this.$u.toast('请输入任务名称') } @@ -228,6 +343,8 @@ export default { if(this.isTimedTask) { if(!this.form.choiceTime.length) { return this.$u.toast("请选择发送时间") + } else if (new Date(this.form.choiceTime).getTime() < Date.now()) { + return this.$u.toast('定时发送时间不得早于当前时间') } } this.flag = true @@ -315,6 +432,12 @@ export default { border-radius: 8px; } } + + .fodder_file { + .item { + + } + } } } @@ -459,6 +582,49 @@ export default { } } + .uploadPopup { + + background: #F7F7F7; + .upload_card { + padding: 32px 32px 0 32px; + box-sizing: border-box; + overflow-x: scroll; + + .upload_item { + margin-bottom: 32px; + } + + .upload_list { + overflow-x: scroll; + display: flex; + .list_item { + text-align: center; + width: 106px; + height: 130px; + margin-right: 48px; + img { + display: inline-block; + width: 84px; + height: 84px; + } + span { + // display: inline-block; + // line-height: 44px; + } + } + } + } + .btnCancel { + width: 100%; + height: 120px; + line-height: 120px; + text-align: center; + border-top: 2px solid #DDDDDD; + margin-top: 80px; + } + + } + .btn { position: fixed; diff --git a/src/project/saas/AppCooperationPropaganda/selectGridMember.vue b/src/project/saas/AppCooperationPropaganda/selectGridMember.vue index f4ec1343..f694c94a 100644 --- a/src/project/saas/AppCooperationPropaganda/selectGridMember.vue +++ b/src/project/saas/AppCooperationPropaganda/selectGridMember.vue @@ -90,7 +90,7 @@ export default { this.userList = [] this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${id}`).then((res) => { if (res?.data) { - this.userList = res.data.map(e => ({...e, isChecked: e.id == this.selected.forEach(i => i.id)})) + this.userList = res.data.map(e => ({...e, isChecked: this.selected.find(i => i.id==e.id)})) } }) }, @@ -129,7 +129,14 @@ export default { // }) // this.selected = {...row, kind: "user"} // } - this.selected = this.userList.filter(v=> v.isChecked) + if(row.isChecked){ + this.selected.push(row) + }else{ + console.log(this.selected) + let index=this.selected.findIndex(item=>row.id===item.id) + index>=0&&this.selected.splice(index, 1) + } + // this.selected = this.userList.filter(v=> v.isChecked) uni.setStorageSync('userSelect', this.selected) },