You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

agreement.vue 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <web-view v-if="isTextSrc" :src="textSrc"></web-view>
  3. <view class="content" v-else>
  4. {{textContent}}
  5. </view>
  6. </template>
  7. <script setup lang="ts">
  8. import {
  9. reactive,
  10. ref
  11. } from "vue";
  12. import {
  13. navTo
  14. } from "@/utils/utils"
  15. import {
  16. onLoad,
  17. onShow
  18. } from "@dcloudio/uni-app";
  19. import {
  20. stringToJson
  21. } from "@/utils/network/encryption.js";
  22. import {
  23. request
  24. } from "@/utils/network/request.js";
  25. import {
  26. infoQuery, envs
  27. } from "@/utils/network/api.js"
  28. const isTextSrc = ref(false)
  29. const textSrc = ref('')
  30. const content = ref('')
  31. const textContent = ref('')
  32. // 获取文本信息----用户协议
  33. const getInfo = () => {
  34. //参数说明
  35. let options = {
  36. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  37. data: {
  38. businessType: 'PRIVACY_AGREEMENT'
  39. }, //请求参数
  40. method: "POST", //提交方式(默认POST)
  41. showLoading: true, //是否显示加载中(默认显示)
  42. };
  43. //调用方式
  44. request(infoQuery, options)
  45. .then((res) => {
  46. let data = stringToJson(res.bizContent)
  47. if (data.textType == "URL") {
  48. textSrc.value = envs[process.env.NODE_ENV].baseUrl + data.text
  49. isTextSrc.value = true
  50. } else {
  51. textContent.value = data.text
  52. isTextSrc.value = false
  53. }
  54. })
  55. .catch((err) => {
  56. console.log(err);
  57. });
  58. }
  59. onLoad(() => {
  60. getInfo()
  61. })
  62. </script>
  63. <style lang="scss" scoped>
  64. .content {
  65. padding: 98rpx 50rpx 0rpx 50rpx;
  66. font-size: 28rpx;
  67. font-weight: 400;
  68. color: #333333;
  69. line-height: 40px;
  70. }
  71. </style>