|
|
@@ -172,12 +172,12 @@ a {
|
|
|
<!-- <div>
|
|
|
<img :src="journalLogo" alt="">
|
|
|
</div> -->
|
|
|
- <div>
|
|
|
- <div v-if="multipleSelection" style="position:relative;">
|
|
|
+ <div v-loading="loading1">
|
|
|
+ <div v-if="multipleSelection.length" style="position:relative;">
|
|
|
<img :src="multipleSelection[0].img" alt="" width="310px" height="157px">
|
|
|
<p style="position:absolute;bottom:20px;left:20px;font-weight:bold;color:#ffffff;">{{multipleSelection[0].name}}</p>
|
|
|
</div>
|
|
|
- <div v-if="multipleSelection">
|
|
|
+ <div v-if="multipleSelection.length">
|
|
|
<div class="syncitem" v-for="(item,index) in multipleSelection" :key="index">
|
|
|
<p>{{item.name.substring(0,20)}}</p>
|
|
|
<img :src="item.img" alt="" width="48px" height="48px">
|
|
|
@@ -186,7 +186,7 @@ a {
|
|
|
</div>
|
|
|
<div class="syncbtn">
|
|
|
<el-button type="normal" size="small" @click="dialogVisible=false">取消</el-button>
|
|
|
- <el-button type="primary" size="small">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="saveSyncToMP()">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -202,6 +202,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
+ loading1: false,
|
|
|
form: { name: "", page: 1, page_size: 20 },
|
|
|
total: 1,
|
|
|
list: [{ name: "2333" }],
|
|
|
@@ -211,7 +213,7 @@ export default {
|
|
|
},
|
|
|
dialogVisible:false,
|
|
|
journalLogo:"",
|
|
|
- multipleSelection:''
|
|
|
+ multipleSelection:[]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -220,10 +222,43 @@ export default {
|
|
|
this.$message.error("请勾选需要同步到公众号的文章!")
|
|
|
return
|
|
|
}
|
|
|
- console.log(this.multipleSelection)
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
+ saveSyncToMP(){
|
|
|
+ let ids = ""
|
|
|
+ this.multipleSelection.forEach((item,index)=>{
|
|
|
+ if(index==0){
|
|
|
+ ids += item.id.toString()
|
|
|
+ }else{
|
|
|
+ ids += ","+item.id.toString()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.loading1 = true;
|
|
|
+ this.$api.syncToMP({ids:ids}).then((res)=>{
|
|
|
+ this.loading1 = false;
|
|
|
+ if(res.data.code==0){
|
|
|
+ this.$confirm("同步成功,已发送到微信公众号图文消息,即可可前往微信公众号预览!", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ showCancelButton: false,
|
|
|
+ type: "success",
|
|
|
+ }).then(()=>{
|
|
|
+ this.dialogVisible = false
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$confirm(
|
|
|
+ "同步失败!"+res.data.message,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ showCancelButton: false,
|
|
|
+ type: "error",
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleSelectionChange(val) {
|
|
|
+ console.log(val)
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
search() {
|