123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- new Vue({
- el: '#app',
- data:{
- educationData:""
- },
- methods:{
-
- },
- mounted(){
- var vm = this
- var Request = GetRequest();
- var id = Request["articleId"];
-
- var promise1 = recordAPI.educationDetail({articleId:id,userType:1}).then(function(res){
- if(res.status == 200){return res.data}
- })
- var promise2 = recordAPI.educationDictionary({typeName:"prio"}).then(function(res){
- if(res.status == 200){return res.data}
- })
-
- Promise.all([promise1, promise2]).then(function(datas){
- var detail = datas[0]
- var content = detail.articleContent
- detail.articleContent = content.split('group1/M00').join(httpRequest.imgServer+'group1/M00')
- //优先级
- var articleleveObj = _.find(datas[1],function(item){return item.code == detail.articlelevel;});
- if(articleleveObj){
- detail.articleleveName = articleleveObj.codeName
- }else{
- detail.articleleveName = ""
- }
- //使用范围
- var userscopeName = ""
- var userscopeArr = [{code:"1",name:'全市使用'},{code:"2",name:'全区使用'},{code:"3",name:'社区使用'},{code:"4",name:'自己使用'}];
- detail.userscopeName = _.find(userscopeArr,function(item){return item.code == detail.userScope;}).name;
- vm.educationData = detail
- }).catch(function(){
- toastr.error("请求出错")
- })
-
- var divH = $(".layui-layer-content",parent.document).height();
- $(".pc-container").slimScroll({ height: divH,color: '#666'});
- $(".mobile-text").slimScroll({ height: '421px',color: '#666'});
- },
- })
|