news-detailes.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="container clearfix rich-text-temp">
  3. <view class="content-title">{{ title }}</view>
  4. <rich-text-template ref="childTemplate"></rich-text-template>
  5. </view>
  6. </template>
  7. <script>
  8. import richTextTemplate from '@/components/cm-module/listTemplate/richTextTemplate'
  9. var self
  10. export default{
  11. components: {
  12. richTextTemplate
  13. },
  14. data() {
  15. return{
  16. title:'',
  17. type: 'introduction'
  18. }
  19. },
  20. onLoad(option){
  21. this.GetNewsCapacity(option.id)
  22. },
  23. methods:{
  24. GetNewsCapacity(id){
  25. this.CommonService.GetNewsCapacity({id:id}).then(response =>{
  26. let data =response.data
  27. let html = this.$api.adaptRichTextImg(data.capacity)
  28. this.title = data.title
  29. this.$refs.childTemplate.html = html
  30. }).catch(error =>{
  31. this.$util.msg(error.msg,2000)
  32. })
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. page{
  39. background-color: #FFFFFF;
  40. }
  41. .content-title{
  42. width: 100%;
  43. height: auto;
  44. line-height: 40rpx;
  45. text-align: center;
  46. color: #333333;
  47. font-size: $font-size-32;
  48. font-weight: bold;
  49. padding-top: 40rpx;
  50. box-sizing: border-box;
  51. padding: 40rpx 40rpx 20rpx 40rpx;
  52. }
  53. </style>