From 24d903ab5c0a6f6eb0456792a27e3276025e90d2 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Thu, 15 Sep 2022 14:34:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppCooperationPropaganda/massDispatch.vue | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/src/apps/AppCooperationPropaganda/massDispatch.vue b/src/apps/AppCooperationPropaganda/massDispatch.vue index f86fe448..f6bfe193 100644 --- a/src/apps/AppCooperationPropaganda/massDispatch.vue +++ b/src/apps/AppCooperationPropaganda/massDispatch.vue @@ -141,50 +141,42 @@ export default { toSend() { // 文本 - let text = {} - if(this.content.length) { - text = { - content: this.content - } + const text = { + content: this.content } const data = [] // 图片 - if(this.picList.length) { - const imgs = this.picList.map(v =>{ - return { - msgtype: "image", - image: { - mediaid: v.mediaId, - imgUrl: v.imgPicUrl, - }, - } - }) - data.push(imgs) - } + const imgs = this.picList.map(v =>{ + return { + msgtype: "image", + image: { + mediaid: v.mediaId, + imgUrl: v.imgPicUrl, + }, + } + }) + data.push(imgs) // 视频 - if(this.videoList.length) { - const videos = this.videoList.map(v =>{ - return { - msgtype: "video", - video:{ - mediaid: v.mediaId, - }, - } - }) - data.push(videos) - } + const videos = this.videoList.map(v =>{ + return { + msgtype: "video", + video:{ + mediaid: v.mediaId, + }, + } + }) + data.push(videos) // 文件 - if(this.fileList.length) { - const files = this.fileList.map(v => { - return { - msgtype: "file", - file:{ - mediaid: v.mediaId, - }, - } - }) - data.push(files) - } + const files = this.fileList.map(v => { + return { + msgtype: "file", + file:{ + mediaid: v.mediaId, + }, + } + }) + data.push(files) + // 链接 // const links = this.webpage.map(v =>{ // return { @@ -197,8 +189,9 @@ export default { // }, // } // }) + this.shareToExternalChat({ ...text, attachments: data }).then((res) =>{ - console.log(res, '返回的数据'); + console.log(res,'返回的数据'); }) }, },