info.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 { details , deconstructArticle } from '@/api/info.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. if(obj.list.content != null){
  33. obj.description = obj.list.content.replace(/<img/g,"<img style='max-width:100%;height:auto;'").replace(/<video/g,"<video style='max-width:100% !import;height:auto;'");
  34. }//小程序商品详情图超出屏幕问题
  35. });
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. page {
  42. min-height: 100%;
  43. background:#FFFFFF;
  44. }
  45. .notice_name {
  46. font-size: (35vw/7.5) !important;
  47. color: #303133;
  48. padding: (25vw/7.5) (25vw/7.5) (0vw/7.5) (25vw/7.5);
  49. margin-bottom: (25vw/7.5);
  50. }
  51. .course-video{
  52. width: 100%;
  53. height: (500vw/7.5);
  54. }
  55. .notice-item {
  56. width: 100%;
  57. height: 100%;
  58. color: #666666;
  59. padding: (35vw/7.5) (35vw/7.5);
  60. font-size: (23vw/7.5);
  61. padding-bottom: (30vw/7.5);
  62. }
  63. /deep/ .edui-faked-video {
  64. width: 750rpx;
  65. }
  66. </style>