refactor(article): 优化标签和作者信息显示逻辑

- 格式化标签循环代码,提高可读性
- 添加条件渲染判断,仅在数据存在时显示编辑和二校信息
- 为ETF关联标的添加显示条件判断
This commit is contained in:
34701892@qq.com 2025-12-03 10:53:42 +08:00
parent 431cb67c12
commit 2fcead28e6
1 changed files with 26 additions and 11 deletions

View File

@ -19,17 +19,25 @@
<view class="r_r_tags" :class="{ mohu: !isLogin }">
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw">
<view class="r_tags">
<view class="tag" style="background-color: #fff9ec; color: #ffb100" v-for="(item, index) in props.data.conceptLabels" :key="index">{{
item
}}</view>
<view
class="tag"
style="background-color: #fff9ec; color: #ffb100"
v-for="(item, index) in props.data.conceptLabels"
:key="index"
>{{ item }}</view
>
</view>
</view>
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw">
<view class="r_tags">
<view class="tag" style="background-color: #f5f8fe; color: #007aff" v-for="(item, index) in props.data.industryLabels" :key="index">{{
item
}}</view>
<view
class="tag"
style="background-color: #f5f8fe; color: #007aff"
v-for="(item, index) in props.data.industryLabels"
:key="index"
>{{ item }}</view
>
</view>
</view>
</view>
@ -49,7 +57,13 @@
</view>
<view style="padding: 35rpx" :class="{ mohu: !isLogin }">
<text class="articleDes" :class="props?.data?.needpay && 'needpay'" style="white-space: pre-wrap" v-html="props.data.content"> </text>
<text
class="articleDes"
:class="props?.data?.needpay && 'needpay'"
style="white-space: pre-wrap"
v-html="props.data.content"
>
</text>
</view>
<!-- <view
@ -60,18 +74,18 @@
</view> -->
<view class="author" style="justify-content: flex-start; margin-top: -30rpx">
<view class="name">
<view class="name" v-if="props.data.editor">
<text class="text">编辑:</text>
<text class="text">{{ props.data.editor }}</text>
</view>
<view class="name" style="margin-left: 40rpx">
<view class="name" style="margin-left: 40rpx" v-if="props.data.secondReviewer">
<text class="text">二校:</text>
<text class="text">{{ props.data.secondReviewer }}</text>
</view>
</view>
<view class="r_etf" style="margin-top: 80rpx">
<view class="r_etf" style="margin-top: 80rpx" v-if="intoType == 'etf'">
<text class="etf_title">AI关联标的</text>
<view class="etfs">
<view v-for="(item, index) in data.etfs" class="etf_item" :key="index" @click="goEtfDetail(item)">
@ -84,7 +98,8 @@
:show="LoginShow"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback" />
@handlePopupErrorCallback="handlePopupErrorCallback"
/>
</view>
</template>