index.vue 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="Body">
  3. <view class="content ql-editor-box" v-html="detail.protocolContent"></view>
  4. </view>
  5. </template>
  6. <script>
  7. import {
  8. protocolInfo
  9. } from "@/api/index.js"
  10. export default {
  11. data() {
  12. return {
  13. detail: {}
  14. }
  15. },
  16. onLoad(options) {
  17. console.log(options)
  18. if (options.code) {
  19. this.getDetail(options.code)
  20. uni.setNavigationBarTitle({
  21. title: options.code == 'user_protocol' ? '用户协议' : options.code == 'privacy_protocol' ? '隐私协议' : ''
  22. })
  23. }
  24. },
  25. methods: {
  26. getDetail(code) {
  27. protocolInfo({
  28. code: code
  29. }).then(res => {
  30. console.log(res)
  31. this.detail = res
  32. })
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .Body {
  39. padding-top: 40rpx;
  40. .content {
  41. padding: 0 30rpx;
  42. ::v-deep a {
  43. word-break: break-all;
  44. }
  45. ::v-deep img {
  46. max-width: 100%;
  47. }
  48. }
  49. }
  50. </style>