refactor: 优化代码格式并移除无用功能
- 格式化 RankList.vue 和 realtimeInfo/index.vue 中的代码 - 移除 PageTop.vue 中未使用的"编辑精选"菜单项 - 调整资讯列表的 limit_num 参数从 20 改为 1000
This commit is contained in:
parent
9bbf2c10b3
commit
258444e317
|
|
@ -24,17 +24,19 @@
|
||||||
<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" v-for="(item, index) in item.conceptLabels" :key="index">{{
|
<view class="tag" style="background-color: #fff9ec; color: #ffb100"
|
||||||
item
|
v-for="(item, index) in item.conceptLabels" :key="index">{{
|
||||||
}}</view>
|
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" v-for="(item, index) in item.industryLabels" :key="index">{{
|
<view class="tag" style="background-color: #f5f8fe; color: #007aff"
|
||||||
item
|
v-for="(item, index) in item.industryLabels" :key="index">{{
|
||||||
}}</view>
|
item
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -51,8 +53,7 @@
|
||||||
</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>
|
||||||
|
|
@ -65,11 +66,8 @@
|
||||||
<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
|
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||||
:show="LoginShow"
|
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||||
@handlePopupClose="handlePopupClose"
|
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
|
||||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -97,7 +95,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,
|
||||||
|
|
@ -125,7 +123,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,
|
||||||
|
|
@ -310,11 +308,16 @@ function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd hh:MM:ss") {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
display: -webkit-box; /* 设置为WebKit内核的弹性盒子模型 */
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical; /* 垂直排列 */
|
/* 设置为WebKit内核的弹性盒子模型 */
|
||||||
-webkit-line-clamp: 2; /* 限制显示三行 */
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden; /* 隐藏超出范围的内容 */
|
/* 垂直排列 */
|
||||||
text-overflow: ellipsis; /* 使用省略号 */
|
-webkit-line-clamp: 2;
|
||||||
|
/* 限制显示三行 */
|
||||||
|
overflow: hidden;
|
||||||
|
/* 隐藏超出范围的内容 */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* 使用省略号 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-meta {
|
.news-meta {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,8 @@
|
||||||
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
|
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
|
||||||
<Line style="margin-top: 30rpx" :data="lineData"></Line>
|
<Line style="margin-top: 30rpx" :data="lineData"></Line>
|
||||||
|
|
||||||
<view style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
<view
|
||||||
|
style="display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center; padding-bottom: 30rpx">
|
||||||
<InfoSummary style="width: 85%" :count="newsNum"></InfoSummary>
|
<InfoSummary style="width: 85%" :count="newsNum"></InfoSummary>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -66,7 +67,9 @@
|
||||||
<view style="background-color: white; margin-top: 40rpx">
|
<view style="background-color: white; margin-top: 40rpx">
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<indexMenuTitle title="资讯头条 Top20"></indexMenuTitle>
|
<indexMenuTitle title="资讯头条 Top20"></indexMenuTitle>
|
||||||
<view style="display: flex; align-items: center; margin-right: 15rpx; font-size: 30rpx; gap: 10rpx; margin-top: 10rpx" @click="showCalendar">
|
<view
|
||||||
|
style="display: flex; align-items: center; margin-right: 15rpx; font-size: 30rpx; gap: 10rpx; margin-top: 10rpx"
|
||||||
|
@click="showCalendar">
|
||||||
{{ chooseDate.startDate.split(" ")[0] }}
|
{{ chooseDate.startDate.split(" ")[0] }}
|
||||||
<u-icon name="calendar" size="26" style="margin-right: 10rpx"></u-icon>
|
<u-icon name="calendar" size="26" style="margin-right: 10rpx"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -81,7 +84,8 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="background-color: white; margin-top: 40rpx">
|
<view style="background-color: white; margin-top: 40rpx">
|
||||||
<view style="display: flex; justify-content: space-between; align-items: center; padding-right: 30rpx; height: 100rpx">
|
<view
|
||||||
|
style="display: flex; justify-content: space-between; align-items: center; padding-right: 30rpx; height: 100rpx">
|
||||||
<indexMenuTitle title="热门行业池 Top10"></indexMenuTitle>
|
<indexMenuTitle title="热门行业池 Top10"></indexMenuTitle>
|
||||||
<view style="display: flex; gap: 3rpx">
|
<view style="display: flex; gap: 3rpx">
|
||||||
<text class="view-all" @click="onViewAll(0)">查看全部</text>
|
<text class="view-all" @click="onViewAll(0)">查看全部</text>
|
||||||
|
|
@ -93,7 +97,8 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="background-color: white; margin-top: 40rpx">
|
<view style="background-color: white; margin-top: 40rpx">
|
||||||
<view style="display: flex; justify-content: space-between; align-items: center; padding-right: 30rpx; height: 100rpx">
|
<view
|
||||||
|
style="display: flex; justify-content: space-between; align-items: center; padding-right: 30rpx; height: 100rpx">
|
||||||
<indexMenuTitle title="风口概念池 Top10"></indexMenuTitle>
|
<indexMenuTitle title="风口概念池 Top10"></indexMenuTitle>
|
||||||
<view style="display: flex; gap: 3rpx">
|
<view style="display: flex; gap: 3rpx">
|
||||||
<text class="view-all" @click="onViewAll(1)">查看全部</text>
|
<text class="view-all" @click="onViewAll(1)">查看全部</text>
|
||||||
|
|
@ -106,21 +111,11 @@
|
||||||
|
|
||||||
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
||||||
|
|
||||||
<LoginPopup
|
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||||
:show="LoginShow"
|
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||||
@handlePopupClose="handlePopupClose"
|
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
|
||||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
|
||||||
|
|
||||||
<u-calendar
|
<u-calendar :show="calendarShow" min-date="2025-01-01" closeOnClickOverlay :max-date="maxDate"
|
||||||
:show="calendarShow"
|
:default-date="chooseDate.startDate" monthNum="12" :key="chooseDate.startDate" @confirm="calendarConfirm"
|
||||||
min-date="2025-01-01"
|
|
||||||
closeOnClickOverlay
|
|
||||||
:max-date="maxDate"
|
|
||||||
:default-date="chooseDate.startDate"
|
|
||||||
monthNum="12"
|
|
||||||
:key="chooseDate.startDate"
|
|
||||||
@confirm="calendarConfirm"
|
|
||||||
@close="calendarShow = false">
|
@close="calendarShow = false">
|
||||||
</u-calendar>
|
</u-calendar>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -208,7 +203,7 @@ async function getNewsList() {
|
||||||
end_date: chooseDate.endDate
|
end_date: chooseDate.endDate
|
||||||
? timeFormat(chooseDate.endDate)
|
? timeFormat(chooseDate.endDate)
|
||||||
: timeFormat(new Date(today.getFullYear(), today.getMonth(), today.getDate(), 12, 0, 0, 0)),
|
: timeFormat(new Date(today.getFullYear(), today.getMonth(), today.getDate(), 12, 0, 0, 0)),
|
||||||
limit_num: 20,
|
limit_num: 1000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
<view class="line" v-if="tabIndex == 3"></view>
|
<view class="line" v-if="tabIndex == 3"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="r_menu_item" @click="tabChange(4)">
|
<!-- <view class="r_menu_item" @click="tabChange(4)">
|
||||||
<text class="menu_item">编辑精选</text>
|
<text class="menu_item">编辑精选</text>
|
||||||
<view class="line" v-if="tabIndex == 4"></view>
|
<view class="line" v-if="tabIndex == 4"></view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view @click="logout" v-if="Session.get('token')">
|
<view @click="logout" v-if="Session.get('token')">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue