From 02ccf52d6c5476e549cc164e980531d45a957d6d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 12 Jan 2023 23:57:17 +0800 Subject: [PATCH] =?UTF-8?q?mp=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=8F=91=E9=80=81?= =?UTF-8?q?=E3=80=90=E5=9B=BE=E6=96=87=E3=80=91=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/news/MpDraftController.http | 8 ++ .../admin/news/MpFreePublishController.http | 2 +- .../admin/news/MpFreePublishController.java | 1 + yudao-ui-admin/src/api/mp/freePublish.js | 10 ++ .../mp/components/wx-material-select/main.vue | 121 +++++++----------- .../src/views/mp/components/wx-msg/main.vue | 14 +- .../src/views/mp/components/wx-news/main.vue | 5 +- .../src/views/mp/components/wx-reply/main.vue | 17 ++- 8 files changed, 91 insertions(+), 87 deletions(-) create mode 100644 yudao-ui-admin/src/api/mp/freePublish.js diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http index 8e95a3ef5..b60ce3519 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.http @@ -19,6 +19,14 @@ tenant-id: {{adminTenentId}} "content": "我是内容", "contentSourceUrl": "https://www.iocoder.cn", "thumbMediaId": "r6ryvl6LrxBU0miaST4Y-pIcmK-zAAId-9TGgy-DrSLhjVuWbuT3ZBjk9K1yQ0Dn" + }, + { + "title": "我是标题 2", + "author": "我是作者 2", + "digest": "我是摘要 2", + "content": "我是内容 2", + "contentSourceUrl": "https://www.iocoder.cn", + "thumbMediaId": "r6ryvl6LrxBU0miaST4Y-pIcmK-zAAId-9TGgy-DrSLhjVuWbuT3ZBjk9K1yQ0Dn" } ] } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.http index 5e38dc4b5..122413200 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.http +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.http @@ -5,7 +5,7 @@ Authorization: Bearer {{token}} tenant-id: {{adminTenentId}} ### 请求 /mp/free-publish/submit 接口 => 成功 -POST {{baseUrl}}/mp/free-publish/submit?accountId=1&mediaId=r6ryvl6LrxBU0miaST4Y-pEm50d1qKxNPkZVzrRZthSJHKCgiylCf4tARZfybZ_O +POST {{baseUrl}}/mp/free-publish/submit?accountId=1&mediaId=r6ryvl6LrxBU0miaST4Y-vilmd7iS51D8IPddxflWrau0hIQ2ovY8YanO5jlgUcM Content-Type: application/json Authorization: Bearer {{token}} tenant-id: {{adminTenentId}} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java index 1354ff354..10b7ad3c9 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java @@ -44,6 +44,7 @@ public class MpFreePublishController { } catch (WxErrorException e) { throw exception(FREE_PUBLISH_LIST_FAIL, e.getError().getErrorMsg()); } + // todo 芋艿:需要查询对应的缩略图,不然前端无法展示 // 返回分页 return success(new PageResult<>(publicationRecords.getItems(), publicationRecords.getTotalCount().longValue())); diff --git a/yudao-ui-admin/src/api/mp/freePublish.js b/yudao-ui-admin/src/api/mp/freePublish.js new file mode 100644 index 000000000..ba24213df --- /dev/null +++ b/yudao-ui-admin/src/api/mp/freePublish.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 获得公众号素材分页 +export function getFreePublishPage(query) { + return request({ + url: '/mp/free-publish/page', + method: 'get', + params: query + }) +} diff --git a/yudao-ui-admin/src/views/mp/components/wx-material-select/main.vue b/yudao-ui-admin/src/views/mp/components/wx-material-select/main.vue index 0ba1604e5..2b92ff487 100644 --- a/yudao-ui-admin/src/views/mp/components/wx-material-select/main.vue +++ b/yudao-ui-admin/src/views/mp/components/wx-material-select/main.vue @@ -48,7 +48,7 @@ + @pagination="getPage"/>
@@ -78,41 +78,32 @@
-
+
-
- +
+ - 选择 + + 选择 +
-
+ +
暂无数据
- - - - +
diff --git a/yudao-ui-admin/src/views/mp/components/wx-reply/main.vue b/yudao-ui-admin/src/views/mp/components/wx-reply/main.vue index cb1a0054b..a6ccdb5ec 100644 --- a/yudao-ui-admin/src/views/mp/components/wx-reply/main.vue +++ b/yudao-ui-admin/src/views/mp/components/wx-reply/main.vue @@ -118,18 +118,20 @@ + 图文 -
- +
+ - +
+
- + {{newsType === '1' ? '选择已发布图文' : '选择草稿箱图文'}} @@ -369,7 +371,10 @@ // 创建 tempObjItem 对象,并设置对应的值 let tempObjItem = {} tempObjItem.type = this.objData.type; - if (this.objData.type === 'music') { // 音乐需要特殊处理,因为选择的是图片的缩略图 + if (this.objData.type === 'news') { + tempObjItem.articles = item.content.newsItem + this.objData.articles = item.content.newsItem + } else if (this.objData.type === 'music') { // 音乐需要特殊处理,因为选择的是图片的缩略图 tempObjItem.thumbMediaId = item.mediaId this.objData.thumbMediaId = item.mediaId tempObjItem.thumbMediaUrl = item.url @@ -431,7 +436,7 @@ }, deleteObj() { if (this.objData.type === 'news') { - this.objData.articles = [] + this.$delete(this.objData, 'articles'); } else if(this.objData.type === 'image') { this.objData.mediaId = null this.objData.url = null