feat: topic page route, mobile style adaption

This commit is contained in:
KUN1007 2023-08-27 23:29:19 +08:00
parent 51edb891ca
commit b5a4be8f7d
6 changed files with 52 additions and 17 deletions

View file

@ -9,7 +9,7 @@ const props = defineProps(['data'])
<div class="topic"> <div class="topic">
<UserPart :kungalgamer="props.data.uid" /> <UserPart :kungalgamer="props.data.uid" />
<!-- TODO: 进入指定话题的路由 --> <!-- TODO: 进入指定话题的路由 -->
<router-link to="/topic"> <router-link :to="`/topic/${props.data.tid}`">
<TopicPart :data="props.data" /> <TopicPart :data="props.data" />
</router-link> </router-link>
</div> </div>

View file

@ -18,10 +18,12 @@ const props = defineProps<{
<!-- 头像图片 TODO: --> <!-- 头像图片 TODO: -->
<img src="@/assets/images/KUN.jpg" alt="KUN" /> <img src="@/assets/images/KUN.jpg" alt="KUN" />
</div> </div>
<!-- 名字 --> <div class="info">
<div class="name">{{ user.name }}</div> <!-- 名字 -->
<!-- 萌萌点 --> <div class="name">{{ user.name }}</div>
<div class="moemoepoint">{{ user.moemoepoint }}</div> <!-- 萌萌点 -->
<div class="moemoepoint">{{ user.moemoepoint }}</div>
</div>
</div> </div>
</template> </template>
@ -49,6 +51,7 @@ const props = defineProps<{
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 17px; margin-top: 17px;
font-size: 23px;
} }
/* 萌萌点 */ /* 萌萌点 */
.moemoepoint { .moemoepoint {
@ -56,4 +59,21 @@ const props = defineProps<{
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
@media (max-width: 700px) {
.kungalgamer {
flex-direction: row;
justify-content: center;
margin-top: 27px;
padding-bottom: 10px;
border-bottom: 1px solid var(--kungalgame-blue-1);
border-top: 1px solid var(--kungalgame-blue-1);
}
.info {
margin-left: 50px;
display: flex;
flex-direction: column;
justify-content: space-around;
}
}
</style> </style>

View file

@ -136,7 +136,7 @@ const {
/* 内容区的顶部 */ /* 内容区的顶部 */
.content-top { .content-top {
width: 100%; width: 100%;
height: 40px; max-height: 100px;
display: flex; display: flex;
text-align: center; text-align: center;
/* 时间和标签分居两侧 */ /* 时间和标签分居两侧 */
@ -144,6 +144,7 @@ const {
/* 下面的分割线 */ /* 下面的分割线 */
border-bottom: 1px solid var(--kungalgame-blue-1); border-bottom: 1px solid var(--kungalgame-blue-1);
box-sizing: border-box; box-sizing: border-box;
flex-grow: 1;
} }
/* 楼主的话题和楼主的信息容器 */ /* 楼主的话题和楼主的信息容器 */
@ -192,4 +193,10 @@ const {
flex-direction: column; flex-direction: column;
} }
} }
@media (max-width: 700px) {
.content-center {
flex-direction: column;
}
}
</style> </style>

View file

@ -196,4 +196,10 @@ defineProps<{
flex-direction: column; flex-direction: column;
} }
} }
@media (max-width: 700px) {
.article {
flex-direction: column;
}
}
</style> </style>

View file

@ -13,11 +13,7 @@ const props = defineProps<{
<!-- 标签的图标字体 --> <!-- 标签的图标字体 -->
<Icon class="tag" icon="mingcute:tag-2-fill" /> <Icon class="tag" icon="mingcute:tag-2-fill" />
<ul> <ul>
<li>啊这可海星</li> <li v-for="(tag, index) in tags" :key="index">{{ tag }}</li>
<li>啊这可海星</li>
<li>啊这可海星</li>
<li>啊这可海星</li>
<li>啊这可海星</li>
</ul> </ul>
</div> </div>
</template> </template>
@ -29,18 +25,23 @@ const props = defineProps<{
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: var(--kungalgame-font-color-3); color: var(--kungalgame-font-color-3);
flex-shrink: 0;
flex-grow: 1;
/* 单个标签的盒子 */ /* 单个标签的盒子 */
ul { ul {
flex-grow: 1;
max-height: 100px;
width: 300px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
overflow-y: scroll;
li { li {
margin-left: 5px; margin: 5px;
font-size: small; font-size: small;
padding: 2px; padding: 2px;
background-color: var(--kungalgame-blue-0); background-color: var(--kungalgame-trans-blue-0);
overflow: hidden; border: 1px solid var(--kungalgame-blue-1);
white-space: nowrap; overflow-y: scroll;
border-radius: 5px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background-color: var(--kungalgame-red-0); background-color: var(--kungalgame-red-0);

View file

@ -111,7 +111,8 @@ const handelReply = () => {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
margin-left: 17px; margin: 17px;
margin-right: 0;
span { span {
display: flex; display: flex;
margin-right: 3px; margin-right: 3px;