1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <li v-if="newsData" @click.prevent="checkInfo(newsData)">
- <div class="newsInfor-img-box" :style="{backgroundImage: `url(${newsData.pic || newsInforImg})`}"></div>
- <div class="newsInfor-list-content">
- <h5>{{newsData.title}}</h5>
- <div><span class="mta-hidden-sm">{{newsData.startTime}}</span></div>
- <div class="mta-hidden-xs"><i></i><span>{{newsData.startTime}}</span><i type="visits"></i><span>{{newsData.visits}}</span>
- </div>
- <p>{{newsData.intro}}</p>
- <a class="mta-hidden-xs" :href="`${baseUrl}/news/${newsData.code}`" >
- <span>了解更多</span>
- </a>
- </div>
- </li>
- </template>
- <script>
- import { mapGetters } from 'vuex';
- export default {
- name: 'NewList',
- props: {
- newsData: {
- type: Object,
- default: () => {
- },
- },
- },
- data() {
- return {
- newsInforImg: require(`~/static/images/client/newsInfor/newsInfor-list-img.png`),
- };
- },
- computed: {
- baseUrl() {
- return this.getBaseUrl;
- },
- ...mapGetters(['getBaseUrl']),
- },
- methods: {
- checkInfo(data) {
- // console.log(window.localtion.href);
- // console.log(self.localtion.href);
- // console.log(document.URL);
- const opt = {
- id: data.code,
- };
- this.$router.push({ name: 'news-id', params: opt });
- this.$emit('know-more', data);
- },
- },
- };
- </script>
- <style scoped>
- </style>
|