qingyiay
2023-10-12 f2aa6f75d70cc7df54bfd0cf33af46fe96401856
pages/public-page/messageDetails/messageDetails.vue
@@ -1,50 +1,67 @@
<template>
   <view>
      <combined-title title="消息详情"></combined-title>
      <view class="compDetails">
         <uni-table border stripe emptyText="暂无更多数据">
            <uni-tr>
               <uni-th align="left">消息标题</uni-th>
               <uni-td align="left">{{ detail.title || '' }}</uni-td>
            </uni-tr>
            <uni-tr>
               <uni-th align="left">消息内容</uni-th>
               <uni-td align="left">{{ detail.content || '' }}</uni-td>
            </uni-tr>
            <uni-tr>
               <uni-th align="left">创建时间</uni-th>
               <uni-td align="left">{{ detail.createTime || '' }}</uni-td>
            </uni-tr>
         </uni-table>
   <view class="main">
      <view class="main-title">
         {{title}}
      </view>
      <u-divider text="这是一条分割线"
         textColor="#2979ff"
         lineColor="#2979ff"
         textSize='20'></u-divider>
      <view class="main-content">
         <u-parse :content="content"
            :lazyLoad="true"
            :selectable="true"></u-parse>
      </view>
   </view>
</template>
<script>
export default {
   data() {
      return {
         index: '',
         detail: {},
         messageId: '',
         id: ''
      };
   },
   onLoad(v) {
      this.messageId = v.messageId;
      this.id = v.id;
   },
   onShow() {
      this.getDetail();
   },
   methods: {
      getDetail() {
         this.$reqGet('getMsgDetail', { messageId: this.messageId, id: this.id }).then(res => {
            this.detail = res.data;
         });
   export default {
      data() {
         return {
            index: '',
            detail: {},
            messageId: '',
            id: '',
            content: '',
            title: ''
         };
      },
      onLoad(v) {
         this.messageId = v.messageId;
         this.id = v.id;
      },
      onShow() {
         this.getDetail();
      },
      methods: {
         getDetail() {
            this.$reqGet('getMsgDetail', { messageId: this.messageId, id: this.id }).then(res => {
               this.detail = res.data;
               this.content = this.detail.content;
               this.title = this.detail.title;
            });
         }
      }
   }
};
   };
</script>
<style></style>
<style lang="scss"
   scoped>
   @mixin flex {
      display: flex;
      justify-content: center;
      align-items: center;
   }
   .main {
      width: 100%;
      height: 100%;
      .main-title,
      .main-content {
         width: 94%;
         margin: vww(10) auto;
      }
   }
</style>