123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <div>
- <common @asynCallBack="asynCallBack"></common>
- <top-header :pageTitle="pageTitle"></top-header>
- <div class="mui-content">
- <div class="vongi-notice">
- <div class="mui-h3">
- {{detail.title}}
- <h6 v-text="detail.createTime"></h6>
- </div>
- <p v-html="detail.content"></p>
- </div>
- <div v-if="noticeList.length" class="vongi-notice-list">
- <h3><img src="~$project/assets/img/text.png" width="12" />相关内容</h3>
- <div class="vongi-floor-padded">
- <router-link :to="{name:'CommonNoticeInfo',query:{id:item.id}}" v-for="(item,index) in noticeList" class="mui-ellipsis"
- v-text="item.title"></router-link>
- </div>
- </div>
- </div>
- <loading :visible="isLoading"></loading>
- </div>
- </template>
- <script>
- import * as API_Notice from '@/apis/Common/notice'
- import Common from '$project/components/Common.vue'
- import Loading from '$project/components/Loading.vue'
- import TopHeader from '$project/components/TopHeader.vue'
- import {
- mapGetters,
- mapMutations
- } from 'vuex'
- export default {
- name: 'CommonNoticeInfo',
- components: {
- Common,
- Loading,
- TopHeader
- },
- data() {
- return {
- pageTitle: '消息详情',
- isLoading: false,
- id: this.$route.query.id,
- detail: [],
- noticeList: [],
- }
- },
- created() {
- },
- methods: {
- //获取详情
- getDetail() {
- this.isLoading = true;
- API_Notice.getMessageInfo(this.id).then(response => {
- this.detail = response;
- this.isLoading = false;
- //获取最新5条通知消息
- this.getLastNotice();
- }).catch(error => {
- this.isLoading = false;
- mui.toast(error);
- })
- },
- //获取最新5条通知消息
- getLastNotice() {
- this.isLoading = true;
- API_Notice.getTopList({
- type: this.detail.type,
- limit: 5,
- excludeMessageId: this.id
- }).then(response => {
- this.noticeList = response;
- this.isLoading = false;
- }).catch(error => {
- this.isLoading = false;
- mui.toast(error);
- })
- },
- asynCallBack() {
- },
- },
- mounted() {
- //获取详情
- this.getDetail();
- },
- destroyed() {},
- computed: {
- ...mapGetters({
- openId: 'wx_openid',
- token: 'token',
- })
- }
- }
- </script>
- <style scoped src="$project/assets/css/xpwyfyy.css"></style>
- <style scoped>
- </style>
|