@@ -113,21 +113,23 @@ SOFTWARE.
113
113
</div >
114
114
<div class =" configur_content" v-if =" tempObj.type === 'article_view_limited'" >
115
115
<el-row >
116
- <div class =" select-item" v-if =" tempObj && tempObj.content && tempObj.content.articles " >
117
- <WxNews :objData =" tempObj.content.articles " ></ WxNews >
116
+ <div class =" select-item" v-if =" tempObj && tempObj.replyArticles " >
117
+ <wx-news :articles =" tempObj.replyArticles " / >
118
118
<el-row class =" ope-row" >
119
- <el-button type =" danger" icon =" el-icon-delete" circle @click =" deleteTempObj " />
119
+ <el-button type =" danger" icon =" el-icon-delete" circle @click =" deleteMaterial " />
120
120
</el-row >
121
121
</div >
122
- <div v-if = " !tempObj.content || !tempObj.content.articles " >
122
+ <div v-else >
123
123
<el-row >
124
124
<el-col :span =" 24" style =" text-align : center " >
125
- <el-button type =" success" @click =" openMaterial" >素材库选择<i class =" el-icon-circle-check el-icon--right" ></i ></el-button >
125
+ <el-button type =" success" @click =" openMaterial" >
126
+ 素材库选择<i class =" el-icon-circle-check el-icon--right" ></i >
127
+ </el-button >
126
128
</el-col >
127
129
</el-row >
128
130
</div >
129
131
<el-dialog title =" 选择图文" :visible.sync =" dialogNewsVisible" width =" 90%" >
130
- <WxMaterialSelect :objData =" {repType: 'news'}" @selectMaterial =" selectMaterial" ></ WxMaterialSelect >
132
+ <wx-material-select :objData =" {type: 'news', accountId: this.accountId }" @selectMaterial =" selectMaterial" / >
131
133
</el-dialog >
132
134
</el-row >
133
135
</div >
@@ -148,7 +150,7 @@ SOFTWARE.
148
150
<script >
149
151
import WxReplySelect from ' @/views/mp/components/wx-reply/main.vue'
150
152
import WxNews from ' @/views/mp/components/wx-news/main.vue' ;
151
- import WxMaterialSelect from ' @/views/mp/components/wx-news /main.vue'
153
+ import WxMaterialSelect from ' @/views/mp/components/wx-material-select /main.vue'
152
154
import { deleteMenu , getMenuList , saveMenu } from " @/api/mp/menu" ;
153
155
import { getSimpleAccounts } from " @/api/mp/account" ;
154
156
@@ -359,10 +361,9 @@ export default {
359
361
this .$delete ( item, ' miniProgramPagePath' )
360
362
this .$delete ( item, ' url' )
361
363
this .$delete ( item, ' reply' )
362
- // TODO 芋艿:需要搞的属性弄下
363
-
364
- this .$delete ( item, ' article_id' )
365
- this .$delete ( item, ' textContent' )
364
+ this .$delete ( item, ' articleId' )
365
+ this .$delete ( item, ' replyArticles' )
366
+ // 关闭配置面板
366
367
this .showConfigureContent = false
367
368
}
368
369
@@ -471,24 +472,37 @@ export default {
471
472
openMaterial () {
472
473
this .dialogNewsVisible = true
473
474
},
474
- selectMaterial (item ){
475
- if (item .content .articles .length > 1 ){
475
+ selectMaterial (item ) {
476
+ const articleId = item .articleId ;
477
+ const articles = item .content .newsItem ;
478
+ // 提示,针对多图文
479
+ if (articles .length > 1 ) {
476
480
this .$alert (' 您选择的是多图文,将默认跳转第一篇' , ' 提示' , {
477
481
confirmButtonText: ' 确定'
478
482
})
479
483
}
480
484
this .dialogNewsVisible = false
481
- this .tempObj .article_id = item .articleId
482
- this .tempObj .mediaName = item .name
483
- this .tempObj .url = item .url
484
- item .mediaType = this .tempObj .mediaType
485
- item .content .articles = item .content .articles .slice (0 ,1 )
486
- this .tempObj .content = item .content
485
+
486
+ // 设置菜单的回复
487
+ this .tempObj .articleId = articleId;
488
+ this .tempObj .replyArticles = [];
489
+ articles .forEach (article => {
490
+ this .tempObj .replyArticles .push ({
491
+ title: article .title ,
492
+ description: article .digest ,
493
+ picUrl: article .picUrl ,
494
+ url: article .url ,
495
+ })
496
+ })
497
+ // this.tempObj.mediaName = item.name
498
+ // this.tempObj.url = item.url
499
+ // item.mediaType = this.tempObj.mediaType
500
+ // item.content.articles = item.content.articles.slice(0,1)
501
+ // this.tempObj.content = item.content
487
502
},
488
- deleteTempObj () {
489
- this .$delete (this .tempObj ,' repName' )
490
- this .$delete (this .tempObj ,' repUrl' )
491
- this .$delete (this .tempObj ,' content' )
503
+ deleteMaterial () {
504
+ this .$delete (this .tempObj ,' articleId' )
505
+ this .$delete (this .tempObj ,' replyArticles' )
492
506
},
493
507
},
494
508
}
0 commit comments