init
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<s-layout
|
||||
:navbar="props.navbar"
|
||||
color="#333333"
|
||||
:title="props.title"
|
||||
:bgStyle="{ color: props.color }"
|
||||
:showLeftButton="props.showLeftButton"
|
||||
:goLeft="props.goLeft"
|
||||
@onClickLeft="onClickLeft"
|
||||
>
|
||||
<!-- <Agreement /> -->
|
||||
<view class="theme-ai pages">
|
||||
<view class="card1 w100">
|
||||
<image class="w100" :src="$ygUrl + 'transparent_bg.png'" mode="" />
|
||||
</view>
|
||||
<view class="scon" :style="{ height: height + 'px' }">
|
||||
<slot />
|
||||
</view>
|
||||
|
||||
<!-- pages内容 -->
|
||||
<!-- <view class="s-con" :style="{ top: height + 'px', height: windowHeight - height + 'px',zIndex:1 }">
|
||||
<slot />
|
||||
</view> -->
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// import Agreement from '@/components/agreement.vue';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
nextTick,
|
||||
defineProps,
|
||||
} from 'vue';
|
||||
let { proxy } = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
showLeftButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
goLeft: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
heightShow: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#F2F4F7',
|
||||
},
|
||||
leftUrl: {
|
||||
//返回上一页地址
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
navbar: {
|
||||
type: String,
|
||||
default: 'inner',
|
||||
},
|
||||
});
|
||||
let height = ref(0);
|
||||
let sysInfo = uni.getSystemInfoSync();
|
||||
const windowHeight = sysInfo.windowHeight;
|
||||
watch(
|
||||
() => [props.height, props.heightShow],
|
||||
(val) => {
|
||||
if (!props.height) {
|
||||
if (!props.heightShow) {
|
||||
height.value = windowHeight - sysInfo.statusBarHeight - uni.upx2px(88);
|
||||
}
|
||||
} else {
|
||||
height.value = props.height;
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
const onClickLeft = () => {
|
||||
if (props.leftUrl) {
|
||||
proxy.utils.go(props.leftUrl);
|
||||
} else {
|
||||
proxy.$emit('onClickLeft');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.pages {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card1 {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.scon {
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.s-con {
|
||||
position: sticky;
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user