privacyPolicy.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!-- ============================= 隐私政策/用户服务条款 ============================= -->
  2. <template>
  3. <view class="u-content">
  4. <u-parse :html="content"></u-parse>
  5. <u-toast ref="uToast" />
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. content: ''
  13. };
  14. },
  15. onLoad(query) {
  16. const termsType = query?.termsType;
  17. if (termsType) {
  18. switch (Number(termsType)) {
  19. case 1:
  20. uni.setNavigationBarTitle({
  21. title: '用户服务条款'
  22. });
  23. break;
  24. case 2:
  25. uni.setNavigationBarTitle({
  26. title: '隐私政策'
  27. });
  28. break;
  29. }
  30. this.getSysterms(termsType);
  31. }
  32. },
  33. methods: {
  34. getSysterms(termsType) {
  35. this.$u.api
  36. .getSysterms({
  37. termsType: Number(termsType)
  38. })
  39. .then((res) => {
  40. if (res.code === 200) {
  41. this.content = res.data?.content;
  42. } else {
  43. this.$refs.uToast.show({
  44. title: res.msg,
  45. type: 'error'
  46. });
  47. }
  48. })
  49. .catch((err) => {
  50. this.$refs.uToast.show({
  51. title: '系统错误!',
  52. type: 'error'
  53. });
  54. });
  55. }
  56. }
  57. };
  58. </script>
  59. <style lang="scss" scoped>
  60. .u-content {
  61. padding: 20rpx;
  62. }
  63. </style>