message.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,
  6. width=device-width,initial-scale=1.0">
  7. <title>问卷调查</title>
  8. <!-- import CSS -->
  9. <link rel="stylesheet" href="static/index.css">
  10. </head>
  11. <style>
  12. body{margin:0px;padding:0px;}
  13. #app{
  14. display: none;
  15. }
  16. .tpl_title {
  17. font-size: 18px;
  18. margin: 10px 0;
  19. }
  20. .item-main{
  21. padding:10px 15px;
  22. }
  23. .el-form-item__label{
  24. font-weight:600;
  25. float:none;
  26. }
  27. .el-message-box{
  28. width:80%;
  29. }
  30. .survey_logo{
  31. width:145px;
  32. }
  33. </style>
  34. <body>
  35. <div id="app">
  36. <div class="item-main">
  37. <img src="static/survey_logo.png" alt="" class="survey_logo" />
  38. <h5 align="center" class="tpl_title">{{ form.name }}</h5>
  39. <div class="content">
  40. <div v-html="form.content"></div>
  41. <div>
  42. <span>附件:</span>
  43. <a :href="form.fileurl">{{form.filename}}</a>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </body>
  49. <!-- import Vue before Element -->
  50. <script src="static/jquery.min.js"></script>
  51. <script src="static/vue.js"></script>
  52. <!-- import JavaScript -->
  53. <script src="static/index.js"></script>
  54. <script>
  55. new Vue({
  56. el: '#app',
  57. data: function() {
  58. return {
  59. type:null,
  60. form:{
  61. },
  62. widgetList:[],
  63. id:'',
  64. title:'',
  65. show:0
  66. }
  67. },
  68. methods:{
  69. getData(){
  70. let url = "/api/admin/message/notice"
  71. $.ajax({
  72. url:url,
  73. method:'get',
  74. data:{
  75. id:this.id
  76. },
  77. success:res=>{
  78. document.getElementById('app').style.display='block'
  79. this.form = res.data
  80. },
  81. error:res=>{
  82. if(res.status==403){
  83. window.location.href="/survey/login.html?id="+this.id
  84. }
  85. }
  86. })
  87. },
  88. handleSuccess(res, file) {
  89. this.form2[res.data.type] = res.data.url;
  90. },
  91. },
  92. created(){
  93. var search=window.location.search.split('?')[1].split('&');
  94. this.id=search[0].split('=')[1]
  95. this.getData()
  96. }
  97. })
  98. </script>
  99. </html>