From cafc4bd14a4d73eca8ce21f1e37d48b1c7927a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Tue, 25 Jun 2024 10:00:21 +0800 Subject: [PATCH] =?UTF-8?q?task=20=E4=B9=B3=E5=B1=B1=E4=BA=A7=E4=BA=A4=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E9=97=BB=E9=99=84=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/project/new/newDetail.js | 17 ++++++++++++++++- static/js/project/policy/policyDetail.js | 18 +++++++++++++++++- view/new/newDetail.html | 11 +++++++++++ view/policy/policyDetail.html | 11 +++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) 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 @@
+ +
+ +
diff --git a/view/policy/policyDetail.html b/view/policy/policyDetail.html index ddc6491..ba91369 100644 --- a/view/policy/policyDetail.html +++ b/view/policy/policyDetail.html @@ -149,6 +149,17 @@
+ +
+ +