info.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="container">
  3. <view class="notice-item">
  4. <jyf-parser :html="description" ref="article"></jyf-parser>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import {
  10. details,
  11. deconstructArticle
  12. } from '@/api/info.js';
  13. import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
  14. export default {
  15. components: {
  16. jyfParser
  17. },
  18. data() {
  19. return {
  20. id: '',
  21. list: "",
  22. description: '',
  23. type: 0,
  24. }
  25. },
  26. onLoad(option) {
  27. this.id = option.id;
  28. this.loadData();
  29. },
  30. methods: {
  31. loadData() {
  32. let obj = this;
  33. details({}, obj.id).then(function(e) {
  34. obj.list = e.data;
  35. console.log(obj.list.url)
  36. if (obj.list.content != null) {
  37. obj.description = obj.list.content.replace(/<img/g,
  38. "<img style='max-width:100%;height:auto;'").replace(/<a/g, "<a class='noa'");
  39. } //小程序商品详情图超出屏幕问题
  40. });
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. page {
  47. min-height: 100%;
  48. background: #FFFFFF;
  49. }
  50. .notice_name {
  51. font-size: 35rpx !important;
  52. color: #303133;
  53. padding: 25rpx 25rpx 0rpx 25rpx;
  54. margin-bottom: 25rpx;
  55. }
  56. .course-video {
  57. width: 100%;
  58. height: 500rpx;
  59. }
  60. .notice-item {
  61. width: 100%;
  62. height: 100%;
  63. color: #666666;
  64. padding: 35rpx 35rpx;
  65. font-size: 23rpx;
  66. padding-bottom: 30rpx;
  67. }
  68. /deep/ .noa {
  69. text-decoration: none;
  70. }
  71. </style>