index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="main">
  3. <uv-navbar :title="title" placeholder autoBack></uv-navbar>
  4. <view class="content ql-editor-box" v-html="content"></view>
  5. </view>
  6. </template>
  7. <script setup>
  8. import { protocolInfo } from "@/api/index.js";
  9. import { ref } from "vue";
  10. import { onLoad } from "@dcloudio/uni-app";
  11. const title = ref("");
  12. const content = ref("");
  13. const getProtocol = (code) => {
  14. if (code == "privacy_protocol") {
  15. title.value = "隐私政策";
  16. }
  17. if (code == "about_us") {
  18. title.value = "关于我们";
  19. }
  20. if (code == "user_protocol") {
  21. title.value = "服务协议";
  22. }
  23. // if (code == "earnings-explain") {
  24. // title.value = "收益说明";
  25. // }
  26. // if (code == "income_statement") {
  27. // title.value = "收益说明";
  28. // }
  29. protocolInfo({ code }).then((res) => {
  30. console.log(res);
  31. if (res.code == 200) {
  32. content.value = res.data.protocolContent;
  33. }
  34. });
  35. };
  36. onLoad((option) => {
  37. getProtocol(option.code);
  38. });
  39. </script>
  40. <style lang="scss" scoped>
  41. .main {
  42. .content {
  43. padding: 0 30rpx;
  44. }
  45. }
  46. </style>