artDetail.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="container">
  3. <view class="status_bar"></view>
  4. <view class="notice-item">
  5. <jyf-parser :html="description" ref="article"></jyf-parser>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import {
  11. getDetail,
  12. } from '@/api/index.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. getDetail(obj.id).then(function(e) {
  34. obj.list = e.data;
  35. if (obj.list.content != null) {
  36. obj.description = obj.list.content.replace(/<img/g,
  37. "<img style='max-width:100%;height:auto;'");
  38. } //小程序商品详情图超出屏幕问题
  39. });
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .status_bar {
  46. height: var(--status-bar-height);
  47. width: 100%;
  48. }
  49. page {
  50. min-height: 100%;
  51. background: #FFFFFF;
  52. }
  53. .notice_name {
  54. font-size: 35rpx !important;
  55. color: #303133;
  56. padding: 25rpx 25rpx 0rpx 25rpx;
  57. margin-bottom: 25rpx;
  58. }
  59. .course-video {
  60. width: 100%;
  61. height: 500rpx;
  62. }
  63. .notice-item {
  64. width: 100%;
  65. height: 100%;
  66. color: #666666;
  67. padding: 35rpx 35rpx;
  68. font-size: 23rpx;
  69. padding-bottom: 30rpx;
  70. }
  71. </style>