diff --git a/static/js/project/new/newDetail.js b/static/js/project/new/newDetail.js index 28f77d1..3175bba 100644 --- a/static/js/project/new/newDetail.js +++ b/static/js/project/new/newDetail.js @@ -90,8 +90,23 @@ define(['jquery', "template", "Tools", "newApi", 'swiper'], function ($, templat $("#newTime").html(content.newsTime); $("#newCome").html(content.realname); $("#newContent").html(content.content); + + if(content.attachment){ + var content = content.attachment.split(','); + let list = []; + content.map(rr=>{ + list.push({ + fileUrl:rr, + fileName:rr.substr(27,rr.length) + }) + }) + + module.data.attachmentList = list; + var attachmentListData = template('attachmentListData', module.data); + $("#attachmentListContent").html(attachmentListData); + } } } return module; -}); \ No newline at end of file +}); diff --git a/static/js/project/policy/policyDetail.js b/static/js/project/policy/policyDetail.js index e1e6c34..5ddb99d 100644 --- a/static/js/project/policy/policyDetail.js +++ b/static/js/project/policy/policyDetail.js @@ -101,8 +101,24 @@ define(['jquery', "template", "Tools", "newApi", 'swiper'], function ($, templat $("#newTime").html(content.newsTime); $("#newCome").html(content.createBy); $("#newContent").html(content.content); + + if(content.attachment){ + var content = content.attachment.split(','); + let list = []; + content.map(rr=>{ + list.push({ + fileUrl:rr, + fileName:rr.substr(27,rr.length) + }) + }) + + module.data.attachmentList = list; + var attachmentListData = template('attachmentListData', module.data); + $("#attachmentListContent").html(attachmentListData); + } + } } return module; -}); \ No newline at end of file +}); diff --git a/view/new/newDetail.html b/view/new/newDetail.html index 48aa7b3..00bb13a 100644 --- a/view/new/newDetail.html +++ b/view/new/newDetail.html @@ -149,6 +149,17 @@
+ +