<template>
	<view class="control-card">
		<button class="item" open-type="share" :loading="loading"> 发名片 </button>
	</view>
</template>

<script setup>
	const props = defineProps(['loading'])
	import {
		onShareAppMessage
	} from '@dcloudio/uni-app';
	import {
		useUserStore
	} from '@/store/modules/user.js'
	import {
		storeToRefs
	} from 'pinia'
	const userStore = useUserStore()
	const {
		cardInfo,
		cardImage,
		currentIndex
	} = storeToRefs(userStore)
	onShareAppMessage(() => {
		return {
			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentId=${cardInfo.value.companyDTO.id}`,
			userName: '小程序',
			imageUrl: cardImage.value
		};
	});
</script>

<style lang="scss" scoped>
	.control-card {
		background-color: #fff;
		border-radius: 0 24rpx 24rpx 24rpx;
		position: relative;
		z-index: 1;
		bottom: 24rpx;
		display: flex;
		align-items: center;
		justify-content: space-around;
		padding: 48rpx 40rpx 24rpx;
		.item {
			display: flex;
			width: 100%;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			gap: 4rpx;
			background-color: #155DFC;
			font-size: 28rpx !important;
			border-radius: 40rpx;
			height: 80rpx;
			color: #fff;
		}
	}

</style>