meitidetail.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="meitidetail">
  3. <view class="title">{{shuju.title}}</view>
  4. <!-- <view class="author">{{shuju.author}}</view> -->
  5. <view v-if="content">
  6. <view v-html="content"></view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import mineApi from '@/api/mine/index.js'
  12. export default {
  13. data() {
  14. return {
  15. primary:this.$theme.primary,
  16. shuju: {
  17. content: '',
  18. },
  19. settingFile:getApp().globalData.siteinfo
  20. };
  21. },
  22. onLoad(options) {
  23. mineApi.articledetail({id:options.id}).then(ret=>{
  24. if (ret.status == 0) {
  25. this.$u.toast("参数错误")
  26. }
  27. if (ret.status == 200) {
  28. this.shuju = ret.data
  29. this.content = ret.data.content.replace(/\<img src="/gi,`<img style='width:100%;display:block' src="${this.settingFile.root_rich_img}`);
  30. }
  31. })
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. page{
  37. width: 100%;
  38. height: 100%;
  39. }
  40. .meitidetail{
  41. width: 100%;
  42. height: 100%;
  43. padding: 20rpx;
  44. text-align: center;
  45. }
  46. .title{
  47. font-weight: bold;
  48. margin: 10rpx 0 30rpx 0rpx;
  49. font-size: 35rpx;
  50. }
  51. .author{
  52. font-weight: bold;
  53. margin: 5rpx 0 25rpx 0;
  54. font-size: 28rpx;
  55. }
  56. </style>