server_explan.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <view class="main">
  4. <u-parse :html="content" />
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import {
  10. getServerProto,
  11. getPrivatePolicy,
  12. getAfterSaleGuar
  13. } from '@/api/app';
  14. import {
  15. getTreaty
  16. } from '@/api/shop'
  17. export default {
  18. data() {
  19. return {
  20. content: ""
  21. };
  22. },
  23. onLoad() {
  24. this.type = Number(this.$Route.query.type)
  25. // 0 ==> 服务协议 1 ==> 隐私政策 2 ==> 售后保障
  26. this.getData()
  27. },
  28. methods: {
  29. async getData() {
  30. let res = {}
  31. switch (this.type) {
  32. case 0:
  33. uni.setNavigationBarTitle({
  34. title: '服务协议'
  35. });
  36. res = await getServerProto();
  37. break;
  38. case 1:
  39. uni.setNavigationBarTitle({
  40. title: '隐私政策'
  41. });
  42. res = await getPrivatePolicy();
  43. break;
  44. case 2:
  45. uni.setNavigationBarTitle({
  46. title: '售后保障'
  47. });
  48. res = await getAfterSaleGuar();
  49. break;
  50. case 3:
  51. uni.setNavigationBarTitle({
  52. title: '入驻协议'
  53. });
  54. res = await getTreaty();
  55. break;
  56. }
  57. if(res.code == 1) {
  58. this.content = res.data.content;
  59. }
  60. }
  61. }
  62. };
  63. </script>
  64. <style lang="scss">
  65. .main {
  66. padding: 20rpx;
  67. }
  68. </style>