itemDetail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="notice_jingXiaoshang_detail">
  3. <div class="titleBox">
  4. <!-- <div class="titleStyle">【{{contentData.title}}】{{contentData.addtime}}</div> -->
  5. <div class="titleStyle">{{contentData.title}}</div>
  6. <span @click="backToPre()">返回上一级</span>
  7. </div>
  8. <div style=" border: 1px solid #ccc"></div>
  9. <div class="content">
  10. <!--{{contentData.content || '-'}}-->
  11. <p v-html="contentData.content"></p>
  12. </div>
  13. <div class="files">
  14. <p style="width: 65px">附件:</p>
  15. <div class="filesName">
  16. <p v-for="(item, index) in contentData.files"
  17. :key="index"
  18. @click="downloadFile(item)">
  19. {{ item.file_name || '-'}}
  20. </p>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import { php_url } from "../../../config/env";
  27. import axiosPhp from "axios";
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. contentData:{},
  33. unifiedUrl:'/lexus_php/api/',
  34. };
  35. },
  36. computed: {},
  37. methods: {
  38. backToPre() {
  39. this.$router.back(-1)
  40. },
  41. // 下载附件
  42. downloadFile: function (item) {
  43. console.log(item);
  44. let url = php_url + item.file_url;
  45. window.open(url);
  46. },
  47. getDetailInfo:function (info) {
  48. axiosPhp({
  49. method: "post",
  50. url: php_url + this.unifiedUrl + "notice_content.php",
  51. data: {
  52. id:info.id,
  53. agentId:info.agentId
  54. },
  55. })
  56. .then((res) => {
  57. console.log(res)
  58. if (res.data.code === 200) {
  59. console.log(res)
  60. this.contentData = {
  61. addtime:res.data.addtime,
  62. content:res.data.content,
  63. title:res.data.title,
  64. files:res.data.files
  65. }
  66. }
  67. })
  68. .catch((err) => {
  69. alert(err)
  70. });
  71. }
  72. },
  73. created() {},
  74. mounted() {
  75. this.contentData = this.$route.query;
  76. this.getDetailInfo(this.contentData)
  77. }
  78. };
  79. </script>
  80. <style scoped lang="less">
  81. .titleBox{
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. }
  86. .titleBox span{
  87. color: #0000ff;
  88. text-align: right;
  89. cursor: pointer;
  90. }
  91. .notice_jingXiaoshang_detail {
  92. margin-left: 32px;
  93. }
  94. .titleStyle {
  95. font-weight:bold;
  96. font-size: 16px;
  97. height: 50px;
  98. line-height: 50px;
  99. }
  100. .content {
  101. margin-top: 16px;
  102. }
  103. .files {
  104. display: flex;
  105. margin-top: 20px;
  106. .filesName {
  107. p {
  108. color: #0056a0;
  109. &:hover{
  110. cursor: pointer;
  111. }
  112. }
  113. }
  114. }
  115. </style>