parse.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <zj-page-layout
  3. :bgColor="'#FFFFFF'"
  4. :hasFooter="false"
  5. :isScroll="false">
  6. <view class="content">
  7. <u-parse :content="content" :tagStyle="style"></u-parse>
  8. </view>
  9. </zj-page-layout>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. type: 1,
  16. content: '',
  17. style: {
  18. p: 'font-size: 32rpx; line-height: 52rpx;',
  19. }
  20. }
  21. },
  22. onLoad({type}) {
  23. this.type = type;
  24. if(type == 1) {
  25. uni.setNavigationBarTitle({
  26.   title: '防骗指南'
  27. })
  28. }else if(type == 2) {
  29. uni.setNavigationBarTitle({
  30.   title: '隐私政策'
  31. })
  32. }else if(type == 3) {
  33. uni.setNavigationBarTitle({
  34.   title: '用户协议'
  35. })
  36. }
  37. this.getDetail();
  38. },
  39. methods: {
  40. getDetail() {
  41. this.$api.get('/app/config/detail-by-type', {
  42. configType: this.type
  43. }).then(res => {
  44. this.content = res.data ? res.data.content : '';
  45. })
  46. },
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .content {
  52. image {
  53. width: 100%;
  54. }
  55. }
  56. </style>