index.vue 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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(e) {
  26. if(e){
  27. getUserAgreement(e.type).then(res => {
  28. this.content = res.data.content
  29. }).catch(err => {
  30. that.$util.Tips({
  31. title: err.msg
  32. });
  33. })
  34. }else{
  35. getUserAgreement('privacy').then(res => {
  36. this.content = res.data.content
  37. }).catch(err => {
  38. that.$util.Tips({
  39. title: err.msg
  40. });
  41. })
  42. }
  43. },
  44. mounted() {
  45. }
  46. }
  47. </script>
  48. <style scoped>
  49. page{
  50. background-color: #fff;
  51. }
  52. .content {
  53. padding: 40rpx 30rpx;
  54. line-height: 2;
  55. }
  56. </style>