privacyAgreement.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. }
  24. },
  25. onShow() {
  26. this.loadData()
  27. },
  28. methods: {
  29. loadData() {
  30. let obj = this;
  31. let id = 3;
  32. if(obj.type == 1) {
  33. id = 4
  34. }
  35. getDetail(id).then(function(e) {
  36. obj.list = e.data;
  37. if (obj.list.content != null) {
  38. obj.description = obj.list.content.replace(/<img/g,
  39. "<img style='max-width:100%;height:auto;'");
  40. } //小程序商品详情图超出屏幕问题
  41. });
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss">
  47. .content {
  48. padding: $page-row-spacing;
  49. line-height: 2;
  50. font-size: $font-base;
  51. }
  52. .title {
  53. font-size: $font-lg + 6rpx;
  54. font-weight: bold;
  55. text-align: center;
  56. }
  57. .lineSt {
  58. text-indent: 2em;
  59. }
  60. .strongItem {
  61. margin: 20rpx 0;
  62. font-weight: bold;
  63. font-size: $font-lg;
  64. }
  65. </style>