mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
mp:增加发送【图文】消息
This commit is contained in:
parent
02ccf52d6c
commit
9f7b646f6c
10
yudao-ui-admin/src/api/mp/draft.js
Normal file
10
yudao-ui-admin/src/api/mp/draft.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得公众号草稿分页
|
||||||
|
export function getDraftPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mp/draft/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
@ -103,7 +103,8 @@
|
|||||||
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
|
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
|
||||||
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue';
|
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue';
|
||||||
import { getMaterialPage } from "@/api/mp/material";
|
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 {
|
export default {
|
||||||
name: "wxMaterialSelect",
|
name: "wxMaterialSelect",
|
||||||
@ -136,8 +137,6 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
accountId: this.objData.accountId,
|
accountId: this.objData.accountId,
|
||||||
},
|
},
|
||||||
// tableOptionVoice: tableOptionVoice,
|
|
||||||
// tableOptionVideo: tableOptionVideo,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -152,22 +151,7 @@
|
|||||||
if (this.objData.type === 'news' && this.newsType === '1') { // 【图文】+ 【已发布】
|
if (this.objData.type === 'news' && this.newsType === '1') { // 【图文】+ 【已发布】
|
||||||
this.getFreePublishPage();
|
this.getFreePublishPage();
|
||||||
} else if (this.objData.type === 'news' && this.newsType === '2') { // 【图文】+ 【草稿】
|
} else if (this.objData.type === 'news' && this.newsType === '2') { // 【图文】+ 【草稿】
|
||||||
getPageNewsDraft(Object.assign({
|
this.getDraftPage();
|
||||||
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
|
|
||||||
})
|
|
||||||
} else { // 【素材】
|
} else { // 【素材】
|
||||||
this.getMaterialPage();
|
this.getMaterialPage();
|
||||||
}
|
}
|
||||||
@ -197,6 +181,21 @@
|
|||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -93,6 +93,9 @@
|
|||||||
<wx-music :title="scope.row.title" :description="scope.row.description" :thumb-media-url="scope.row.thumbMediaUrl"
|
<wx-music :title="scope.row.title" :description="scope.row.description" :thumb-media-url="scope.row.thumbMediaUrl"
|
||||||
:music-url="scope.row.musicUrl" :hq-music-url="scope.row.hqMusicUrl" />
|
:music-url="scope.row.musicUrl" :hq-music-url="scope.row.hqMusicUrl" />
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="scope.row.type === 'news'">
|
||||||
|
<wx-news :articles="scope.row.articles" />
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-tag type="danger" size="mini">未知消息类型</el-tag>
|
<el-tag type="danger" size="mini">未知消息类型</el-tag>
|
||||||
</div>
|
</div>
|
||||||
@ -100,6 +103,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<!-- TODO 芋艿:增加消息按钮 -->
|
||||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"-->
|
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"-->
|
||||||
<!-- v-hasPermi="['mp:message:update']">修改-->
|
<!-- v-hasPermi="['mp:message:update']">修改-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
@ -124,6 +128,7 @@ import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
|
|||||||
import WxMsg from '@/views/mp/components/wx-msg/main.vue';
|
import WxMsg from '@/views/mp/components/wx-msg/main.vue';
|
||||||
import WxLocation from '@/views/mp/components/wx-location/main.vue';
|
import WxLocation from '@/views/mp/components/wx-location/main.vue';
|
||||||
import WxMusic from '@/views/mp/components/wx-music/main.vue';
|
import WxMusic from '@/views/mp/components/wx-music/main.vue';
|
||||||
|
import WxNews from '@/views/mp/components/wx-news/main.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WxFansMsg",
|
name: "WxFansMsg",
|
||||||
@ -132,7 +137,8 @@ export default {
|
|||||||
WxVoicePlayer,
|
WxVoicePlayer,
|
||||||
WxMsg,
|
WxMsg,
|
||||||
WxLocation,
|
WxLocation,
|
||||||
WxMusic
|
WxMusic,
|
||||||
|
WxNews
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user