From dc66ec6f3c3ae560bdcbb5e0a1790b27228205e8 Mon Sep 17 00:00:00 2001
From: inleft <inleft@qq.com>
Date: Thu, 03 Mar 2022 23:33:09 +0800
Subject: [PATCH] 修复图片定位问题

---
 src/components/mini/box-new-article.vue |   41 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/src/components/mini/box-new-article.vue b/src/components/mini/box-new-article.vue
index 30b62c6..1fbb81b 100644
--- a/src/components/mini/box-new-article.vue
+++ b/src/components/mini/box-new-article.vue
@@ -2,8 +2,8 @@
 	<div>
 		<div class="recent-posts" id="recent-posts">
 			<div class="recent-post-item">
-
-				<div class="post_cover left_radius" v-if="id%2==0">
+				<div class="miniTag" v-if="isTop==1">置顶</div>
+				<div class="post_cover left_radius" v-if="index%2==0">
 					<router-link :to="{path:'/mdDetail',query:{id:id}}" :title="title">
 						<div class="block left_radius"></div>
 						<img class="post_bg" :src="coverFileURL" :onerror="img404" :alt="title">
@@ -20,8 +20,8 @@
 
 				<div class="recent-post-info">
 					<router-link :to="{path:'/mdDetail',query:{id:id}}" 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"/>
+						<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}}
 					</router-link>
 					<!-- <a class="article-title" href="/mdDetail" :title="title"> {{title}}</a> -->
@@ -35,7 +35,8 @@
 						<span class="article-meta__separator" style="margin: 0px 3px ;"> | </span>
 						<span class="article-meta">
 							<a-icon type="book" />
-							<router-link :to="{path:'/mdDetail',query:{id:id}}" class="article-meta__categories">
+							<router-link :to="{path:'/articleList',query:{typeId:articleTypeId}}"
+								class="article-meta__categories">
 								{{articleTypeName}}
 							</router-link>
 							<!-- <a class="article-meta__categories" href="#"> {{tag}}</a> -->
@@ -53,7 +54,16 @@
 <script>
 	export default {
 		props: {
+			"index": {
+				default: 0,
+			},
 			"id": {
+				default: 0,
+			},
+			"articleTypeId": {
+				default: null
+			},
+			"isTop": {
 				default: 0,
 			},
 			"authStatus": {
@@ -97,6 +107,22 @@
 	@title-clolr: dimgray;
 	@card-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0.2), 0 0 0 rgba(255, 255, 255, 0.8), inset 9px 9px 15px rgba(0, 0, 0, 0.1), inset -9px -9px 15px rgba(255, 255, 255, 1);
 
+	.recent-post-item {
+		position: relative;
+
+		a {
+			position: initial;
+		}
+	}
+
+	.miniTag {
+		z-index: 1;
+		position: absolute;
+		right: 8px;
+		top: 8px;
+		transform: rotate(30deg);
+		box-shadow: aliceblue;
+	}
 
 	// #recent-posts>.recent-post-item:not(:first-child) {
 	// 	margin-top: 1rem;
@@ -181,9 +207,10 @@
 	}
 
 	#recent-posts>.recent-post-item .post_cover {
-		width: 33%;
-		position: sticky;
+		// position: sticky;
+		position: inherit;
 
+		width: 33%;
 		opacity: .8;
 		padding: calc(1.2rem * @ahzoo-proportion) calc(0.2rem * @ahzoo-proportion);
 		overflow: hidden;

--
Gitblit v1.9.1