首页堆叠调整

This commit is contained in:
7YHong 2021-12-29 12:18:33 +08:00
parent b0bf5b1b39
commit 0dfceda42e
5 changed files with 72 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -21,6 +21,7 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%;
} }
.title { .title {
text-align: center; text-align: center;

View File

@ -1,13 +1,19 @@
<import name="my-tabbar" src="./tabbar"></import> <import name="my-tabbar" src="./tabbar"></import>
<import name="device" src="./device"></import> <import name="device" src="./device"></import>
<import name="key" src="./device"></import> <import name="key" src="./key"></import>
<import name="message" src="./device"></import> <import name="message" src="./device"></import>
<import name="settings" src="./device"></import> <import name="settings" src="./device"></import>
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div> <stack class="stack">
<component is="{{ tabbarData[currentPageIndex].compName }}"></component> <image class="deer-background" src="/assets/images/home-background.png" />
</div> <!-- <text
>stack容器排列方式为层叠每个子组件按照先后顺序依次堆叠覆盖前面的组件</text
> -->
<div class="container">
<component is="{{ tabbarData[currentPageIndex].compName }}"></component>
</div>
</stack>
<my-tabbar tabbar="{{tabbarData}}" onemit-evt="emitEvt"></my-tabbar> <my-tabbar tabbar="{{tabbarData}}" onemit-evt="emitEvt"></my-tabbar>
</div> </div>
</template> </template>
@ -70,8 +76,22 @@ export default {
.wrapper { .wrapper {
.flex-box-mixins(column, center, center); .flex-box-mixins(column, center, center);
.container { .stack {
height: 100%; /* width: 100%; */
flex-grow: 1;
align-items: flex-end;
.container {
width: 100%;
height: 100%;
}
.deer-background {
/* position: fixed; */
width: 100%;
margin-bottom: 20px;
/* bottom: 200px; */
}
} }
} }
</style> </style>

View File

@ -0,0 +1,30 @@
<template>
<div class="wrapper">
<text class="title">{{ title }}</text>
</div>
</template>
<script>
export default {
data: {
title: "Hello World. Quickapp Component 'Key'."
},
props: [],
onInit() {}
}
</script>
<style>
.wrapper {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
}
.title {
text-align: center;
color: #212121;
}
</style>

View File

@ -1,16 +1,12 @@
<template> <template>
<div class="{{tabbar.length !== 0 ? 'wrap' : ''}}"> <div if="{{tabbar.length !== 0 }}" class="tabbar">
<slot content="content"></slot> <div class="shadow"></div>
<div class="tab-bar" if="{{tabbar.length !== 0}}"> <div class="tab">
<div class="shadow"></div> <div for="{{tab in tabbar}}">
<div class="tab tab-recommend"> <image
<div for="{{tab in tabbar}}"> @click="changePage($idx)"
<image src="{{tab.active?tab.selectedIconPath:tab.iconPath}}"
@click="changePage($idx)" ></image>
src="{{tab.active?tab.selectedIconPath:tab.iconPath}}"
if="{{tab.iconPath}}"
></image>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -26,36 +22,26 @@ export default {
this.$emit('emitEvt', { this.$emit('emitEvt', {
idx idx
}); });
// router.push({
// uri: e.target.dataset.path,
// params: {
// ___PARAM_LAUNCH_FLAG___: "clearTask"
// }
// });
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.wrap { .tabbar {
padding-bottom: 108px;
}
.tab-bar {
.shadow { .shadow {
position: fixed; position: fixed;
bottom: 108px; bottom: 108px;
height: 9px; height: 12px;
width: 100%; width: 100%;
background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.09)); background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.09));
} }
.tab { .tab {
background-color: rgba(255, 255, 255, 0.98); background-color: rgba(255, 255, 255, 0.98);
position: fixed; /* position: fixed; */
bottom: 0; /* bottom: 0; */
flex-direction: row; /* flex-direction: row; */
height: 108px; height: 108px;
width: 100%; width: 100%;
justify-content: space-around; justify-content: space-around;
@ -76,7 +62,7 @@ export default {
} }
} }
.selected { /* .selected {
color: #0091ff; color: #0091ff;
} }
@ -86,6 +72,6 @@ export default {
.tab-mine { .tab-mine {
right: 0; right: 0;
} } */
} }
</style> </style>