about-us.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="user-agreement">
  3. <!-- <view class="agreement-title">{{ aboutUsData.title }}</view> -->
  4. <view class="agreement-content">
  5. <u-parse
  6. v-if="articleHtml"
  7. :html="articleHtml"
  8. :autoscroll="true"
  9. :autoset-title="false"
  10. :tag-style="articleTagStyle"
  11. class="agreement-parse"
  12. />
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import { ARTICLE_TAG_STYLE, formatArticleHtml } from '@/utils/article-content.js'
  18. export default {
  19. data() {
  20. return {
  21. aboutUsData: {
  22. title: '',
  23. content: '',
  24. },
  25. articleHtml: '',
  26. articleTagStyle: ARTICLE_TAG_STYLE,
  27. }
  28. },
  29. onLoad() {
  30. this.getAboutUs();
  31. },
  32. methods: {
  33. // 获取关于书嗨
  34. getAboutUs() {
  35. uni.showLoading({
  36. title: "加载中...",
  37. });
  38. uni.$u.http
  39. .get("/token/getArticleOne?code=aboutShuHi")
  40. .then((res) => {
  41. if (res.code === 200) {
  42. this.aboutUsData = res.data
  43. this.articleHtml = formatArticleHtml(res.data.content || '')
  44. } else {
  45. this.$u.toast(res.msg || "获取关于书嗨失败");
  46. }
  47. })
  48. .finally(() => {
  49. uni.hideLoading();
  50. });
  51. },
  52. },
  53. };
  54. </script>
  55. <style lang="scss" scoped>
  56. .user-agreement {
  57. min-height: 100vh;
  58. background-color: $app-theme-bg-color;
  59. padding: 30rpx;
  60. padding-bottom: 50px;
  61. .agreement-title {
  62. font-size: 36rpx;
  63. font-weight: bold;
  64. color: $app-theme-text-color;
  65. text-align: center;
  66. margin-bottom: 40rpx;
  67. }
  68. .agreement-content {
  69. font-size: 28rpx;
  70. color: $app-theme-text-color;
  71. line-height: 1.8;
  72. width: 100%;
  73. overflow: hidden;
  74. }
  75. .agreement-parse {
  76. width: 100%;
  77. }
  78. }
  79. ::v-deep .agreement-parse {
  80. .interlayer {
  81. width: 100%;
  82. max-width: 100%;
  83. }
  84. .article-table-scroll,
  85. view[style*='overflow'] {
  86. width: 100% !important;
  87. max-width: 100%;
  88. overflow-x: auto !important;
  89. overflow-y: hidden;
  90. -webkit-overflow-scrolling: touch;
  91. }
  92. }
  93. </style>