noticeDetails.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!-- 消息详情 -->
  2. <template>
  3. <view class="news-details">
  4. <view class="news-details-header">
  5. <view class="news-details-header-title">{{ info.name }}</view>
  6. <view class="news-details-header-subtitle">
  7. <view v-if="info.createBy">来源:{{ info.createBy }}</view>
  8. <view>{{ info.releasTime }}</view>
  9. </view>
  10. </view>
  11. <view class="news-details-content">
  12. <u-parse :html="info.content"></u-parse>
  13. </view>
  14. <u-toast ref="uToast" />
  15. </view>
  16. </template>
  17. <script>
  18. export default{
  19. data(){
  20. return{
  21. info: ''
  22. }
  23. },
  24. onLoad(page){
  25. if (page.id) {
  26. this.getDetails(page.id)
  27. }
  28. },
  29. onShow(){
  30. },
  31. methods:{
  32. // 获取详情
  33. getDetails(id) {
  34. this.$u.api.noticeApi.getNoticeDetailsApi({ id }).then(res=>{
  35. if (res.code === 200) {
  36. this.info = res.data
  37. } else {
  38. this.$refs.uToast.show({
  39. title: res.msg,
  40. type: 'error'
  41. })
  42. }
  43. })
  44. .catch(err => {
  45. this.$refs.uToast.show({
  46. title: '操作失败!',
  47. type: 'error'
  48. })
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .news-details {
  56. padding: 30rpx 44rpx;
  57. font-family: 'PingFangSC-Regular, PingFang SC';
  58. &-header {
  59. border-bottom: solid 1px #DBDBDB;
  60. padding-bottom: 22rpx;
  61. &-title {
  62. color: #000;
  63. font-size: 36rpx;
  64. }
  65. &-subtitle {
  66. margin-top: 20rpx;
  67. display: flex;
  68. justify-content: space-between;
  69. color: #6F6F6F;
  70. font-size: 24rpx;
  71. }
  72. }
  73. &-content {
  74. padding: 18rpx 0;
  75. line-height: 50rpx;
  76. }
  77. }
  78. </style>