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,
|
onShareAppMessage,
|
||||||
onShareTimeline,
|
onShareTimeline,
|
||||||
} from "@dcloudio/uni-app";
|
} from "@dcloudio/uni-app";
|
||||||
import articleMock from "@/mock/article.js";
|
// import articleMock from "@/mock/article.js";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ import {
|
||||||
onShareAppMessage,
|
onShareAppMessage,
|
||||||
onShareTimeline,
|
onShareTimeline,
|
||||||
} from "@dcloudio/uni-app";
|
} from "@dcloudio/uni-app";
|
||||||
import articleMock from "@/mock/article.js";
|
// import articleMock from "@/mock/article.js";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="mine">
|
<view class="mine">
|
||||||
<PageHeaderView title="个人中心"></PageHeaderView>
|
<Navbar title="中证参考" :hasBack="false"></Navbar>
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<view class="userContainer">
|
<view class="userContainer">
|
||||||
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar>
|
<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 { Session } from "@/utils/storage";
|
||||||
import LoginPopup from "@/components/loginPopup/index.vue";
|
import LoginPopup from "@/components/loginPopup/index.vue";
|
||||||
import { useShareStore } from "@/stores/shareStore";
|
import { useShareStore } from "@/stores/shareStore";
|
||||||
import PageHeaderView from "@/components/PageHeaderView.vue";
|
import Navbar from '@/components/mini/Navbar.vue'
|
||||||
|
|
||||||
const stores = useShareStore();
|
const stores = useShareStore();
|
||||||
const curPages = getCurrentPages();
|
const curPages = getCurrentPages();
|
||||||
|
|
@ -219,7 +219,7 @@ onPullDownRefresh(() => {
|
||||||
.userContainer {
|
.userContainer {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 90rpx 45rpx 45rpx 45rpx;
|
padding: 40rpx 45rpx 45rpx 45rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
.userData {
|
.userData {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="r_all">
|
<view class="r_all">
|
||||||
<view class="top88"></view>
|
|
||||||
<view class="navnar">
|
<view class="navnar">
|
||||||
<view>
|
<view>
|
||||||
<u-icon name="arrow-left" color="#000" size="22" v-if="hasBack"></u-icon>
|
<u-icon name="arrow-left" color="#000" size="22" v-if="hasBack"></u-icon>
|
||||||
|
|
@ -37,11 +36,6 @@ onMounted(async () => { });
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top88 {
|
|
||||||
width: 100vw;
|
|
||||||
height: 88rpx;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navnar {
|
.navnar {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<view class="tabbar">
|
<view class="tabbar">
|
||||||
<view class="tabbar_item" @click="tabChange(0)">
|
<view class="tabbar_item" @click="tabChange(0)">
|
||||||
<image v-if="tabIndex == 1"
|
<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" />
|
class="tabbar_img" />
|
||||||
<image v-if="tabIndex == 0"
|
<image v-if="tabIndex == 0"
|
||||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,26 @@
|
||||||
<!-- <Navbar title="中证参考" :hasBack="false"></Navbar> -->
|
<!-- <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="{ height: getNavHeight() + 'px' }" v-if="tabIndex == 0"></view>
|
<view :style="{
|
||||||
<view
|
height: getNavHeight() + 'px',
|
||||||
:style="{ height: getNavHeight() + 'px', backgroundColor: '#fff', position: 'sticky', top: 0, zIndex: '999999' }"
|
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||||
v-else></view>
|
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 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">
|
<view class="r_sreach">
|
||||||
<image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
|
<image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
|
||||||
</image>
|
</image>
|
||||||
|
|
@ -30,7 +42,7 @@
|
||||||
<u-swiper :list="list1" @change="change" @click="click"></u-swiper>
|
<u-swiper :list="list1" @change="change" @click="click"></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="margin-top: 30rpx;">
|
<view style="padding-top: 30rpx;background-color: white;padding-bottom: 30rpx;">
|
||||||
<Tabs></Tabs>
|
<Tabs></Tabs>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -56,7 +68,7 @@ import Tabs from "@/components/mini/Tabs.vue";
|
||||||
import {
|
import {
|
||||||
getTopNews,
|
getTopNews,
|
||||||
} from "@/api/newsInfo";
|
} from "@/api/newsInfo";
|
||||||
import { onShow } from "@dcloudio/uni-app";
|
import { onPageNotFound, onPageScroll, onShow } from "@dcloudio/uni-app";
|
||||||
import { getNavHeight } from "@/utils/util"
|
import { getNavHeight } from "@/utils/util"
|
||||||
|
|
||||||
const list1 = reactive([
|
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(() => {
|
onShow(() => {
|
||||||
tabChange(0)
|
tabChange(0)
|
||||||
})
|
})
|
||||||
|
|
@ -110,6 +132,7 @@ onMounted(async () => {
|
||||||
.content {
|
.content {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
|
padding-bottom: 300rpx;
|
||||||
|
|
||||||
.r_sreach {
|
.r_sreach {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
import List from "@/components/articleList/index.vue";
|
import List from "@/components/articleList/index.vue";
|
||||||
import Pay from "@/components/pay/index.vue";
|
import Pay from "@/components/pay/index.vue";
|
||||||
import articleListMock from "@/mock/articleList.js";
|
import articleListMock from "@/mock/articleList.js";
|
||||||
import { newsList } from "@/mock/list.js";
|
// import { newsList } from "@/mock/list.js";
|
||||||
|
|
||||||
const articleList = ref([...articleListMock]);
|
const articleList = ref([...articleListMock]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue