style(RankList): 格式化代码并修复硬编码的新闻来源
- 调整标签和元数据的代码格式以提高可读性 - 将硬编码的新闻来源替换为动态变量 - 统一字体家族的声明格式
This commit is contained in:
parent
fc9502b16a
commit
2a9f835a0f
|
|
@ -24,19 +24,25 @@
|
||||||
<view class="r_r_tags" v-if="hasTag">
|
<view class="r_r_tags" v-if="hasTag">
|
||||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw">
|
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw">
|
||||||
<view class="r_tags">
|
<view class="r_tags">
|
||||||
<view class="tag" style="background-color: #fff9ec; color: #ffb100"
|
<view
|
||||||
v-for="(item, index) in item.conceptLabels" :key="index">{{
|
class="tag"
|
||||||
item
|
style="background-color: #fff9ec; color: #ffb100"
|
||||||
}}</view>
|
v-for="(item, index) in item.conceptLabels"
|
||||||
|
:key="index"
|
||||||
|
>{{ item }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw">
|
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw">
|
||||||
<view class="r_tags">
|
<view class="r_tags">
|
||||||
<view class="tag" style="background-color: #f5f8fe; color: #007aff"
|
<view
|
||||||
v-for="(item, index) in item.industryLabels" :key="index">{{
|
class="tag"
|
||||||
item
|
style="background-color: #f5f8fe; color: #007aff"
|
||||||
}}</view>
|
v-for="(item, index) in item.industryLabels"
|
||||||
|
:key="index"
|
||||||
|
>{{ item }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -44,7 +50,7 @@
|
||||||
|
|
||||||
<view class="news-meta">
|
<view class="news-meta">
|
||||||
<view>
|
<view>
|
||||||
<text class="source">{{ item.source }}</text>
|
<text class="source">中国证券报</text>
|
||||||
<!-- <text class="time">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text> -->
|
<!-- <text class="time">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text> -->
|
||||||
<!-- .format('YYYY-MM-DD HH:mm:ss'); -->
|
<!-- .format('YYYY-MM-DD HH:mm:ss'); -->
|
||||||
<text class="time">
|
<text class="time">
|
||||||
|
|
@ -53,7 +59,8 @@
|
||||||
</view>
|
</view>
|
||||||
<text class="score" v-if="needExp">
|
<text class="score" v-if="needExp">
|
||||||
<text v-if="index < 3">资讯评分:</text>
|
<text v-if="index < 3">资讯评分:</text>
|
||||||
{{ item.news_score }}</text>
|
{{ item.news_score }}</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -66,8 +73,12 @@
|
||||||
<img src="@/assets/zixun/down_icon.png" class="exp_up" v-else />
|
<img src="@/assets/zixun/down_icon.png" class="exp_up" v-else />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
<LoginPopup
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
:show="LoginShow"
|
||||||
|
@handlePopupClose="handlePopupClose"
|
||||||
|
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||||
|
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -94,7 +105,7 @@ watch(
|
||||||
try {
|
try {
|
||||||
concept_label = JSON.parse(item.concept_label);
|
concept_label = JSON.parse(item.concept_label);
|
||||||
industry_label = JSON.parse(item.industry_label);
|
industry_label = JSON.parse(item.industry_label);
|
||||||
} catch (e) { }
|
} catch (e) {}
|
||||||
rankListLocal.value.push({
|
rankListLocal.value.push({
|
||||||
...item,
|
...item,
|
||||||
conceptLabels: concept_label,
|
conceptLabels: concept_label,
|
||||||
|
|
@ -103,7 +114,7 @@ watch(
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -122,7 +133,7 @@ watch(
|
||||||
try {
|
try {
|
||||||
concept_label = JSON.parse(item.concept_label);
|
concept_label = JSON.parse(item.concept_label);
|
||||||
industry_label = JSON.parse(item.industry_label);
|
industry_label = JSON.parse(item.industry_label);
|
||||||
} catch (e) { }
|
} catch (e) {}
|
||||||
|
|
||||||
rankListLocal.value.push({
|
rankListLocal.value.push({
|
||||||
...item,
|
...item,
|
||||||
|
|
@ -131,7 +142,7 @@ watch(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 接收父组件传入的新闻列表
|
// 接收父组件传入的新闻列表
|
||||||
|
|
@ -261,7 +272,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
}
|
}
|
||||||
|
|
||||||
.rank-text-top3 {
|
.rank-text-top3 {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
|
|
@ -278,7 +291,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
}
|
}
|
||||||
|
|
||||||
.rank-text {
|
.rank-text {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #e98254;
|
color: #e98254;
|
||||||
|
|
@ -300,7 +315,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-desc {
|
.news-desc {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
@ -331,7 +348,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
.time,
|
.time,
|
||||||
.score {
|
.score {
|
||||||
// opacity: 0.8;
|
// opacity: 0.8;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
|
|
@ -345,7 +364,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
}
|
}
|
||||||
|
|
||||||
.score {
|
.score {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #ffa800;
|
color: #ffa800;
|
||||||
|
|
@ -378,7 +399,9 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
gap: 10rpx;
|
gap: 10rpx;
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #3f80fa;
|
color: #3f80fa;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue