agree.vue 990 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. try {
  26. const res = uni.getStorageSync('config');
  27. if (res) {
  28. res.agree = res.agree.replace(/\<img/gi, '<img class="rich-img"');
  29. that.$set(that, `info`, res);
  30. }
  31. } catch (err) {
  32. uni.showToast({
  33. title: err.errmsg,
  34. icon: 'error',
  35. duration: 2000
  36. });
  37. }
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss">
  43. .main {
  44. display: flex;
  45. flex-direction: column;
  46. width: 100vw;
  47. height: 100vh;
  48. .one {
  49. padding: 2vw;
  50. .rich-img {
  51. width: 100% !important;
  52. display: block;
  53. }
  54. }
  55. }
  56. </style>