privacyPolicy.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.getSysterms({
  36. termsType: Number(termsType)
  37. })
  38. .then(res => {
  39. if (res.code === 200) {
  40. this.content = res.data?.content
  41. } else {
  42. this.$refs.uToast.show({
  43. title: res.msg,
  44. type: 'error',
  45. })
  46. }
  47. })
  48. .catch(err => {
  49. this.$refs.uToast.show({
  50. title: '系统错误!',
  51. type: 'error',
  52. })
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .u-content {
  60. padding: 20rpx;
  61. }
  62. </style>