Commit 34d2cefa by caoyanzhi

update: 微信图文升级

parent 8973d15f
......@@ -5,6 +5,7 @@
图文消息(共{{ total }}条)
<el-input v-model="listParams.searchName" clearable class="w200 ml10" placeholder="请输入标题/作者" @change="loadImgTextList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-checkbox class="vertical-middle ml0" v-if="$store.state.marketing.isShowSelf && showSelf" v-model="listParams.showSelfFlag" :true-label="1" :false-label="0" label="仅看本人" border @change="loadImgTextList" />
<el-checkbox class="vertical-middle ml0" v-model="listParams.wxscType" :true-label="3" :false-label="1" label="仅看历史图文" border @change="loadImgTextList" />
</div>
<div>
<el-button type="primary" @click="add">新建图文</el-button>
......@@ -53,7 +54,7 @@
</el-table>
</el-radio-group>
<dm-pagination v-show="textImgList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
<sync-imgtext :show.sync="syncImgTextShow"></sync-imgtext>
<sync-imgtext :wxsc-type="wxscType" :show.sync="syncImgTextShow"></sync-imgtext>
</section>
</template>
......@@ -92,16 +93,24 @@ export default {
}
},
created() {
this.$store.commit(
'mutations_layoutTips',
`<div class="layout--tips">
<i class="el-icon-info"></i>因为在微信公众后台发布的图文会从草稿箱转移到发表记录,若在微信公众后台有发布操作,建议在达摩侧的草稿箱检查同步
</div>`
);
this.loadImgTextList();
},
data() {
return {
wxscType: '4',
textImgList: [],
listParams: {
currentPage: 1,
pageSize: 20,
searchName: '',
showSelfFlag: this.showSelfFlag || ''
showSelfFlag: this.showSelfFlag || '',
wxscType: ''
},
total: 0,
loading: false,
......@@ -166,7 +175,7 @@ export default {
this.$emit('get-data', { imageTextId: row.imageTextId, imageTextWechatId: row.imageTextWechatId });
},
add() {
this.$router.push('/wechat/editor');
this.$router.push(`/wechat/editor?type=${this.wxscType}`);
},
editData(row) {
this.$router.push('/wechat/editor/' + row.imageTextId);
......
<template>
<el-dialog class="sync-imgtext__dialog" title="同步微信图文" :visible.sync="show" width="30%" :before-close="close" v-loading="loading">
<div class="gic-modal-bd text-center">
<el-dialog class="sync-imgtext__dialog" title="同步微信草稿箱图文" :visible.sync="show" width="30%" :before-close="close" v-loading="loading">
<div class="gic-modal-bd">
<div class="gic-modal-content">
<p class="fz16" style="margin-bottom:20px">
微信图文共<span> {{ count }} </span><span @click="getSyncInfo" class="blue" style="margin-left:10px;">刷新</span>
微信草稿箱里的图文共<span> {{ count }} </span><span @click="getSyncInfo" class="blue" style="margin-left:10px;">刷新</span>
</p>
<p class="gray fz12">同步全部图文可能会需要比较久的时间,请耐心等待</p>
<div style="margin-bottom: 10px">
同步条数:
<el-select style="width: 160px" v-if="loadStatus === 1 && count !== 0" v-model="size" placeholder="选择同步条数">
<el-option v-for="item in sizeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<p class="gray fz12">同步全部图文可能会需要比较久的时间,请耐心等待...</p>
</div>
</div>
<div class="text-center pt20">
<el-select class="w100" v-if="loadStatus === 1 && count !== 0" v-model="size" placeholder="选择群发类型">
<el-option v-for="item in sizeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<template slot="footer">
<el-button @click="close">取消</el-button>
<el-button v-if="loadStatus === 1" type="primary" @click="syncWechat()">立即同步</el-button>
<el-button v-if="loadStatus === 0" type="primary" :loading="true">同步中</el-button>
<el-button v-if="loadStatus === 3" icon="el-icon-error" type="danger">同步失败</el-button>
</div>
</template>
</el-dialog>
</template>
<script>
......@@ -25,6 +29,11 @@ export default {
show: {
type: Boolean,
default: false
},
// 4:草稿列表 5:发布列表
wxscType: {
type: [Number, String],
default: ''
}
},
watch: {
......@@ -57,7 +66,7 @@ export default {
async syncWechat() {
this.loadStatus = 0;
const num = this.size === 999999 ? this.count : this.size;
let res = await syncWechatImageText({ num });
let res = await syncWechatImageText({ num, wxscType: this.wxscType });
if (num <= 20 && res.errorCode === 0) {
this.$tips({ type: 'success', message: '同步成功' });
this.loadStatus = 1;
......
......@@ -87,7 +87,7 @@ export default {
children: [
{
path: 'imgtext',
name: '图文',
name: '图文草稿箱',
component: () => import(/* webpackChunkName: "wechat" */ '../../components/libs/imgTextTemp/index.vue'),
meta: {
path: '/wechat/temp/imgtext'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment