Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

user-agreement.vue 1.3KB

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