index.vue 868 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="content">
  3. <jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
  4. </view>
  5. </template>
  6. <script>
  7. import parser from "@/components/jyf-parser/jyf-parser";
  8. import {
  9. getUserAgreement,
  10. } from '@/api/user.js';
  11. export default {
  12. components: {
  13. "jyf-parser": parser
  14. },
  15. data() {
  16. return {
  17. tagStyle: {
  18. img: 'width:100%;display:block;',
  19. table: 'width:100%',
  20. video: 'width:100%'
  21. },
  22. content: ``
  23. }
  24. },
  25. onLoad(options) {
  26. getUserAgreement(options.type).then(res => {
  27. this.content = res.data.content
  28. uni.setNavigationBarTitle({
  29. title: res.data.title
  30. });
  31. }).catch(err => {
  32. that.$util.Tips({
  33. title: err
  34. });
  35. })
  36. }
  37. }
  38. </script>
  39. <style scoped>
  40. page {
  41. background-color: #fff;
  42. }
  43. .content {
  44. padding: 40rpx 30rpx;
  45. line-height: 2;
  46. }
  47. </style>