privacyAgreement.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="content">
  3. <view class="" v-html="description">
  4. </view>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. getDetail,
  10. } from '@/api/index.js';
  11. export default {
  12. data() {
  13. return {
  14. description: ''
  15. }
  16. },
  17. onLoad(opt) {
  18. if(opt.type) {
  19. this.type = opt.type
  20. uni.setNavigationBarTitle({
  21. title: '用户协议'
  22. })
  23. }else {
  24. uni.setNavigationBarTitle({
  25. title: '隐私协议'
  26. })
  27. }
  28. },
  29. onShow() {
  30. this.loadData()
  31. },
  32. methods: {
  33. loadData() {
  34. let obj = this;
  35. let id = 1;
  36. if(obj.type == 1) {
  37. id = 2
  38. }
  39. getDetail(id).then(function(e) {
  40. obj.list = e.data;
  41. if (obj.list.content != null) {
  42. obj.description = obj.list.content.replace(/<img/g,
  43. "<img style='max-width:100%;height:auto;'");
  44. } //小程序商品详情图超出屏幕问题
  45. });
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. .content {
  52. padding: $page-row-spacing;
  53. line-height: 2;
  54. font-size: $font-base;
  55. }
  56. .title {
  57. font-size: $font-lg + 6rpx;
  58. font-weight: bold;
  59. text-align: center;
  60. }
  61. .lineSt {
  62. text-indent: 2em;
  63. }
  64. .strongItem {
  65. margin: 20rpx 0;
  66. font-weight: bold;
  67. font-size: $font-lg;
  68. }
  69. </style>