洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.5 KiB

10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title=" "></topNavbar>
  4. <view class="pad">
  5. <view class="card">
  6. <view class="tit">{{detailInfo.title}}</view>
  7. <!-- <view class="h2">二级标题二级标题二级标题二级标题二级标题二级标题</view> -->
  8. <view class="content">
  9. <!-- <rich-text :nodes="detailInfo.mainBody" ></rich-text> -->
  10. <u-parse :content="detailInfo.mainBody" :tagStyle="style"></u-parse>
  11. </view>
  12. <view class="date">发布时间{{ $u.timeFormat(detailInfo.createTime, 'yyyy/mm/dd') }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import { getarticle } from '@/config/api.js'
  19. export default {
  20. data() {
  21. return {
  22. id: '',
  23. detailInfo: {},
  24. style: {
  25. img: 'max-width:100%;height:auto',
  26. p: 'font-size:32rpx',
  27. }
  28. }
  29. },
  30. onLoad(options) {
  31. this.id = options.id
  32. this.getarticleFn()
  33. let obj = {a: 1}
  34. },
  35. methods: {
  36. async getarticleFn() {
  37. const {data: res} = await getarticle({id: this.id})
  38. this.detailInfo = res
  39. // this.detailInfo = (res).replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
  40. console.log(res)
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .pageBgImg {
  47. min-height: 100vh;
  48. .card {
  49. padding: 28rpx 24rpx;
  50. .tit {
  51. font-size: 28rpx;
  52. font-weight: 550;
  53. }
  54. .h2 {
  55. margin: 8rpx 0 42rpx 0;
  56. color: #686B73;
  57. font-size: 24rpx;
  58. }
  59. .content {
  60. padding: 28rpx 0;
  61. }
  62. .date {
  63. padding: 72rpx 0 40rpx 0;
  64. font-size: 20rpx;
  65. color: #686B73;
  66. }
  67. }
  68. }
  69. </style>