fix: 新分支迁移mp

This commit is contained in:
hw
2025-11-25 14:42:56 +08:00
parent f22b390380
commit b4c77f5498
29 changed files with 320 additions and 483 deletions

View File

@@ -1,6 +1,4 @@
<script lang="ts" setup>
import { ElImage } from 'element-plus';
/** 微信消息 - 图文 */
defineOptions({ name: 'WxNews' });
@@ -22,13 +20,13 @@ defineExpose({
<div class="news-home">
<div v-for="(article, index) in articles" :key="index" class="news-div">
<!-- 头条 -->
<!-- TODO @hw第一篇文章头条图片是铺满不过要限制高度第二篇文章开始次条图片是在右侧也是需要限制宽高 -->
<a v-if="index === 0" :href="article.url" target="_blank">
<div class="news-main">
<div class="news-content flex items-center justify-center">
<ElImage
:src="article.picUrl || article.thumbUrl"
class="material-img"
<div class="news-content">
<img
:src="article.picUrl"
:preview="false"
class="material-img flex w-[100px] items-center justify-center"
/>
<div class="news-content-title">
<span>{{ article.title }}</span>
@@ -40,12 +38,13 @@ defineExpose({
<a v-else :href="article.url" target="_blank">
<div class="news-main-item">
<div class="news-content-item">
<div class="news-content-item-title">{{ article.title }}</div>
<div class="news-content-item-img flex items-center justify-center">
<div class="news-content-item-img">
<div class="news-content-item-title">{{ article.title }}</div>
<img
:src="article.picUrl || article.thumbUrl"
class="material-img"
height="100%"
:src="article.picUrl"
class="h-[70px] w-[70px] object-cover"
alt="文章图片"
/>
</div>
</div>
@@ -56,12 +55,15 @@ defineExpose({
</template>
<style lang="scss" scoped>
/** TODO @dylan@hw看看有没适合 tindwind 的哈。 */
/** TODO @dylan看看有没适合 tindwind 的哈。 */
.news-home {
width: 100%;
margin: auto;
background-color: #fff;
display: flex;
flex-direction: column;
gap: 10px;
}
.news-main {
@@ -83,42 +85,34 @@ defineExpose({
display: inline-block;
width: 98%;
padding: 1%;
font-size: 12px;
font-size: 16px;
color: #fff;
white-space: normal;
background-color: black;
opacity: 0.65;
margin-left: 10px;
}
.news-main-item {
padding: 5px 0;
background-color: #fff;
border-top: 1px solid #eaeaea;
}
.news-content-item {
padding: 10px;
box-sizing: border-box;
position: relative;
}
.news-content-item-title {
display: inline-block;
width: 70%;
margin-left: 1%;
font-size: 10px;
white-space: normal;
flex: 1;
font-size: 14px;
}
.news-content-item-img {
display: inline-block;
width: 25%;
margin-right: 1%;
background-color: #acadae;
display: flex;
align-items: center;
}
.material-img {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
width: auto;
object-fit: cover;
}
</style>