init
This commit is contained in:
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<!-- :class="['theme-' + sys?.mode, 'main-' + sys?.theme, 'font-' + sys?.fontSize]" -->
|
||||
<view class="page-app theme-ai" :style="[bgMain]">
|
||||
<!-- :style="[bgMain]" -->
|
||||
<view class="page-main">
|
||||
<cardNavbar
|
||||
v-if="navbar === 'normal'"
|
||||
:title="title"
|
||||
:showLeftButton="showLeftButton"
|
||||
@clickLeft="onClickLeft"
|
||||
:index="props.index"
|
||||
/>
|
||||
<innerNavbar
|
||||
v-if="navbar === 'inner'"
|
||||
:title="title"
|
||||
:showLeftButton="showLeftButton"
|
||||
@clickLeft="onClickLeft"
|
||||
:index="props.index"
|
||||
/>
|
||||
<transparentNavbar
|
||||
v-if="navbar === 'transparent'"
|
||||
:title="title"
|
||||
:showLeftButton="showLeftButton"
|
||||
@clickLeft="onClickLeft"
|
||||
:index="props.index"
|
||||
/>
|
||||
|
||||
<!-- 页面内容插槽 -->
|
||||
<!-- :style="{ paddingTop: paddingTop + 'px' }" -->
|
||||
<view class="pageCon" :style="{ paddingTop: paddingTop + 'px' }">
|
||||
<!-- <view class="transparent_bg" style="z-index: 100;">
|
||||
<image src="/static/transparent_bg.png" />
|
||||
</view> -->
|
||||
<slot />
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- 全局授权弹窗 -->
|
||||
<s-auth-modal />
|
||||
<!-- 全局快捷入口 -->
|
||||
<s-menu-tools />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getCurrentInstance, ref, computed } from 'vue';
|
||||
import innerNavbar from '@/components/card_navbar/inner-navbar';
|
||||
import cardNavbar from '@/components/card_navbar/card_navbar';
|
||||
import transparentNavbar from '@/components/card_navbar/transparent_navbar';
|
||||
import sheep from '@/sheep';
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
navbar: {
|
||||
type: String,
|
||||
default: 'normal',
|
||||
},
|
||||
opacityBgUi: {
|
||||
type: String,
|
||||
default: 'bg-white',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#ffffff',
|
||||
},
|
||||
tools: {
|
||||
type: String,
|
||||
default: 'title',
|
||||
},
|
||||
keyword: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
navbarStyle: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
styleType: '',
|
||||
type: '',
|
||||
color: '',
|
||||
src: '',
|
||||
list: [],
|
||||
alwaysShow: 0,
|
||||
}),
|
||||
},
|
||||
bgStyle: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
src: '',
|
||||
color: '#F2F4F7',
|
||||
}),
|
||||
},
|
||||
tabbar: {
|
||||
type: [String, Boolean],
|
||||
default: '',
|
||||
},
|
||||
onShareAppMessage: {
|
||||
type: [Boolean, Object],
|
||||
default: true,
|
||||
},
|
||||
leftWidth: {
|
||||
type: [Number, String],
|
||||
default: 100,
|
||||
},
|
||||
rightWidth: {
|
||||
type: [Number, String],
|
||||
default: 100,
|
||||
},
|
||||
defaultSearch: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
//展示返回按钮
|
||||
showLeftButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
goLeft: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
default: '2',
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
const sys = computed(() => sysStore);
|
||||
const sysStore = sheep.$store('sys');
|
||||
const userStore = sheep.$store('user');
|
||||
const appStore = sheep.$store('app');
|
||||
const modalStore = sheep.$store('modal');
|
||||
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
let paddingTop = ref();
|
||||
paddingTop.value = statusBarHeight + 44;
|
||||
|
||||
const bgMain = computed(() => {
|
||||
return {
|
||||
background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
|
||||
props.bgStyle.backgroundImage,
|
||||
)}) no-repeat top center / 100% auto`,
|
||||
};
|
||||
});
|
||||
const onClickLeft = () => {
|
||||
console.log('返回2');
|
||||
proxy.$emit('onClickLeft');
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.one {
|
||||
width: 100%;
|
||||
height: 708rpx;
|
||||
background-image: linear-gradient(to top, #f2f4f7 0%, rgba(251, 129, 55, 0.459) 36%);
|
||||
}
|
||||
|
||||
.transparent_bg {
|
||||
width: 100%;
|
||||
height: 708rpx;
|
||||
|
||||
// position: fixed;
|
||||
// top: 0;
|
||||
// left: 0;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.page-app {
|
||||
.page-main {
|
||||
.pageCon {
|
||||
// min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pageCon {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user