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.

risk-agreement.vue 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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
  27. } from "@/utils/network/api.js"
  28. const textContent = ref('')
  29. const textSrc = ref('')
  30. const isTextSrc = ref(false)
  31. // 获取文本信息----用户协议
  32. const getInfo = (type) => {
  33. //参数说明
  34. let options = {
  35. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  36. data: {
  37. businessType: 'RISK_NOTIFICATION'
  38. }, //请求参数
  39. method: "POST", //提交方式(默认POST)
  40. showLoading: true, //是否显示加载中(默认显示)
  41. };
  42. //调用方式
  43. request(infoQuery, options)
  44. .then((res) => {
  45. let data = stringToJson(res.bizContent)
  46. console.log(data);
  47. if (data.textType == "URL") {
  48. textSrc.value = 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. })
  61. onShow(() => {
  62. getInfo()
  63. console.log(1);
  64. })
  65. </script>
  66. <style lang="scss" scoped>
  67. .content {
  68. padding: 0rpx 40rpx;
  69. font-size: 28rpx;
  70. font-weight: 400;
  71. color: #333333;
  72. line-height: 40px;
  73. }
  74. </style>