<template>
	<!-- 底部按钮 -->
	<view class="fixed-button"><xh-button :disabled="disabled" :text="text" @handleClick="handleClick"></xh-button></view>
</template>

<script>
import XhButton from './xh-button.vue';
export default {
	name: 'FixedButton',
	components: {
		XhButton
	},
	props: {
		text: {
			type: String | null,
			default: '提交'
		},
		disabled:{
			type:Boolean,
			default: false
		}
	},
	data() {
		return {
			buttonStyle: {
				width: '100%',
				height: '80rpx',
				fontSize: '32rpx',
				fontWeight: 'bold'
			}
		};
	},
	methods: {
		handleClick() {
			this.$emit('handleClick');
		}
	}
};
</script>

<style lang="scss" scoped>
.fixed-button {
	width: 100%;
	box-sizing: border-box;
	position: fixed;
	z-index: 99999;
	left: 0;
	padding: 0 30rpx;
	padding-bottom: constant(safe-area-inset-bottom);
	/* 兼容 iOS < 11.2 */
	padding-bottom: env(safe-area-inset-bottom);
	/* 兼容 iOS >= 11.2 */
	bottom: 20rpx;
}
</style>
