refactor(资讯页面): 优化布局样式并调整数据初始化顺序

调整页面元素的样式布局以提高可读性,将数据初始化逻辑重新排序以优化加载流程
This commit is contained in:
34701892@qq.com 2025-09-22 21:26:45 +08:00
parent 3129d239a6
commit 0c9a07e76d
1 changed files with 23 additions and 11 deletions

View File

@ -58,7 +58,8 @@
<indexMenuTitle title="资讯评分分布区间"></indexMenuTitle>
<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>
</view>
</view>
@ -72,7 +73,8 @@
</view>
<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>
<view style="display: flex; gap: 3rpx">
<text class="view-all" @click="onViewAll(0)">查看全部</text>
@ -84,7 +86,8 @@
</view>
<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>
<view style="display: flex; gap: 3rpx">
<text class="view-all" @click="onViewAll(1)">查看全部</text>
@ -97,13 +100,12 @@
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
<LoginPopup
:show="LoginShow"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback" />
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
<u-calendar :show="calendarShow" mode="range" @confirm="calendarConfirm"> </u-calendar>
<u-calendar :show="calendarShow" :min-date="minDate" closeOnClickOverlay :max-date="maxDate" mode="range"
@confirm="calendarConfirm" @close="calendarShow = false">
</u-calendar>
</view>
</template>
@ -127,6 +129,14 @@ import indexMenuTitle from "@/components/indexMenuTitle.vue"; // 路径根据实
import dayjs from "dayjs/esm/index";
import HotIndustryList from "@/components/HotIndustryList.vue"; //
const d = new Date();
const year = d.getFullYear();
let month = d.getMonth() + 1;
month = month < 10 ? `0${month}` : month;
const date = d.getDate();
const maxDate = `${year}-${month}-${date + 1}`;
const minDate = `${year}-${month}-${date - 10}`;
const calendarShow = ref(false);
const newsList = ref([]);
@ -212,8 +222,7 @@ function initData() {
getLineData();
//
getTopNum();
//
getNewsList();
// top10
getTopIndustry_dFn();
// top10
@ -277,6 +286,9 @@ onMounted(async () => {
if (!Session.get("token")) {
LoginShow.value = true;
}
//
getNewsList();
});
/**