details.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view style="background-color: #fff;">
  3. <u-navbar :title="newsDetail.title"></u-navbar>
  4. <view class="main">
  5. <view class="news-content" v-html="newsDetail.value">
  6. </view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import * as newsApi from '@/apis/news.js'
  12. export default {
  13. data() {
  14. return {
  15. id: '',
  16. newsDetail: '',
  17. }
  18. },
  19. onLoad(op) {
  20. this.id =op.code;
  21. this.getNewsInfoDetail();
  22. },
  23. methods: {
  24. getNewsInfoDetail() {
  25. uni.showLoading({
  26. title: "加载中",
  27. mask: true,
  28. })
  29. newsApi.findConfigureByKey({
  30. key:this.id
  31. }).then((res) => {
  32. uni.hideLoading()
  33. this.newsDetail = res.data;
  34. }).catch(error => {
  35. uni.showToast({
  36. title: error,
  37. icon: "none"
  38. })
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .main{
  46. margin: 0px 16px ;
  47. padding-bottom: 34px;
  48. .new-title{
  49. color: #101010;
  50. font-size: 18px;
  51. height: 48px;
  52. margin: 16px 0 35px;
  53. }
  54. .time{
  55. display: flex;
  56. justify-content: space-between;
  57. color: #888888;
  58. .num{
  59. margin-left: 4px;
  60. }
  61. }
  62. .news-content{
  63. margin-top: 13px;
  64. font-size: 14px;
  65. line-height: 28px;
  66. color: #101010;
  67. }
  68. }
  69. </style>