agree.vue 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <rich-text :nodes="info.agree"></rich-text>
  6. </view>
  7. </view>
  8. </mobile-frame>
  9. </template>
  10. <script>
  11. export default {
  12. components: {},
  13. data() {
  14. return {
  15. info: {}
  16. };
  17. },
  18. onShow: function() {
  19. const that = this;
  20. that.search();
  21. },
  22. methods: {
  23. search() {
  24. const that = this;
  25. uni.getStorage({
  26. key: 'config',
  27. success: function(res) {
  28. if (res.data) {
  29. res.data.agree = res.data.agree.replace(/\<img/gi, '<img class="rich-img"');
  30. that.$set(that, `info`, res.data);
  31. }
  32. },
  33. fail: function(err) {
  34. console.log(err);
  35. }
  36. })
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .main {
  43. display: flex;
  44. flex-direction: column;
  45. width: 100vw;
  46. height: 100vh;
  47. .one {
  48. padding: 2vw;
  49. .rich-img {
  50. width: 100% !important;
  51. display: block;
  52. }
  53. }
  54. }
  55. </style>