detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="industralDetail">
  3. <div class="industralBox">
  4. <div class="industralTitle">{{detail.title}}</div>
  5. <div class="industralTime">{{detail.releaseTime}} &nbsp;|&nbsp; 园区管委会</div>
  6. </div>
  7. <div class="industralBox">
  8. <div class="industralTitle">简介</div>
  9. <div class="industralInfo" v-html="detail.content">
  10. <!-- (1) 对规模达到1亿元的创业投资基金,可按不超过基金规模1%的比例给予奖励;达到2亿元的,可按不超过1.5%的比例给予奖励;达到5亿元的,可按不超过2%的比例给予奖励。-->
  11. </div>
  12. <img style="width: 100%;height: 100%" v-for="item in imgUrlList" :src="item.url" alt="" />
  13. <div v-for="item in fileUrlList" style=" font-size: 16px; margin: 10px;color: #0000FF" @click="jumpFile(item)">
  14. {{item.name}}
  15. </div>
  16. <!-- <div class="industralInfo">-->
  17. <!-- (2) 对规模达到2亿元的私募股权基金,可按不超过基金规模1%的比例给予奖励:达到5亿元的,可按不超过1.5%的比例给予奖励:达到10亿元的,可按不超过2%的比例给予奖励。-->
  18. <!-- </div>-->
  19. <!-- <div class="industralInfo">-->
  20. <!-- (3) 对规模达到5亿元的私募证券基金,可接不超过基金规模0.5%的比例给予奖励;达到10亿元的,可按不超过1%的比例给予奖励;达到20亿元的,可按不超过1.5%的比例给子奖励。-->
  21. <!-- </div>-->
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import { policyGetById } from "@/js_sdk/http.js";
  27. export default {
  28. name: "detail",
  29. data(){
  30. return{
  31. detail: {},
  32. fileUrlList: [],
  33. imgUrlList: []
  34. }
  35. },
  36. onLoad(item) {
  37. // console.log(item.id)
  38. this.selectById(item.id)
  39. },
  40. methods:{
  41. selectById(id) {
  42. const _this = this
  43. policyGetById({ id }).then((res) => {
  44. console.log(res)
  45. if (res.data) {
  46. const det = _this.getItemJson(res.data)
  47. _this.detail = det
  48. if (det.fileUrl && det.fileUrl.length > 2) {
  49. const themeUrlList = []
  50. const imgUrlList = []
  51. const files = _this.$common.castEval(det.fileUrl)
  52. files.forEach(item => {
  53. const ul = {
  54. name: item.name,
  55. url: item.url.replace('server', 'smartParkH5Server')
  56. }
  57. if (item.name.indexOf('png') > -1 || item.name.indexOf('jpg') > -1 || item.name.indexOf('jpeg') > -1) {
  58. imgUrlList.push(ul)
  59. } else {
  60. themeUrlList.push(ul)
  61. }
  62. })
  63. if (imgUrlList.length > 0) {
  64. _this.imgUrlList = imgUrlList
  65. }
  66. _this.fileUrlList = themeUrlList
  67. }
  68. }
  69. })
  70. console.log(_this.detail)
  71. },
  72. getItemJson: function(item) {
  73. item.releaseTime = this.$common.transDate(item.releaseTime)
  74. // item.serviceType = this.dc_map.QUICK_SELECTION[item.serviceType]
  75. if (item.content && item.content.indexOf('smartParkH5Server' > -1)) {
  76. item.content = item.content.replace('server', 'smartParkH5Server')
  77. }
  78. if (item.content.indexOf('width') !== -1 && item.content.indexOf('height') !== -1) {
  79. item.content = item.content.replace(/width="(\S*)"/, 'width="100%"').replace(/height="(\S*)"/, 'height="100%"')
  80. }
  81. return item
  82. },
  83. jumpFile(item) {
  84. console.log(window.location.href)
  85. console.log(window.location.href.split('#')[0])
  86. wx.miniProgram.navigateTo({ url: '/pages/file/download?callBackUrl=' + encodeURIComponent(window.location.href.split('#')[0]) +
  87. '&url=' + item.url + '&name=' + item.name })
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .industralDetail{
  94. .industralBox{
  95. padding: 32rpx;
  96. background: white;
  97. margin: 24rpx 0;
  98. .industralTitle{
  99. color: rgba(34, 34, 34, 1);
  100. font-size: 32rpx;
  101. font-weight: 600;
  102. }
  103. .industralTime{
  104. font-size: 28rpx;
  105. margin-top: 16rpx;
  106. color: rgba(136, 136, 136, 1);
  107. }
  108. .industralInfo{
  109. margin: 24rpx 0;
  110. line-height: 50rpx;
  111. font-size: 28rpx;
  112. color: #444444;
  113. }
  114. }
  115. }
  116. </style>