text.vue 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class="pd10rpx">
  3. <rich-text :nodes="nodes" style="font-size: 14px;"></rich-text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. nodes:"",
  11. }
  12. },
  13. onLoad(e) {
  14. console.log(e,"e")
  15. uni.setNavigationBarTitle({
  16. title:e.title,
  17. })
  18. let url = e.title =="用户服务协议"?"user/yixie":e.title =="关于我们"?"user/aboutUs":e.title == "帮助中心" ?
  19. "user/helps" : 'user/yinsi';
  20. this.request({
  21. url: url,
  22. data: {
  23. kc_id:"",
  24. },
  25. }).then(res => {
  26. console.log(res,"res")
  27. if (res.code === '200') {
  28. this.nodes = res.data.kc_text.replace('<img', '<img style="max-width:100%;height:auto;display:block;margin:10px 0;"')
  29. }
  30. });
  31. },
  32. onShareAppMessage(e) {
  33. },
  34. methods: {
  35. }
  36. }
  37. </script>
  38. <style>
  39. .pd10rpx{
  40. padding: 0 10px;
  41. }
  42. </style>