detail.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="container">
  3. <!-- 公告详情 -->
  4. <view class="title">{{ noticeDetail.title }}</view>
  5. <view class="time" v-if="noticeDetail">
  6. <span>
  7. <span>作者:{{noticeDetail.author || '茶付宝'}}</span>
  8. </span>
  9. <span :style="{'margin-left':'20rpx'}">
  10. 时间: {{ $day(noticeDetail.add_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}
  11. </span></view
  12. >
  13. <mp-html :content="noticeDetail.content" class="mar_t50"></mp-html>
  14. <!-- 公告详情-end -->
  15. </view>
  16. </template>
  17. <script>
  18. import { post } from "@/request/api.js";
  19. import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue"
  20. export default {
  21. data() {
  22. return {
  23. content: "",
  24. noticeDetail: {},
  25. };
  26. },
  27. onLoad(da) {
  28. this.loadData(da.id)
  29. },
  30. methods: {
  31. loadData(id) {
  32. let data = {
  33. article_id: id,
  34. };
  35. post("v1/notice", data).then((res) => {
  36. if (res.code == 0) {
  37. this.noticeDetail = res.data.data;
  38. }
  39. });
  40. },
  41. },
  42. components: {
  43. mpHtml,
  44. },
  45. };
  46. </script>
  47. <style lang="scss" scoped>
  48. // 用户须知
  49. .container {
  50. border-top: 20rpx solid #f5f5f5;
  51. padding: 0 20rpx;
  52. box-sizing: border-box;
  53. .title {
  54. margin-top: 20rpx;
  55. font-size: 48rpx;
  56. font-weight: bold;
  57. }
  58. .time {
  59. margin-top: 10rpx;
  60. font-size: 20rpx;
  61. color: #666363;
  62. }
  63. }
  64. // 用户须知-end
  65. </style>