news_detail.vue 741 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.hideLoading()
  29. })
  30. },
  31. }
  32. </script>
  33. <style scoped>
  34. .news{
  35. background-color: white;
  36. }
  37. .u-content {
  38. /* margin-top: 100rpx; */
  39. }
  40. page, .content {
  41. background:#fff;
  42. }
  43. </style>