news_detail.vue 803 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="news">
  3. <view class="u-content padding" :selectable="true">
  4. <u-parse :html="content"></u-parse>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. content:''
  13. };
  14. },
  15. onLoad(options) {
  16. const that = this
  17. uni.showLoading({
  18. title: '正在加载',
  19. mask:true
  20. })
  21. that.$api.request('news', 'getNewsDetail', {
  22. id: options.id
  23. }, failres => {
  24. that.$api.msg(failres.errmsg)
  25. uni.hideLoading()
  26. }).then(res => {
  27. that.content = res.data.content
  28. uni.setNavigationBarTitle({
  29. title:res.data.title
  30. })
  31. uni.hideLoading()
  32. })
  33. },
  34. }
  35. </script>
  36. <style scoped>
  37. .news{
  38. background-color: white;
  39. }
  40. .u-content {
  41. /* margin-top: 100rpx; */
  42. }
  43. page, .content {
  44. background:#fff;
  45. }
  46. </style>