refactor(mini): 移除mock数据引用并优化mini组件样式
移除多个组件中对mock数据的引用,改用真实数据源 优化Navbar组件样式,移除冗余的top88视图 修复Tabbar组件中图片URL的拼写错误 调整mineMini组件头部样式和padding 优化minihome页面滚动时的导航栏背景色变化
This commit is contained in:
parent
1ba80c041c
commit
14aec795a6
|
|
@ -38,7 +38,7 @@ import {
|
|||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
import articleMock from "@/mock/article.js";
|
||||
// import articleMock from "@/mock/article.js";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ import {
|
|||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
import articleMock from "@/mock/article.js";
|
||||
// import articleMock from "@/mock/article.js";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="mine">
|
||||
<PageHeaderView title="个人中心"></PageHeaderView>
|
||||
<Navbar title="中证参考" :hasBack="false"></Navbar>
|
||||
<!-- 用户信息 -->
|
||||
<view class="userContainer">
|
||||
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar>
|
||||
|
|
@ -93,7 +93,7 @@ import { onPullDownRefresh, onShow } from "@dcloudio/uni-app";
|
|||
import { Session } from "@/utils/storage";
|
||||
import LoginPopup from "@/components/loginPopup/index.vue";
|
||||
import { useShareStore } from "@/stores/shareStore";
|
||||
import PageHeaderView from "@/components/PageHeaderView.vue";
|
||||
import Navbar from '@/components/mini/Navbar.vue'
|
||||
|
||||
const stores = useShareStore();
|
||||
const curPages = getCurrentPages();
|
||||
|
|
@ -219,7 +219,7 @@ onPullDownRefresh(() => {
|
|||
.userContainer {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 90rpx 45rpx 45rpx 45rpx;
|
||||
padding: 40rpx 45rpx 45rpx 45rpx;
|
||||
display: flex;
|
||||
|
||||
.userData {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<view class="r_all">
|
||||
<view class="top88"></view>
|
||||
<view class="navnar">
|
||||
<view>
|
||||
<u-icon name="arrow-left" color="#000" size="22" v-if="hasBack"></u-icon>
|
||||
|
|
@ -37,11 +36,6 @@ onMounted(async () => { });
|
|||
z-index: 99999;
|
||||
}
|
||||
|
||||
.top88 {
|
||||
width: 100vw;
|
||||
height: 88rpx;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.navnar {
|
||||
width: 100vw;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="tabbar">
|
||||
<view class="tabbar_item" @click="tabChange(0)">
|
||||
<image v-if="tabIndex == 1"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.pngg"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
|
||||
class="tabbar_img" />
|
||||
<image v-if="tabIndex == 0"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
||||
|
|
|
|||
|
|
@ -4,14 +4,26 @@
|
|||
<!-- <Navbar title="中证参考" :hasBack="false"></Navbar> -->
|
||||
<image class="top_bk" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"></image>
|
||||
|
||||
<view :style="{ height: getNavHeight() + 'px' }" v-if="tabIndex == 0"></view>
|
||||
<view
|
||||
:style="{ height: getNavHeight() + 'px', backgroundColor: '#fff', position: 'sticky', top: 0, zIndex: '999999' }"
|
||||
v-else></view>
|
||||
<view :style="{
|
||||
height: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||
position: 'sticky', top: 0,
|
||||
zIndex: '999999',
|
||||
}" v-if="tabIndex == 0"></view>
|
||||
<view :style="{
|
||||
height: getNavHeight() + 'px',
|
||||
backgroundColor: '#fff',
|
||||
position: 'sticky', top: 0,
|
||||
zIndex: '999999',
|
||||
|
||||
}" v-else></view>
|
||||
|
||||
<view class="content">
|
||||
|
||||
<view :style="{ position: 'sticky', top: getNavHeight() + 'px' }" v-if="tabIndex == 0">
|
||||
<view :style="{
|
||||
position: 'sticky', top: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent'
|
||||
}" v-if="tabIndex == 0">
|
||||
<view class="r_sreach">
|
||||
<image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
|
||||
</image>
|
||||
|
|
@ -30,7 +42,7 @@
|
|||
<u-swiper :list="list1" @change="change" @click="click"></u-swiper>
|
||||
</view>
|
||||
|
||||
<view style="margin-top: 30rpx;">
|
||||
<view style="padding-top: 30rpx;background-color: white;padding-bottom: 30rpx;">
|
||||
<Tabs></Tabs>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -56,7 +68,7 @@ import Tabs from "@/components/mini/Tabs.vue";
|
|||
import {
|
||||
getTopNews,
|
||||
} from "@/api/newsInfo";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { onPageNotFound, onPageScroll, onShow } from "@dcloudio/uni-app";
|
||||
import { getNavHeight } from "@/utils/util"
|
||||
|
||||
const list1 = reactive([
|
||||
|
|
@ -88,6 +100,16 @@ function tabChange(index) {
|
|||
}
|
||||
}
|
||||
|
||||
const isScroll = ref(false)
|
||||
onPageScroll((val) => {
|
||||
if (val.scrollTop > 150) {
|
||||
isScroll.value = true
|
||||
} else {
|
||||
isScroll.value = false
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
tabChange(0)
|
||||
})
|
||||
|
|
@ -110,6 +132,7 @@ onMounted(async () => {
|
|||
.content {
|
||||
position: relative;
|
||||
z-index: 99999;
|
||||
padding-bottom: 300rpx;
|
||||
|
||||
.r_sreach {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
|
|||
import List from "@/components/articleList/index.vue";
|
||||
import Pay from "@/components/pay/index.vue";
|
||||
import articleListMock from "@/mock/articleList.js";
|
||||
import { newsList } from "@/mock/list.js";
|
||||
// import { newsList } from "@/mock/list.js";
|
||||
|
||||
const articleList = ref([...articleListMock]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue