article.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="u-content">
  3. <u-parse :content="conent"></u-parse>
  4. </view>
  5. </template>
  6. <script>
  7. import mineApi from '@/api/mine/index.js'
  8. export default {
  9. data() {
  10. return {
  11. primary:this.$theme.primary,
  12. conent: '',
  13. settingFile: getApp().globalData.siteinfo,
  14. }
  15. },
  16. onLoad(options) {
  17. let that=this;
  18. if (options) {
  19. if (options.type == 1) {
  20. uni.setNavigationBarTitle({
  21. title: '关于我们'
  22. });
  23. mineApi.about({}).then(ret => {
  24. if (ret.status == 200) {
  25. that.conent = ret.data.content.replace(/\<img src="/gi,
  26. `<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
  27. }
  28. console.log(that.conent)
  29. })
  30. } else if (options.type == 2) {
  31. // uni.setNavigationBarTitle({
  32. // title: options.title
  33. // });
  34. // mineApi.about({}).then(ret => {
  35. // if (ret.status == 200) {
  36. // this.conent = ret.data.mcjs.content.replace(/\<img src="/gi,
  37. // `<img style='width:100%' src="${this.settingFile.root_rich_img}`);
  38. // }
  39. // })
  40. }
  41. }
  42. },
  43. methods: {
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .u-content {
  49. padding: 24rpx;
  50. }
  51. </style>