fix: 修复文章来源显示默认值及优化标签样式

修复文章组件中来源标签未定义时显示默认值"中国证券报"的问题
优化标签显示样式,移除冗余代码并简化模板结构
This commit is contained in:
zzp 2025-11-21 10:31:26 +08:00
parent 995f682ab8
commit 1e56d7c8f9
2 changed files with 11 additions and 26 deletions

View File

@ -3,8 +3,8 @@ ENV = production
# 线上环境接口地址
# VITE_API_URL = https://cankao.cs.com.cn/mini
# VITE_API_URL = http://123.60.153.169:8040/apih5
VITE_API_URL = https://cankao.cs.com.cn/apih5
VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = https://cankao.cs.com.cn/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5

View File

@ -4,7 +4,7 @@
<view class="author">
<view class="name" :class="{ mohu: !isLogin }">
<text class="text">来源:</text>
<text class="text">{{ props.data.tag }}</text>
<text class="text">{{ props.data.tag ? props.data.tag : "中国证券报" }}</text>
</view>
<!-- <view class="name" v-if="props.data.editor">
@ -18,25 +18,17 @@
<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>
@ -56,13 +48,7 @@
</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
@ -97,8 +83,7 @@
:show="LoginShow"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback"
/>
@handlePopupErrorCallback="handlePopupErrorCallback" />
</view>
</template>