info.vue 1.4 KB

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