<template>
	<view v-if="ifshow"  class="topcon" @click="gotop">
		<image class="topimg" src="/static/image/top.png" mode="aspectFill" lazy-load></image>
	</view>
</template>

<script> 
export default {
	data() {
		return {
			ifshow:false,
		};
	}, 
	props: {
		scrollTop: {
			type: Number,
			default: 0
		},
	},
	methods: {
		topData(e){
			//这个e直接是滚动时候的高度
			this.ifshow = e>200;
			this.$forceUpdate();
		},
		gotop(){
			uni.pageScrollTo({
				scrollTop: 0,
				duration: 300 // 动画时长，默认300ms
			});
		}
	}
}
</script>

<style lang="scss" scoped>
	.topcon{
		position: fixed;
		right: 20rpx;
		bottom: 180rpx;
		width: 66rpx;
		height: 66rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: rgba(228, 249, 247, 0.8);
		border-radius: 100% 100%;
		border: 1rpx solid #00a89b;
		z-index: 998;
		.topimg{
			width: 40rpx;
			height: 40rpx;
			opacity: 1;
		}
	}
</style>
 