From 4b70e2e988a180e6a1600b7f09a907fcb2bccfe2 Mon Sep 17 00:00:00 2001 From: yinxr <2273460044@qq.com> Date: Tue, 29 Jan 2019 19:36:19 +0800 Subject: [PATCH] Signed-off-by: yinxr <2273460044@qq.com> --- .../WEB-INF/manager/include/head-file.ftl | 3 +- src/main/webapp/WEB-INF/manager/login.ftl | 5 +- .../WEB-INF/manager/mweixin/metarial/form.ftl | 52 +++++++++++++++---- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/main/webapp/WEB-INF/manager/include/head-file.ftl b/src/main/webapp/WEB-INF/manager/include/head-file.ftl index 2b9feb6d..e70c599d 100644 --- a/src/main/webapp/WEB-INF/manager/include/head-file.ftl +++ b/src/main/webapp/WEB-INF/manager/include/head-file.ftl @@ -34,9 +34,8 @@ - + - + +
diff --git a/src/main/webapp/WEB-INF/manager/mweixin/metarial/form.ftl b/src/main/webapp/WEB-INF/manager/mweixin/metarial/form.ftl index 776524ca..fd4ae527 100644 --- a/src/main/webapp/WEB-INF/manager/mweixin/metarial/form.ftl +++ b/src/main/webapp/WEB-INF/manager/mweixin/metarial/form.ftl @@ -19,7 +19,7 @@@@ -104,6 +104,7 @@ thumbnailUrl:'',//缩略图路径 headMask:false,//缩略图删除 uploadDisable:false,//是否禁止上传 + newsCategoryId:'',//微信分类编号 }, watch:{ articleForm:{ @@ -111,20 +112,34 @@ this.mainArticle.basicTitle = n.basicTitle }, deep:true, - } + }, }, methods: { open:function(material){ menuVue.menuActive = '新建图文'; if(material && material.newsId>0){ // 编辑 - this.subArticleList = material.articleList + this.subArticleList = material.articleList; + console.log('子',material.articleList); this.mainArticle = material.newsArticle + // 默认显示头文章的详情 + this.articleForm.basicTitle = material.newsArticle.basicTitle + this.articleForm.articleAuthor = material.newsArticle.articleAuthor + this.articleForm.basicDescription = material.newsArticle.basicDescription + this.articleForm.articleContent = material.newsArticle.articleContent + this.thumbnailShow = true + this.thumbnailUrl = material.newsArticle.basicPic + this.editor.setContent(material.newsArticle.articleContent) + this.$forceUpdate(); }else{ // 新增 console.log('this.defaultArticleForm',this.defaultArticleForm); - this.articleForm = this.defaultArticleForm - this.mainArticle = this.defaultMainArticle + this.editor.setContent('') + this.thumbnailShow = false + this.thumbnailUrl = '' + this.articleForm = {} + this.subArticleList = []; + this.mainArticle = {} } console.log('"material',material); }, @@ -165,6 +180,12 @@ basicThumbnailsl: 'https://img03.sogoucdn.com/app/a/100520091/20190125113148' }) }, + // 更新或修改子文章 + addOrUpdateSubArticle:function(element){ + if(element.articleBasicId>0){ + + } + }, // 计算剩余字数 resetWordNum: function(type,limit) { var result = event.target.value; @@ -182,7 +203,22 @@ }, // 保存微信文章 newsSave:function(){ - + var that = this; + console.log('that.articleForm',that.articleForm); + console.log('that.articleList',that.articleList); + // 获取百度编辑器内容 + this.editor.getContent(); + ms.http.post(ms.manager + "/weixin/news/save.do",{ + newsArticleBean:that.mainArticle, + articleList:JSON.stringify(that.articleList), + newsCategoryId:that.newsCategoryId, + newsIsSyn:false, + newsType:1 + }).then(function (res) { + console.log('res',res); + }, function (err) { + that.$message.error(err); + }) } }, mounted: function() { @@ -222,10 +258,6 @@ ); }); } - - // 初始化默认值 - this.defaultArticleForm = JSON.parse(JSON.stringify(this.articleForm)) - this.defaultMainArticle = JSON.parse(JSON.stringify(this.mainArticle)) } }) \ No newline at end of file