refactor(minihome): 重构首页布局并优化样式
- 移除注释代码和未使用的组件 - 重新设计顶部标签栏和搜索框样式 - 简化banner图片数组 - 调整页面结构和间距
This commit is contained in:
parent
8f23f0c315
commit
695149674f
|
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<!-- 顶部 banner 区域 -->
|
||||
<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
|
||||
:style="{
|
||||
|
|
@ -38,38 +34,43 @@
|
|||
}"
|
||||
v-if="tabIndex == 0 || tabIndex == 2"
|
||||
>
|
||||
<view class="r_sreach">
|
||||
<image
|
||||
class="logo_text"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"
|
||||
>
|
||||
<!-- <view class="r_sreach">
|
||||
<image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
|
||||
</image>
|
||||
|
||||
<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>
|
||||
<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 style="padding: 0 24rpx; margin-top: 30rpx" v-if="tabIndex == 0">
|
||||
<u-swiper :list="list1" @change="change" @click="click"></u-swiper>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-if="tabIndex == 0"
|
||||
style="
|
||||
padding-top: 30rpx;
|
||||
background-color: white;
|
||||
padding-bottom: 30rpx;
|
||||
"
|
||||
>
|
||||
<!-- <view v-if="tabIndex == 0" style="padding-top: 30rpx; background-color: white; padding-bottom: 30rpx">
|
||||
<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>
|
||||
|
||||
|
|
@ -84,7 +85,7 @@
|
|||
<MineMini v-if="tabIndex == 1" @logout="tabIndex = 0"></MineMini>
|
||||
</view>
|
||||
|
||||
<Tabbar :tabIndex="tabIndex" @tabChange="tabChange"></Tabbar>
|
||||
<!-- <Tabbar :tabIndex="tabIndex" @tabChange="tabChange"></Tabbar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -103,8 +104,8 @@ import Domestic from "@/components/domesticMini.vue";
|
|||
|
||||
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",
|
||||
]);
|
||||
|
||||
const newsList = ref([]);
|
||||
|
|
@ -160,10 +161,7 @@ onPageScroll((val) => {
|
|||
});
|
||||
|
||||
onShow(() => {
|
||||
if (
|
||||
uni.getStorageSync("homeTabIndex") == 1 ||
|
||||
uni.getStorageSync("homeTabIndex") == 2
|
||||
) {
|
||||
if (uni.getStorageSync("homeTabIndex") == 1 || uni.getStorageSync("homeTabIndex") == 2) {
|
||||
tabChange(uni.getStorageSync("homeTabIndex"));
|
||||
} else {
|
||||
tabChange(0);
|
||||
|
|
@ -195,7 +193,6 @@ onMounted(async () => {
|
|||
.r_sreach {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.logo_text {
|
||||
|
|
@ -207,11 +204,11 @@ onMounted(async () => {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 100rpx;
|
||||
width: 47vw;
|
||||
height: 68rpx;
|
||||
width: 27vw;
|
||||
height: 58rpx;
|
||||
margin-left: 20rpx;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.sreach_icon {
|
||||
|
|
@ -222,7 +219,6 @@ onMounted(async () => {
|
|||
image {
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -236,4 +232,24 @@ onMounted(async () => {
|
|||
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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue