From 9f7b646f6c8c61c4238d99e1655c72de3e6bf66f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 13 Jan 2023 00:07:13 +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 --- yudao-ui-admin/src/api/mp/draft.js | 10 +++++ .../mp/components/wx-material-select/main.vue | 37 +++++++++---------- yudao-ui-admin/src/views/mp/message/index.vue | 8 +++- 3 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 yudao-ui-admin/src/api/mp/draft.js diff --git a/yudao-ui-admin/src/api/mp/draft.js b/yudao-ui-admin/src/api/mp/draft.js new file mode 100644 index 000000000..b1623c6d7 --- /dev/null +++ b/yudao-ui-admin/src/api/mp/draft.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 获得公众号草稿分页 +export function getDraftPage(query) { + return request({ + url: '/mp/draft/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 2b92ff487..456846e26 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 @@ -103,7 +103,8 @@ import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'; import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue'; import { getMaterialPage } from "@/api/mp/material"; - import {getFreePublishPage} from "@/api/mp/freePublish"; + import { getFreePublishPage } from "@/api/mp/freePublish"; + import {getDraftPage} from "@/api/mp/draft"; export default { name: "wxMaterialSelect", @@ -136,8 +137,6 @@ pageSize: 10, accountId: this.objData.accountId, }, - // tableOptionVoice: tableOptionVoice, - // tableOptionVideo: tableOptionVideo, } }, created() { @@ -152,22 +151,7 @@ if (this.objData.type === 'news' && this.newsType === '1') { // 【图文】+ 【已发布】 this.getFreePublishPage(); } else if (this.objData.type === 'news' && this.newsType === '2') { // 【图文】+ 【草稿】 - getPageNewsDraft(Object.assign({ - current: page.currentPage, - size: page.pageSize, - appId:this.appId, - }, params)).then(response => { - let tableData = response.data.items - tableData.forEach(item => { - item.mediaId = item.mediaId - item.content.articles = item.content.newsItem - }) - this.list = tableData - this.page.total = response.data.totalCount - this.page.currentPage = page.currentPage - this.page.pageSize = page.pageSize - this.loading = false - }) + this.getDraftPage(); } else { // 【素材】 this.getMaterialPage(); } @@ -197,6 +181,21 @@ }).finally(() => { this.loading = false }) + }, + getDraftPage() { + getDraftPage((this.queryParams)).then(response => { + // 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面 + response.data.list.forEach(item => { + const newsItem = item.content.newsItem; + newsItem.forEach(article => { + article.picUrl = article.thumbUrl; + }) + }) + this.list = response.data.list + this.total = response.data.total + }).finally(() => { + this.loading = false + }) } } }; diff --git a/yudao-ui-admin/src/views/mp/message/index.vue b/yudao-ui-admin/src/views/mp/message/index.vue index d57f26fc3..4766ffeef 100644 --- a/yudao-ui-admin/src/views/mp/message/index.vue +++ b/yudao-ui-admin/src/views/mp/message/index.vue @@ -93,6 +93,9 @@ +
+ +
未知消息类型
@@ -100,6 +103,7 @@