refactor(minihome): 重构首页布局并优化样式

- 移除注释代码和未使用的组件
- 重新设计顶部标签栏和搜索框样式
- 简化banner图片数组
- 调整页面结构和间距
This commit is contained in:
34701892@qq.com 2025-12-17 10:46:59 +08:00
parent 8f23f0c315
commit 695149674f
1 changed files with 50 additions and 34 deletions

View File

@ -1,11 +1,7 @@
<template> <template>
<!-- 顶部 banner 区域 --> <!-- 顶部 banner 区域 -->
<view class="all"> <view class="all">
<!-- <Navbar title="中证参考" :hasBack="false"></Navbar> --> <image class="top_bk" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"></image>
<image
class="top_bk"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"
></image>
<view <view
:style="{ :style="{
@ -38,38 +34,43 @@
}" }"
v-if="tabIndex == 0 || tabIndex == 2" v-if="tabIndex == 0 || tabIndex == 2"
> >
<view class="r_sreach"> <!-- <view class="r_sreach">
<image <image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
class="logo_text"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"
>
</image> </image>
<view class="sreach" @click="goSreach" v-if="tabIndex == 0"> <view class="sreach" @click="goSreach" v-if="tabIndex == 0">
<view class="sreach_icon"> <view class="sreach_icon">
<image <image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"></image>
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"
></image>
</view> </view>
<view class="sreach_text"> <view class="sreach_text">
<text>搜索资讯</text> <text>搜索资讯</text>
</view> </view>
</view> </view>
</view> </view> -->
<view style="padding: 0 24rpx; margin-top: 30rpx" v-if="tabIndex == 0"> <view style="padding: 0 24rpx; margin-top: 30rpx" v-if="tabIndex == 0">
<u-swiper :list="list1" @change="change" @click="click"></u-swiper> <u-swiper :list="list1" @change="change" @click="click"></u-swiper>
</view> </view>
<view <!-- <view v-if="tabIndex == 0" style="padding-top: 30rpx; background-color: white; padding-bottom: 30rpx">
v-if="tabIndex == 0"
style="
padding-top: 30rpx;
background-color: white;
padding-bottom: 30rpx;
"
>
<Tabs></Tabs> <Tabs></Tabs>
</view> -->
</view>
<view class="r_tab">
<view style="display: flex; align-items: center; gap: 15rpx">
<view class="tab_item" @click="tabIndex = 0">海外资讯</view>
<view class="tab_item" @click="tabIndex = 1">国内资讯</view>
</view>
<view class="r_sreach">
<view class="sreach" @click="goSreach" v-if="tabIndex == 0">
<view class="sreach_icon">
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"></image>
</view>
<view class="sreach_text">
<text>搜索资讯</text>
</view>
</view>
</view> </view>
</view> </view>
@ -84,7 +85,7 @@
<MineMini v-if="tabIndex == 1" @logout="tabIndex = 0"></MineMini> <MineMini v-if="tabIndex == 1" @logout="tabIndex = 0"></MineMini>
</view> </view>
<Tabbar :tabIndex="tabIndex" @tabChange="tabChange"></Tabbar> <!-- <Tabbar :tabIndex="tabIndex" @tabChange="tabChange"></Tabbar> -->
</view> </view>
</template> </template>
@ -103,8 +104,8 @@ import Domestic from "@/components/domesticMini.vue";
const list1 = reactive([ const list1 = reactive([
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png", "https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png", // "https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png", // "https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
]); ]);
const newsList = ref([]); const newsList = ref([]);
@ -160,10 +161,7 @@ onPageScroll((val) => {
}); });
onShow(() => { onShow(() => {
if ( if (uni.getStorageSync("homeTabIndex") == 1 || uni.getStorageSync("homeTabIndex") == 2) {
uni.getStorageSync("homeTabIndex") == 1 ||
uni.getStorageSync("homeTabIndex") == 2
) {
tabChange(uni.getStorageSync("homeTabIndex")); tabChange(uni.getStorageSync("homeTabIndex"));
} else { } else {
tabChange(0); tabChange(0);
@ -195,7 +193,6 @@ onMounted(async () => {
.r_sreach { .r_sreach {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 30rpx;
} }
.logo_text { .logo_text {
@ -207,11 +204,11 @@ onMounted(async () => {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0rpx 30rpx; padding: 0rpx 30rpx;
background-color: #fff;
border-radius: 100rpx; border-radius: 100rpx;
width: 47vw; width: 27vw;
height: 68rpx; height: 58rpx;
margin-left: 20rpx; margin-left: 20rpx;
background-color: #f6f6f6;
} }
.sreach_icon { .sreach_icon {
@ -222,7 +219,6 @@ onMounted(async () => {
image { image {
width: 35rpx; width: 35rpx;
height: 35rpx; height: 35rpx;
margin-top: 5rpx;
} }
} }
@ -236,4 +232,24 @@ onMounted(async () => {
font-style: normal; font-style: normal;
} }
} }
.r_tab {
display: flex;
align-items: center;
height: 80rpx;
padding: 0 30rpx;
background-color: white;
justify-content: space-between;
padding-top: 20rpx;
.tab_item {
font-family: PingFangSC, PingFang SC;
font-weight: bold;
font-size: 28rpx;
color: #000;
line-height: 33rpx;
text-align: left;
font-style: normal;
}
}
</style> </style>