detail.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="container">
  3. <navBar name="信息详情"></navBar>
  4. <view class="title">{{info.title}}</view>
  5. <view >{{info.overview}}</view>
  6. <image v-if="info.cover" :src="info.cover" class="img" mode="aspectFill" />
  7. <rich-text :nodes="info.content"></rich-text>
  8. </view>
  9. </template>
  10. <script>
  11. const config = require('@/common/config.js');
  12. const http = require('@/common/http.js');
  13. const request = require('@/common/request.js');
  14. const common = require('@/common/common.js');
  15. export default {
  16. data() {
  17. return {
  18. id: '',
  19. info: {}
  20. }
  21. },
  22. onLoad(options) {
  23. this.id = options.id
  24. this.queryMsgDetail()
  25. },
  26. methods: {
  27. queryMsgDetail() {
  28. const req = { type:'PLAT',id : Number(this.id) }
  29. http.postApi(config.API_MESSAGE_DTL, req, res => {
  30. if (res.succeed) {
  31. this.info = res.data.data
  32. console.log(this.info)
  33. }
  34. })
  35. },
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .container{
  41. display: flex;
  42. flex-direction: column;
  43. .title{
  44. font-size: 36rpx;
  45. font-weight: bold;
  46. margin: 20rpx;
  47. }
  48. .img{
  49. width: 750rpx;
  50. }
  51. }
  52. </style>