inleft
2022-08-26 fa1bd95d533444d7360d1ada127b7a3279a3901f
src/components/mini/box-new-article.vue
@@ -3,75 +3,54 @@
      <div class="recent-post-item">
         <div class="miniTag" v-if="isTop==1">置顶</div>
         <div class="post_cover left_radius" v-if="index%2==0">
            <a :href="jumpURL" target="_blank" class="no-underline" v-if="articleFileType==5"
               @click="showMsg(articleFileType,jumpURL)">
            <a @click="routerJump(id,articleFileType,typeId)" :title="title" class="article-title">
               <div class="block left_radius"></div>
               <img class="post_bg" :src="coverFileURL" :onerror="img404" :alt="title">
            </a>
            <router-link :to="{path:'/mdDetail',query:{id:id}}" :title="title" v-else>
               <div class="block left_radius"></div>
               <img class="post_bg" :src="coverFileURL" :onerror="img404" :alt="title">
            </router-link>
         </div>
         <div class="post_cover right_radius" v-else>
            <a :href="jumpURL" target="_blank" class="no-underline" v-if="articleFileType==5"
               @click="showMsg(articleFileType,jumpURL)">
               <div class="block left_radius"></div>
               <img class="post_bg" :src="coverFileURL" :onerror="img404" :alt="title">
            </a>
            <router-link :to="{path:'/mdDetail',query:{id:id}}" :title="title" v-else>
            <a @click="routerJump(id,articleFileType,typeId)" :title="title" class="article-title">
               <div class="block right_radius"></div>
               <img class="post_bg" :src="coverFileURL" :onerror="img404" :alt="title">
               <!-- <img class="post_bg" src="https://unpkg.zhimg.com/ahzo@1.0.3/blogpic/1.jpg" onerror="this.onerror=null,this.src=&quot;/img/404.jpg&quot;" :alt="title"> -->
            </router-link>
            </a>
         </div>
         <div class="recent-post-info">
            <!-- <a :href="jumpURL" target="_blank" class="article-title" v-if="articleFileType==5"
               @click="showMsg(articleFileType,jumpURL)">
            <a @click="routerJump(id,articleFileType,typeId)" :title="title" class="article-title">
               <a-icon type="lock" style="color:rgba(0,0,0,.25)" v-if="authStatus==3" />
               <a-icon type="stop" style="color:rgba(0,0,0,.25)" v-if="authStatus==2" />
               {{title}}
               <a-badge :count="1" dot v-if="isAnyUpdate==1" title="最近有更新"></a-badge>
            </a> -->
            </a>
            <router-link :to="{path:'/mdDetail',query:{id:id,articleFileType:articleFileType}}"
               class="article-title">
               <a-icon type="lock" style="color:rgba(0,0,0,.25)" v-if="authStatus==3" />
               <a-icon type="stop" style="color:rgba(0,0,0,.25)" v-if="authStatus==2" />
               {{title}}
               <a-badge :count="1" dot v-if="isAnyUpdate==1" title="最近有更新"></a-badge>
            </router-link>
            <!-- <a class="article-title" href="/mdDetail" :title="title"> {{title}}</a> -->
            <div class="article-meta-wrap" style="display: flex;">
               <span class="post-meta-date">
               <span class="post-meta-date" style="margin-right: 7px;">
                  <a-icon type="calendar" />
                  <span class="article-meta-label"></span>
                  <time datetime="2022-01-13T06:25:00.000Z" title=" 2022-01-13 14:25:00"> {{publishDate}} </time>
                  <span class="article-meta__categories"> {{publishDate}} </span>
               </span>
               <span class="article-meta__separator" style="margin: 0px 3px ;"> | </span>
               <span class="article-meta">
                  <a-icon type="book" />
                  <router-link :to="{path:'/articleList',query:{typeId:articleTypeId}}"
                     class="article-meta__categories"> {{articleTypeName}}</router-link>
                  <span v-if="articleFileType==5">
                     <span v-if="jumpURL !=null && jumpURL!=''">
                        <span class="article-meta__separator" style="margin: 0px 3px ;">|</span>
                        <span class="post-meta-date">
                           <a-icon type="share-alt" />
                           <a :href="jumpURL" target="_blank" class="no-underline"> 外链 </a>
                        </span>
                     </span>
                  <a @click="routerToTypeList(articleTypeId)" class="article-meta__categories">
                     {{articleTypeName}}
                  </a>
                     <span v-else>
                        <span class="article-meta__separator" style="margin: 0px 3px ;">|</span>
                        <span class="post-meta-date">
                           <a-icon type="thunderbolt" />碎碎念
                        </span>
                  <span v-if="jumpURL !=null && jumpURL!=''">
                     <a-icon type="share-alt" />
                     <a :href="jumpURL" target="_blank" class="no-underline"> 外链 </a>
                  </span>
                  <span v-else-if="articleFileType==fileType.fileTypeTalking_9">
                     <a-icon type="thunderbolt" />
                     <span class="post-meta-date">碎碎念</span>
                  </span>
                  <span v-if="articleFileType==fileType.fileTypeVideo_3">
                     <a-icon type="video-camera" />
                     <span class="post-meta-date">
                        <a @click="routerToPlatform()">视频</a>
                     </span>
                  </span>
                  <!-- <a class="article-meta__categories" href="#"> {{tag}}</a> -->
@@ -90,21 +69,60 @@
      NotificationOutlined
   } from '@ant-design/icons-vue';
   import myConstant from "../../config/myConstant.js"
   export default {
      methods: {
         showMsg(articleFileType, jumpURL) {
            if (articleFileType == 5 && (jumpURL == null || jumpURL == "")) {
               this.$message.info('这只是一句碎碎念,没有更多内容啦', 3);
               return
            }
         }
      },
      components: {
         NotificationOutlined
      },
      data() {
         return {
            fileType: myConstant.fileType,
            img404: "this.onerror='';this.src=\"http://t.inleft.com/share/media_photo/1.jpg\"",
         }
      },
      methods: {
         routerJump(id, articleFileType, typeId) {
            let routerName = "mdDetail";
            // if (articleFileType == this.fileType.fileTypeVideo_3) {
            //    routerName = "videoDetail";
            // }
            this.$router.push({
               name: routerName,
               query: {
                  id: id,
                  articleFileType: articleFileType,
                  typeId: typeId
               },
               // params: {
               //    id: id,
               //    articleFileType: articleFileType,
               //    typeId: typeId
               // }
            })
         },
         routerToPlatform() {
            this.$router.push({
               name: "platformGroup"
            })
         },
         routerToTypeList(typeId) {
            this.$router.push({
               name: "articleList",
               query: {
                  typeId: typeId,
               }
            })
         }
      },
      props: {
         "index": {
            default: 0,
         },
         "typeId": {
            default: "",
         },
         "id": {
            default: 0,
@@ -145,11 +163,6 @@
         "jumpURL": {
            default: "",
         }
      },
      data() {
         return {
            img404: "this.onerror='';this.src=\"http://t.inleft.com/share/media_photo/1.jpg\"",
         }
      }
   }
</script>
@@ -170,6 +183,10 @@
      a {
         position: initial;
      }
      img {
         user-select: none;
      }
   }
   .miniTag {
@@ -180,6 +197,8 @@
      transform: rotate(30deg);
      box-shadow: aliceblue;
   }
   // #recent-posts>.recent-post-item:not(:first-child) {
   //    margin-top: 1rem;
@@ -471,9 +490,10 @@
         line-height: 1.7;
         color: #999;
         display: -webkit-container;
         -webkit-line-clamp: 3;
         -webkit-line-clamp: 2;
         text-overflow: ellipsis;
         overflow: hidden;
         min-height: 20px;
      }
   }